ca.nengo.model.nef.impl
Class DecodedTermination

java.lang.Object
  extended by ca.nengo.model.nef.impl.DecodedTermination
All Implemented Interfaces:
Probeable, Resettable, Termination, java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
BiasTermination

public class DecodedTermination
extends java.lang.Object
implements Termination, Resettable, Probeable

A Termination of decoded state vectors onto an NEFEnsemble. A DecodedTermination performs a linear transformation on incoming vectors, mapping them into the space of the NEFEnsemble to which this Termination belongs. A DecodedTermination also applies linear PSC dynamics (typically exponential decay) to the resulting vector.

Non-linear dynamics are not allowed at this level. This is because the vector input to an NEFEnsemble only has meaning in terms of the decomposition of synaptic weights into decoding vectors, transformation matrix, and encoding vectors. Linear PSC dynamics actually apply to currents, but if everything is linear we can re-order the dynamics and the encoders for convenience (so that the dynamics seem to operate on the state vectors). In contrast, non-linear dynamics must be modeled within each Neuron, because all inputs to a non-linear dynamical process must be taken into account before the effect of any single input is known.

Author:
Bryan Tripp
See Also:
Serialized Form

Field Summary
static java.lang.String OUTPUT
          Name of Probeable output state.
 
Constructor Summary
DecodedTermination(Node node, java.lang.String name, float[][] transform, LinearSystem dynamics, Integrator integrator)
           
 
Method Summary
 Termination clone()
           
 int getDimensions()
           
 LinearSystem getDynamics()
           
 TimeSeries getHistory(java.lang.String stateName)
          Note that the units of TimeSeries' for a given state do not change over time (ie at different time steps).
 float[][] getInitialState()
           
 RealOutput getInput()
           
 boolean getModulatory()
           
 java.lang.String getName()
           
 Node getNode()
           
 float[] getOutput()
          This method should be called after run(...).
 DecodedTermination getScaling()
           
 float[] getStaticBias()
           
 float getTau()
           
 float[][] getTransform()
           
 java.util.Properties listStates()
           
 void reset(boolean randomize)
           
 void run(float startTime, float endTime)
           
 void setDynamics(LinearSystem dynamics)
           
 void setInitialState(float[][] state)
           
 void setModulatory(boolean modulatory)
           
protected  void setNode(Node node)
           
 void setScaling(DecodedTermination t)
           
 void setStaticBias(float[] bias)
           
 void setTau(float tau)
           
 void setTransform(float[][] transform)
           
 void setValues(InstantaneousOutput values)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OUTPUT

public static final java.lang.String OUTPUT
Name of Probeable output state.

See Also:
Constant Field Values
Constructor Detail

DecodedTermination

public DecodedTermination(Node node,
                          java.lang.String name,
                          float[][] transform,
                          LinearSystem dynamics,
                          Integrator integrator)
                   throws StructuralException
Parameters:
node - The parent Node
name - The name of this Termination
transform - A matrix that maps input (which has the dimension of this Termination) onto the state space represented by the NEFEnsemble to which the Termination belongs
dynamics - Post-synaptic current dynamics (single-input single-output). Time-varying dynamics are OK, but non-linear dynamics don't make sense here, because other Terminations may input onto the same neurons.
integrator - Numerical integrator with which to solve dynamics
Throws:
StructuralException - If dynamics are not SISO or given transform is not a matrix
Method Detail

setStaticBias

public void setStaticBias(float[] bias)
Parameters:
bias - Intrinsic bias that is added to inputs to this termination

getStaticBias

public float[] getStaticBias()
Returns:
Static bias vector (a copy)

setValues

public void setValues(InstantaneousOutput values)
               throws SimulationException
Specified by:
setValues in interface Termination
Parameters:
values - Only RealOutput is accepted.
Throws:
SimulationException - if the given values have the wrong dimension
See Also:
Termination.setValues(ca.nengo.model.InstantaneousOutput)

run

public void run(float startTime,
                float endTime)
         throws SimulationException
Parameters:
startTime - Simulation time at which running is to start
endTime - Simulation time at which running is to end
Throws:
SimulationException

getOutput

public float[] getOutput()
This method should be called after run(...).

Returns:
Output of dynamical system -- of interest at end of run(...)

getInput

public RealOutput getInput()
Returns:
Latest input to Termination (pre transform and dynamics)

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()

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)

getInitialState

public float[][] getInitialState()
Returns:
Initial states of dynamics (one row per output dimension)

setInitialState

public void setInitialState(float[][] state)
Parameters:
state - Initial state of dynamics (dimension of termination output X dimension of dynamics state)

getTransform

public float[][] getTransform()
Returns:
The matrix that maps input (which has the dimension of this Termination) onto the state space represented by the NEFEnsemble to which the Termination belongs

setTransform

public void setTransform(float[][] transform)
                  throws StructuralException
Parameters:
transform - New transform
Throws:
StructuralException - If the transform is not a matrix or has the wrong size

setScaling

public void setScaling(DecodedTermination t)

getScaling

public DecodedTermination getScaling()

getDynamics

public LinearSystem getDynamics()
Returns:
The dynamics that govern each dimension of this Termination. Changing the properties of the return value will change dynamics of all dimensions, effective next run time.

setDynamics

public void setDynamics(LinearSystem dynamics)
Parameters:
dynamics - New dynamics for each dimension of this Termination (effective immediately). This method uses a clone of the given dynamics.

getTau

public float getTau()
Specified by:
getTau in interface Termination
Returns:
Slowest time constant of dynamics, if dynamics are LTI, otherwise 0

setTau

public void setTau(float tau)
            throws StructuralException
Specified by:
setTau in interface Termination
Parameters:
tau - New time constant to replace current slowest time constant of dynamics
Throws:
StructuralException - if the dynamics of this Termination are not LTI in controllable canonical form

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()

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)

getHistory

public TimeSeries getHistory(java.lang.String stateName)
                      throws SimulationException
Description copied from interface: Probeable
Note that the units of TimeSeries' for a given state do not change over time (ie at different time steps). CAUTION: The TimeSeries should not contain a reference to any arrays that you are going to change later. The caller owns what you return.

Specified by:
getHistory in interface Probeable
Parameters:
stateName - A state variable name
Returns:
History of values for the named state variable. The history must cover the most recent network time step, and no more. There should be no overlap in the time points returned for different steps.
Throws:
SimulationException - if the Probeable does not have the requested state
See Also:
Probeable.getHistory(java.lang.String)

listStates

public java.util.Properties listStates()
Specified by:
listStates in interface Probeable
Returns:
List of state variable names, eg "V", and associated descriptions eg "membrane potential (mV)"
See Also:
Probeable.listStates()

getNode

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

setNode

protected void setNode(Node node)

clone

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