Skip to content

Commit

Permalink
Make stdp_facetshw synapse consistent with PR#924
Browse files Browse the repository at this point in the history
PR nest#924 fixed direct comparison of delta_t to zero in STDP.
Among other things, that PR added the assertion
  minus_dt < 1.0 * stdp_numerical_imprecision
to all spike-timing-dependent plasticity models. Except
stdp_facetshw synapse, which is fixed in this commit.

In stdp_facetshw synapse the direct comparison to zero was
acceptable, because of the initialization
  double minus_dt = 0;
  double plus_dt = 0;
So, the direct comparison to zero here just checks if `minus_dt`
or `plus_dt` retain their initial values, which basically means
the same as checking `if ( start != finish )`. Still, I remove
the comparison to zero for clarity, since it is redundant.
  • Loading branch information
aserenko committed May 4, 2018
1 parent 79bbbb0 commit 6975f94
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions models/stdp_connection_facetshw_hom.h
Expand Up @@ -496,21 +496,19 @@ STDPFACETSHWConnectionHom< targetidentifierT >::send( Event& e,
if ( start != finish ) // take only first postspike after last prespike
{
minus_dt = t_lastspike - ( start->t_ + dendritic_delay );

// get_history() should make sure that
// start->t_ > t_lastspike - dendritic_delay, i.e. minus_dt < 0
assert( minus_dt < -1.0 * kernel().connection_manager.get_stdp_eps() );

a_causal_ += std::exp( minus_dt / cp.tau_plus_ );
}

if ( start != finish ) // take only last postspike before current spike
{
--finish;
plus_dt = ( finish->t_ + dendritic_delay ) - t_spike;
}

if ( minus_dt != 0 )
{
a_causal_ += std::exp( minus_dt / cp.tau_plus_ );
}

if ( plus_dt != 0 )
{
a_acausal_ += std::exp( plus_dt / cp.tau_minus_ );
}

Expand Down

0 comments on commit 6975f94

Please sign in to comment.