ca.nengo.model.plasticity.impl
Class SpikePlasticityRule

java.lang.Object
  extended by ca.nengo.model.plasticity.impl.SpikePlasticityRule
All Implemented Interfaces:
PlasticityRule, 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 firing-rate-based 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(java.lang.String origin, java.lang.String modTerm, int modTermDim, Function onInSpike, Function onOutSpike, int termDim, int originDim)
           
 
Method Summary
 PlasticityRule clone()
           
 float[][] getDerivative(float[][] transform, InstantaneousOutput input, float time)
           
 int getModTermDim()
           
 java.lang.String getModTermName()
           
 Function getOnInSpike()
           
 Function getOnOutSpike()
           
 int getOriginDim()
           
 java.lang.String getOriginName()
           
 int getTermDim()
           
 void setModTermDim(int dim)
           
 void setModTermName(java.lang.String name)
           
 void setOnInSpike(Function function)
           
 void setOnOutSpike(Function function)
           
 void setOriginDim(int dim)
           
 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).
 void setTermDim(int dim)
           
 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

SpikePlasticityRule

public SpikePlasticityRule(java.lang.String origin,
                           java.lang.String modTerm,
                           int modTermDim,
                           Function onInSpike,
                           Function onOutSpike,
                           int termDim,
                           int originDim)
Parameters:
origin - 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)
modTermDim - Dimension index of the modulatory input within above Termination
onInSpike - Function defining synaptic weight change when there is an incoming spike. The function must have three dimensions: 1) time since last post-synaptic spike; 2) existing weight; 3) modulatory input. (Any of these can be ignored.)
onOutSpike - Function defining synaptic weight change when there is an outgoing spike. The function must have three dimensions: 1) time since last pre-synaptic spike; 2) existing weight; 3) modulatory input. (Any of these can be ignored.)
termDim - Dimension of Termination this rule applies to
originDim - Dimension of post-synaptic activity (eg number of neurons if rule belongs to an Ensemble)
Method Detail

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)

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

getOnInSpike

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

setOnInSpike

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

getOnOutSpike

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

setOnOutSpike

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

getTermDim

public int getTermDim()
Returns:
Dimension of Termination this rule applies to

setTermDim

public void setTermDim(int dim)
Parameters:
dim - Dimension of Termination this rule applies to

getOriginDim

public int getOriginDim()
Returns:
Dimension of post-synaptic activity (eg number of neurons if rule belongs to an Ensemble)

setOriginDim

public void setOriginDim(int dim)
Parameters:
dim - Dimension of post-synaptic activity (eg number of neurons if rule belongs to an Ensemble)

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)

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)

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