|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.penguinwerks.jodene.NeuronTraining
This class is used by the neuron to facilitate training. The
NeuronTraining class maintains the weight adjustments,
the prior weight adjustments, the partial derivatives, and the learning
rate and momentum for the training.
| Constructor Summary | |
NeuronTraining()
Default constructor. |
|
| Method Summary | |
void |
adjustWeights(double[] weights)
Called to adjust the weights. |
java.lang.Double |
calculateDelta(double[] feedback,
double derivative)
Calcuates the delta given the deltas of the subsequent layers and the weight connecting this neuron to the next neuron. |
java.lang.Double |
calculateDelta(double expected,
double actual,
double derivative)
Calculates the delta given the expected values, the actual values and the derivative of the activation value. |
void |
calculatePartials(double[] inputs,
double delta)
Initializes the partials, if necessary. |
void |
clearPartials()
Clears the partial derivatives, called after weights are adjusted. |
void |
endEpoch()
Called to end the epoch. |
double |
getLearningRate()
The learning rate used by this Neuron trainer. |
double |
getMomentum()
The momentum rate used by this Neuron trainer. |
double[] |
getPartials()
Return the partial derivatives. |
Trainer |
getTrainer()
The trainer that owns this neuron trainer. |
double[] |
getWeightUpdates()
Returns the weight updates - anther specious function. |
void |
setLearningRate(double learningRate)
The learning rate used by this Neuron trainer. |
void |
setMomentum(double momentum)
The momentum rate used by this Neuron trainer. |
void |
setSize(int sz)
Sizes the arrays for the weight adjustmets, etc. |
void |
updateWeightAdjustments()
Updates the weight adjustments. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public NeuronTraining()
| Method Detail |
public Trainer getTrainer()
public void setSize(int sz)
sz - The size (in inputs) of the neuron to train.public double getLearningRate()
public void setLearningRate(double learningRate)
learningRate - The learningRate to set.public double getMomentum()
public void setMomentum(double momentum)
momentum - The momentum to set.
public java.lang.Double calculateDelta(double expected,
double actual,
double derivative)
expected - The expected value.actual - The actual value.derivative - The derivative of the activation.
public java.lang.Double calculateDelta(double[] feedback,
double derivative)
feedback - The feedback (delta and connecting weight)derivative - The derivative of the activation.
public void clearPartials()
public void calculatePartials(double[] inputs,
double delta)
inputs - The inputs for this training example.delta - The calculated delta for this neuron.public double[] getPartials()
public void updateWeightAdjustments()
public double[] getWeightUpdates()
public void endEpoch()
public void adjustWeights(double[] weights)
weights - The weights to adjust.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||