Callbacks: Requirements and design #438
Replies: 5 comments
-
My main motivation for callbacks are being able to implement resets such as the ones in the Izhikevich model (https://www.izhikevich.org/publications/spikes.pdf) without rewriting I have no strong opinion, especially on the latter point (the resets I am quite keen on via callbacks, unless you have a clearly better idea :) ). |
Beta Was this translation helpful? Give feedback.
-
Maybe we can pick this up again here, and even broaden the scope of the discussion. Perhaps we can learn something from how @JonathanWenger uses callbacks in the linear algebra code, eventually leading to a probnum-wide convention? @JonathanWenger please feel no need to reply soon though. This is not urgent. |
Beta Was this translation helpful? Give feedback.
-
I ended up removing callbacks from the interface and adding a method to the class which implements the PN method and returns an iterator (in fact a generator). This can then be looped through and exposes all internals of the model. You can also use this to restart the solver from any state. |
Beta Was this translation helpful? Give feedback.
-
Note for my future self: these guys (https://ode-solver.readthedocs.io/en/master/usage.html#classes-and-functions) implement ODE solvers with generators. In general, I find the idea very elegant, but I am not yet sure about speed. |
Beta Was this translation helpful? Give feedback.
-
Hmmm, at least it does not seem slower... still not sure about advantages and disadvantages, but I kind of like the idea. |
Beta Was this translation helpful? Give feedback.
-
As we started discussing in #243, the currently implemented callbacks are as useful as we would like them to be (yet). For example, they can currently not be used to stochastically perturb the function estimates. So, the questions seem to be:
self
?Beta Was this translation helpful? Give feedback.
All reactions