From 3288f218eb54dee7523773741835c0e3b768418f Mon Sep 17 00:00:00 2001 From: clinssen Date: Thu, 20 Jun 2024 10:24:43 +0200 Subject: [PATCH 1/3] Update C++ docstrings for extended histentry --- nestkernel/histentry.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/nestkernel/histentry.h b/nestkernel/histentry.h index 0d5b1392bf..caad0b882c 100644 --- a/nestkernel/histentry.h +++ b/nestkernel/histentry.h @@ -40,20 +40,22 @@ class histentry double t_; //!< point in time when spike occurred (in ms) double Kminus_; //!< value of Kminus at that time double Kminus_triplet_; //!< value of triplet STDP Kminus at that time - size_t access_counter_; //!< access counter to enable removal of the entry, once all neurons read it + size_t access_counter_; //! how often this entry was accessed (to enable removal, once read by all synapses which need it) }; -// entry in the history of plasticity rules which consider additional factors +/** + * Class to represent a single entry in the spiking history of the ClopathArchivingNode or the UrbanczikArchivingNode. + * + * These history entries typically represent continuously-evolving values in time, so history timestamps correspond to ``nest.biological_time`` in simulation resolution rather than times of spikes. + */ class histentry_extended { public: histentry_extended( double t, double dw, size_t access_counter ); - double t_; //!< point in time when spike occurred (in ms) + double t_; //!< point in time for the history entry spike occurred (in ms) double dw_; - //! how often this entry was accessed (to enable removal, once read by all - //! neurons which need it) - size_t access_counter_; + size_t access_counter_; //! how often this entry was accessed (to enable removal, once read by all synapses which need it) friend bool operator<( const histentry_extended he, double t ); }; From e772aec4391c03cd8132674dcd4dabab91673122 Mon Sep 17 00:00:00 2001 From: "C.A.P. Linssen" Date: Thu, 20 Jun 2024 12:00:57 +0200 Subject: [PATCH 2/3] Update C++ docstrings for extended histentry --- models/clopath_synapse.h | 11 ++++++----- nestkernel/histentry.h | 9 ++++++--- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/models/clopath_synapse.h b/models/clopath_synapse.h index 0252e7f019..0eb4268b98 100644 --- a/models/clopath_synapse.h +++ b/models/clopath_synapse.h @@ -247,16 +247,17 @@ clopath_synapse< targetidentifierT >::send( Event& e, size_t t, const CommonSyna std::deque< histentry_extended >::iterator start; std::deque< histentry_extended >::iterator finish; + // facilitation due to postsynaptic activity since last pre-synaptic spike + // For a new synapse, t_lastspike_ contains the point in time of the last // spike. So we initially read the // history(t_last_spike - dendritic_delay, ..., T_spike-dendritic_delay] // which increases the access counter for these entries. - // At registration, all entries' access counters of - // history[0, ..., t_last_spike - dendritic_delay] have been - // incremented by ArchivingNode::register_stdp_connection(). See bug #218 for - // details. + + // Note that in the STDP synapse, this loop iterates over post spikes, + // whereas here we loop over continuous-time history entries (see + // histentry_extended). target->get_LTP_history( t_lastspike_ - dendritic_delay, t_spike - dendritic_delay, &start, &finish ); - // facilitation due to postsynaptic activity since last pre-synaptic spike while ( start != finish ) { const double minus_dt = t_lastspike_ - ( start->t_ + dendritic_delay ); diff --git a/nestkernel/histentry.h b/nestkernel/histentry.h index caad0b882c..04c7c5f158 100644 --- a/nestkernel/histentry.h +++ b/nestkernel/histentry.h @@ -40,13 +40,15 @@ class histentry double t_; //!< point in time when spike occurred (in ms) double Kminus_; //!< value of Kminus at that time double Kminus_triplet_; //!< value of triplet STDP Kminus at that time - size_t access_counter_; //! how often this entry was accessed (to enable removal, once read by all synapses which need it) + size_t + access_counter_; //! how often this entry was accessed (to enable removal, once read by all synapses which need it) }; /** * Class to represent a single entry in the spiking history of the ClopathArchivingNode or the UrbanczikArchivingNode. * - * These history entries typically represent continuously-evolving values in time, so history timestamps correspond to ``nest.biological_time`` in simulation resolution rather than times of spikes. + * These history entries typically represent continuously-evolving values in time, so history timestamps correspond to + * ``nest.biological_time`` in simulation resolution rather than times of spikes. */ class histentry_extended { @@ -55,7 +57,8 @@ class histentry_extended double t_; //!< point in time for the history entry spike occurred (in ms) double dw_; - size_t access_counter_; //! how often this entry was accessed (to enable removal, once read by all synapses which need it) + size_t + access_counter_; //! how often this entry was accessed (to enable removal, once read by all synapses which need it) friend bool operator<( const histentry_extended he, double t ); }; From c8db4eadb5a757943e3919824ab998426c63e10e Mon Sep 17 00:00:00 2001 From: "C.A.P. Linssen" Date: Mon, 9 Sep 2024 10:22:36 +0200 Subject: [PATCH 3/3] update C++ docstrings for extended histentry --- models/clopath_synapse.h | 5 +++-- nestkernel/histentry.h | 8 +++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/models/clopath_synapse.h b/models/clopath_synapse.h index 0eb4268b98..331907f0b2 100644 --- a/models/clopath_synapse.h +++ b/models/clopath_synapse.h @@ -247,8 +247,6 @@ clopath_synapse< targetidentifierT >::send( Event& e, size_t t, const CommonSyna std::deque< histentry_extended >::iterator start; std::deque< histentry_extended >::iterator finish; - // facilitation due to postsynaptic activity since last pre-synaptic spike - // For a new synapse, t_lastspike_ contains the point in time of the last // spike. So we initially read the // history(t_last_spike - dendritic_delay, ..., T_spike-dendritic_delay] @@ -261,7 +259,10 @@ clopath_synapse< targetidentifierT >::send( Event& e, size_t t, const CommonSyna while ( start != finish ) { const double minus_dt = t_lastspike_ - ( start->t_ + dendritic_delay ); + + // facilitation due to postsynaptic activity since last pre-synaptic spike weight_ = facilitate_( weight_, start->dw_, x_bar_ * exp( minus_dt / tau_x_ ) ); + ++start; } diff --git a/nestkernel/histentry.h b/nestkernel/histentry.h index 04c7c5f158..413aebe505 100644 --- a/nestkernel/histentry.h +++ b/nestkernel/histentry.h @@ -40,8 +40,7 @@ class histentry double t_; //!< point in time when spike occurred (in ms) double Kminus_; //!< value of Kminus at that time double Kminus_triplet_; //!< value of triplet STDP Kminus at that time - size_t - access_counter_; //! how often this entry was accessed (to enable removal, once read by all synapses which need it) + size_t access_counter_; //! how often this entry was accessed (to enable removal, once read by all synapses which need it) }; /** @@ -55,10 +54,9 @@ class histentry_extended public: histentry_extended( double t, double dw, size_t access_counter ); - double t_; //!< point in time for the history entry spike occurred (in ms) + double t_; //!< point in time for the history entry (in ms) double dw_; - size_t - access_counter_; //! how often this entry was accessed (to enable removal, once read by all synapses which need it) + size_t access_counter_; //! how often this entry was accessed (to enable removal, once read by all synapses which need it) friend bool operator<( const histentry_extended he, double t ); };