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