Nengo.ca

ca.nengo.model.impl
Class LinearExponentialTermination

java.lang.Object
  extended by ca.nengo.model.impl.LinearExponentialTermination
All Implemented Interfaces:
PlasticNodeTermination, Resettable, Termination, java.io.Serializable, java.lang.Cloneable

public class LinearExponentialTermination
extends java.lang.Object
implements PlasticNodeTermination

A Termination at which incoming spikes induce exponentially decaying post-synaptic currents that are combined linearly. Real-valued spike rate inputs have approximately the same effect over time as actual (boolean) spike inputs at the same rate.

Each input is weighted (weights specified in the constructor) so that the time integral of the post-synaptic current arising from one spike equals the weight. The time integral of post-synaptic current arising from real-valued input of 1 over a period of 1s also equals the weight. This means that spike input and spike-rate input have roughly the same effects.

See Also:
Serialized Form

Constructor Summary
LinearExponentialTermination(Node node, java.lang.String name, float[] weights, float tauPSC)
           
 
Method Summary
 LinearExponentialTermination clone()
           
 LinearExponentialTermination clone(Node node)
          Clone method that changes necessary parameters to point to a new parent, for use in cloning ensembles, etc.
 int getDimensions()
           
 InstantaneousOutput getInput()
           
 boolean getModulatory()
           
 java.lang.String getName()
           
 Node getNode()
           
 float getOutput()
           
 float getTau()
           
 float[] getWeightProbabilities()
           
 float[] getWeights()
           
 void reset(boolean randomize)
          Resets current to 0 (randomize arg is ignored).
 void saveWeights()
          Save the current state of the weights so it can be reset there
 void setModulatory(boolean modulatory)
           
 void setNode(Node node)
           
 void setTau(float tau)
           
 void setValues(InstantaneousOutput values)
           
 void setWeightProbabilities(float[] probs)
           
 void setWeights(float[] weights, boolean save)
           
 float updateCurrent(boolean applySpikes, float integrationTime, float decayTime)
          Updates net post-synaptic current for this Termination according to new inputs and exponential dynamics applied to previous inputs.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LinearExponentialTermination

public LinearExponentialTermination(Node node,
                                    java.lang.String name,
                                    float[] weights,
                                    float tauPSC)
Parameters:
node - The parent Node
name - Name of the Termination (must be unique within the Neuron or Ensemble to which it is attached)
weights - Ordered list of synaptic weights of each input channel
tauPSC - Time constant of exponential post-synaptic current decay
Method Detail

reset

public void reset(boolean randomize)
Resets current to 0 (randomize arg is ignored).

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)

saveWeights

public void saveWeights()
Description copied from interface: PlasticNodeTermination
Save the current state of the weights so it can be reset there

Specified by:
saveWeights in interface PlasticNodeTermination

getName

public java.lang.String getName()
Specified by:
getName in interface Termination
Returns:
Name of this Termination (unique in the scope of the object the which the Termination is connected, eg the Neuron or Ensemble).
See Also:
Termination.getName()

getDimensions

public int getDimensions()
Specified by:
getDimensions in interface Termination
Returns:
Dimensionality of information entering this Termination (eg number of axons, or dimension of decoded function of variables represented by sending Ensemble)
See Also:
Termination.getDimensions()

getWeights

public float[] getWeights()
Specified by:
getWeights in interface PlasticNodeTermination
Returns:
List of synaptic weights for each input channel

setWeights

public void setWeights(float[] weights,
                       boolean save)
Specified by:
setWeights in interface PlasticNodeTermination
Parameters:
weights - The new synaptic weights for each input channel
save - Should the weights be saved for resetting purposes?

setWeightProbabilities

public void setWeightProbabilities(float[] probs)
Parameters:
probs - The new synaptic vesicle release probabilities for each input channel

getWeightProbabilities

public float[] getWeightProbabilities()
Returns:
List of synaptic release probabilities for each input channel

getInput

public InstantaneousOutput getInput()
Specified by:
getInput in interface PlasticNodeTermination
Specified by:
getInput in interface Termination
Returns:
The most recent input to the Termination

getOutput

public float getOutput()
Specified by:
getOutput in interface PlasticNodeTermination
Returns:
The most recent output of the Termination (after summation and dynamics)

setValues

public void setValues(InstantaneousOutput values)
               throws SimulationException
Specified by:
setValues in interface Termination
Parameters:
values - Can be either SpikeOutput or RealOutput
Throws:
SimulationException - if the given values have the wrong dimension
See Also:
Termination.setValues(ca.nengo.model.InstantaneousOutput)

updateCurrent

public float updateCurrent(boolean applySpikes,
                           float integrationTime,
                           float decayTime)
Updates net post-synaptic current for this Termination according to new inputs and exponential dynamics applied to previous inputs. The arguments provide flexibility in updating the current, in terms of whether spike inputs are applied, for how long real-valued inputs are applied, and for how long the net current decays exponentially. A usage example follows: Suppose the SynapticIntegrator that contains this Termination models each network time step in three steps of its own. Suppose also that the SynapticIntegrator uses updateCurrent() to find the current at the beginning and end of each network time step, and at the two points in between. A reasonable way for the SynapticIntegrator to use updateCurrent() in this scenario would be as follows (the variable tau represents 1/3 of the length of the network time step):
  1. At the beginning of the network time step call updateCurrent(true, tau, 0) to model the application of spikes and real-valued inputs from the previous time step, without decaying them.
  2. To advance to each of the two intermediate times call updateCurrent(false, tau, tau). Spikes are not re-applied (a given spike should only be applied once). Real-valued inputs are continuous in time, so they are integrated again. Currents also begin to decay.
  3. At the end of the network time step call updateCurrent(false, 0, tau). Real-valued inputs for this time interval are not applied at the end of this network time step, since they will be applied at the (identical) beginning of the next network time step.
    1. The essential points are that spikes are only applied once during a network time step, and that the total integration and decay times over a network time step both equal the length of the network time step.

      Parameters:
      applySpikes - True if spike inputs are to be applied
      integrationTime - Time over which real-valued inputs are to be integrated
      decayTime - Time over which post-synaptic currents are to decay
      Returns:
      Net synaptic current flowing into this termination after specified input and decay

getNode

public Node getNode()
Specified by:
getNode in interface Termination
Returns:
The Node to which this Termination belongs
See Also:
Termination.getNode()

setNode

public void setNode(Node node)
Parameters:
node - Parent node

getModulatory

public boolean getModulatory()
Specified by:
getModulatory in interface Termination
Returns:
Whether the Termination is modulatory, in the sense of neuromodulation, ie true if input via this Termination is not summed to drive a node, but influences node activity in some other way
See Also:
Termination.getModulatory()

getTau

public float getTau()
Specified by:
getTau in interface Termination
Returns:
Time constant of dominant dynamics
See Also:
Termination.getTau()

setModulatory

public void setModulatory(boolean modulatory)
Specified by:
setModulatory in interface Termination
Parameters:
modulatory - True if the Termination is to be modulatory
See Also:
Termination.setModulatory(boolean)

setTau

public void setTau(float tau)
            throws StructuralException
Specified by:
setTau in interface Termination
Parameters:
tau - Time constant of dominant dynamics
Throws:
StructuralException - if the time constant cannot be changed
See Also:
Termination.setTau(float)

clone

public LinearExponentialTermination clone()
                                   throws java.lang.CloneNotSupportedException
Specified by:
clone in interface PlasticNodeTermination
Specified by:
clone in interface Termination
Overrides:
clone in class java.lang.Object
Returns:
Valid clone
Throws:
java.lang.CloneNotSupportedException - if clone can't be made

clone

public LinearExponentialTermination clone(Node node)
                                   throws java.lang.CloneNotSupportedException
Description copied from interface: Termination
Clone method that changes necessary parameters to point to a new parent, for use in cloning ensembles, etc.

Specified by:
clone in interface PlasticNodeTermination
Specified by:
clone in interface Termination
Parameters:
node - New parent node
Returns:
A clone of the termination for the new parent ensemble
Throws:
java.lang.CloneNotSupportedException - if clone cannot be made

Nengo.ca