-
Notifications
You must be signed in to change notification settings - Fork 0
Output
Without choosing outputs, the model will run, but once the simulation is complete, there will be no feedback to the user. Therefore the user should always choose some form of output.
There are two ways the user can choose outputs:
- By stating the desired outputs in the Output section of the model txt file.
- By typing the desired outputs in the console after the simulator has finished. The syntax for these two methods is the same.
Note: end: the user can also use the end command. If used in the model file, it will end the model without allowing the user to input any desired plots or saves. If used in the console, it will end the code.
Note: Plotting pauses the code: Due to a quirk of matplotlib, the package we use to plot graphs, the code will stall every time it plots something. To continue the code, the user will have to close all open plots. (If using pycharm, scientific mode might bypass this problem)
Note: Saving: Data is saved in xlsx (Excel) files. The file name will automatically describe the data being saved. Sometimes the file will not appear until the code has finished running.
The user can use the following commands:
-
<plot/save> neuron <data_name> <function> {<Neurons>} {<times>}:
Used to plot or save things like the voltage or firing of neurons.
<data_name>should be either "voltage" or "output".
Special cases:-
plot neuron raster raster {<Neurons>} {<times>}: This will plot a raster plot of the firing of the specified neurons at the specified times. Note that raster plots cannot be saved (consider using<data_name>= output,<function>= raw instead) -
plot neuron <data_name> spec {<Neurons>} {<times>}: This will plot a spectrogram/sonogram of the specified data_name, for the specified neurons over the specified times (it used the mean over all specified neurons). Note that the spectrogram cannot be saved.
-
-
<plot/save> synapse <data_name> <function> {<Neurons from>} {<Neurons to>} {<times>}:
This refers to all the synapses from<Neurons from>to<Neurons to>.
<data_name>should be "weight".
Special cases:-
plot synapse <data_name> spec {<Neurons from>} {<Neurons to>} {<times>}: This will plot a spectrogram/sonogram of the specified data_name, for the specified synapses over the specified times (it used the mean over all specified synapses). Note that the spectrogram cannot be saved.
-
-
<plot/save> connection <data_name> <function> <connection_name> {<times>}:
This refers to all the synapses in the connection<connection_name>.
<data_name>should be "weight".
Special cases:-
plot synapse <data_name> spec <connection_name> {<times>}: This will plot a spectrogram/sonogram of the specified data_name, for the specified synapses over the specified times (it used the mean over all specified synapses). Note that the spectrogram cannot be saved.
-
When plotting or saving data, the user must choose to apply one of several functions to the chosen data:
<function> =:
-
raw: This is the most basic function. It has no effect on the data, and can be thought of as default. Note that if you use raw for multiple neurons or synapses, you will get multiple plots, one for each neuron or synapse. -
mean: This computes the mean of all the data over all the neurons or synapses. eg: You can use this to get the "local feild potential" of a group of neurons. -
psd: This will compute the power spectral density for the data. Note that if you use psd for multiple neurons or synapses, you will get multiple plots, one for each neuron or synapse. -
mean_psd: This will compute the average power spectral density for the data (averaged over all neurons/synapses).
Note: You can find a brief introduction to power spectral density and spectrograms: power spectral density, spectrograms
Consider
Simulator_setup:
timestep 1
final_timestep 500
Model_structure:
group basic OSN 100
group basic extra 100
connect OSN_to_extra basicS {OSN} {extra} 0.9
Parameters:
edit_neurons {OSN} time_constant 1, sigmoid_center 0.7, sigmoid_slope 0.15
edit_neurons {extra} time_constant 1, sigmoid_center 0.7, sigmoid_slope 0.15
edit_connection OSN_to_extra initial_weight 0.0001, E 70, tau1 1, tau2 4, exite_width 9, inhib_width 20.0, exite_magnitude 1.0, inhib_magnitude 1.0, weight_change 0.0005
sniff {OSN} {50:450} 1. 8 50 10
We could plot a raster plot of all the neurons over all timesteps:
plot neuron raster raster {:} {:}
However, what if we wanted only the plots for group OSN, over all time?
plot neuron raster raster {OSN} {:}
Furthermore, what if we wanted only the plots for group OSN, but only from timestep 200 onward?
plot neuron raster raster {OSN} {200:}

Say you are trying to analyze the above example. You've seen some raster plots, but it might be valuable to look at the individual voltages involved.
You plot voltages for all neurons over all times
plot neuron voltage raw {:} {:}

These voltages look good, but there are far too many of them. You decide that it would be worth focusing in on only 20 neurons in OSN, and only on times after the 200th timestep. You plot voltages for neuron 50 to 70, after the 200th timestep.
plot neuron voltage raw {50:70} {200:}

Having focused in on a few neurons in OSN, you decide that it would be a good idea to get a general overview of the average voltage of neurons in OSN. You plot mean voltage for neurons in OSN, over all time.
plot neuron voltage mean {OSN} {:}

Now you have an understanding of the overall voltage of OSN. You wonder if the neurons in OSN are following the voltage, as they should. You decide to compute the average output (firing) of all the neurons in OSN. You plot the mean output for neurons in OSN, over all time.
plot neuron output mean {OSN} {:}

You decide to alter your model to include some learning.
Consider:
Simulator_setup:
timestep 1
final_timestep 500
Model_structure:
group basic OSN 100
group basic extra 100
connect OSN_to_extra hat {OSN} {extra} 0.9
connect OSN_to_extra_inhib hat {OSN} {extra} 0.9
Parameters:
edit_neurons {OSN} time_constant 1, sigmoid_center 0.7, sigmoid_slope 0.15
edit_neurons {extra} time_constant 1, sigmoid_center 0.7, sigmoid_slope 0.15
edit_connection OSN_to_extra initial_weight 0.0001, E 70, tau1 1, tau2 4, exite_width 9, inhib_width 20.0, exite_magnitude 1.0, inhib_magnitude 1.0, weight_change 0.0005
edit_connection OSN_to_extra_inhib initial_weight -0.0001, E 70, tau1 1, tau2 4, exite_width 9, inhib_width 20.0, exite_magnitude 1.0, inhib_magnitude 1.0, weight_change -0.0005
sniff {OSN} {50:450} 1. 8 50 10
You wish to see the overall effect of learning in the model. Since all synapses are from OSN to extra, you decide to plot the mean weight of all of them, over all time.
plot synapse weight mean {OSN} {extra} {:}

You are pleased with the output, but you realize that your model contains two different types of synapses, some excitatory, some inhibitory. You decide to plot the mean weight of these two connections separately.
plot connection weight mean OSN_to_extra {:}
plot connection weight mean OSN_to_extra_inhib {:}
Seeing the results, you realize that the weights of OSN_to_extra were increasing and the weights of OSN_to_extra_inhib were decreasing. You also notice that the sum of the weights of these two groups is equal to that in your first weight graph.
Click to return to home page: Home
- Home
- Introduction
- Python Setup/ Running the Code
- Choosing which model file to run
- Model File Format
- Save States
- Neuron and Synapse Types:
- Full Model Examples: