ca.nengo.model.plasticity.impl
Class RealPlasticityRule

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

public class RealPlasticityRule
extends java.lang.Object
implements PlasticityRule

A basic implementation of EnsemblePlasticityRule. The learning rate is defined by a function of four inputs: a presynaptic variable, a postsynaptic variable, a transformation weight, and a single modulatory input. The function is user-defined and may ignore any of these inputs. This learning rate function is applied to each element of the transformation matrix of the Termination to which this rule applies. 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. This is also user-defined, as one dimension of some other Termination onto the same NEFEnsemble. TODO: test

Author:
Bryan Tripp
See Also:
Serialized Form

Constructor Summary
RealPlasticityRule(java.lang.String modTermName, int modTermDim, Function function, java.lang.String originName)
           
 
Method Summary
 PlasticityRule clone()
           
 float[][] getDerivative(float[][] transform, InstantaneousOutput input, float time)
           
 Function getFunction()
           
 int getModTermDim()
           
 java.lang.String getModTermName()
           
 java.lang.String getOriginName()
           
 void setFunction(Function function)
           
 void setModTermDim(int dim)
           
 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).
 void setTerminationState(java.lang.String name, InstantaneousOutput state, float time)
          Provides potentially modulatory input to the rule.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RealPlasticityRule

public RealPlasticityRule(java.lang.String modTermName,
                          int modTermDim,
                          Function function,
                          java.lang.String originName)
Parameters:
modTermName - Name of the Termination from which modulatory input is drawn (can be null if not used)
modTermDim - Dimension index of the modulatory input within above Termination
function - Four-dimensional function defining the rate of change of transformation matrix weights. The (scalar) inputs are presynaptic state, postsynaptic state, existing weight, and modulatory input. This function is applied to each element of the transformation matrix on the Termination to which this PlastityRule applies. See class documentation for more details.
originName - Name of Origin from which post-synaptic activity is drawn
Method Detail

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)

getModTermDim

public int getModTermDim()
Returns:
Dimension index of the modulatory input within above Termination

setModTermDim

public void setModTermDim(int dim)
Parameters:
dim - Dimension index of the modulatory input within above Termination

getFunction

public Function getFunction()
Returns:
Four-dimensional function defining the rate of change of transformation matrix weights.

setFunction

public void setFunction(Function function)
Parameters:
function - Four-dimensional function 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

setTerminationState

public void setTerminationState(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:
setTerminationState 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.setTerminationState(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