public interface Trainer extends Serializable
train
is used to adjust the weights in a
network to best fit a set of observed data.
After a network is trained, the other methods in this interface can be
used to check the quality of the fit.Modifier and Type | Method and Description |
---|---|
double[] |
getErrorGradient()
Returns the value of the gradient of the
error function with respect to the weights.
|
int |
getErrorStatus()
Returns the error status.
|
double |
getErrorValue()
Returns the value of the error function minimized by the trainer.
|
void |
train(Network network,
double[][] xData,
double[][] yData)
Trains the neural network using supplied training patterns.
|
void train(Network network, double[][] xData, double[][] yData)
network
- A Network
object, which is the
Network
to be trained.xData
- A double
matrix containing the input training
patterns. The number of columns in xData
must
equal the number of nodes in the InputLayer
.
Each row of xData
contains a training pattern.yData
- A double
matrix containing the output training
patterns. The number of columns in yData
must equal the number of Perceptron
s in the
OutputLayer
. Each row of yData
contains a training pattern.double getErrorValue()
double
indicating the final value of the error
function from the last training. Before training, NaN
is returned.int getErrorStatus()
int
specifying the error.
If there was no error, zero is returned.
A non-zero return indicates a potential problem with the trainer.double[] getErrorGradient()
double
array, the length of the number of weights,
containing the value of the gradient of the error function
with respect to the weights
at the computed optimal point.
Before training, null
is returned.Copyright © 2020 Rogue Wave Software. All rights reserved.