This pull request addresses discrepancies in the usage of the function EpropArchivingNode<HistEntryT>::write_update_to_history between the bsshslm_2020 models and other models.
Discrepancy:
bsshslm_2020 Models:
These models provide update intervals to write_update_to_history that are relative to the neurons' timelines. To align these times with the origin, an adjustment via the addition of shift is necessary.
Non-bsshslm_2020 Models:
These models input spike times directly to write_update_to_history. Since the spike times are already aligned with the origin, adding shift is not only unnecessary but also causes adverse effects. Specifically, it results in the accidental deletion of extra eprop_history_ entries each time erase_used_eprop_history is triggered. This deletion leads to misalignment of the archive entries with respect to the spiking variables used during the compute_gradient function.
This issue went undetected previously due to:
[1] The sine-waves task was primarily used during development. This task features lazy neuron activity within a non-sparsely connected network (so every neuron has the lazy ones at the presynaptic end), which meant that the archive was seldom cleared sufficiently for any single neuron, masking the underlying problem.
[2] The function std::lower_bound() employed in get_eprop_history(const long time_step) returns the first entry where t_ >= time_step. Consequently, no significant errors were observed even when an exact match for t_ == time_step was not found, further obscuring the issue.
[3] The impact of the problem on learning performance is minimal, thanks to the network's inherent robustness to shifts in data.
Proposed Solution:
To effectively manage these divergent cases, I propose the following modifications:
Introduce a boolean variable is_bsshslm_2020_model in both register_eprop_connection and write_update_to_history functions. This variable will enable the program to differentiate and appropriately handle the updates based on the model type.
Modify the parameters used to log updates in the history from using t_previous_spike and t_spike directly to using adjusted times t_previous_spike - delay_rec_out and t_spike - delay_rec_out. This change ensures that the intended region of eprop_history (initially [t_previous_spike, t_spike)) is correctly mapped to [t_previous_spike - delay_rec_out, t_spike - delay_rec_out), as depicted in Figure 1.
FIGURE 1 remark: The write_learning_signal_to_history function aligns L^t with psi^t in the eprop_archive
Objective of the PR:
This pull request addresses discrepancies in the usage of the function
EpropArchivingNode<HistEntryT>::write_update_to_history
between thebsshslm_2020
models and other models.Discrepancy:
bsshslm_2020 Models:
write_update_to_history
that are relative to the neurons' timelines. To align these times with the origin, an adjustment via the addition ofshift
is necessary.Non-bsshslm_2020 Models:
write_update_to_history
. Since the spike times are already aligned with the origin, addingshift
is not only unnecessary but also causes adverse effects. Specifically, it results in the accidental deletion of extraeprop_history_
entries each timeerase_used_eprop_history
is triggered. This deletion leads to misalignment of the archive entries with respect to the spiking variables used during thecompute_gradient
function.This issue went undetected previously due to:
std::lower_bound()
employed inget_eprop_history(const long time_step)
returns the first entry wheret_ >= time_step
. Consequently, no significant errors were observed even when an exact match fort_ == time_step
was not found, further obscuring the issue.Proposed Solution:
To effectively manage these divergent cases, I propose the following modifications:
Introduce a boolean variable
is_bsshslm_2020_model
in bothregister_eprop_connection
andwrite_update_to_history
functions. This variable will enable the program to differentiate and appropriately handle the updates based on the model type.Modify the parameters used to log updates in the history from using
t_previous_spike
andt_spike
directly to using adjusted timest_previous_spike - delay_rec_out
andt_spike - delay_rec_out
. This change ensures that the intended region ofeprop_history
(initially[t_previous_spike, t_spike)
) is correctly mapped to[t_previous_spike - delay_rec_out, t_spike - delay_rec_out)
, as depicted in Figure 1.FIGURE 1 remark: The
write_learning_signal_to_history
function alignsL^t
withpsi^t
in theeprop_archive