ca.nengo.model.plasticity.impl
Class RealPlasticityRule

java.lang.Object
  extended by ca.nengo.model.plasticity.impl.RealPlasticityRule
All Implemented Interfaces:
PlasticityRule, Resettable, java.io.Serializable, java.lang.Cloneable

public class RealPlasticityRule
extends java.lang.Object
implements PlasticityRule

A basic implementation of PlasticityRule for real valued input. The learning rate is defined by an AbstractRealLearningFunction (see its declaration for the inputs it receives). This learning rate function is applied to each In each case, the presynaptic-variable input to the function is the corresponding dimension of input to the Termination. The postsynaptic variable is taken as the corresponding dimension of the Origin NEFEnsemble.X. This implementation supports only a single separate modulatory variable, though it can be multi-dimensional. This is also user-defined, as some other Termination onto the same NEFEnsemble. TODO: test

Author:
Bryan Tripp
See Also:
Serialized Form

Constructor Summary
RealPlasticityRule(AbstractRealLearningFunction function, java.lang.String originName, java.lang.String modTermName)
           
 
Method Summary
 PlasticityRule clone()
           
 float[][] getDerivative(float[][] transform, InstantaneousOutput input, float time)
           
 AbstractRealLearningFunction getFunction()
           
 java.lang.String getModTermName()
           
 java.lang.String getOriginName()
           
 void reset(boolean randomize)
           
 void setFunction(AbstractRealLearningFunction function)
           
 void setModTerminationState(java.lang.String name, InstantaneousOutput state, float time)
          Provides potentially modulatory input to the rule.
 void setModTermName(java.lang.String name)
           
 void setOriginName(java.lang.String originName)
           
 void setOriginState(java.lang.String name, InstantaneousOutput state, float time)
          Provides state or functional output, which may serve as an indication of postsynaptic activity (used in Hebbian learning).
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RealPlasticityRule

public RealPlasticityRule(AbstractRealLearningFunction function,
                          java.lang.String originName,
                          java.lang.String modTermName)
Parameters:
function - AbstractRealLearningFunction defining the rate of change of transformation matrix weights.
originName - Name of Origin from which post-synaptic activity is drawn
modTermName - Name of the Termination from which modulatory input is drawn (can be null if not used)
Method Detail

reset

public void reset(boolean randomize)
Specified by:
reset in interface Resettable
Parameters:
randomize - True indicates that the object should be reset to a randomly selected initial state (the object must be aware of the distribution from which to draw from). False indicates that the object should be reset to a fixed initial state (which it must also know). Some objects may not support randomization of the initial state, in which case a fixed state will be used in either case.
See Also:
Resettable.reset(boolean)

getModTermName

public java.lang.String getModTermName()
Returns:
Name of the Termination from which modulatory input is drawn (can be null if not used)

setModTermName

public void setModTermName(java.lang.String name)
Parameters:
name - Name of the Termination from which modulatory input is drawn (can be null if not used)

getFunction

public AbstractRealLearningFunction getFunction()
Returns:
AbstractRealLearningFunction defining the rate of change of transformation matrix weights.

setFunction

public void setFunction(AbstractRealLearningFunction function)
Parameters:
function - AbstractRealLearningFunction defining the rate of change of transformation matrix weights (as in constructor)

getOriginName

public java.lang.String getOriginName()
Returns:
Name of Origin from which post-synaptic activity is drawn

setOriginName

public void setOriginName(java.lang.String originName)
Parameters:
originName - Name of Origin from which post-synaptic activity is drawn

setModTerminationState

public void setModTerminationState(java.lang.String name,
                                   InstantaneousOutput state,
                                   float time)
Description copied from interface: PlasticityRule
Provides potentially modulatory input to the rule. Note that although modulatory input will most commonly be used here, an NEFEnsemble will provide outputs of all Terminations via this method regardless of whether a Termination has property Termination.MODULATORY=="true".

Specified by:
setModTerminationState in interface PlasticityRule
Parameters:
name - The name of a DecodedTermination onto the ensemble
state - The present value of output from the named Termination (may differ from its input in terms of dynamics and dimension)
time - Simulation time at which state arrives at site of plasticity
See Also:
PlasticityRule.setModTerminationState(java.lang.String, ca.nengo.model.InstantaneousOutput, float)

setOriginState

public void setOriginState(java.lang.String name,
                           InstantaneousOutput state,
                           float time)
Description copied from interface: PlasticityRule
Provides state or functional output, which may serve as an indication of postsynaptic activity (used in Hebbian learning).

Specified by:
setOriginState in interface PlasticityRule
Parameters:
name - The name of a DecodedOrigin from the ensemble
state - The present value of output from the named Origin
time - Simulation time at which state arrives at site of plasticity
See Also:
PlasticityRule.setOriginState(java.lang.String, ca.nengo.model.InstantaneousOutput, float)

getDerivative

public float[][] getDerivative(float[][] transform,
                               InstantaneousOutput input,
                               float time)
Specified by:
getDerivative in interface PlasticityRule
Parameters:
transform - The present transformation matrix of a Termination
input - The present input to the Termination
time - Simulation time at which input arrives at site of plasticity
Returns:
The rate of change of each element in the transform (units per second) if input is RealOutput, otherwise the increment of each element in the transform
See Also:
PlasticityRule.getDerivative(float[][], ca.nengo.model.InstantaneousOutput, float)

clone

public PlasticityRule clone()
                     throws java.lang.CloneNotSupportedException
Specified by:
clone in interface PlasticityRule
Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException