public class NetworkArrayImpl extends NetworkImpl
Modifier and Type | Class and Description |
---|---|
class |
NetworkArrayImpl.ArrayOrigin
Origin representing the concatenation of origins on each of the
ensembles within the network array.
|
static interface |
NetworkArrayImpl.WeightFunc |
NetworkImpl.OriginWrapper, NetworkImpl.TerminationWrapper
VisiblyMutable.Event, VisiblyMutable.Listener, VisiblyMutable.NameChangeEvent, VisiblyMutable.NodeRemovedEvent
DEFAULT_NAME, myNumGPU, myNumJavaThreads, myUseGPU
Constructor and Description |
---|
NetworkArrayImpl(java.lang.String name,
NEFEnsembleImpl[] nodes)
Create a network holding an array of nodes.
|
Modifier and Type | Method and Description |
---|---|
Origin |
addDecodedOrigin(java.lang.String name,
Function[] functions,
java.lang.String nodeOrigin)
Create a new Origin.
|
Origin |
addDecodedOrigin(java.lang.String name,
Function[] functions,
java.lang.String nodeOrigin,
boolean splitFunctions)
Create a new origin by splitting the given functions across the nodes.
|
Termination |
addDecodedTermination(java.lang.String name,
float[][] matrix,
float tauPSC)
Create a new decoded termination.
|
Termination |
addDecodedTermination(java.lang.String name,
float[][] matrix,
float tauPSC,
boolean modulatory) |
Termination |
addIndexTermination(java.lang.String name,
float[][] matrix,
float tauPSC)
Create a new termination.
|
Termination |
addIndexTermination(java.lang.String name,
float[][] matrix,
float tauPSC,
boolean isModulatory) |
Termination |
addIndexTermination(java.lang.String name,
float[][] matrix,
float tauPSC,
boolean isModulatory,
int[] index) |
Termination |
addIndexTermination(java.lang.String name,
float[][] matrix,
float tauPSC,
int[] index) |
Termination |
addPlasticTermination(java.lang.String name,
float[][] weights,
float tauPSC,
float[][] decoders) |
Termination |
addPlasticTermination(java.lang.String name,
float[][] weights,
float tauPSC,
float[][] decoders,
NetworkArrayImpl.WeightFunc weightFunc)
Create a new plastic termination.
|
Termination |
addTermination(java.lang.String name,
float[][][] matrix,
float tauPSC)
Create a new termination.
|
Termination |
addTermination(java.lang.String name,
float[][][] weights,
float tauPSC,
boolean modulatory) |
Termination |
addTermination(java.lang.String name,
float[][] matrix,
float tauPSC)
Create a new termination.
|
Termination |
addTermination(java.lang.String name,
float[][] weights,
float tauPSC,
boolean modulatory) |
NetworkArrayImpl |
clone() |
void |
createEnsembleOrigin(java.lang.String name)
Create an Origin that concatenates the values of internal Origins.
|
void |
exposeAxons()
Exposes the AXON terminations of each ensemble in the network.
|
int |
getDimension() |
float[][] |
getEncoders()
Returns the encoders for the whole network array (the encoders of each
population within the array concatenated together).
|
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).
|
int |
getNeurons() |
int[] |
getNodeDimension() |
Node[] |
getNodes()
Gets the nodes in the proper order from the network array.
|
Termination[] |
getTerminations() |
void |
learn(java.lang.String learnTerm,
java.lang.String modTerm,
float rate)
Sets learning parameters on learned terminations in the array.
|
void |
learn(java.lang.String learnTerm,
java.lang.String modTerm,
float rate,
boolean oja)
Sets learning parameters on learned terminations in the array.
|
java.util.Properties |
listStates() |
void |
releaseMemory()
Releases memory of all ensembles in the network.
|
void |
setLearning(boolean learn)
Sets learning on/off for all ensembles in the network.
|
addChangeListener, addNode, addProjection, addStepListener, addTasks, changed, countNeurons, dumpToScript, dumpToScript, exposeOrigin, exposeState, exposeTermination, fireStepListeners, fixMode, fixMode, getChildren, getDocumentation, getExposedOriginName, getExposedTerminationName, getMetadata, getMetaData, getMode, getName, getNeuronCount, getNode, getNodeCount, getNodeOrigins, getNodeTerminations, getOrigin, getOrigins, getProjectionMap, getProjections, getSimulator, getStepSize, getTasks, getTermination, getUseGPU, hideOrigin, hideState, hideTermination, killNeurons, killNeurons, notifyAboutDeletion, removeChangeListener, removeNode, removeProjection, removeStepListener, reset, run, run, setDocumentation, setMetadata, setMetaData, setMode, setMyMode, setName, setSimulator, setStepSize, setTasks, setTime, setUseGPU, toPostScript, toScript
public NetworkArrayImpl(java.lang.String name, NEFEnsembleImpl[] nodes) throws StructuralException
name
- The name of the NetworkArray to createnodes
- The ca.nengo.model.nef.NEFEnsemble nodes to combine togetherStructuralException
public void createEnsembleOrigin(java.lang.String name) throws StructuralException
name
- The name of the Origin to create. Each internal node must already have an Origin
with that name.StructuralException
public int getNeurons()
public Origin addDecodedOrigin(java.lang.String name, Function[] functions, java.lang.String nodeOrigin) throws StructuralException
name
- The name of the newly created originfunctions
- A list of ca.nengo.math.Function objects to approximate at this originnodeOrigin
- Name of the base Origin to use to build this function approximation
(this will always be 'AXON' for spike-based synapses)StructuralException
public Origin addDecodedOrigin(java.lang.String name, Function[] functions, java.lang.String nodeOrigin, boolean splitFunctions) throws StructuralException
name
- The name of the newly created originfunctions
- A list of ca.nengo.math.Function objects to approximate at this originnodeOrigin
- Name of the base Origin to use to build this function approximation
(this will always be 'AXON' for spike-based synapses)splitFunctions
- True if the functions should be split across the nodes, otherwise
this behaves the same as the default addDecodedOriginStructuralException
public Termination addTermination(java.lang.String name, float[][] matrix, float tauPSC) throws StructuralException
name
- The name of the newly created terminationweights
- Synaptic connection weight matrix (NxM where N is the total number of neurons in the NetworkArray)tauPSC
- Post-synaptic time constantmodulatory
- Boolean value that is False for normal connections, True for modulatory connections
(which adjust neural properties rather than the input current)StructuralException
public Termination addTermination(java.lang.String name, float[][] weights, float tauPSC, boolean modulatory) throws StructuralException
StructuralException
public Termination addTermination(java.lang.String name, float[][][] matrix, float tauPSC) throws StructuralException
name
- The name of the newly created terminationweights
- Synaptic connection weight matrix (LxNxM where L is the number of nodes in the array,
N is the number of neurons in each node, and M is the dimensionality of each node)tauPSC
- Post-synaptic time constantmodulatory
- Boolean value that is False for normal connections, True for modulatory connections
(which adjust neural properties rather than the input current)StructuralException
public Termination addTermination(java.lang.String name, float[][][] weights, float tauPSC, boolean modulatory) throws StructuralException
StructuralException
public Termination addDecodedTermination(java.lang.String name, float[][] matrix, float tauPSC) throws StructuralException
name
- The name of the newly created terminationmatrix
- Transformation matrix which defines a linear map on incoming information,
onto the space of vectors that can be represented by this NetworkArray. The first dimension
is taken as matrix columns, and must have the same length as the Origin that will be connected
to this Termination. The second dimension is taken as matrix rows, and must have the same
length as the encoders of this NEFEnsemble.tauPSC
- Post-synaptic time constantmodulatory
- Boolean value that is False for normal connections, True for modulatory connections
(which adjust neural properties rather than the input current)StructuralException
public Termination addDecodedTermination(java.lang.String name, float[][] matrix, float tauPSC, boolean modulatory) throws StructuralException
StructuralException
public Termination addIndexTermination(java.lang.String name, float[][] matrix, float tauPSC) throws StructuralException
string
- name: the name of the newly created originmatrix:
- synaptic connection weight matrix (NxM where M is the total number of neurons in the ensembles to be connected)float
- tauPSC: post-synaptic time constantboolean
- isModulatory: False for normal connections, True for modulatory connections (which adjust neural
properties rather than the input current)index:
- The indexes of the ensembles to connect to. If set to None, this function behaves exactly like addTermination().StructuralException
public Termination addIndexTermination(java.lang.String name, float[][] matrix, float tauPSC, boolean isModulatory) throws StructuralException
StructuralException
public Termination addIndexTermination(java.lang.String name, float[][] matrix, float tauPSC, int[] index) throws StructuralException
StructuralException
public Termination addIndexTermination(java.lang.String name, float[][] matrix, float tauPSC, boolean isModulatory, int[] index) throws StructuralException
StructuralException
public Node[] getNodes()
getNodes
in interface Network
getNodes
in class NetworkImpl
Network.getNodes()
public Termination[] getTerminations()
getTerminations
in interface Node
getTerminations
in class NetworkImpl
Node.getTerminations()
public Termination addPlasticTermination(java.lang.String name, float[][] weights, float tauPSC, float[][] decoders) throws StructuralException
StructuralException
public Termination addPlasticTermination(java.lang.String name, float[][] weights, float tauPSC, float[][] decoders, NetworkArrayImpl.WeightFunc weightFunc) throws StructuralException
name
- The name of the newly created PES terminationweights
- Synaptic connection weight matrix (NxM where N is the total number of neurons in the NetworkArray)tauPSC
- Post-synaptic time constant
(which adjust neural properties rather than the input current)weightFunc
- object wrapping a function that consumes a weight matrix and returns a modified weight matrixStructuralException
public int[] getNodeDimension()
public int getDimension()
NEFEnsemble.getDimension()
public void exposeAxons() throws StructuralException
StructuralException
public java.util.Properties listStates()
listStates
in interface Probeable
listStates
in class NetworkImpl
Probeable.listStates()
public TimeSeries getHistory(java.lang.String stateName) throws SimulationException
Probeable
getHistory
in interface Probeable
getHistory
in class NetworkImpl
stateName
- A state variable nameSimulationException
- if the Probeable does not have the requested stateProbeable.getHistory(java.lang.String)
public void learn(java.lang.String learnTerm, java.lang.String modTerm, float rate)
learnTerm
- name of the learned terminationmodTerm
- name of the modulatory terminationrate
- learning ratepublic void learn(java.lang.String learnTerm, java.lang.String modTerm, float rate, boolean oja)
learnTerm
- name of the learned terminationmodTerm
- name of the modulatory terminationrate
- learning rateoja
- whether or not to use Oja smoothingpublic void setLearning(boolean learn)
learn
- true if the ensembles are learning, else falsepublic void releaseMemory()
public float[][] getEncoders()
public NetworkArrayImpl clone() throws java.lang.CloneNotSupportedException
clone
in interface Node
clone
in class NetworkImpl
java.lang.CloneNotSupportedException
- if clone can't be made