Open clinssen opened 8 months ago
Including the relevant report from @tomtetzlaff here about the ignore_and_fire neuron model.
In my original version, I had defined the variable
phase_steps integer = steps( max(0.,phase) / firing_rate )
in the internals block. It's just the integer version of the state variable "phase". In the above NESTML version, you moved the definition of "phase_steps" to the state block, probably because it is not a fixed parameter, but a quantity which changes over time.
However, instead of calculating its initial value from the initial phase, you set it to
phase_steps integer = firing_period_steps / 2
This is a problem because now one cannot control the initial value of "phase_steps" by setting the initial value of "phase". If I create a population of ignore_and-fire neurons, they all fire the first spike at the same time, even if the initial "phase" is randomized. The idea was that by randomizing the initial phase, one can generate asynchronous firing, as described here:
In
and in the attached script, you'll find a revised version of the model. Here, I declare "phase_steps" in line 25 as a state variable with initial value zero, but then it is recalculated in line 41 at the beginning of each update step according to the current value of the phase. This generates the correct behavior, but I find this solution somewhat suboptimal. In principle, line 41 needs to be executed only during the initialization. At all later steps, "phase_steps" is already in sync with "phase" according to line 52. Do you see a better solution? Having line 41 in the state block doesn't work because then "phase_steps" is set according to the default initial value of "phase", rather than according to the initial "phase" set by the user.
Check that state/parameters/internals obtain the right initial values, at different stages, e.g. after
Create()
, afterCopyModel()
.Upon model creation, parameters, internals and state are initialized to their default values defined in the NESTML model (in that order). What if there is a state variable, dependent on a parameter value, that is set to a non-default value? Could NEST
CopyModel()
be used for this?