Interface Trainer

All Superinterfaces:
Serializable
All Known Implementing Classes:
EpochTrainer, LeastSquaresTrainer, QuasiNewtonTrainer

public interface Trainer extends Serializable
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 Type
    Method
    Description
    double[]
    Returns the value of the gradient of the error function with respect to the weights.
    int
    Returns the error status.
    double
    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.
  • Method Details

    • train

      void train(Network network, double[][] xData, double[][] yData)
      Trains the neural network using supplied training patterns.
      Parameters:
      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 Perceptrons in the OutputLayer. Each row of yData contains a training pattern.
    • getErrorValue

      double getErrorValue()
      Returns the value of the error function minimized by the trainer.
      Returns:
      A double indicating the final value of the error function from the last training. Before training, NaN is returned.
    • getErrorStatus

      int getErrorStatus()
      Returns the error status.
      Returns:
      An int specifying 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 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.