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

Gif models #261

Merged
merged 38 commits into from Oct 7, 2016
Merged

Gif models #261

merged 38 commits into from Oct 7, 2016

Conversation

@hesam-setareh
Copy link
Contributor

hesam-setareh commented Mar 5, 2016

Implementing generalized integrate-and-fire (GIF) neuron model for nest in four versions:
gif_psc_exp
gif_psc_exp_multisynapse
gif_cond_exp
gif_cond_exp_multisynapse

And also a unittest for each version.

kernel().model_manager.register_node_model< gif_psc_exp >( "gif_psc_exp" );
kernel().model_manager.register_node_model< gif_psc_exp_multisynapse >( "gif_psc_exp_multisynapse" );
kernel().model_manager.register_node_model< gif_cond_exp >( "gif_cond_exp" );
kernel().model_manager.register_node_model< gif_cond_exp_multisynapse >( "gif_cond_exp_multisynapse" );

This comment has been minimized.

Copy link
@tammoippen

tammoippen Mar 7, 2016

Contributor

The cond models, which use the GSL have to be encapsulated by

#ifdef HAVE_GSL
...
#endif

Otherwise the template argument is not valid, when you compile without GSL.

@tammoippen
Copy link
Contributor

tammoippen commented Mar 7, 2016

The formatting is off. Please follow the instructions on our developer space to format the code.

@jougs
Copy link
Contributor

jougs commented Mar 7, 2016

Once the formal issues are resolved, I suggest @heplesser and @rcfduarte as reviewers.

@tammoippen
Copy link
Contributor

tammoippen commented Mar 8, 2016

Hi @hesam-setareh ,

Which version of clang-format did you use? It is important that you use version 3.6, as the other versions will format the code differently.

instead of eta and gamma.
References:

This comment has been minimized.

Copy link
@heplesser

heplesser Mar 31, 2016

Contributor

Please move the references section down, to just before the author section. Also, check the formatting of the references, the clang-format process seems to have introduced some unfortunate line breaks. I suppose this applies to the other h-files, too.

This comment has been minimized.

Copy link
@hesam-setareh

hesam-setareh May 17, 2016

Author Contributor

Done.

*/

#ifndef gif_cond_exp_H
#define gif_cond_exp_H

This comment has been minimized.

Copy link
@heplesser

heplesser Mar 31, 2016

Contributor

The include guard should be all caps: GIF_COND_EXP_H. I assume this applies to the other header files, too.

This comment has been minimized.

Copy link
@hesam-setareh

hesam-setareh May 17, 2016

Author Contributor

Done.

gamma_i = gamma_i + q_gamma_i (in case of spike emission).
In the source code and parameter names we use stc and sfa, respectively
instead of eta and gamma.

This comment has been minimized.

Copy link
@heplesser

heplesser Mar 31, 2016

Contributor

This information does not really belong into the user space documentation, since it is only relevant for developers.

This comment has been minimized.

Copy link
@hesam-setareh

hesam-setareh May 17, 2016

Author Contributor

Moved to definition of Parameters_.

(sfa) after each spike emission in mV.
tau_sfa vector of double - Time constants of sfa variables in ms.
delta_u double - Stochasticity level in mV.
lambda0 double - Stochastic intensity at firing threshold V_T in Hz.

This comment has been minimized.

Copy link
@heplesser

heplesser Mar 31, 2016

Contributor

Strictly speaking, Hz applies to periodic processes only, so it should be 1/s.

This comment has been minimized.

Copy link
@heplesser

heplesser Mar 31, 2016

Contributor

I think lambda_0 with underscore would be nicer.

This comment has been minimized.

Copy link
@hesam-setareh

hesam-setareh May 17, 2016

Author Contributor

I applied both comments.

double_t y0_; //!< This is piecewise constant external current
double_t y3_; //!< This is the membrane potential RELATIVE TO RESTING POTENTIAL.
double_t q_; //!< This is the change of the 'threshold' due to adaptation.
double_t stc_; // Spike triggered current.

This comment has been minimized.

Copy link
@heplesser

heplesser Mar 31, 2016

Contributor

The comment (and subsequent similar comments) should begin with //!<, so that Doxygen will recognize it as member documentation when generating developer documentation. This would be a good place to point out that stc_ is eta in the paper.

This comment has been minimized.

Copy link
@hesam-setareh

hesam-setareh May 17, 2016

Author Contributor

Done.

, V_reset_( -55.0 ) // mV
, delta_u_( 1.5 ) // mV
, v_t_star_( -35 ) // mV
, lambda0_( 10000.0 ) // Hz

This comment has been minimized.

Copy link
@heplesser

heplesser Mar 31, 2016

Contributor

In the PLoS paper, you fix lambda_0 to 1 Hz. Why do you use 10.000 Hz as default here?

This comment has been minimized.

Copy link
@hesam-setareh

hesam-setareh May 17, 2016

Author Contributor

I changed the value to 1 Hz (1/s).

tau_sfa_.clear();
q_sfa_.clear();
tau_stc_.clear();
q_stc_.clear();

This comment has been minimized.

Copy link
@heplesser

heplesser Mar 31, 2016

Contributor

Instead of calling clear() on all the vector members, it would be tidier to add them as , tau_sfa_() etc in the initializer list above.

This comment has been minimized.

Copy link
@hesam-setareh

hesam-setareh May 17, 2016

Author Contributor

Done.

updateValue< double >( d, names::V_reset, V_reset_ );
updateValue< double >( d, names::delta_u, delta_u_ );
updateValue< double >( d, names::v_t_star, v_t_star_ );
updateValue< double >( d, "lambda0", lambda0_ );

This comment has been minimized.

Copy link
@heplesser

heplesser Mar 31, 2016

Contributor

I would add lambda0 to names as well, but I think I would prefer an additional underscore: lambda_0

This comment has been minimized.

Copy link
@heplesser

heplesser Mar 31, 2016

Contributor

You should probably convert lambda0 from 1/s to 1/ms (i.e., divide by 1000) here, then you do not need to do that on every time step. You need to multiply by 1000 then in the get() method. I suppose it would also make sense to test that lambda0 >= 0 (== 0 means no spiking, but it causes no problems as far as I can see, so one could allow it for testing).

This comment has been minimized.

Copy link
@hesam-setareh

hesam-setareh May 17, 2016

Author Contributor

Done.

{

q_temp_ = 0;
for ( uint_t i = 0; i < S_.q_stc_elems_.size(); i++ )

This comment has been minimized.

Copy link
@heplesser

heplesser Mar 31, 2016

Contributor

Rather use size_t than uint_t for the loop variable.

This comment has been minimized.

Copy link
@hesam-setareh

hesam-setareh May 17, 2016

Author Contributor

Done.

assert( to >= 0 && ( delay ) from < kernel().connection_builder_manager.get_min_delay() );
assert( from < to );

double_t q_temp_;

This comment has been minimized.

Copy link
@heplesser

heplesser Mar 31, 2016

Contributor

You could move the declaration a few lines down to first use.

This comment has been minimized.

Copy link
@hesam-setareh

hesam-setareh May 17, 2016

Author Contributor

Defining the declaration inside the loop reduces the performance. Therefore, I kept it outside the loop.

if ( S_.r_ref_ == 0 ) // neuron not refractory, so evolve V
{

if ( S_.add_stc_sfa_ == true )

This comment has been minimized.

Copy link
@heplesser

heplesser Mar 31, 2016

Contributor

Drop the == true, if ( S_.add_stc_sfa_ ) does just the same.

This comment has been minimized.

Copy link
@heplesser

heplesser Mar 31, 2016

Contributor

At this point, there is an interesting question about the precise definition of the model. In all other NEST models, refractoriness affects membrane potential only. In your implementation, though, you let stc (eta) and sfa (gamma) evolve during the refractory period as if the spike did not yet happen (lines 323-434), and then apply the jump to both values at the end of the refractory time. Eqs 1 and 4 in the PLoS paper gather give the impression that eta and gamma set in at the spike time t_j, not at t_j+t_ref.

Therefore, I would suggest to add the jumps right after a spike has been applied, in the code block that also emits the spike; you can then drop S_.add_stc_sfa_. One then needs to be a bit careful about the next time step:

  1. Let a time step be (t, t+h] (time steps in NEST are always left open, right closed intervals). The stc_elems_ at the end of a time step contain the value at the end of the step, including a jump if the neuron spiked during the step.
  2. We need to use those stc_elems_ values when computing the total stc entering into the membrane potential update.
  3. Only after we have used the values must we update them.

You do this already correctly on lines 323-343 (the same applies to sfa)

The only problem is the sfa value returned by State_::get(), since that value is only updated at the beginning of the next update loop and would just not contain any jumps occurring during the last step of a Simulate call. The best way to make sure that the correct sfa value is returned, is probably to compute the sfa value explicity in the get() method.

This comment has been minimized.

Copy link
@hesam-setareh

hesam-setareh May 17, 2016

Author Contributor

Probably this is the most controversial point of the implementation. I have discussed with the designer of gif model and he pointed out:
1 - stc and sfa should be evolved during the refractory period.
2 - In case of spike emission, the jumps should be applied to stc and sfa after the refractory period (t_j + t_ref) not after the spike (t_j). That is why I used S_.add_stc_sfa_. true value of this variable indicates that there was a spike before the refractory period and stc and sfa should be jumped.

In the modified version of the code I added stc to the recordable map, so the user can capture the value of both adaptation variables (stc and sfa).

I agree with you that the article does not explain this point clearly.

q_sfa vector of double - Values added to spike-frequency adaptation
(sfa) after each spike emission in mV.
tau_sfa vector of double - Time constants of sfa variables in ms.
delta_u double - Stochasticity level in mV.

This comment has been minimized.

Copy link
@heplesser

heplesser Mar 31, 2016

Contributor

This corresponds to Delta_V in the paper, doesn't it? Wouldn't it be better then to call it Delta_V?

This comment has been minimized.

Copy link
@hesam-setareh

hesam-setareh May 17, 2016

Author Contributor

I changed it to Delta_V.

tau_sfa vector of double - Time constants of sfa variables in ms.
delta_u double - Stochasticity level in mV.
lambda0 double - Stochastic intensity at firing threshold V_T in Hz.
v_t_star double - Minimum threshold in mV

This comment has been minimized.

Copy link
@heplesser

heplesser Mar 31, 2016

Contributor

I'd suggest V_T_start to make it more similar to the paper.

This comment has been minimized.

Copy link
@hesam-setareh

hesam-setareh May 17, 2016

Author Contributor

Done.


S_.q_ = q_temp_ + P_.v_t_star_;

ulong_t n_spikes = 0;

This comment has been minimized.

Copy link
@heplesser

heplesser Mar 31, 2016

Contributor

Could the neuron ever produce more that one spike in a time step? If not, I would make this a bool called neuron_spikes_ or similar.

This comment has been minimized.

Copy link
@hesam-setareh

hesam-setareh May 17, 2016

Author Contributor

You have right. The neuron does not produce more than one spike. Actually, I did not need the neuron_spikes_ variable and removed it.

{
double_t y0_; //!< This is piecewise constant external current
double_t y3_; //!< This is the membrane potential RELATIVE TO RESTING POTENTIAL.
double_t q_; //!< This is the change of the 'threshold' due to adaptation.

This comment has been minimized.

Copy link
@heplesser

heplesser Mar 31, 2016

Contributor

I think you are overusing q_ a bit, which makes the code more difficult to read than necessary. Above, q_* is used for the jump amplitude for stc and sfa, here you use it for the threshold. I would choose a different name here---why not sfa_?

This comment has been minimized.

Copy link
@hesam-setareh

hesam-setareh May 17, 2016

Author Contributor

I changed it to sfa_.

double_t stc_; // Spike triggered current.

std::vector< double_t > q_sfa_elems_; // Vector of adaptation parameters.
std::vector< double_t > q_stc_elems_; // Vector of spike triggered parameters.

This comment has been minimized.

Copy link
@heplesser

heplesser Mar 31, 2016

Contributor

The q_ prefix in these two variables does not make much sense, I think, given that you use q_ to indicate jump sizes in the parameter names. I'd just drop q_ here.

This comment has been minimized.

Copy link
@hesam-setareh

hesam-setareh May 17, 2016

Author Contributor

I modified the name of variables. Now we have sfa_ and stc_.


int_t r_ref_; // absolute refractory counter (no membrane potential propagation)

bool initialized_; // it is true if the vectors are initialized

This comment has been minimized.

Copy link
@heplesser

heplesser Mar 31, 2016

Contributor

The name should be more specific. e.g., sfa_stc_initialized_, but it might be unnecessary, see comments in cpp-file.

This comment has been minimized.

Copy link
@hesam-setareh

hesam-setareh May 17, 2016

Author Contributor

I changed its name to sfa_stc_initialized_. I think we need this variable. I explain the reason in the comment of cpp-file.

S_.i_syn_in_ *= V_.P11in_;

S_.i_syn_ex_ += B_.spikes_ex_.get_value( lag );
S_.i_syn_in_ += B_.spikes_in_.get_value( lag );

This comment has been minimized.

Copy link
@heplesser

heplesser Mar 31, 2016

Contributor

L 401-405: You need to update the synaptic currents before computing the new membrane potential S_.y3_ above, and at the same time make sure that synaptic currents are updated also while the neuron is refractory.

This comment has been minimized.

Copy link
@hesam-setareh

hesam-setareh May 17, 2016

Author Contributor

Fixed.

double_t P21ex_;
double_t P21in_;
std::vector< double_t > Q33_; // for sfa
std::vector< double_t > Q44_; // for stc

This comment has been minimized.

Copy link
@heplesser

heplesser Mar 31, 2016

Contributor

I think P_sfa_ and P_stc_ would be more useful names, making clear to which quantities these propagator elements apply.

This comment has been minimized.

Copy link
@hesam-setareh

hesam-setareh May 17, 2016

Author Contributor

I changed their names to P_sfa_ and P_stc.

std::vector< double_t > Q44_; // for stc


double_t h_; //!< simulation time step in ms

This comment has been minimized.

Copy link
@heplesser

heplesser Mar 31, 2016

Contributor

No need to store this in a member variable, you can always get it from the kernel when needed using efficient inlined.

This comment has been minimized.

Copy link
@hesam-setareh

hesam-setareh May 17, 2016

Author Contributor

It has been removed.


librandom::RngPtr rng_; // random number generator of my own thread
librandom::PoissonRandomDev poisson_dev_; // random deviate generator
librandom::GammaRandomDev gamma_dev_; // random deviate generator

This comment has been minimized.

Copy link
@heplesser

heplesser Mar 31, 2016

Contributor

Do you use the poisson and gamma generators anywhere?

This comment has been minimized.

Copy link
@hesam-setareh

hesam-setareh May 17, 2016

Author Contributor

You have right. We did not need them. They are removed in the modified version.

{

// Draw random number and compare to prob to have a spike
if ( V_.rng_->drand() <= -numerics::expm1( -lambda * ( V_.h_ / 1000.0 ) ) )

This comment has been minimized.

Copy link
@heplesser

heplesser Mar 31, 2016

Contributor

This should be <, not <=, since drand() returns numbers from [0, 1), not (0, 1]. You can avoid repeated division by 1000 by rescaling lambda0 to 1/ms when the parameter is set. You should also comment why the expm1() function appears here. Most people would expect just lambda*h, but you approximate the integral in Eq 3 of the PLoS paper as lambda * h and then use the more exact expression 1 - exp(-lambda*h), don't you?

This comment has been minimized.

Copy link
@hesam-setareh

hesam-setareh May 17, 2016

Author Contributor
  1. I have changed <= to <.
  2. I rescaled the value of lambda_0 to 1/ms, then dropped the division by 1000.
  3. Thats is right. I use the exact formula 1 - exp (-lambda*h). I have added a line of comment to clarify: // hazard function is computed by 1 - exp(- lambda * dt)

std::vector< double_t > y_; //!< neuron state

double_t y0_; //!< This is piecewise constant external current

This comment has been minimized.

Copy link
@Silmathoron

Silmathoron Sep 8, 2016

Member

Better to name it I_stim_ (cf. gif_cond_exp.h).

This comment has been minimized.

Copy link
@hesam-setareh

hesam-setareh Sep 14, 2016

Author Contributor

Fixed.

&gif_cond_exp_multisynapse::
get_y_elem_< gif_cond_exp_multisynapse::State_::V_M > );
insert_( names::E_sfa, &gif_cond_exp_multisynapse::get_E_sfa_ );
insert_( names::I_stc, &gif_cond_exp_multisynapse::get_I_stc_ );

This comment has been minimized.

Copy link
@Silmathoron

Silmathoron Sep 8, 2016

Member

@heplesser can RecordablesMap deal with vectors? (i.e. can we create a get_gs function that would return all synaptic conductances?)
I think it would be best to give access to as much synaptic information as possible...
Otherwise we could at least give access to I_syn_exc and I_syn_inh...

This comment has been minimized.

Copy link
@heplesser

heplesser Sep 8, 2016

Contributor

@Silmathoron RecordablesMap can only map to functions returning a double, no vectors.

if ( tau_tmp[ i ] == ( c_m_ / g_L_ ) )
throw BadProperty(
"Membrane and synapse time constant(s) must differ. See note in "
"documentation." );

This comment has been minimized.

Copy link
@Silmathoron

Silmathoron Sep 8, 2016

Member

Which "note" are you referencing? I'm afraid I did not find it...

This comment has been minimized.

Copy link
@hesam-setareh

hesam-setareh Sep 14, 2016

Author Contributor

As Hans mentioned, we do not need to check this condition (propagator checks this condition itself). Therefore, I removed these lines.

def< double >( d, names::t_ref, t_ref_ );
def< double >( d, names::E_ex, E_ex_ );
def< double >( d, names::E_in, E_in_ );
def< int >( d, "n_synapses", num_of_receptors_ );

This comment has been minimized.

Copy link
@Silmathoron

Silmathoron Sep 8, 2016

Member

@heplesser I am wondering about this n_synapses... I know it is what is used in the original iaf_psc_alpha_multisynapse model, but maybe we should change this to a more explicit num_of_synapses name.
And I guess this should go into nest_names.h...

This comment has been minimized.

Copy link
@heplesser

heplesser Sep 8, 2016

Contributor

@Silmathoron We use n_events in the dict returned by the spike detector, so I think n_synapses is okay. num_synapses would be slightly more expressive, but not enough to warrant a change, I think. Putting n_synapses into nest_names.h would be a good thing, but that applies to other neuron models as well, so I would create a separate issue for it and let this pass for now.

{
double_t y0_; //!< This is piecewise constant external current
double_t
y3_; //!< This is the membrane potential RELATIVE TO RESTING POTENTIAL.

This comment has been minimized.

Copy link
@Silmathoron

Silmathoron Sep 8, 2016

Member

Change y0_ and y3_ (see gif_psc_exp.h)

This comment has been minimized.

Copy link
@hesam-setareh

hesam-setareh Sep 14, 2016

Author Contributor

Done.

extern const Name b; //!< Specific to Brette & Gerstner 2005 (aeif_cond-*)
extern const Name beta; //!< Specific to amat2_*
extern const Name
beta_Ca; //!< Increment in calcuim concentration with each spike

This comment has been minimized.

Copy link
@Silmathoron

Silmathoron Sep 8, 2016

Member

"calcium" (I know it's not you, but since we are at it... ^^")

This comment has been minimized.

Copy link
@hesam-setareh

hesam-setareh Sep 14, 2016

Author Contributor

Fixed.

@Silmathoron
Copy link
Member

Silmathoron commented Sep 8, 2016

Ok, I've gone through the code and it looks like it'll be great once a few details are corrected.
In addition, it's really nice to have a new example file!

Remove _t from datatypes
@hesam-setareh
Copy link
Contributor Author

hesam-setareh commented Sep 15, 2016

@heplesser , @Silmathoron
Dear Hans and Tanguy,

Thanks for your useful comments. I have applied the comments and modified GIF models. After deciding about the number of reversal potentials in multisynapse conductance-based models, I will do more things:

  • Modifying gif_cond_exp_multisynapse in order to change the number of reversal potentials
  • Adding an example of multisyanpse model (ipython format)
  • Adding a SLI testunit to check consistency for each pair of multisynapse/plain neuron model

Regards,
Hesam

# Conflicts:
#	nestkernel/nest_names.h
Copy link
Contributor

heplesser left a comment

@hesam-setareh Thank you for all your improvements! I think we are essentially there now. I would just like to ask you to improve the code around allocating y_ a bit, see my comments below. The crucial thing is to avoid C-style casts. And at least in operator=, you need to delete whatever y_ might point to if it is not 0.

With that, the code would be ready to merge from my point.

, sfa_( 0.0 )
, stc_( 0.0 )
, sfa_elems_()
, stc_elems_()
, r_ref_( 0 )
{
y_ = ( double* ) malloc( NUMBER_OF_FIXED_STATES_ELEMENTS * sizeof( double ) );

This comment has been minimized.

Copy link
@heplesser

heplesser Sep 29, 2016

Contributor

You need this allocation several places in this code, so it might be an idea to turn it into a method. That method then could also check if y_ != 0 and call delete first in that case to avoid memory leaks, and update size_neuron_state_. Also, Bjarne Stroustrup advises against using C-style casts, rather use

reinterpret_cast < double* >( ... )

This comment has been minimized.

Copy link
@hesam-setareh

hesam-setareh Oct 3, 2016

Author Contributor

I have added a new method (neuron_state_memory_allocate) to do this job. A also replaced the old fashion casting with reinterpret_cast.

@@ -174,7 +177,10 @@ nest::gif_cond_exp_multisynapse::State_::State_( const State_& s )
for ( size_t i = 0; i < stc_elems_.size(); ++i )
stc_elems_[ i ] = s.stc_elems_[ i ];

y_ = s.y_;
size_neuron_state_ = s.size_neuron_state_;
y_ = ( double* ) malloc( size_neuron_state_ * sizeof( double ) );

This comment has been minimized.

Copy link
@heplesser

heplesser Sep 29, 2016

Contributor

See comment on allocation above.

This comment has been minimized.

Copy link
@hesam-setareh

hesam-setareh Oct 3, 2016

Author Contributor

Fixed.

@@ -193,7 +197,12 @@ nest::gif_cond_exp_multisynapse::State_&
for ( size_t i = 0; i < stc_elems_.size(); ++i )
stc_elems_[ i ] = s.stc_elems_[ i ];

y0_ = s.y0_;
size_neuron_state_ = s.size_neuron_state_;
y_ = ( double* ) malloc( size_neuron_state_ * sizeof( double ) );

This comment has been minimized.

Copy link
@heplesser

heplesser Sep 29, 2016

Contributor

See comment on allocation above.

This comment has been minimized.

Copy link
@hesam-setareh

hesam-setareh Oct 3, 2016

Author Contributor

Fixed.

@@ -393,6 +399,9 @@ nest::gif_cond_exp_multisynapse::~gif_cond_exp_multisynapse()
gsl_odeiv_control_free( B_.c_ );
if ( B_.e_ )
gsl_odeiv_evolve_free( B_.e_ );

if ( S_.size_neuron_state_ > 0 )

This comment has been minimized.

Copy link
@heplesser

heplesser Sep 29, 2016

Contributor

I would rather use if ( S_.y_ != 0 ) as test.

This comment has been minimized.

Copy link
@hesam-setareh

hesam-setareh Oct 3, 2016

Author Contributor

Now, I use ( S_.y_ != NULL).

This comment has been minimized.

Copy link
@heplesser

heplesser Oct 4, 2016

Contributor

Bjarne Stroustrup actually recommends to test against zero-pointers as p != 0 in C++ instead of comparing to NULL (which is recommended for C), since C++ type checking will ensure that whichever type 0 is it will be converted to pointer type before comparison so that the comparison is safe. NULL on the other hand, might be defined to be anything. See "The C++ Programming Language", Ch 5.1.1 Zero.

This comment has been minimized.

Copy link
@hesam-setareh

hesam-setareh Oct 5, 2016

Author Contributor

OK. Thanks for your attention. I replaced NULL with 0.

Resolving merge conflicts
@heplesser
Copy link
Contributor

heplesser commented Oct 4, 2016

@hesam-setareh Did you possibly forget to commit or push your most recent changes? The last commit I find on Github is from 29 September and the changes you mention in your comments a few hours ago are not visible to me.

@hesam-setareh
Copy link
Contributor Author

hesam-setareh commented Oct 5, 2016

@heplesser
Dear Hans,
I have done the modifications and pushed the new version of gif_cond_exp_multisyanpse. I was about to commit two days ago, but I found a bug in copy constructor of State. That is why it took 2 days to commit the changes.
In the copy constructor, I had to set y_ to 0 before passing it to the memory allocation method. Otherwise the method tries to free a random location and leads to an error.

}

double
get_input_currents_ex_() const

This comment has been minimized.

Copy link
@Silmathoron

Silmathoron Oct 5, 2016

Member

If possible, could you replace get_input_currents_ex/in_ by get_I_syn_ex/in_ and rename S_.i_syn_ex_ to S_.I_syn_ex_? I'm sorry, I know this is a bit tedious, but since people tend to build on previous models, I'd rather have as many of them as coherent with the naming conventions as possible ;)

This comment has been minimized.

Copy link
@hesam-setareh

hesam-setareh Oct 6, 2016

Author Contributor

Thanks for your comments. I have changed the name of synaptic current variables. I also add several lines of comment to gif_population.py.

Copy link
Contributor

heplesser left a comment

@hesam-setareh Thanks for the improvements! In my view, there are just three tiny details left (names for recordables, name of neuron_state_memory_allocate and a missing comment in a test (see comment by @Silmathoron).

The modification of handling of input weights and of reversal potentials should go into a later PR; I don't think they should block this PR.

void set( const DictionaryDatum&, const Parameters_& );

private:
void neuron_state_memory_allocate( int new_size );

This comment has been minimized.

Copy link
@heplesser

heplesser Oct 6, 2016

Contributor

Since it is private, the name should end with a _.

This comment has been minimized.

Copy link
@hesam-setareh

hesam-setareh Oct 6, 2016

Author Contributor

Fixed. Thank you.

Copy link
Member

Silmathoron left a comment

All good for me!

@heplesser
Copy link
Contributor

heplesser commented Oct 7, 2016

Dear @hesam-setareh ! Thank you very much for porting the GIF models to NEST and for your hard work during a long code review! It is a great pleasure to merge your code :).

@heplesser heplesser merged commit 75fd135 into nest:master Oct 7, 2016
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

6 participants
You can’t perform that action at this time.