JMSLTM Numerical Library 6.1

com.imsl.datamining.neural
Class Network

java.lang.Object
  extended by com.imsl.datamining.neural.Network
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
FeedForwardNetwork

public abstract class Network
extends Object
implements Serializable

Neural network base class.

See Also:
Example 1, Example 2 - A Complete Training Example, Serialized Form

Constructor Summary
Network()
          Default constructor for Network.
 
Method Summary
 double[] computeStatistics(double[][] xData, double[][] yData)
          Computes error statistics.
abstract  HiddenLayer createHiddenLayer()
          Creates the next HiddenLayer in the Network.
abstract  double[] forecast(double[] x)
          Returns a forecast for each of the Network's outputs computed from the trained Network.
abstract  double[][] getForecastGradient(double[] x)
          Returns the derivatives of the outputs with respect to the weights.
abstract  InputLayer getInputLayer()
          Returns the InputLayer object.
abstract  Link[] getLinks()
          Returns an array containing the Link objects in the Network.
abstract  int getNumberOfInputs()
          Returns the number of Network inputs.
abstract  int getNumberOfLinks()
          Returns the number of Network Links among the nodes.
abstract  int getNumberOfOutputs()
          Returns the number of Network output Perceptrons.
abstract  int getNumberOfWeights()
          Returns the number of weights in the Network.
abstract  OutputLayer getOutputLayer()
          Returns the OutputLayer.
abstract  Perceptron[] getPerceptrons()
          Returns an array containing the Perceptrons in the Network.
abstract  double[] getWeights()
          Returns the weights.
abstract  void setWeights(double[] weights)
          Sets the weights.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Network

public Network()
Default constructor for Network. Since this class is abstract, it cannot be instantiated directly; this constructor is used by constructors in classes derived from Network.

Method Detail

computeStatistics

public double[] computeStatistics(double[][] xData,
                                  double[][] yData)
Computes error statistics.

This is a static method that can be used to compute the statistics regardless of the training class used to train the Network.

Computes statistics related to the error. In this table, the observed values are y_i. The forecasted values are hat{y}_i. The mean observed value is bar{y} = sum_i y_i / NC, where N is the number of observations and C is the number of classes per observation.

Index Name Formula
0 SSE frac{1}{2}sum_ileft(y_i-hat{y}_iright)^2
1 RMS frac{sum_i left(y_i-hat{y}_iright)^2}{sum_i left(y_i-bar{y}_iright)}
2 Laplacian sum_i left|y_i-hat{y}_iright|
3 Scaled Laplacian frac{sum_i left|y_i-hat{y}_iright|}{sum_ileft|y_i-bar{y}_iright|}
4 Max residual max_ileft|y_i-hat{y}_iright|

Parameters:
xData - A double matrix containing the input values.
yData - A double array containing the observed values.
Returns:
A double array containing the above described statistics.

createHiddenLayer

public abstract HiddenLayer createHiddenLayer()
Creates the next HiddenLayer in the Network.

Returns:
The new HiddenLayer.

forecast

public abstract double[] forecast(double[] x)
Returns a forecast for each of the Network's outputs computed from the trained Network.

Parameters:
x - A double array of values with the same length and order as the training patterns used to train the Network.
Returns:
A double array containing the forecasts for the output Perceptrons. Its length is equal to the number of output Perceptrons.

getForecastGradient

public abstract double[][] getForecastGradient(double[] x)
Returns the derivatives of the outputs with respect to the weights.

Parameters:
x - A double array which specifies the input values at which the gradient is to be evaluated.
Returns:
A double array containing the gradient values. The value of gradient[i][j] is dy_i/dw_j, where y_i is the i-th output and w_j is the j-th weight.

getInputLayer

public abstract InputLayer getInputLayer()
Returns the InputLayer object.

Returns:
The Network InputLayer.

getLinks

public abstract Link[] getLinks()
Returns an array containing the Link objects in the Network.

Returns:
An array of Links associated with this Network.

getNumberOfInputs

public abstract int getNumberOfInputs()
Returns the number of Network inputs.

Returns:
An int which contains the number of inputs.

getNumberOfLinks

public abstract int getNumberOfLinks()
Returns the number of Network Links among the nodes.

Returns:
An int which contains the number of Links in the Network.

getNumberOfOutputs

public abstract int getNumberOfOutputs()
Returns the number of Network output Perceptrons.

Returns:
An int which contains the number of outputs.

getNumberOfWeights

public abstract int getNumberOfWeights()
Returns the number of weights in the Network.

Returns:
An int which contains the number of weights associated with this Network.

getOutputLayer

public abstract OutputLayer getOutputLayer()
Returns the OutputLayer.

Returns:
The Network OutputLayer.

getPerceptrons

public abstract Perceptron[] getPerceptrons()
Returns an array containing the Perceptrons in the Network.

Returns:
An array of Perceptrons associated with this Network.

getWeights

public abstract double[] getWeights()
Returns the weights.

Returns:
A double array containing the weights associated with Network Links.

setWeights

public abstract void setWeights(double[] weights)
Sets the weights.

Parameters:
weights - A double array which specifies the weights to be associated with Network Links.

JMSLTM Numerical Library 6.1

Copyright © 1970-2010 Visual Numerics, Inc.
Built July 30 2010.