public static class NeuralNetwork.Trainer extends RegressionTrainer<double[]>
Constructor and Description |
---|
Trainer(int... numUnits)
Constructor.
|
Trainer(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,
double[] y)
Learns a regression model with given training data.
|
setAttributes
public Trainer(int... numUnits)
numUnits
- the number of units in each layer.public Trainer(NeuralNetwork.ActivationFunction activation, int... numUnits)
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, double[] y)
RegressionTrainer
train
in class RegressionTrainer<double[]>
x
- the training instances.y
- the training response values.