Skip to content

Commit

Permalink
move precise spike time offset from Event to Time class
Browse files Browse the repository at this point in the history
  • Loading branch information
C.A.P. Linssen committed Dec 1, 2022
1 parent 6ba79f1 commit 824a144
Show file tree
Hide file tree
Showing 32 changed files with 66 additions and 174 deletions.
7 changes: 0 additions & 7 deletions models/clopath_synapse.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,6 @@ synapses can only be connected to neuron models that are capable of doing this
archiving. So far, compatible models are ``aeif_psc_delta_clopath`` and
``hh_psc_alpha_clopath``.
.. warning::
This synaptic plasticity rule does not take
:ref:`precise spike timing <sim_precise_spike_times>` into
account. When calculating the weight update, the precise spike time part
of the timestamp is ignored.
See also [2]_, [3]_.
Parameters
Expand Down
17 changes: 9 additions & 8 deletions models/cont_delay_synapse.h
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,8 @@ class cont_delay_synapse : public Connection< targetidentifierT >
/**
* Send an event to the receiver of this connection.
* \param e The event to send
* \param p The port under which this connection is stored in the Connector.
* \param t The thread on which this connection is stored.
* \param cp common properties of all synapses (empty).
*/
template < typename targetidentifierT >
inline void
Expand All @@ -211,25 +212,25 @@ cont_delay_synapse< targetidentifierT >::send( Event& e, thread t, const CommonS
e.set_receiver( *get_target( t ) );
e.set_weight( weight_ );
e.set_rport( get_rport() );
double orig_event_offset = e.get_stamp().get_offset();
double total_offset = orig_event_offset + delay_offset_;
// As far as i have seen, offsets are outside of tics regime provided
const double orig_event_offset = e.get_stamp().get_offset();
const double total_offset = orig_event_offset + delay_offset_;
// As far as I have seen, offsets are outside of tics regime provided
// by the Time-class to allow more precise spike-times, hence comparing
// on the tics level here is not reasonable. Still, the double comparison
// seems save.
// seems safe.
if ( total_offset < Time::get_resolution().get_ms() )
{
e.set_delay_steps( get_delay_steps() );
e.set_offset( total_offset );
e.get_stamp().set_offset( total_offset );
}
else
{
e.set_delay_steps( get_delay_steps() - 1 );
e.set_offset( total_offset - Time::get_resolution().get_ms() );
e.get_stamp().set_offset( total_offset - Time::get_resolution().get_ms() );
}
e();
// reset offset to original value
e.set_offset( orig_event_offset );
e.get_stamp().set_offset( orig_event_offset );
}

} // of namespace nest
Expand Down
7 changes: 0 additions & 7 deletions models/ht_synapse.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,6 @@ Synaptic dynamics are given by
For implementation details see:
`HillTononi_model <../model_details/HillTononiModels.ipynb>`_
.. warning::
This synaptic plasticity rule does not take
:ref:`precise spike timing <sim_precise_spike_times>` into
account. When calculating the weight update, the precise spike time part
of the timestamp is ignored.
Parameters
++++++++++
Expand Down
2 changes: 1 addition & 1 deletion models/iaf_chxk_2008.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ nest::iaf_chxk_2008::update( Time const& origin, const long from, const long to
set_spiketime( Time::step( origin.get_steps() + lag + 1 ) );

SpikeEvent se;
se.set_offset( dt );
se.get_stamp().set_offset( dt );
kernel().event_delivery_manager.send( *this, se, lag );
}

Expand Down
4 changes: 2 additions & 2 deletions models/iaf_psc_alpha_ps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ nest::iaf_psc_alpha_ps::emit_spike_( Time const& origin, const long lag, const d
// send spike
set_spiketime( Time::step( S_.last_spike_step_ ), S_.last_spike_offset_ );
SpikeEvent se;
se.set_offset( S_.last_spike_offset_ );
se.get_stamp().set_offset( S_.last_spike_offset_ );
kernel().event_delivery_manager.send( *this, se, lag );

return;
Expand All @@ -566,7 +566,7 @@ nest::iaf_psc_alpha_ps::emit_instant_spike_( Time const& origin, const long lag,
// send spike
set_spiketime( Time::step( S_.last_spike_step_ ), S_.last_spike_offset_ );
SpikeEvent se;
se.set_offset( S_.last_spike_offset_ );
se.get_stamp().set_offset( S_.last_spike_offset_ );
kernel().event_delivery_manager.send( *this, se, lag );

return;
Expand Down
4 changes: 2 additions & 2 deletions models/iaf_psc_delta_ps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ nest::iaf_psc_delta_ps::emit_spike_( Time const& origin, const long lag, const d
// send spike
set_spiketime( Time::step( S_.last_spike_step_ ), S_.last_spike_offset_ );
SpikeEvent se;
se.set_offset( S_.last_spike_offset_ );
se.get_stamp().set_offset( S_.last_spike_offset_ );
kernel().event_delivery_manager.send( *this, se, lag );
}

Expand All @@ -497,7 +497,7 @@ nest::iaf_psc_delta_ps::emit_instant_spike_( Time const& origin, const long lag,
// send spike
set_spiketime( Time::step( S_.last_spike_step_ ), S_.last_spike_offset_ );
SpikeEvent se;
se.set_offset( S_.last_spike_offset_ );
se.get_stamp().set_offset( S_.last_spike_offset_ );
kernel().event_delivery_manager.send( *this, se, lag );
}

Expand Down
4 changes: 2 additions & 2 deletions models/iaf_psc_exp_ps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ nest::iaf_psc_exp_ps::emit_spike_( const Time& origin, const long lag, const dou
set_spiketime( Time::step( S_.last_spike_step_ ), S_.last_spike_offset_ );
SpikeEvent se;

se.set_offset( S_.last_spike_offset_ );
se.get_stamp().set_offset( S_.last_spike_offset_ );
kernel().event_delivery_manager.send( *this, se, lag );
}

Expand All @@ -534,7 +534,7 @@ nest::iaf_psc_exp_ps::emit_instant_spike_( const Time& origin, const long lag, c
set_spiketime( Time::step( S_.last_spike_step_ ), S_.last_spike_offset_ );
SpikeEvent se;

se.set_offset( S_.last_spike_offset_ );
se.get_stamp().set_offset( S_.last_spike_offset_ );
kernel().event_delivery_manager.send( *this, se, lag );
}

Expand Down
4 changes: 2 additions & 2 deletions models/iaf_psc_exp_ps_lossless.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ nest::iaf_psc_exp_ps_lossless::emit_spike_( const Time& origin, const long lag,
set_spiketime( Time::step( S_.last_spike_step_ ), S_.last_spike_offset_ );
SpikeEvent se;

se.set_offset( S_.last_spike_offset_ );
se.get_stamp().set_offset( S_.last_spike_offset_ );
kernel().event_delivery_manager.send( *this, se, lag );
}

Expand All @@ -577,7 +577,7 @@ nest::iaf_psc_exp_ps_lossless::emit_instant_spike_( const Time& origin, const lo
set_spiketime( Time::step( S_.last_spike_step_ ), S_.last_spike_offset_ );
SpikeEvent se;

se.set_offset( S_.last_spike_offset_ );
se.get_stamp().set_offset( S_.last_spike_offset_ );
kernel().event_delivery_manager.send( *this, se, lag );
}

Expand Down
7 changes: 0 additions & 7 deletions models/jonke_synapse.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,6 @@ and
This makes it possible to implement update rules which approximate the
rule stated in [1]_, and for examples, the rules given in [2]_ and [3]_.
.. warning::
This synaptic plasticity rule does not take
:ref:`precise spike timing <sim_precise_spike_times>` into
account. When calculating the weight update, the precise spike time part
of the timestamp is ignored.
Parameters
++++++++++
Expand Down
2 changes: 1 addition & 1 deletion models/parrot_neuron_ps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ parrot_neuron_ps::update( Time const& origin, long const from, long const to )
// send spike
SpikeEvent se;
se.set_multiplicity( multiplicity );
se.set_offset( ev_offset );
se.get_stamp().set_offset( ev_offset );
kernel().event_delivery_manager.send( *this, se, lag );

for ( unsigned long i = 0; i < multiplicity; ++i )
Expand Down
2 changes: 1 addition & 1 deletion models/poisson_generator_ps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ nest::poisson_generator_ps::event_hook( DSSpikeEvent& e )
while ( nextspk.first <= V_.t_max_active_ )
{
e.set_stamp( nextspk.first );
e.set_offset( nextspk.second );
e.get_stamp().set_offset( nextspk.second );
e.get_receiver().handle( e );

// Draw time of next spike
Expand Down
7 changes: 0 additions & 7 deletions models/quantal_stp_synapse.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,6 @@ equations is taken from Maass and Markram 2002 [3]_.
The connection weight is interpreted as the maximal weight that can
be obtained if all n release sites are activated.
.. warning::
This synaptic plasticity rule does not take
:ref:`precise spike timing <sim_precise_spike_times>` into
account. When calculating the weight update, the precise spike time part
of the timestamp is ignored.
Parameters
++++++++++
Expand Down
2 changes: 1 addition & 1 deletion models/spike_generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ nest::spike_generator::update( Time const& sliceT0, const long from, const long

if ( P_.precise_times_ )
{
se->set_offset( P_.spike_offsets_[ S_.position_ ] );
se->get_stamp().set_offset( P_.spike_offsets_[ S_.position_ ] );
}

if ( not P_.spike_multiplicities_.empty() )
Expand Down
7 changes: 0 additions & 7 deletions models/stdp_dopamine_synapse.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,6 @@ of neurons. The spikes emitted by the pool of dopamine neurons are
delivered to the synapse via the assigned volume transmitter. The
dopaminergic dynamics is calculated in the synapse itself.
.. warning::
This synaptic plasticity rule does not take
:ref:`precise spike timing <sim_precise_spike_times>` into
account. When calculating the weight update, the precise spike time part
of the timestamp is ignored.
Parameters
++++++++++
Expand Down
7 changes: 0 additions & 7 deletions models/stdp_nn_pre_centered_synapse.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,6 @@ occurrence, and is reset to 0 on a post-spike occurrence. The postsynaptic
trace (implemented on the postsynaptic neuron side) decays with the time
constant ``tau_minus`` and increases to 1 on a post-spike occurrence.
.. warning::
This synaptic plasticity rule does not take
:ref:`precise spike timing <sim_precise_spike_times>` into
account. When calculating the weight update, the precise spike time part
of the timestamp is ignored.
Parameters
++++++++++
Expand Down
7 changes: 0 additions & 7 deletions models/stdp_nn_restr_synapse.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,6 @@ eligibility trace [1]_ (implemented on the postsynaptic neuron side). It
decays exponentially with the time constant ``tau_minus`` and increases to 1 on
a post-spike occurrence (instead of increasing by 1 as in ``stdp_synapse``).
.. warning::
This synaptic plasticity rule does not take
:ref:`precise spike timing <sim_precise_spike_times>` into
account. When calculating the weight update, the precise spike time part
of the timestamp is ignored.
Parameters
++++++++++
Expand Down
7 changes: 0 additions & 7 deletions models/stdp_nn_symm_synapse.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,6 @@ occurrence. The postsynaptic trace (implemented on the postsynaptic neuron
side) decays with the time constant ``tau_minus`` and increases to 1 on a
post-spike occurrence.
.. warning::
This synaptic plasticity rule does not take
:ref:`precise spike timing <sim_precise_spike_times>` into
account. When calculating the weight update, the precise spike time part
of the timestamp is ignored.
Parameters
++++++++++
Expand Down
7 changes: 0 additions & 7 deletions models/stdp_pl_synapse_hom.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,6 @@ Parameters
The parameters can only be set by SetDefaults and apply to all synapses of
the model.
.. warning::
This synaptic plasticity rule does not take
:ref:`precise spike timing <sim_precise_spike_times>` into
account. When calculating the weight update, the precise spike time part
of the timestamp is ignored.
References
++++++++++
Expand Down
7 changes: 0 additions & 7 deletions models/stdp_synapse.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,6 @@ Description
dependent plasticity (as defined in [1]_). Here the weight dependence
exponent can be set separately for potentiation and depression.
.. warning::
This synaptic plasticity rule does not take
:ref:`precise spike timing <sim_precise_spike_times>` into
account. When calculating the weight update, the precise spike time part
of the timestamp is ignored.
See also [2]_, [3]_, [4]_.
Parameters
Expand Down
7 changes: 0 additions & 7 deletions models/stdp_synapse_facetshw_hom.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,6 @@ The modified spike pairing scheme requires the calculation of ``tau_minus_``
within this synapse and not at the neuron site via ``Kplus_`` like in
``stdp_synapse_hom``.
.. warning::
This synaptic plasticity rule does not take
:ref:`precise spike timing <sim_precise_spike_times>` into
account. When calculating the weight update, the precise spike time part
of the timestamp is ignored.
The synapse IDs are assigned to each synapse in an ascending order (0,1,2,
...) according their first presynaptic activity and is used to group synapses
that are updated at once. It is possible to avoid activity dependent synapse
Expand Down
7 changes: 0 additions & 7 deletions models/stdp_synapse_hom.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,6 @@ exponent can be set separately for potentiation and depression.
* Guetig STDP [1]_ mu_plus = mu_minus = [0.0,1.0]
* van Rossum STDP [4]_ mu_plus = 0.0 mu_minus = 1.0
.. warning::
This synaptic plasticity rule does not take
:ref:`precise spike timing <sim_precise_spike_times>` into
account. When calculating the weight update, the precise spike time part
of the timestamp is ignored.
Parameters
++++++++++
Expand Down
7 changes: 0 additions & 7 deletions models/stdp_triplet_synapse.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,6 @@ plasticity accounting for spike triplet effects (as defined in [1]_).
without changing the postsynaptic archiving-node (clip the traces to a
maximum of 1).
.. warning::
This synaptic plasticity rule does not take
:ref:`precise spike timing <sim_precise_spike_times>` into
account. When calculating the weight update, the precise spike time part
of the timestamp is ignored.
Parameters
++++++++++
Expand Down
7 changes: 0 additions & 7 deletions models/tsodyks2_synapse.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,6 @@ The parameter ``A_se`` from the publications is represented by the
synaptic weight. The variable x in the synapse properties is the
factor that scales the synaptic weight.
.. warning::
This synaptic plasticity rule does not take
:ref:`precise spike timing <sim_precise_spike_times>` into
account. When calculating the weight update, the precise spike time part
of the timestamp is ignored.
See also [3]_.
Under identical conditions, the tsodyks2_synapse produces slightly
Expand Down
7 changes: 0 additions & 7 deletions models/tsodyks_synapse.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,6 @@ neuron, however, might choose to have a synaptic current that is not necessarily
identical to the concentration of transmitter ``y(t)`` in the synaptic cleft. It may
realize an arbitrary postsynaptic effect depending on ``y(t)``.
.. warning::
This synaptic plasticity rule does not take
:ref:`precise spike timing <sim_precise_spike_times>` into
account. When calculating the weight update, the precise spike time part
of the timestamp is ignored.
Parameters
++++++++++
Expand Down
7 changes: 0 additions & 7 deletions models/tsodyks_synapse_hom.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,6 @@ might choose to have a synaptic current that is not necessarily identical to
the concentration of transmitter y(t) in the synaptic cleft. It may realize
an arbitrary postsynaptic effect depending on y(t).
.. warning::
This synaptic plasticity rule does not take
:ref:`precise spike timing <sim_precise_spike_times>` into
account. When calculating the weight update, the precise spike time part
of the timestamp is ignored.
Parameters
++++++++++
Expand Down
7 changes: 0 additions & 7 deletions models/urbanczik_synapse.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,6 @@ which is continuous in time. Therefore they can only be connected to neuron
models that are capable of doing this archiving. So far, the only compatible
model is :doc:`pp_cond_exp_mc_urbanczik <pp_cond_exp_mc_urbanczik>`.
.. warning::
This synaptic plasticity rule does not take
:ref:`precise spike timing <sim_precise_spike_times>` into
account. When calculating the weight update, the precise spike time part
of the timestamp is ignored.
Parameters
++++++++++
Expand Down
Loading

0 comments on commit 824a144

Please sign in to comment.