Skip to content

Commit c792a46

Browse files
author
rbodo
committed
Updated nest example and test case with better parameters for time resolution, refractory period, delay and threshold.
1 parent 5819553 commit c792a46

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

examples/mnist_keras_nest.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@
9999
# SNN TOOLBOX CONFIGURATION #
100100
#############################
101101

102+
dt = 0.1 # Time resolution of simulator.
103+
102104
# Create a config file with experimental setup for SNN Toolbox.
103105
configparser = import_configparser()
104106
config = configparser.ConfigParser()
@@ -119,12 +121,14 @@
119121
'duration': 50, # Number of time steps to run each sample.
120122
'num_to_test': 5, # How many test samples to run.
121123
'batch_size': 1, # Batch size for simulation.
122-
'dt': 0.1 # Time resolution for ODE solving.
124+
'dt': dt # Time resolution for ODE solving.
123125
}
124126

125127
config['cell'] = {
126-
'tau_refrac': 0.1 # Refractory period must be at least one
127-
# time step.
128+
'tau_refrac': dt, # Refractory period and delay must be at
129+
'delay': dt, # least one time step.
130+
'v_thresh': 0.01 # Reducing default value (1) for higher
131+
# spikerates.
128132
}
129133

130134
config['output'] = {

tests/core/test_models.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,12 +173,16 @@ def test_nest(self, _model_1, _config):
173173

174174
updates = {
175175
'tools': {'evaluate_ann': False},
176-
'input': {'poisson_input': True},
177176
'simulation': {
178177
'simulator': 'nest',
179-
'duration': 100,
180-
'num_to_test': 100,
181-
'batch_size': 1},
178+
'duration': 50,
179+
'num_to_test': 10,
180+
'batch_size': 1,
181+
'dt': 0.1},
182+
'cell': {
183+
'tau_refrac': 0.1,
184+
'delay': 0.1,
185+
'v_thresh': 0.01},
182186
'output': {
183187
'log_vars': {'activations_n_b_l', 'spiketrains_n_b_l_t'}}}
184188

0 commit comments

Comments
 (0)