org.encog.neural.networks.training.hebbian
Class HebbianTraining

java.lang.Object
  extended by org.encog.neural.networks.training.BasicTraining
      extended by org.encog.neural.networks.training.hebbian.HebbianTraining
All Implemented Interfaces:
LearningRate, Train

public class HebbianTraining
extends BasicTraining
implements LearningRate

This class implements Hebbian learning for Enocg. This class specifically handles the following three cases of Hebbian learning. Supervised Hebbian Learning Unsupervised Hebbian Learning OJA Unsupervised Hebbian Learning Choosing between supervised and unsupervised is simply a matter of passing in training data that has ideal outputs, in the case of supervised, or lacks ideal outputs, in the case of unsupervised. OJA's rule can be used with unsupervised training. It can be specified using a flag to the constructor. For more information on OJA's rule, see: http://en.wikipedia.org/wiki/Oja%27s_rule


Constructor Summary
HebbianTraining(BasicNetwork network, NeuralDataSet training, boolean oja, double learningRate)
          Construct a Hebbian training object.
 
Method Summary
 double getLearningRate()
           
 BasicNetwork getNetwork()
          Get the current best network from the training.
 NeuralDataSet getTraining()
           
 boolean isOja()
           
 boolean isSupervised()
           
 void iteration()
          Perform a single training iteration.
 void setLearningRate(double rate)
          Set the learning date.
 
Methods inherited from class org.encog.neural.networks.training.BasicTraining
addStrategy, finishTraining, getCloud, getError, getIteration, getStrategies, isTrainingDone, iteration, postIteration, preIteration, setCloud, setError, setIteration, setTraining
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HebbianTraining

public HebbianTraining(BasicNetwork network,
                       NeuralDataSet training,
                       boolean oja,
                       double learningRate)
Construct a Hebbian training object. It will train in supervised or unsupervised mode, depending on the nature of the training data.

Parameters:
network - The network to train.
training - The training data.
oja - True of OJA's rule should be used. This can only be used with unsupervised data.
learningRate - The learning rate.
Method Detail

getLearningRate

public double getLearningRate()
Specified by:
getLearningRate in interface LearningRate
Returns:
The learning rate.

getNetwork

public BasicNetwork getNetwork()
Description copied from interface: Train
Get the current best network from the training.

Specified by:
getNetwork in interface Train
Returns:
The network to train.

getTraining

public NeuralDataSet getTraining()
Specified by:
getTraining in interface Train
Overrides:
getTraining in class BasicTraining
Returns:
The training data.

isOja

public boolean isOja()
Returns:
True if OJA's rule is in use.

isSupervised

public boolean isSupervised()
Returns:
True if this is supervised training.

iteration

public void iteration()
Perform a single training iteration.

Specified by:
iteration in interface Train

setLearningRate

public void setLearningRate(double rate)
Set the learning date.

Specified by:
setLearningRate in interface LearningRate
Parameters:
rate - The new learning rate.


Copyright © 2011. All Rights Reserved.