|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectca.nengo.model.impl.AbstractEnsemble
ca.nengo.model.impl.EnsembleImpl
ca.nengo.model.nef.impl.DecodableEnsembleImpl
ca.nengo.model.nef.impl.NEFEnsembleImpl
public class NEFEnsembleImpl
Default implementation of NEFEnsemble. TODO: links to NEF documentation TODO: test
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface ca.nengo.util.VisiblyMutable |
|---|
VisiblyMutable.Event, VisiblyMutable.Listener, VisiblyMutable.NameChangeEvent |
| Field Summary | |
|---|---|
static java.lang.String |
BIAS_SUFFIX
|
static java.lang.String |
INTERNEURON_SUFFIX
|
| Fields inherited from class ca.nengo.model.impl.AbstractEnsemble |
|---|
myTerminations |
| Fields inherited from interface ca.nengo.model.nef.NEFEnsemble |
|---|
X |
| Constructor Summary | |
|---|---|
NEFEnsembleImpl(java.lang.String name,
NEFNode[] nodes,
float[][] encoders,
ApproximatorFactory factory,
float[][] evalPoints,
float[] radii)
|
|
| Method Summary | |
|---|---|
BiasOrigin |
addBiasOrigin(Origin existing,
int numInterneurons,
java.lang.String name,
boolean excitatory)
Adds a BiasOrigin, which operates in parallel with an existing Origin, such that the effective weights of the two origins together are all of the same sign (as is normally the case with synaptic weights in the brain). |
BiasTermination[] |
addBiasTerminations(DecodedTermination baseTermination,
float interneuronTauPSC,
float[][] biasDecoders,
float[][] functionDecoders)
Adds BiasTerminations, which are meant to receive projections from BiasOrigins. |
Origin |
addDecodedOrigin(java.lang.String name,
Function[] functions,
java.lang.String nodeOrigin)
Adds an Origin that corresponds to a decoding of the activities of Nodes in this Ensemble. |
Termination |
addDecodedTermination(java.lang.String name,
float[][] matrix,
float[] tfNumerator,
float[] tfDenominator,
float passthrough,
boolean isModulatory)
As above but with arbitrary single-input-single-output PSC dynamics. |
Termination |
addDecodedTermination(java.lang.String name,
float[][] matrix,
float tauPSC,
boolean isModulatory)
Adds a new Termination into this Ensemble, at which information is to be received in the form of decoded state variables rather than spikes, etc. |
NEFEnsemble |
clone()
|
protected float[] |
getConstantOutput(int nodeIndex,
float[][] evalPoints,
java.lang.String origin)
|
protected float[][] |
getConstantOutputs(float[][] evalPoints,
java.lang.String origin)
|
int |
getDimension()
|
float[][] |
getEncoders()
|
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 |
getPlasticityInterval()
Returns minimum of plasticity intervals of plastic component nodes, or -1 if none of the component nodes are plastic. |
PlasticityRule |
getPlasticityRule(java.lang.String terminationName)
|
java.lang.String[] |
getPlasticityRuleNames()
|
float |
getRadialInput(float[] state,
int node)
|
float[] |
getRadii()
|
boolean |
getReuseApproximators()
|
Termination |
getTermination(java.lang.String name)
|
Termination[] |
getTerminations()
|
java.util.Properties |
listStates()
|
void |
removeDecodedTermination(java.lang.String name)
|
void |
reset(boolean randomize)
Resets each Node in this Ensemble. |
void |
run(float startTime,
float endTime)
Runs each neuron in the Ensemble. |
void |
setEncoders(float[][] encoders)
|
void |
setMode(SimulationMode mode)
This Ensemble does not support SimulationMode.DIRECT. |
void |
setPlasticityInterval(float time)
|
void |
setPlasticityRule(java.lang.String terminationName,
PlasticityRule rule)
TODO: should there be a pass-through option as in EnsembleImpl? |
void |
setRadii(float[] radii)
|
void |
setReuseApproximators(boolean reuse)
|
| Methods inherited from class ca.nengo.model.nef.impl.DecodableEnsembleImpl |
|---|
addDecodedOrigin, addDecodedOrigin, addDecodedOrigin, doneOrigins, getApproximatorFactory, getOrigin, getOrigins, removeDecodedOrigin, setTime |
| Methods inherited from class ca.nengo.model.impl.EnsembleImpl |
|---|
addTermination, removeTermination |
| Methods inherited from class ca.nengo.model.impl.AbstractEnsemble |
|---|
addChangeListener, collectSpikes, findCommon1DOrigins, fireVisibleChangeEvent, getCollectSpikesRatio, getDocumentation, getMode, getName, getNodes, getSpikePattern, isCollectingSpikes, removeChangeListener, setCollectSpikesRatio, setDocumentation, setName |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface ca.nengo.model.nef.DecodableEnsemble |
|---|
addDecodedOrigin, addDecodedOrigin, doneOrigins, removeDecodedOrigin |
| Methods inherited from interface ca.nengo.model.Ensemble |
|---|
collectSpikes, getNodes, getSpikePattern, isCollectingSpikes |
| Methods inherited from interface ca.nengo.model.Node |
|---|
getDocumentation, getName, getOrigin, getOrigins, setDocumentation, setName |
| Methods inherited from interface ca.nengo.model.SimulationMode.ModeConfigurable |
|---|
getMode |
| Methods inherited from interface ca.nengo.util.VisiblyMutable |
|---|
addChangeListener, removeChangeListener |
| Field Detail |
|---|
public static java.lang.String BIAS_SUFFIX
public static java.lang.String INTERNEURON_SUFFIX
| Constructor Detail |
|---|
public NEFEnsembleImpl(java.lang.String name,
NEFNode[] nodes,
float[][] encoders,
ApproximatorFactory factory,
float[][] evalPoints,
float[] radii)
throws StructuralException
name - Unique name of Ensemblenodes - Nodes that make up the Ensembleencoders - List of encoding vectors (one for each node). All must have same lengthfactory - Source of LinearApproximators to use in decoding outputevalPoints - Vector inputs at which output is found to produce DecodedOrigins
StructuralException - if there are a different number of Nodes than encoding vectors or if not
all encoders have the same length| Method Detail |
|---|
public float[] getRadii()
getRadii in interface NEFEnsembleNEFEnsemble.getRadii()public void setRadii(float[] radii)
radii - A list of radii of encoded area along each dimension; uniform
radius along each dimension can be specified with a list of length 1
protected float[][] getConstantOutputs(float[][] evalPoints,
java.lang.String origin)
throws StructuralException
evalPoints - Vector points at which to find output (each one must have same dimension as
encoder)origin - Name of Origin from which to collect output for each Node
StructuralException - If CONSTANT_RATE is not supported by any Node
protected float[] getConstantOutput(int nodeIndex,
float[][] evalPoints,
java.lang.String origin)
throws StructuralException,
SimulationException
nodeIndex - Index of Node for which to find output at various inputsevalPoints - Vector points at which to find output (each one must have same dimension as
encoder)origin - Name of Origin from which to collect output
StructuralException - If CONSTANT_RATE is not supported by the given Node
SimulationException - If the Node does not have an Origin with the given namepublic int getDimension()
getDimension in interface ExpandableNodegetDimension in interface NEFEnsemblegetDimension in class EnsembleImplNEFEnsemble.getDimension()public float[][] getEncoders()
getEncoders in interface NEFEnsembleNEFEnsemble.getEncoders()public void setEncoders(float[][] encoders)
encoders - New encoding vectors (row per Node)public boolean getReuseApproximators()
public void setReuseApproximators(boolean reuse)
reuse - True if LinearApproximators for a Node Origin are re-used for decoding multiple decoded Origins.
public Origin addDecodedOrigin(java.lang.String name,
Function[] functions,
java.lang.String nodeOrigin)
throws StructuralException
NEFEnsemble
addDecodedOrigin in interface NEFEnsemblename - Name of decodingfunctions - Functions that define the decoding (one function for each dimension of output).
All functions must have an input dimension equal to the dimension of this NEFEnsemble.nodeOrigin - Name of the Node-level Origins from which this Ensemble-level Origin is derived
(often Neuron.AXON)
StructuralException - if functions do not all have the same input dimension as the
dimension of this ensembleNEFEnsemble.addDecodedOrigin(java.lang.String, Function[], String)
public BiasOrigin addBiasOrigin(Origin existing,
int numInterneurons,
java.lang.String name,
boolean excitatory)
throws StructuralException
NEFEnsemble
addBiasOrigin in interface NEFEnsembleexisting - An existing Origin on this NEFEnsemblenumInterneurons - Number of interneuronsname - Name of BiasOrigin (name of associated interneuron ensemble is also derived from this)excitatory - If true, effective weights will be positive; if false they will be negative (inhibitory)
StructuralException - if given Origin is not a DecodedOrigin or if there is a construction problemNEFEnsemble.addBiasOrigin(ca.nengo.model.Origin, int, java.lang.String, boolean)
public Termination addDecodedTermination(java.lang.String name,
float[][] matrix,
float tauPSC,
boolean isModulatory)
throws StructuralException
NEFEnsemble
addDecodedTermination in interface NEFEnsemblename - Unique name for this Termination (in the scope of this Ensemble)matrix - Transformation matrix which defines a linear map on incoming information,
onto the space of vectors that can be represented by this NEFEnsemble. The first dimension
is taken as matrix rows, and must have the same length as the Origin that will be connected
to this Termination. The second dimension is taken as matrix columns, and must have the same
length as the encoders of this NEFEnsemble. TODO: this is transposed?tauPSC - Time constant of post-synaptic current decay (all Terminations have
this property but it may have slightly different interpretations depending other properties
of the Termination).isModulatory - If true, inputs to this Termination do not drive Nodes in the Ensemble directly
but may have modulatory influences (eg related to plasticity). If false, the transformation matrix
output dimension must match the dimension of this Ensemble.
StructuralException - if given transformation matrix is not a matrixNEFEnsemble.addDecodedTermination(java.lang.String, float[][], float, boolean)
public Termination addDecodedTermination(java.lang.String name,
float[][] matrix,
float[] tfNumerator,
float[] tfDenominator,
float passthrough,
boolean isModulatory)
throws StructuralException
NEFEnsemble
addDecodedTermination in interface NEFEnsemblename - Unique name for this Termination (in the scope of this Ensemble)matrix - Transformation matrix which defines a linear map on incoming informationtfNumerator - Coefficients of transfer function numerator (see CanonicalModel.getRealization(...)
for details)tfDenominator - Coefficients of transfer function denominatorisModulatory - If true, inputs to this Termination do not drive Nodes in the Ensemble directly
but may have modulatory influences (eg related to plasticity). If false, the transformation matrix
output dimension must match the dimension of this Ensemble.
StructuralException - if given transformation matrix is not a matrix or there is a problem
with the transfer functionNEFEnsemble.addDecodedTermination(java.lang.String, float[][], float[], float[], float, boolean)
public BiasTermination[] addBiasTerminations(DecodedTermination baseTermination,
float interneuronTauPSC,
float[][] biasDecoders,
float[][] functionDecoders)
throws StructuralException
NEFEnsemble
addBiasTerminations in interface NEFEnsemblebaseTermination - The Termination that is to be biased (so that projections to it consist of weights of a single sign)interneuronTauPSC - Time constant of post-synaptic current decay of inhibitory termination from interneurons onto this ensemblebiasDecoders - The decoding weights of the associated BiasOriginfunctionDecoders - The decoding vectors of the BiasOrigin's associated base origin
StructuralExceptionNEFEnsemble.addBiasTerminations(ca.nengo.model.nef.impl.DecodedTermination, float, float[][], float[][])public void removeDecodedTermination(java.lang.String name)
removeDecodedTermination in interface NEFEnsemblename - Name of Termination to remove.NEFEnsemble.removeDecodedTermination(java.lang.String)public Termination[] getTerminations()
getTerminations in interface NodegetTerminations in class EnsembleImplNode.getTerminations()
public void run(float startTime,
float endTime)
throws SimulationException
AbstractEnsemble
run in interface Noderun in class DecodableEnsembleImplstartTime - simulation time at which running starts (s)endTime - simulation time at which running ends (s)
SimulationException - if a problem is encountered while trying to runNode.run(float, float)
public float getRadialInput(float[] state,
int node)
state - State vectornode - Node number
public Termination getTermination(java.lang.String name)
throws StructuralException
getTermination in interface NodegetTermination in class EnsembleImplname - Name of a Termination onto this Node
StructuralException - if the named Termination does not existNode.getTermination(java.lang.String)public void setMode(SimulationMode mode)
EnsembleImpl
setMode in interface SimulationMode.ModeConfigurablesetMode in class EnsembleImplmode - SimulationMode in which it is desired that the object runs.SimulationMode.ModeConfigurable.setMode(ca.nengo.model.SimulationMode)public void reset(boolean randomize)
AbstractEnsemble
reset in interface Resettablereset in class AbstractEnsemblerandomize - 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.Resettable.reset(boolean)
public void setPlasticityRule(java.lang.String terminationName,
PlasticityRule rule)
throws StructuralException
setPlasticityRule in interface PlasticsetPlasticityRule in class EnsembleImplterminationName - Name of termination to which plasticity rule applies.rule - A rule that defines how the termination's transformation matrix elements change during simulation
StructuralException - if the named Termination does not existPlastic.setPlasticityRule(java.lang.String, ca.nengo.model.plasticity.PlasticityRule)public void setPlasticityInterval(float time)
setPlasticityInterval in interface PlasticsetPlasticityInterval in class EnsembleImpltime - Period after which plasticity rules are evaluated (defaults to every time step).Plastic.setPlasticityInterval(float)public float getPlasticityInterval()
EnsembleImpl
getPlasticityInterval in interface PlasticgetPlasticityInterval in class EnsembleImplPlastic.getPlasticityInterval()
public PlasticityRule getPlasticityRule(java.lang.String terminationName)
throws StructuralException
getPlasticityRule in interface PlasticgetPlasticityRule in class EnsembleImplterminationName - Name of termination to which plasticity rule applies.
StructuralException - if the named Termination does not existPlastic.getPlasticityRule(java.lang.String)public java.lang.String[] getPlasticityRuleNames()
getPlasticityRuleNames in interface PlasticgetPlasticityRuleNames in class EnsembleImplPlastic.getPlasticityRuleNames()
public TimeSeries getHistory(java.lang.String stateName)
throws SimulationException
Probeable
getHistory in interface ProbeablegetHistory in class DecodableEnsembleImplstateName - A state variable name
SimulationException - if the Probeable does not have the requested stateProbeable.getHistory(java.lang.String)public java.util.Properties listStates()
listStates in interface ProbeablelistStates in class DecodableEnsembleImplProbeable.listStates()
public NEFEnsemble clone()
throws java.lang.CloneNotSupportedException
clone in interface Nodeclone in class DecodableEnsembleImpljava.lang.CloneNotSupportedException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||