Package com.imsl.datamining.neural
Interface Trainer
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
EpochTrainer,LeastSquaresTrainer,QuasiNewtonTrainer
Interface implemented by classes used to train a network.
The method
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.-
Method Summary
Modifier and TypeMethodDescriptiondouble[]Returns the value of the gradient of the error function with respect to the weights.intReturns the error status.doubleReturns the value of the error function minimized by the trainer.voidTrains the neural network using supplied training patterns.
-
Method Details
-
train
Trains the neural network using supplied training patterns.- Parameters:
network- ANetworkobject, which is theNetworkto be trained.xData- Adoublematrix containing the input training patterns. The number of columns inxDatamust equal the number of nodes in theInputLayer. Each row ofxDatacontains a training pattern.yData- Adoublematrix containing the output training patterns. The number of columns inyDatamust equal the number ofPerceptrons in theOutputLayer. Each row ofyDatacontains a training pattern.
-
getErrorValue
double getErrorValue()Returns the value of the error function minimized by the trainer.- Returns:
- A
doubleindicating the final value of the error function from the last training. Before training,NaNis returned.
-
getErrorStatus
int getErrorStatus()Returns the error status.- Returns:
- An
intspecifying the error. If there was no error, zero is returned. A non-zero return indicates a potential problem with the trainer.
-
getErrorGradient
double[] getErrorGradient()Returns the value of the gradient of the error function with respect to the weights.- Returns:
- A
doublearray, 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,nullis returned.
-