Demonstration of using a discrimination function available in nmcog

The demonstration will be for a temporal discrimation function. For a overview of this function refer to the guidebook.

Import BuoMerz as a cognitive function

[1]:
from nmcog.spinnaker.discriminate import BuoMerz
Detected PyNN version 0.9.4 and Neo version 0.8.0

Run it

For this example we are passing one or more stimulus.

[2]:
%%capture
s1 = 80; s2 = 130; s3 = 180; s4 = 230; s5 = 280 # each stimulus carries temporal information in milliseconds
#temp_diff = BuoMerz([s1])
#temp_diff = BuoMerz([s1, s2])
temp_diff = BuoMerz([s1, s2, s3, s4, s5])
Created spalloc job 5336676
Waiting for board power commands to complete.
Created spalloc job 5336678
Waiting for board power commands to complete.
Created spalloc job 5336681
Waiting for board power commands to complete.
Created spalloc job 5336683
Waiting for board power commands to complete.
Created spalloc job 5336686
Waiting for board power commands to complete.

Visualize it

View all in one time-series plot

[4]:
temp_diff.plot_output_layer_timeseries()

View each time-series plot separately

[5]:
temp_diff.plot_output_layer_timeseries_vertical()

View each population in the output layer corresponding to respective stimulus

Note, one unique population for respecgtive stimlus.

[6]:
temp_diff.plot_output_layer_vertical()

Get simulation results.

Also, the user can get the results (Neo SpikeTrains) for further analysis.

[7]:
sim_result = temp_diff.get_results()

The result is a dictionary whose keys correspond to the stimulus as shown below.

[8]:
print(sim_result.keys())
dict_keys(['80', '130', '180', '230', '280'])

Furthermore, the values for the stimulus keys are also dictionaries as shown below.

[9]:
print(sim_result["80"].keys())
dict_keys(['origin', 'end', 'popIn', 'out', 'ex4', 'inh4', 'ex3', 'inh3'])

Glossary: - “origin”; simulation start time for given stimulus - “end”; stimulation end time for given stimulus - “popIn”; population for the input layer - “ex4”; excitatory population for Layer-4 - “inh4”; inhibitory population for Layer-4 - “ex3”; excitatory population for Layer-3 - “inh3”; inhibitory population for Layer-3 - “out”; spike trains for all the populations within the output layer

[ ]: