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

Recording of currents generated by electrodes in PyNN #474

Closed
appukuttan-shailesh opened this issue May 2, 2017 · 2 comments
Closed

Recording of currents generated by electrodes in PyNN #474

appukuttan-shailesh opened this issue May 2, 2017 · 2 comments

Comments

@appukuttan-shailesh
Copy link
Contributor

appukuttan-shailesh commented May 2, 2017

This issue is a continuation of that initiated in #465 . NEST now allows the recording of electrode currents (see this). Thus, we are now in a position to expose this functionality for the following three simulators - Brian, NEURON, NEST.

It should be noted that the native implementation of current recording varies across these simulators. To introduce uniformity across simulators, when run via PyNN, we have have decided to proceed with the following:

  1. 'start' time for electrode corresponds to the time instant when the current initiates at the electrode
  2. the 'target' (e.g. neuronal vm) experiences the current and changes value at the immediate next time instant
  3. parameter values will be made available for every time instant of simulation; including at the start and stop time instants of the simulation

Note: Differences from recording in the native simulators

Brian
PyNN uses Brian's StateMonitor with when='start', and thus does not return a value for the final time instant of simulation. This was then compensated by explicitly storing the end of simulation values. This has been modified now by extending the run time by a single dt.

=> Update on 6th July, 2017 (PR #501 )
We decided not to extend the run time by a single dt, but rather pick the final value of the current from the state variables as is already done for vm and other parameters.

NEURON
In NEURON, the value of current at the electrode changes at the time instant following the specified 'start' time. Changes in Vm are also reflected at the same time instant. In PyNN, this is altered (as described in points 1 & 2 above). This required the extension of the run time by a single dt.

=> Update on 6th July, 2017 (PR #501 )
We decided not to extend the run time by a single dt as this led to several issues downstream (would require changes in several existing tests which directly access the recorded NEO object, rather than the data otuput via the simulator interface). The current fix simply repeats the last value of recorded current and appends this (so last two values are forced to be identical).

NEST
NEST makes use the parameter min_delay to evaluate delay between current initiation and reaching the target. Thus, a start time of 't_start' ms for the electrode, would translate to current initiation at 't_start' and effect on target at 't_start + min_delay'. In PyNN, the implementation was adjusted to ensure that the start time corresponded to the initiation of effect on the target, by advancing the current injection internally by min_delay. This has now been updated (by simple padding) to ensure that when the currents are plotted, they begin at 't_start'. Also, in NEST the parameter values towards the end of the simulation are not retrieved, whereas this is made possible in PyNN by extending the run time appropriately.

@appukuttan-shailesh
Copy link
Contributor Author

appukuttan-shailesh commented May 2, 2017

More notes for NEST

  1. For the AC Source in NEST, the value of current evaluated at the first time instant following initiation seems to be incorrect (the first value appears to be skipped; as is confirmed via tests on Brian and NEURON). This has been reported here. We await a clarification on the same. In the meantime, for internal consistency across simulators, we tweak the phase for the AC Source in 'pynn.nest' to compensate for this issue. This might have to be reversed in the future, if changes are made in NEST.

=> Update on 6th July, 2017
This was fixed here: nest/nest-simulator#730
The tweak, mentioned above, has been removed in view of this fix.

  1. For noisy current, when electrode's dt is different from the simulation dt, then NEST presently only records values at electrode's dt interval. This results in different length of vectors for the recorded current and others such membrane potential. This issue has been highlighted in NEST here, along with a possible fix. We await a clarification on the same. This issue does not exist for Brian and NEURON. When electrode's dt = simulation dt, then there is no problem.

=> Update on 6th July, 2017
This was fixed here: nest/nest-simulator#733

appukuttan-shailesh added a commit to appukuttan-shailesh/PyNN that referenced this issue Jul 4, 2017
appukuttan-shailesh added a commit to appukuttan-shailesh/PyNN that referenced this issue Jul 4, 2017
@appukuttan-shailesh
Copy link
Contributor Author

(The earlier posts have been updated inline to reflect the recent implementation details and the related simulator fixes)

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

No branches or pull requests

1 participant