net.sourceforge.jabm.learning
Class WidrowHoffLearner

java.lang.Object
  extended by net.sourceforge.jabm.learning.AbstractLearner
      extended by net.sourceforge.jabm.learning.WidrowHoffLearner
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, ContinuousLearner, Learner, MimicryLearner, Prototypeable
Direct Known Subclasses:
WidrowHoffLearnerWithMomentum

public class WidrowHoffLearner
extends AbstractLearner
implements MimicryLearner, Prototypeable, java.io.Serializable

An implementation of the Widrow-Hoff learning algorithm for 1-dimensional training sets.

See Also:
Serialized Form
 

Field Summary
protected  double currentOutput
          The current output level.
static double DEFAULT_LEARNING_RATE
           
protected  double delta
          The current amount of adjustment to the output.
protected  double learningRate
          The learning rate.
protected  cern.jet.random.AbstractContinousDistribution randomParamDistribution
           
 
Fields inherited from class net.sourceforge.jabm.learning.AbstractLearner
monitor
 
Constructor Summary
WidrowHoffLearner()
           
WidrowHoffLearner(cern.jet.random.AbstractContinousDistribution randomParamDistribution)
           
WidrowHoffLearner(double learningRate, cern.jet.random.AbstractContinousDistribution randomParamDistribution)
           
WidrowHoffLearner(double learningRate, cern.jet.random.engine.RandomEngine prng)
           
 
Method Summary
 double act()
          Generate an output from the learning algorithm.
 double delta(double target)
           
 void dumpState(DataWriter out)
          Write out our state data to the specified data writer.
 double getCurrentOutput()
           
 double getDelta()
           
 double getLearningDelta()
          Return a value indicative of the amount of learning that occured during the last iteration.
 double getLearningRate()
           
 cern.jet.random.AbstractContinousDistribution getRandomParamDistribution()
           
 void initialise()
           
 java.lang.Object protoClone()
           
 void randomInitialise()
          Initialise with random values for free parameters
 void reset()
           
 void setLearningRate(double learningRate)
           
 void setOutputLevel(double currentOutput)
          Initialise the learning algorithm to output the supplied value.
 void setRandomParamDistribution(cern.jet.random.AbstractContinousDistribution randomParamDistribution)
           
 java.lang.String toString()
           
 void train(double target)
          Provide a training signal to the learning algorithm.
 
Methods inherited from class net.sourceforge.jabm.learning.AbstractLearner
monitor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.sourceforge.jabm.learning.Learner
monitor
 

Field Detail

learningRate

protected double learningRate
The learning rate.


currentOutput

protected double currentOutput
The current output level.


delta

protected double delta
The current amount of adjustment to the output.


randomParamDistribution

protected cern.jet.random.AbstractContinousDistribution randomParamDistribution

DEFAULT_LEARNING_RATE

public static final double DEFAULT_LEARNING_RATE
See Also:
Constant Field Values
Constructor Detail

WidrowHoffLearner

public WidrowHoffLearner(double learningRate,
                         cern.jet.random.AbstractContinousDistribution randomParamDistribution)

WidrowHoffLearner

public WidrowHoffLearner(cern.jet.random.AbstractContinousDistribution randomParamDistribution)

WidrowHoffLearner

public WidrowHoffLearner()

WidrowHoffLearner

public WidrowHoffLearner(double learningRate,
                         cern.jet.random.engine.RandomEngine prng)
Method Detail

initialise

public void initialise()

protoClone

public java.lang.Object protoClone()
Specified by:
protoClone in interface Prototypeable

act

public double act()
Description copied from interface: ContinuousLearner
Generate an output from the learning algorithm.

Specified by:
act in interface ContinuousLearner

train

public void train(double target)
Description copied from interface: MimicryLearner
Provide a training signal to the learning algorithm.

Specified by:
train in interface MimicryLearner

delta

public double delta(double target)

setOutputLevel

public void setOutputLevel(double currentOutput)
Description copied from interface: MimicryLearner
Initialise the learning algorithm to output the supplied value.

Specified by:
setOutputLevel in interface MimicryLearner

dumpState

public void dumpState(DataWriter out)
Description copied from interface: Learner
Write out our state data to the specified data writer.

Specified by:
dumpState in interface Learner
Specified by:
dumpState in class AbstractLearner

getLearningDelta

public double getLearningDelta()
Description copied from interface: Learner
Return a value indicative of the amount of learning that occured during the last iteration. Values close to 0.0 indicate that the learner has converged to an equilibrium state.

Specified by:
getLearningDelta in interface Learner
Specified by:
getLearningDelta in class AbstractLearner
Returns:
A double representing the amount of learning that occured.

reset

public void reset()

setLearningRate

public void setLearningRate(double learningRate)

getLearningRate

public double getLearningRate()

randomInitialise

public void randomInitialise()
Description copied from interface: MimicryLearner
Initialise with random values for free parameters

Specified by:
randomInitialise in interface MimicryLearner

getCurrentOutput

public double getCurrentOutput()

getDelta

public double getDelta()

getRandomParamDistribution

public cern.jet.random.AbstractContinousDistribution getRandomParamDistribution()

setRandomParamDistribution

public void setRandomParamDistribution(cern.jet.random.AbstractContinousDistribution randomParamDistribution)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object