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

Apply delay check correctly and increment skipped in mad impl #1266

Merged
merged 4 commits into from
Jan 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ static inline neuromodulated_synapse_t process_plastic_synapse(
&post_event_history[s.index]);

// Add weight to ring-buffer entry, but only if not too late
if (s.delay_dendritic + s.delay_axonal >= colour_delay) {
if (s.delay_dendritic + s.delay_axonal > colour_delay) {
synapse_dynamics_stdp_update_ring_buffers(ring_buffers, s,
final_state.weight);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ struct synapse_row_plastic_data_t {
plastic_synapse_t synapses[];
};

extern uint32_t skipped_synapses;

//---------------------------------------
//! \brief Synapse update loop core
//! \param[in] time: The current time
Expand Down Expand Up @@ -214,10 +216,12 @@ static inline plastic_synapse_t process_plastic_synapse(
&post_event_history[s.index]);

// Add weight to ring-buffer entry, but only if not too late
if (s.delay_axonal + s.delay_dendritic >= colour_delay) {
if (s.delay_axonal + s.delay_dendritic > colour_delay) {
int32_t weight = synapse_structure_get_final_weight(final_state);
synapse_dynamics_stdp_update_ring_buffers(ring_buffers, s, weight);
}
} else {
skipped_synapses++;
}

return synapse_structure_get_final_synaptic_word(final_state);
}
Expand Down
5 changes: 3 additions & 2 deletions neural_modelling/src/neuron/synapses.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,9 @@ static inline bool process_fixed_synapses(
// (should auto increment pointer in single instruction)
uint32_t synaptic_word = *synaptic_words++;

// If the delay is too small, skip
if ((synaptic_word & synapse_delay_mask_shifted) < colour_delay_shifted) {
// If the (shifted) delay is non zero and too small, skip
if (((synaptic_word & synapse_delay_mask_shifted) != 0) &&
((synaptic_word & synapse_delay_mask_shifted) <= colour_delay_shifted)) {
skipped_synapses++;
continue;
}
Expand Down