public abstract class Network extends Object implements Serializable
Constructor and Description |
---|
Network()
Default constructor for
Network . |
Modifier and Type | Method and Description |
---|---|
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 Link s among the
node s. |
abstract int |
getNumberOfOutputs()
Returns the number of
Network output Perceptron s. |
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
Perceptron s in the
Network . |
abstract double[] |
getWeights()
Returns the weights.
|
abstract void |
setWeights(double[] weights)
Sets the weights.
|
public Network()
Network
.
Since this class is abstract, it cannot be instantiated directly;
this constructor is used by constructors in classes derived from
Network
.public abstract int getNumberOfInputs()
Network
inputs.int
which contains the number of inputs.public abstract int getNumberOfOutputs()
Network
output Perceptron
s.int
which contains the number of outputs.public abstract InputLayer getInputLayer()
InputLayer
object.Network
InputLayer
.public abstract HiddenLayer createHiddenLayer()
HiddenLayer
in the Network
.HiddenLayer
.public abstract OutputLayer getOutputLayer()
OutputLayer
.Network
OutputLayer
.public abstract Perceptron[] getPerceptrons()
Perceptron
s in the
Network
.Perceptron
s associated with this
Network
.public abstract Link[] getLinks()
Link
objects in the
Network
.Link
s associated with this
Network
.public abstract int getNumberOfLinks()
Network
Link
s among the
node
s.int
which contains the number of Link
s in
the Network
.public abstract double[] getWeights()
double
array containing the weights
associated with Network
Link
s.public abstract void setWeights(double[] weights)
weights
- A double
array which specifies the weights
to be associated with Network
Link
s.public abstract int getNumberOfWeights()
Network
.int
which contains the number of weights
associated with this Network
.public abstract double[] forecast(double[] x)
Network
's outputs
computed from the trained Network
.x
- A double
array of values with the same length and
order as the training patterns used to train the
Network
.double
array containing the forecasts for the
output Perceptron
s. Its length is equal to the
number of output Perceptron
s.public abstract double[][] getForecastGradient(double[] x)
x
- A double
array which specifies the input
values at which the gradient is to be evaluated.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.public double[] computeStatistics(double[][] xData, double[][] yData)
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_i\left(y_i-\hat{y}_i\right)^2\) |
1 | RMS | \(\frac{\sum_i \left(y_i-\hat{y}_i\right)^2}{\sum_i \left(y_i-\bar{y}_i\right)} \) |
2 | Laplacian | \(\sum_i \left|y_i-\hat{y}_i\right|\) |
3 | Scaled Laplacian | \(\frac{\sum_i \left|y_i-\hat{y}_i\right|}{\sum_i\left|y_i-\bar{y}_i\right|}\) |
4 | Max residual | \(\max_i\left|y_i-\hat{y}_i\right|\) |
xData
- A double
matrix containing the input values.yData
- A double
array containing the observed
values.double
array containing the above described
statistics.Copyright © 2020 Rogue Wave Software. All rights reserved.