PyNN solver selection

25 views
Skip to first unread message

Alberto Vergani

unread,
Sep 10, 2023, 5:05:42 AM9/10/23
to Neural Ensemble
Dear experts,

I am running some  simulations with PyNN having Brian as backend simulator.

While simulating, there is warning about the numerical integrator which Brian selected.

This is the warning:
INFO No numerical integration method specified for group 'neurongroup_1', using method 'euler' (took 0.01s, trying other methods took 0.03s). [brian2.stateupdaters.base.method_choice]

And it says that "brian2.stateupdaters.base.method_choice" should define the solver; but this is native Brian syntax.

So, I kindly ask you if there is a way in PyNN to manage the solver embedded in the backend simulators, as for Brian and maybe the others.

Thanks
Best regards,
Alberto

Marcel Stimberg

unread,
Sep 11, 2023, 4:43:08 AM9/11/23
to neurale...@googlegroups.com

Hi Alberto,

So, I kindly ask you if there is a way in PyNN to manage the solver embedded in the backend simulators, as for Brian and maybe the others.

I am no expert on PyNN, but I don't think there is a generic mechanism to set the solver. Some of the Brian models included in PyNN define a solver (e.g. the adaptive exponential IF models use RK2), but most don't and therefore fall back to Brian's default selection. In your example, it decides to use forward Euler, since it cannot use exact integration for your equations.

Specifically for Brian, you can set the `method_choice` attribute of `brian2_group.state_updater` – but obviously this won't work for other backends. For example:

hh = sim.Population(1, sim.HH_cond_exp(i_offset=0.2), label="HH_cond_exp")
hh.brian2_group.state_updater.method_choice = 'exponential_euler'

Hope that helps!

  Marcel


PS:


While simulating, there is warning about the numerical integrator which Brian selected.

This is the warning:
INFO No numerical integration method specified for group 'neurongroup_1', using method 'euler' (took 0.01s, trying other methods took 0.03s). [brian2.stateupdaters.base.method_choice]

And it says that "brian2.stateupdaters.base.method_choice" should define the solver; but this is native Brian syntax.


Two minor nitpicking comments on this:

1. this isn't a warning but an "info" message, to make the user aware of a choice that Brian made

2. The [brian2.stateupdaters.base.method_choice] is a category/label for the log message, not how you'd define the solver

Andrew Davison

unread,
Sep 11, 2023, 5:22:47 AM9/11/23
to Neural Ensemble
Many thanks Marcel for the reply.

In general, the other backend simulators do not support setting the solver at the Python level, it is done at the neuron model description level, in C++ or NMODL.

Given this, it doesn't make sense to define a way to do this in PyNN, you should set it in a Brian-specific way, as Marcel describes.

To have a script that still runs with other backends, you can wrap the Brian-specific code in:

```
if sim.__name__ == "pyNN.brian2":
    ...
```

Best regards,

Andrew

Alberto

unread,
Sep 11, 2023, 5:58:39 AM9/11/23
to neurale...@googlegroups.com
Dear Marcel and Andrew,

Thanks for your reply and suggestions!

Best regards,
Alberto

--
You received this message because you are subscribed to the Google Groups "Neural Ensemble" group.
To unsubscribe from this group and stop receiving emails from it, send an email to neuralensembl...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/neuralensemble/16f612b6-2265-4022-8b32-610b5724cbc6n%40googlegroups.com.


--
Vergani, AA


Reply all
Reply to author
Forward
0 new messages