{{ message }}

# Revise implementation of ht_neuron#491

Merged
merged 48 commits into from Dec 16, 2016
Merged

# Revise implementation of ht_neuron#491

merged 48 commits into from Dec 16, 2016

## Conversation

### heplesser commented Sep 22, 2016

 Implement the full NMDA model from the Hill-Tononi paper with instantaneous blocking and fast and slow unblocking. This PR will change model behavior. As reviewers, I suggest @ingablundell and @suku248. The text was updated successfully, but these errors were encountered:
We are unable to convert the task to an issue at this time. Please try again.
added 9 commits Apr 16, 2016
 First version of improved NMDA model. 
 8018857 
 Changed defaults parameters for ht_connection to defaults in Synthesi… 
 96099dd 
…s code; some code tidying.
 Merge branch 'master' into HT_NMDA 
 2bdc9ac 
# Conflicts:
#	models/ht_neuron.cpp
 Fixed small bug and formatting. 
 cf5805a 
 Fixed NMDA-conductance readout function. 
 2fda52a 
 Fixed code format. 
 916bc07 
 Merge branch 'master' into HT_NMDA 
 5ee4829 
 Merge branch 'master' into HT_NMDA 
 a5b883c 
# Conflicts:
#	models/ht_connection.h
#	models/ht_neuron.cpp
#	models/ht_neuron.h
 Updated model documentation to full NMDA implementation; adjuste one … 
 ffbdb18 
…example parameter value.
suggested changes

### Silmathoron left a comment

Ok, the changes make sense for me, I'll try to test the model at some point this week.
There are a few points that need discussing, though.

 , tau_P_( 50.0 ) , delta_P_( 0.2 ) , tau_P_( 500.0 ) , delta_P_( 0.5 )

### Silmathoron Oct 17, 2016

Since this could potentially have an influence on existing user scripts, could you justify the change in default parameters?

### heplesser Oct 18, 2016

The actual values of these two parameters are not given in the Hill-Tononi (2005) paper. The new values are the default values in the original Synthesis simulator code by Sean Hill. I sent a mail to NEST User on 22 September warning of changes to the Hill-Tononi model and asking for comments from anyone who may be affected, but have not received a single answer, so I think we are safe here.

### Silmathoron Oct 18, 2016

Ok, sounds fine!

 @@ -49,8 +49,7 @@ RecordablesMap< ht_neuron >::create() Name( "Theta" ), &ht_neuron::get_y_elem_< ht_neuron::State_::THETA > ); insert_( Name( "g_AMPA" ), &ht_neuron::get_y_elem_< ht_neuron::State_::G_AMPA > ); insert_( Name( "g_NMDA" ), &ht_neuron::get_y_elem_< ht_neuron::State_::G_NMDA > ); insert_( Name( "g_NMDA" ), &ht_neuron::get_g_NMDA_ );

### Silmathoron Oct 17, 2016

Why is the recordable g_NMDA different from the state variable? (cf. get_g_NMDA)

EDIT: ok, I understand, the state variable G_NMDA is the g(t) from the docstring and the recordable is the real g_NMDA = g(t)*m(V, t), which cannot be stored directly as a state variable since it is not what's updated.
But then the naming looks misleading to me, I guess we should change G_NMDA to something else and update the docstring... though I must say I'm at a loss regarding the name. Maybe G_T would be the most sensible choice...

### heplesser Oct 18, 2016

Naming is a bit of a mess here. In the paper, it is \tilde{g}_NMDA = m(V) g_NMDA(t), where g_NMDA(t) is the double exponential function.

I think that the end user will be most interested in the actual conductance of NMDA channels when Mg-blocking is taken into account (the m(V)). Therefore, I think the recordable should be g_NMDA and the getter get_g_NMDA_(), but I think I will change the name of the state variable, maybe to G_NMDA_TIMECOURSE.

### Silmathoron Oct 18, 2016

Yes, I agree that g_NMDA should be the variable recorded, and G_NMDA_TIMECOURSE looks good!

 * NMDA conductance * * We need to take care to handle instantaneous blocking correctly. * If the unblock-variables Mg_{fast,slow} > Mg_ss, the steady-state

### Silmathoron Oct 17, 2016

This looks unclear to me, you mean "if the unblock variables are greater than their respective steady-state values", right? I think the combination of equation and text sentence with commas is rather disturbing.

### heplesser Oct 18, 2016

You are right, fixed.

 , NMDA_Vact( -58.0 ) // mV , NMDA_Sact( 2.5 ) // mV , NMDA_Tau_1( 4.0 ) // ms , NMDA_Tau_2( 40.0 ) // ms

### Silmathoron Oct 17, 2016

If you think it's worth it (I'm not sure), having all taus in lowercase would be more coherent, though it would break existing codes... and Tau_m instead of tau_m is really too bad since it's supposed to be common to many models...

 @@ -280,7 +300,10 @@ class ht_neuron : public Archiving_Node DG_GABA_A,

### Silmathoron Oct 17, 2016

I would be in favour of changing G_NMDA to G_T but there should at least be a comment like
G_NMDA, // state variable corresponding to g(t), with g_NMDA = m(V, t) * g(t)
or something equivalent.

 @@ -409,6 +432,26 @@ class ht_neuron : public Archiving_Node { return S_.I_h_; } double_t

### Silmathoron Oct 17, 2016

why are there double_t?

### heplesser Oct 18, 2016

I suppose because the branch is a bit old .... Fixed.

### heplesser commented Oct 18, 2016 • edited

 @Silmathoron I now noticed that the model needs a bit more work. I will change all names to use names:: names, will add checks to parameter setting (currently, there are no checks at all) and change all _Tau_ and _Theta_ in names to lowercase equivalents. But I probably won't get that done today.

### Silmathoron commented Oct 18, 2016

 Ok, thanks for your hard work! May the code be with you!

 First step in changing variable names, esp _Tau_ -> _tau_ 
 4998bf2 
reviewed
 * We need to take care to handle instantaneous blocking correctly. * If the unblock-variables Mg_{fast,slow} > Mg_ss, the steady-state * value for the present membrane potential, we cannot change those values * in State_[], since the ODE Solver may call this function multiple times

### ingablundell Oct 21, 2016

I would prefer it if "those values" were specified

### heplesser Oct 24, 2016 • edited

I will fix this with the next update to the PR.

### ingablundell commented Oct 21, 2016

 The documentation of the NMDA current is very clear and helpful! Although I would add an explicit definition of g (what is g_NMDA in the paper). The calculation of the NMDA part of I_syn and propagation of Mg_fast and Mg_slow look correct to me! I approve this pull request.

reviewed
 m(V) = 1 / ( 1 + exp( - ( V - NMDA_Vact ) / NMDA_Sact ) ) where g(t) is a beta function (difference of exponentials).

### ingablundell Oct 21, 2016

I would prefer it if g was stated explicitly

### heplesser Oct 24, 2016

I will fix this with the next update to the PR.

added 11 commits Oct 25, 2016
 Improved comments / documentation. 
 18fb781 
 Removed test that was accidentally committed in this branch. 
 57e5463 
 Added checkes on parameters. 
 5c6b651 
 Added checkes on parameters. 
 8018960 
 Fixing examples to lower-case variable names. 
 a157412 
 Updated ConnPlotter documentation wrt to changes in ht_neuron. 
 800bd08 
 Fixed formatting. 
 b978ae0 
 Merge branch 'master' into HT_NMDA 
 25793f7 
# Conflicts:
#	nestkernel/nest_names.cpp
#	nestkernel/nest_names.h
 Fixed formatting. 
 680f3f6 
 Merge branch 'master' into HT_NMDA 
 53f136e 
# Conflicts:
#	nestkernel/nest_names.cpp
#	nestkernel/nest_names.h
 Fixed formatting. 
 0889bf5 

### heplesser commented Oct 26, 2016

 @Silmathoron I have now completed my revisions, so you can continue reviewing.

suggested changes

### Silmathoron left a comment • edited

Nice restructuring!
Here is a first round of comments, I'll try to check the equations and test the model next week:

• in ht_connection.h, line 44, it should be tau_P (or tau_rec, if possible, cf. comments below).
• the THIS MODEL NEURON HAS NOT BEEN TESTED EXTENSIVELY! comment leaves me perplex... what do you mean exactly? Wouldn't a test file solve the problem?

 def< double >( d, "tau_P", tau_P_ ); def< double >( d, "delta_P", delta_P_ ); def< double >( d, "P", p_ ); def< double >( d, names::tau_P, tau_P_ );

### Silmathoron Oct 27, 2016

Since we are trying to limit the number of names and given that this is clearly a recovery time, I think it would be a good idea to set it to names::tau_rec and specify in the docstring "the recovery time tau_P in the paper is called tau_rec here", or something equivalent

### heplesser Nov 23, 2016

I see your point, but since everything here is about P, and I would like to stay reasonably close to the paper to ease comparisons, I would like to stick with tau_P.

### Silmathoron Nov 25, 2016

Fair enough ;)

 def< double >( d, names::theta_eq, theta_eq ); def< double >( d, names::tau_theta, tau_theta ); def< double >( d, names::tau_spike, tau_spike ); def< double >( d, names::spike_duration, t_spike );

### Silmathoron Oct 27, 2016

t_spike is not detailed anywhere, could you add a line of explanation in the docstring?

 //! Timer (counter) for potassium current. int r_potassium_; //! Timer (counter) for spike-activated repolarizing potassium current. int r_spike_; bool g_spike_; //!< active / not active

### Silmathoron Oct 27, 2016

The name g_spike_ seems weird for a boolean telling whether the K current is in action or not. Also this variable is not documented though it's a recordable...

 - Intrinsic currents I_h (pacemaker), I_T (low-threshold calcium), I_Na(p) (persistent sodium), and I_KNa (depolarization-activated potassium). - Several apparent typographical errors in the descriptions of

### Silmathoron Oct 27, 2016

I guess you mean errors in the paper [1], but maybe it should be more explicit...

 t_peak = tau_2 tau_1 / ( tau_2 - tau_1 ) ln( tau_2 / tau_1 ) m(V, t) = a(V) m_fast*(V, t) + ( 1 - a(V) ) m_slow*(V, t) a(V) = 0.51 - 0.0028 V

### Silmathoron Oct 27, 2016

There is an apparent problem with the homogeneity, here... I suppose 0.0028 is in mV^{-1}, but could you specify it explicitely? (maybe introduce a named constant).
Shouldn't the user want to be able to set these two values? If not (which would be surprising to me), would you mind explaining their origin?

### heplesser Nov 23, 2016

I sure should document this better and provide details in a notebook. Given the number of parameters in this model that are fixed as numerical constants, making them all settable would make the code more complex (just inventing good names for all constants would be a major effort). Therefore, I would like to leave them as they are (seems to be quite usual for these more complex models). The particular values here are from Vargas-Caballero and Robinson, J Neurophysiol 89: 2778–2783, 2003. I will add the reference.

 @@ -155,6 +175,8 @@ const Name growth_rate( "growth_rate" ); const Name gsl_error_tol( "gsl_error_tol" ); const Name h( "h" ); const Name h_E_rev( "h_E_rev" );

### Silmathoron Oct 27, 2016

same comment as above

 @@ -179,6 +207,9 @@ const Name Interpol_Order( "Interpol_Order" ); const Name interval( "interval" ); const Name is_refractory( "is_refractory" ); const Name KNa_E_rev( "KNa_E_rev" );

### Silmathoron Oct 27, 2016

see above

 @@ -202,8 +233,18 @@ const Name N_channels( "N_channels" ); const Name n_events( "n_events" ); const Name n_proc( "n_proc" ); const Name n_receptors( "n_receptors" ); const Name NaP_E_rev( "NaP_E_rev" );

### Silmathoron Oct 27, 2016

see above

 const Name needs_prelim_update( "needs_prelim_update" ); const Name neuron( "neuron" ); const Name NMDA_E_rev( "NMDA_E_rev" );

### Silmathoron Oct 27, 2016

see above

 @@ -288,6 +332,8 @@ const Name synapse_model( "synapse_model" ); const Name synapse_modelid( "synapse_modelid" ); const Name synaptic_elements( "synaptic_elements" ); const Name T_E_rev( "T_E_rev" );

see above

### heplesser commented Nov 25, 2016

 All should be fixed now. I am continuing work on the notebook, next step is a systematic test of the intrinsic currents (voltage-clamping is coming to NEST ...)

added 7 commits Nov 28, 2016
 ht_neuron now supports voltage clamp and equilibration. 
 f5eb579 
I_H verified in notebook.
 All intrinsic channels now checked. Some re-organization of code for … 
 97e21db 
…better clarity and proper initialization with steady-state values.
 Corrected read-out of NMDA current to multimeter. 
 6ca214f 
 Notebook documenting Hill-Tononi models now essentially complete. All… 
 900b308 
… channels tested successfully and decent similarity to Fig 5 in paper achieved.
 Formatting fixes. 
 4178bf2 
 Merge branch 'master' of https://github.com/nest/nest-simulator into … 
 ea6a79d 
…HT_NMDA

# Conflicts:
#	nestkernel/nest_names.cpp
#	nestkernel/nest_names.h
 Added missing name declarations. 
 9fba9dc 

### heplesser commented Nov 29, 2016 • edited

 @Silmathoron @ingablundell I have just pushed a major revision of the model including a notebook exploring all aspects of the model (docs/model_details). Enjoy! Note that failing tests may be due to Travis trouble this afternoon.

 Removed warning about limited testing. 
 badd650 
reviewed

### Silmathoron left a comment

Great work on that, the update function is much clearer now!
There are only a few points left that need some clarifications; also I realized that I forgot to ask, but I find it very surprising that, in such a detailed model, conductances cannot be taken directly from biological data... could you at least provide typical values that would allow for an approximate conversion?

again: which RK?

### heplesser Dec 15, 2016

Done.

added 2 commits Dec 15, 2016
 Merge branch 'master' of https://github.com/nest/nest-simulator into … 
 bec1c52 
…HT_NMDA
 Improved notebook text based on suggestions by @ingablundell. 
 e7110c6 

### heplesser commented Dec 15, 2016

 @ingablundell Thank you! I have revised the notebook according to your suggestions, with one exception. @apeyser Could you merge, as this is my PR?

merged commit b13c085 into nest:master Dec 16, 2016
1 check passed
deleted the HT_NMDA branch Dec 20, 2016