Nengo.ca

ca.nengo.model.plasticity.impl
Class PlasticEnsembleTermination

java.lang.Object
  extended by ca.nengo.model.impl.EnsembleTermination
      extended by ca.nengo.model.plasticity.impl.PlasticEnsembleTermination
All Implemented Interfaces:
Resettable, Termination, java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
ModulatedPlasticEnsembleTermination, STDPTermination

public abstract class PlasticEnsembleTermination
extends EnsembleTermination

A Termination that is composed of Terminations onto multiple Nodes. The dimensions of the Terminations onto each Node must be the same.

Physiologically, this might correspond to a set of n axons passing into a neuron pool. Each neuron in the pool receives synaptic connections from as many as n of these axons (zero weight is equivalent to no connection). Sometimes we deal with this set of axons only in terms of the branches they send to one specific Neuron (a Node-level Termination) but here we deal with all branches (an Ensemble-level Termination). In either case the spikes transmitted by the axons are the same.

TODO: test

See Also:
Serialized Form

Field Summary
protected  boolean myLearning
           
protected  float myLearningRate
           
protected  java.lang.String myOriginName
           
protected  float[] myOutput
           
 
Constructor Summary
PlasticEnsembleTermination(Node node, java.lang.String name, PlasticNodeTermination[] nodeTerminations)
           
 
Method Summary
 PlasticEnsembleTermination clone(Node node)
          Clone method that changes necessary parameters to point to a new parent, for use in cloning ensembles, etc.
 InstantaneousOutput getInput()
           
 boolean getLearning()
           
 float getLearningRate()
           
 java.lang.String getOriginName()
           
 float[] getOutputs()
           
 float[][] getTransform()
           
 void reset(boolean randomize)
           
 void saveTransform()
          Saves the weights in the PlasticNodeTerminations within.
 void setLearning(boolean learning)
           
 void setLearningRate(float learningRate)
           
 void setOriginName(java.lang.String originName)
           
 void setOriginState(java.lang.String name, InstantaneousOutput state, float time)
           
 void setTransform(float[][] transform, boolean save)
           
abstract  void updateTransform(float time, int start, int end)
           
 
Methods inherited from class ca.nengo.model.impl.EnsembleTermination
clone, getDimensions, getModulatory, getName, getNode, getNodeTerminations, getTau, setModulatory, setTau, setValues
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myLearningRate

protected float myLearningRate

myLearning

protected boolean myLearning

myOriginName

protected java.lang.String myOriginName

myOutput

protected float[] myOutput
Constructor Detail

PlasticEnsembleTermination

public PlasticEnsembleTermination(Node node,
                                  java.lang.String name,
                                  PlasticNodeTermination[] nodeTerminations)
                           throws StructuralException
Parameters:
node - The parent Node
name - Name of this Termination
nodeTerminations - Node-level Terminations that make up this Termination. Must be all LinearExponentialTerminations
Throws:
StructuralException - If dimensions of different terminations are not all the same
Method Detail

getOriginName

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

setOriginName

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

setOriginState

public void setOriginState(java.lang.String name,
                           InstantaneousOutput state,
                           float time)
                    throws StructuralException
Parameters:
name - Name of Origin from which postsynaptic activity is drawn
state - State of named origin
time - Current time
Throws:
StructuralException - if Origin is not set

getTransform

public float[][] getTransform()
Returns:
The transformation matrix, which is made up of the weight vectors for each of the PlasticNodeTerminations within. This can be thought of as the connection weight matrix in most cases.

setTransform

public void setTransform(float[][] transform,
                         boolean save)
Parameters:
transform - The transformation matrix, which can be thought of as the connection weight matrix in most cases. This will be passed through to set the weight vectors on each PlasticNodeTermination within.

saveTransform

public void saveTransform()
Saves the weights in the PlasticNodeTerminations within.


reset

public void reset(boolean randomize)
Specified by:
reset in interface Resettable
Overrides:
reset in class EnsembleTermination
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)

updateTransform

public abstract void updateTransform(float time,
                                     int start,
                                     int end)
                              throws StructuralException
Parameters:
time - Current time
start - The start index of the range of transform values to update (for multithreading)
end - The end index of the range of transform values to update (for multithreading)
Throws:
StructuralException - if

getInput

public InstantaneousOutput getInput()
Specified by:
getInput in interface Termination
Overrides:
getInput in class EnsembleTermination
Returns:
Latest input to the underlying terminations.
See Also:
EnsembleTermination.getInput()

getOutputs

public float[] getOutputs()
Returns:
The output currents from the PlasticNodeTermination being wrapped

getLearningRate

public float getLearningRate()
Returns:
Learning rate of the termination

setLearningRate

public void setLearningRate(float learningRate)
Parameters:
learningRate - Learning rate of the termination

getLearning

public boolean getLearning()
Returns:
Whether or not the termination is currently learning

setLearning

public void setLearning(boolean learning)
Parameters:
learning - Turn learning on or off for this termination

clone

public PlasticEnsembleTermination 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 Termination
Overrides:
clone in class EnsembleTermination
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