Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check NEST initialization of state/parameters/internals #982

Open
1 task
clinssen opened this issue Nov 7, 2023 · 1 comment
Open
1 task

Check NEST initialization of state/parameters/internals #982

clinssen opened this issue Nov 7, 2023 · 1 comment
Labels

Comments

@clinssen
Copy link
Contributor

clinssen commented Nov 7, 2023

Check that state/parameters/internals obtain the right initial values, at different stages, e.g. after Create(), after CopyModel().

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?

  • Create a NEST integration test for this.
@clinssen clinssen added the bug label Nov 7, 2023
@clinssen
Copy link
Contributor Author

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:

https://jugit.fz-juelich.de/aca_requirements_validation_and_benchmarking/development-of-test-and-science-cases/-/blob/master/testcases/utils/nestml_models/doc/ignore_and_fire.md?ref_type=heads

In

https://jugit.fz-juelich.de/aca_requirements_validation_and_benchmarking/development-of-test-and-science-cases/-/blob/master/testcases/utils/nestml_models/ignore_and_fire.nestml

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.

ignore_and_fire.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant