ca.nengo.model.plasticity.impl
Class SpikePlasticityRule

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

public class SpikePlasticityRule
extends java.lang.Object
implements PlasticityRule

A PlasticityRule that accepts spiking input.

Spiking input must be dealt with in order to run learning rules in a spiking SimulationMode. Spiking input is also the only way to simulate spike-timing-dependent plasticity.

Author:
Bryan Tripp
See Also:
Serialized Form

Constructor Summary
SpikePlasticityRule(AbstractSpikeLearningFunction onInSpike, AbstractSpikeLearningFunction onOutSpike, java.lang.String originName, java.lang.String modTermName)
           
 
Method Summary
 PlasticityRule clone()
           
 float[][] getDerivative(float[][] transform, InstantaneousOutput input, float time)
           
 java.lang.String getModTermName()
           
 AbstractSpikeLearningFunction getOnInSpike()
           
 AbstractSpikeLearningFunction getOnOutSpike()
           
 java.lang.String getOriginName()
           
 void reset(boolean randomize)
           
 void setModTerminationState(java.lang.String name, InstantaneousOutput state, float time)
          Provides potentially modulatory input to the rule.
 void setModTermName(java.lang.String name)
           
 void setOnInSpike(AbstractSpikeLearningFunction function)
           
 void setOnOutSpike(AbstractSpikeLearningFunction function)
           
 void setOriginName(java.lang.String name)
           
 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

SpikePlasticityRule

public SpikePlasticityRule(AbstractSpikeLearningFunction onInSpike,
                           AbstractSpikeLearningFunction onOutSpike,
                           java.lang.String originName,
                           java.lang.String modTermName)
Parameters:
onInSpike - AbstractSpikeLearningFunction defining synaptic weight change when there is an incoming spike.
onOutSpike - AbstractSpikeLearningFunction defining synaptic weight change when there is an outgoing spike.
originName - Name of Origin from which post-synaptic activity is drawn
modTerm - 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)

getOriginName

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

setOriginName

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

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)

getOnInSpike

public AbstractSpikeLearningFunction getOnInSpike()
Returns:
Function defining synaptic weight change when there is an incoming spike.

setOnInSpike

public void setOnInSpike(AbstractSpikeLearningFunction function)
Parameters:
function - Function defining synaptic weight change when there is an incoming spike.

getOnOutSpike

public AbstractSpikeLearningFunction getOnOutSpike()
Returns:
Function defining synaptic weight change when there is an outgoing spike.

setOnOutSpike

public void setOnOutSpike(AbstractSpikeLearningFunction function)
Parameters:
function - Function defining synaptic weight change when there is an outgoing spike.

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)

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:
ca.nengo.model.plasticity.PlasticityRule#setTerminationState(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