public static class NeuralNetwork.Trainer extends ClassifierTrainer<double[]>
| Constructor and Description |
|---|
Trainer(NeuralNetwork.ErrorFunction error,
int... numUnits)
Constructor.
|
Trainer(NeuralNetwork.ErrorFunction error,
NeuralNetwork.ActivationFunction activation,
int... numUnits)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
NeuralNetwork.Trainer |
setLearningRate(double eta)
Sets the learning rate.
|
NeuralNetwork.Trainer |
setMomentum(double alpha)
Sets the momentum factor.
|
NeuralNetwork.Trainer |
setNumEpochs(int epochs)
Sets the number of epochs of stochastic learning.
|
NeuralNetwork.Trainer |
setWeightDecay(double lambda)
Sets the weight decay factor.
|
NeuralNetwork |
train(double[][] x,
int[] y)
Learns a classifier with given training data.
|
setAttributespublic Trainer(NeuralNetwork.ErrorFunction error, int... numUnits)
error - the error function.numUnits - the number of units in each layer.public Trainer(NeuralNetwork.ErrorFunction error, NeuralNetwork.ActivationFunction activation, int... numUnits)
error - the error function.activation - the activation function of output layer.numUnits - the number of units in each layer.public NeuralNetwork.Trainer setLearningRate(double eta)
eta - the learning rate.public NeuralNetwork.Trainer setMomentum(double alpha)
alpha - the momentum factor.public NeuralNetwork.Trainer setWeightDecay(double lambda)
lambda - the weight decay for regularization.public NeuralNetwork.Trainer setNumEpochs(int epochs)
epochs - the number of epochs of stochastic learning.public NeuralNetwork train(double[][] x, int[] y)
ClassifierTrainertrain in class ClassifierTrainer<double[]>x - the training instances.y - the training labels.