FSAHelperFunctions¶
Neuromorphic Embodied Agents that Learn (NEAL) based functions for constructing State Machines.
-
class
nmcog.spinnaker.specialfunction.neal.stateMachineClass.FSAHelperFunctions(simName='spinnaker', spinnVersion=8)¶ This is the class for constructing State Machines. The individual CAs (both inputs and states) run at 5 ms.
-
getCAConnectors(CA)¶ Create excitatory connector list and inhibitory connector list for a given cell assembly. The method returns a list such that the first element is the excitatory connector list.
Regardless of excitatory or inhibitory connector lists, the most basic element of a connector list is a PyNN Connector tuple of the form (pre_idx, post_idx, weight, delay) where pre_idx is the index (i.e. order in the Population, not the ID) of the presynaptic neuron, post_idx is the index of the postsynaptic neuron, and weight, delay are the synaptic parameters.
Parameters used CA_SIZECA_INHIBSINTRA_CA_WEIGHTINTRA_CA_TO_INHIB_WEIGHTINTRA_CA_FROM_INHIB_WEIGHTNealCoverFunctions .DELAYBy default a cell assembly size
CA_SIZE= 10, which is the number of neuron units in each assembly.These ten neuron populations are such that
- eight of them project excitatory connections, lets call them <<0>> to <<7>>
- two of them project inhibitory connections, lets call them <<8>> and <<9>>
Three kinds of connections are made,
- Excitatory connection from one neuron unit to another unit that projects excitatory connection (but not itself). Below shows projections from <<0>>.
Connection Weight is INTRA_CA_WEIGHT. .-. .-. .-. .-. .-. ( 0 ) ( 2 ) ( 4 ) ( 6 ) ( 8 ) '-' '-' '-' '-' '-' + ^ ^ ^ + ++++++++++++++++++++++++++ v v v v .-. .-. .-. .-. .-. ( 1 ) ( 3 ) ( 5 ) ( 7 ) ( 9 ) '-' '-' '-' '-' '-'
- Excitatory connection from neuron unit to another that project inhibitory connection. Below shows projections from <<0>>.
Connection Weight is INTRA_CA_TO_INHIB_WEIGHT. .-. .-. .-. .-. .-. ( 0 ) ( 2 ) ( 4 ) ( 6 ) ( 8 ) '-' '-' '-' '-' '-' + ^ +++++++++++++++++++++++++++++++++++++ v .-. .-. .-. .-. .-. ( 1 ) ( 3 ) ( 5 ) ( 7 ) ( 9 ) '-' '-' '-' '-' '-'
- Inhibitory connection from neuron unit to other unit that project excitatory connection (but not to units that project inhibitory connection including itself). Below shows projections from <<8>>.
Connection Weight is INTRA_CA_FROM_INHIB_WEIGHT. .-. .-. .-. .-. .-. ( 0 ) ( 2 ) ( 4 ) ( 6 ) ( 8 ) '-' '-' '-' '-' '-' ^ ^ ^ ^ - ------------------------------------- v v v v .-. .-. .-. .-. .-. ( 1 ) ( 3 ) ( 5 ) ( 7 ) ( 9 ) '-' '-' '-' '-' '-'
Note:
- The two kinds of excitatory connections are collected in one list, the excitatory connector list.
-
halfTurnOnStateFromSpikeSource(spikeSource, toNeurons, toCA)¶ Given a spikeSource , this method turns 1/2 ON the state of the desired cell assembly.
toNeuronsspecifies the type of PyNN population within the cell assembly.Parameters used CA_SIZECA_INHIBSHALF_INPUT_WEIGHTNealCoverFunctions .DELAY
-
inhibitOneNeuronFromSpikeSource(spikeSource, toNeurons, toNeuron, weight)¶ Given a spikeSource , this method inhibits the state of a desired neuron unit within a PyNN population with the given weight value.
Parameters used NealCoverFunctions .DELAY
-
inhibitStateFromSpikeSource(spikeSource, toNeurons, toCA, weight)¶ Given a spikeSource , this method inhibits the state of the desired cell assembly.
toNeuronsspecifies the type of PyNN population within the cell assembly.Parameters used CA_SIZECA_INHIBSNealCoverFunctions .DELAY
-
initParams()¶ Constants values comments CA_SIZE10 - This will (almost certainly) not work with a different sized CA.
CA_INHIBS2 INPUT_WEIGHT0.12 HALF_INPUT_WEIGHT0.008 INTRA_CA_TO_INHIB_WEIGHT0.002 INTRA_CA_FROM_INHIB_WEIGHT0.15 CA_STOPS_CA_WEIGHT0.15 ONE_NEURON_STOPS_CA_WEIGHT1.0 ONE_NEURON_HALF_CA_WEIGHT0.02 INTRA_CA_WEIGHT0.025 0.022 FULL_ON_WEIGHT0.01 FULL_ON_WEIGHT_SLOW0.0022 HALF_ON_WEIGHT0.0012 HALF_ON_ONE_WEIGHT0.002 STATE_TO_ONE_WEIGHT0.01 ONE_HALF_ON_WEIGHT0.016 ONE_HALF_ON_ONE_WEIGHT0.08 CELL_PARAMS‘v_thresh’
‘v_reset’
‘tau_refrac’
‘tau_syn_E’
‘tau_syn_I’
‘v_rest’
‘i_offset’
dictionary
-48.0
-70.0
2.0
5.0
5.0
-65.0
0.0
-
makeCA(neurons, CA)¶ Given a neuron population and cell assembly parameters this method gets excitatory and inhibitory connectors (from
getCAConnectors()) for the presumptive cell assembly.- Because the default a cell assembly size
CA_SIZE= 10, there are ten neuron units
oooooooooooooooooooooooooooooooooooooooooooooooo o o o .-. .-. .-. .-. .-. o o ( 0 ) ( 2 ) ( 4 ) ( 6 ) ( 8 ) o o '-' '-' '-' '-' '-' o o o o cell assembly of CA_SIZE = 10 o o o o .-. .-. .-. .-. .-. o o ( 1 ) ( 3 ) ( 5 ) ( 7 ) ( 9 ) o o '-' '-' '-' '-' '-' o o o oooooooooooooooooooooooooooooooooooooooooooooooo
- These neuron units are connected using
getCAConnectors()put together via NealCoverFunctions.nealProjection - The source and target neuron populations are one and the same.
Therefore, a cell assembly here is
- one PyNN neuron population
- with ten neuron units within the population
- and the ten neuron units are connected (see
getCAConnectors()for how the connections are made).
- Because the default a cell assembly size
-
nopMakeCA(neurons, CA)¶ Legacy.
-
oneNeuronHalfTurnsOffState(fromNeurons, fromNeuron, toNeurons, toCA)¶ From a given a neuron unit of a PyNN population, this method turns 1/2 OFF the state of a desired PyNN population within a cell assembly.
Parameters used CA_SIZECA_INHIBSONE_HALF_ON_WEIGHTNealCoverFunctions .DELAY
-
oneNeuronHalfTurnsOnOneNeuron(fromNeurons, fromCA, toNeurons, toCA)¶ From a given a neuron unit of a PyNN population, this method turns 1/2 ON the state of another neuron unit of a PyNN population within a desired cell assembly.
Parameters used ONE_HALF_ON_ONE_WEIGHT
-
oneNeuronHalfTurnsOnState(fromNeurons, fromNeuron, toNeurons, toCA)¶ From a given a neuron unit of a PyNN population, this method turns 1/2 ON the state of a desired PyNN population within a cell assembly.
Parameters used CA_SIZECA_INHIBSONE_HALF_ON_WEIGHTNealCoverFunctions .DELAY
-
oneNeuronInhibitsOneNeuron(fromNeurons, fromNeuron, toNeurons, toNeuron, weight)¶ From a given a neuron unit of a PyNN population, this method inhibits the state of another neuron unit of a desired PyNN population with the given weight value.
Parameters used NealCoverFunctions .DELAY
-
oneNeuronInhibitsState(fromNeurons, fromNeuron, toNeurons, toCA, weight)¶ From a given a neuron unit of a PyNN population, this method inhibits the state of a desired PyNN population within a desired cell assembly with the given weight value.
Parameters used CA_SIZECA_INHIBSNealCoverFunctions .DELAY
-
oneNeuronStimulatesOneNeuron(fromNeurons, fromNeuron, toNeurons, toNeuron, weight)¶ From a given a neuron unit of a PyNN population, this method stimulates the state of another neuron unit of a desired PyNN population with the given weight value.
Parameters used NealCoverFunctions .DELAY
-
oneNeuronStimulatesState(fromNeurons, fromNeuron, toNeurons, toCA, weight)¶ From a given a neuron unit of a PyNN population, this method stimulates the state of a desired PyNN population within a cell assembly with the given weight value.
Parameters used CA_SIZECA_INHIBSNealCoverFunctions .DELAY
-
oneNeuronTurnsOffState(fromNeurons, fromNeuron, toNeurons, toCA)¶ From a given a neuron unit of a PyNN population, this method turns OFF the state of a desired PyNN population within a cell assembly.
Parameters used CA_SIZECA_INHIBSONE_NEURON_STOPS_CA_WEIGHTNealCoverFunctions .DELAY
-
oneNeuronTurnsOnOneNeuron(fromNeurons, fromCA, toNeurons, toCA)¶ From a given a neuron unit of a PyNN population, this method turns ON the state of another neuron unit of a PyNN population within a desired cell assembly.
Parameters used INPUT_WEIGHT
-
oneNeuronTurnsOnState(fromNeurons, fromNeuron, toNeurons, toCA)¶ From a given a neuron unit of a PyNN population, this method turns ON the state of a desired PyNN population within a cell assembly.
Parameters used CA_SIZECA_INHIBSINPUT_WEIGHTNealCoverFunctions .DELAY
-
stateHalfTurnsOffState(fromNeurons, fromCA, toNeurons, toCA)¶ From a given PyNN population in a cell assembly, this method turns 1/2 OFF the state of a desired PyNN population within a desired cell assembly.
Parameters used CA_SIZECA_INHIBSHALF_ON_WEIGHTNealCoverFunctions .DELAYNote:
- For illustration on how the connections are made see
stateHalfTurnsOnState().
- For illustration on how the connections are made see
-
stateHalfTurnsOnOneNueron(fromNeurons, fromCA, toNeurons, toNeuron)¶ From a given PyNN population in a cell assembly, this method turns 1/2 ON the state of another neuron unit of a desired PyNN population.
Parameters used CA_SIZECA_INHIBSHALF_ON_ONE_WEIGHTNealCoverFunctions .DELAYNote:
- For illustration on how the connections are made see
stateTurnsOnOneNeuron().
- For illustration on how the connections are made see
-
stateHalfTurnsOnState(fromNeurons, fromCA, toNeurons, toCA)¶ From a given PyNN population in a cell assembly, this method turns 1/2 ON the state of a desired PyNN population within a desired cell assembly.
Parameters used CA_SIZECA_INHIBSHALF_ON_WEIGHTNealCoverFunctions .DELAYConnection between the cell assemblies is as shown
fromCA toCA ooooooooooooooooooooooo ooooooooooooooooooooooo o o o o o o o o o (0) (2) (4) (6) (8) o o (0) (2) (4) (6) (8) o o + o HALF_ON_WEIGHT o ^ ^ ^ ^ o o +++++++++++++++o++++++++++++++++++o+++++++++++++++ o o o o v v v v o o (1) (3) (5) (7) (9) o o (1) (3) (5) (7) (9) o o o o o o o o o ooooooooooooooooooooooo ooooooooooooooooooooooo
Note:
A cell assembly is composed of CA_SIZE number of neuron units such that each unit is of same kind.
Therefore, the arguments
fromNeuronsandtoNeurons(plural) refers to the kind of neuron population in the from- and to-assemblies.That is,
fromNeuronsandtoNeuronsdo not indicate some specific neuron population within respective assemblies.The specification of a unit (from and to) a cell assembly is done by the connector list of tuples.
This specification is such that the
fromNeuronandtoNeuronare only in reference to units with excitatory connections.- Referring to illustration in
getCAConnectors()then in the above illustrationfromNeuronandtoNeuron(singular) will be <<0>> to <<7>> - <<8>> and <<9>> are neither the source nor the target for the connection.
- Referring to illustration in
-
stateInhibitsOneNeuron(fromNeurons, fromCA, toNeurons, toNeuron, weight)¶ From a given PyNN population in a cell assembly, this method inhibits the state of another neuron unit of a desired PyNN population with the given weight value.
Parameters used CA_SIZECA_INHIBSNealCoverFunctions .DELAYNote:
- For illustration on how the connections are made see
stateTurnsOnOneNeuron()with the exception that this is “inhibitory”.
- For illustration on how the connections are made see
-
stateInhibitsState(fromNeurons, fromCA, toNeurons, toCA, wt)¶ From a given PyNN population in a cell assembly, this method inhibits the state of a desired PyNN population within a desired cell assembly with the given weight value.
Parameters used CA_SIZENealCoverFunctions .DELAYNote:
- For illustration on how the connections are made see
stateTurnsOffState()with the exception that this is “inhibitory”.
- For illustration on how the connections are made see
-
stateStimulatesOneNeuron(fromNeurons, fromCA, toNeurons, toNeuron, weight)¶ From a given PyNN population in a cell assembly, this method stimulates the state of another neuron unit of a desired PyNN population with the given weight value.
Parameters used CA_SIZECA_INHIBSNealCoverFunctions .DELAYNote:
- For illustration on how the connections are made see
stateTurnsOnOneNeuron().
- For illustration on how the connections are made see
-
stateStimulatesState(fromNeurons, fromCA, toNeurons, toCA, weight)¶ From a given PyNN population in a cell assembly, this method stimulates the state of a desired PyNN population within a desired cell assembly with the given weight value.
Parameters used CA_SIZECA_INHIBSNealCoverFunctions .DELAYNote:
- For illustration on how the connections are made see
stateHalfTurnsOnState().
- For illustration on how the connections are made see
-
stateTurnsOffState(fromNeurons, fromCA, toNeurons, toCA)¶ From a given PyNN population in a cell assembly, this method turns OFF the state of a desired PyNN population within a desired cell assembly.
Parameters used CA_SIZECA_INHIBSCA_STOPS_CA_WEIGHTNealCoverFunctions .DELAYConnection between the cell assemblies is as shown
fromCA toCA ooooooooooooooooooooooo ooooooooooooooooooooooo o o o o o o o o o (0) (2) (4) (6) (8) o o (0) (2) (4) (6) (8) o o - o CA_STOPS_CA_WEIGHT o ^ ^ ^ ^ ^ o o ---------------o----------------------o------------------- o o o o v v v v v o o (1) (3) (5) (7) (9) o o (1) (3) (5) (7) (9) o o o o o o o o o ooooooooooooooooooooooo ooooooooooooooooooooooo
Note:
A cell assembly is composed of CA_SIZE number of neuron units such that each unit is of same kind.
Therefore, the arguments
fromNeuronsandtoNeurons(plural) refers to the kind of neuron population in the from- and to-assemblies.That is,
fromNeuronsandtoNeuronsdo not indicate some specific neuron population within respective assemblies.The specificiation of a unit (from and to) a cell assembly is done by the connector list of tuples.
This specification is such that the
fromNeuronandtoNeuronare from every unit within a cell assembly.- Thus, unlike the illustration in
stateHalfTurnsOnState()in the above illustrationfromNeuronandtoNeuron(singular) will be <<0>> to <<9>> - See the illustration in
getCAConnectors()for referring to <<0>> to <<9>>
- Thus, unlike the illustration in
-
stateTurnsOnOneNeuron(fromNeurons, fromCA, toNeurons, toNeuron)¶ From a given a neuron unit of a PyNN population in a cell assembly, this method turns ON the state of another neuron unit of a desired PyNN population.
Parameters used CA_SIZECA_INHIBSSTATE_TO_ONE_WEIGHTNealCoverFunctions .DELAYConnection between the cell assemblies is as shown
fromCA ooooooooooooooooooooooo o o o o toNeuron o (0) (2) (4) (6) (8) o ( x ) o + o STATE_TO_ONE_WEIGHT ^ o +++++++++++++++o+++++++++++++++++++++++++++++ o o o (1) (3) (5) (7) (9) o o o o o ooooooooooooooooooooooo
Note:
A cell assembly is composed of CA_SIZE number of neuron units such that each unit is of same kind.
Therefore, the arguments
fromNeuronsandtoNeurons(plural) refers to the kind of neuron population in the from- and to-assemblies.That is,
fromNeuronsandtoNeuronsdo not indicate some specific neuron population within respective assemblies.The specificiation of a unit (from and to) a cell assembly is done by the connector list of tuples.
This specification is such that the
fromNeuronandtoNeuronare only in reference to units with excitatory connections.- Referring to illustration in
getCAConnectors()then in the above illustrationfromNeuronandtoNeuron(singular) will be <<0>> to <<7>> - <<8>> and <<9>> are not the source for the connection.
- In theory
toNeuroncan be in the same cell assembly as those offromNeuron.
- Referring to illustration in
-
stateTurnsOnOneRBSNeuron(fromNeurons, fromCA, toNeurons, toNeuron)¶ From a given PyNN population in a cell assembly, this method turns ON the state of another neuron unit of a desired PyNN population with the given weight value 0.015.
Parameters used CA_SIZECA_INHIBSNealCoverFunctions .DELAYNote:
- For illustration on how the connections are made see
stateTurnsOnOneNeuron().
- For illustration on how the connections are made see
-
stateTurnsOnState(fromNeurons, fromCA, toNeurons, toCA)¶ From a given PyNN population in a cell assembly, this method turns ON the state of a desired PyNN population within a desired cell assembly.
Parameters used CA_SIZECA_INHIBSFULL_ON_WEIGHTNealCoverFunctions .DELAYNote:
- For illustration on how the connections are made see
stateHalfTurnsOnState().
- For illustration on how the connections are made see
-
stateTurnsOnStateSlow(fromNeurons, fromCA, toNeurons, toCA)¶ From a given PyNN population in a cell assembly, this method slowly turns ON the state of a desired PyNN population within a desired cell assembly.
Parameters used CA_SIZECA_INHIBSFULL_ON_WEIGHT_SLOWNealCoverFunctions .DELAYNote:
- For illustration on how the connections are made see
stateHalfTurnsOnState().
- For illustration on how the connections are made see
-
stimulateStateFromSpikeSource(spikeSource, toNeurons, toCA, weight)¶ Given a spikeSource , this method stimulates the state of the desired cell assembly with the given weight value.
toNeuronsspecifies the type of PyNN population within the cell assembly.Parameters used CA_SIZECA_INHIBSNealCoverFunctions .DELAY
-
test3StateFSA(firstSpikeGenerator, secondSpikeGenerator, stateCells)¶ Legacy.
-
testCreateNeurons()¶ Legacy.
-
testCreateTwoInputs()¶ Legacy.
-
testInit()¶ Legacy.
-
testPrintPklSpikes(fileName)¶ Legacy.
-
testPrintResults(simCells)¶ Legacy.
-
testRunFSA(duration)¶ Legacy.
-
testSetupRecording(cells)¶ Legacy.
-
turnOffOneNeuronFromSpikeSource(spikeSource, toNeurons, toNeuron)¶ Given a spikeSource , this method turns OFF the state of a desired neuron unit within a PyNN population.
Parameters used CA_STOPS_CA_WEIGHTNealCoverFunctions .DELAY
-
turnOffStateFromSpikeSource(spikeSource, toNeurons, toCA)¶ Given a spikeSource , this method turns OFF the state of the desired cell assembly.
toNeuronsspecifies the type of PyNN population within the cell assembly.Parameters used CA_SIZECA_INHIBSONE_NEURON_STOPS_CA_WEIGHTNealCoverFunctions .DELAY
-
turnOnOneNeuronFromSpikeSource(spikeSource, toNeurons, toNeuron)¶ Given a spikeSource , this method turns ON the state of a desired neuron unit within a PyNN population.
Parameters used INPUT_WEIGHTNealCoverFunctions .DELAY
-
turnOnStateFromSpikeSource(spikeSource, toNeurons, toCA)¶ Given a spikeSource , this method turns ON the state of the desired cell assembly.
toNeuronsspecifies the type of PyNN population within the cell assembly.Parameters used CA_SIZECA_INHIBSINPUT_WEIGHTNealCoverFunctions .DELAY
-