Code and Short Tutorial for Neural State Machine
Code
Tutorial
- Finite state automata are pretty standard computer
systems. The
Finite State Machine wiki is a good place to start if you
don't know about them.
- The way we manage states in neurons is to have binary cell
assemblies. These are groups of neurons that are either all
firing or not firing.
- Similarly, we have inputs, like words, in the form of spike
sources. These make neurons fire, and we can use a CA to represent
the inputs in the neural system..
- We make a topology by connecting the neurons, or in this case the
neurons in each of the states.
- So, if we start the system by turning the start state on, it
will persist until there is an input.
- We make a second state, which we'll call A, and an input a.
We connect both the start state and the input a CA to the
A state. We do this with stateHalfTurnsOnState. Now when
the start state is going, and an a comes in, they turn on the A State.
- We'll also connect the A state back to the start state and the
a input state, but we'll make it shut them down. We do this with
stateTurnsOffState.
- Now after the a input comes in, the system has the A state on, and
only the A state.
- Code Notes:
- testFSA.py is a piece of PyNN code. It makes a two state FSA like
the one described above.
- The body of code starts toward the end marked by #main.
- What it does is load the NealCoverFunctions (to deal with both
Nest and SpiNNaker relatively easily) and the stateMachineClass,
for building the states.
- It then calls the init function, which sets up the simulator
(Nest) or emulator (SpiNNaker).
- You then make the spike sources that will start the first (0) state
and start the input (the second state).
- You then make the neurons. (In SpiNNaker the smallest number you can
make is 100).
- Then you set up the topology to connect all the neurons.
- Then you run the simulation or emulation.
- The results are then written to files.
- Nest writes to temp.pkl. To look at the spikes, run
python printPklFile.py temp.pkl > temp.sp (and the spikes are in
temp.sp).