Undesired behaviour STDP mechanism

71 views
Skip to first unread message

Daniel Casanueva Morato

unread,
Dec 14, 2024, 7:37:28 AM12/14/24
to SpiNNaker Users Group
Hi,

We continue to work on exploring new SNN-based memory systems and have encountered another problem along the way. As this problem is not related to the one in the previous thread, we have opened this new thread to address it.

We are working on an SNN deployed in SpiNNaker with several interconnected populations with a single input layer and a single output layer. Among these populations there are some connected with synapses where we apply the STDP learning mechanism for learning certain features of the input information.  

In total, we have 4 pairs of populations connected with STDP synapses with an all-to-all relationship. Focusing on these populations, the postsynaptic ones are composed of a neuron model that we have developed from the standard LIF model of the library (the error is the same for us using the standard LIF model ‘IF_curr_exp’). All network parameters have been configured in such a way that given an input, the network is able to learn it. For a network size defined by 2 of the population pairs with STDP of 4 presynaptic neurons x 16 postsynaptic neurons and by the other 2 population pairs with STDP of 16 presynaptic neurons x 4 postsynaptic neurons, the network works as expected. When we increase the number of pre- and post-synaptic neurons in the populations with 4 neurons, it works correctly, but when we increase the number of pre- and post-synaptic neurons from 16 to 17 (or any size larger than 16), the STDP mechanism stops working. By stop working we mean that all the weights collapse to 0 as soon as the presynaptic neuron is activated for the first time. Synapses that start at the highest possible weight go to 0 and those that start at 0 stay at 0.

The attached image is an approximation of what the network we are working with would look like. The hidden layers are formed by a set of interconnected populations of neurons with static synapses.

We have been debugging using the log_info() function to check a little bit what is going on and we have found:
- In the STDP, whenever the variable ‘valid’ is 1, the variable ‘accumulation’ is 0.
- Presynaptic and postsynaptic events are computed.

We would very much appreciate some guidance as to where the problem may be located.

Thank you very much in advance.
Best regards,
Daniel
snn_example.png

Pablo Sánchez

unread,
Dec 17, 2024, 9:18:29 AM12/17/24
to SpiNNaker Users Group
Greetings,

I am Daniel's colleague, currently working on the same project. I am writing this comment to update the thread with relevant information after the new debugging tests we have performed. Keep in mind that we are using the sPyNNaker library at version 6.0.0.

1) When conducting simple tests with the network (described by Daniel above) that includes STDP-regulated population pairs of 4x16 and 16x4 respectively, we have found that for the 2nd population pair (the one of 16x4 neurons) the following weight configuration is printed using log_info() at weight_additive_one_term_impl.c:62:

[INFO] (weight_additive_one_term_impl.c: 67):   Synapse type 0: Min weight:0, Max weight:1536, A2+:460800, A2-:460800
[INFO] (weight_additive_one_term_impl.c: 67):   Synapse type 1: Min weight:0, Max weight:192, A2+:57600, A2-:57600

Note that, in the Python script, the following configuration values were set: "A_plus": 300.0, "A_minus": 300.0, "w_max": 6.0, "w_min": 0.0

2) Repeating the test for STDP-regulated pairs of 4x32 and 32x4 respectively, the new weight configuration of the 32x4 pair gets printed as:
[INFO] (weight_additive_one_term_impl.c: 67):   Synapse type 0: Min weight:0, Max weight:768, A2+:230400, A2-:230400
[INFO] (weight_additive_one_term_impl.c: 67):   Synapse type 1: Min weight:0, Max weight:192, A2+:57600, A2-:57600

3) Again, after repeating the test for a greater number of neurons, including STDP-regulated pairs of 4x40 and 40x4 respectively, the following weight configuration is printed:
[INFO] (weight_additive_one_term_impl.c: 67):   Synapse type 0: Min weight:0, Max weight:384, A2+:115200, A2-:115200
[INFO] (weight_additive_one_term_impl.c: 67):   Synapse type 1: Min weight:0, Max weight:96, A2+:28800, A2-:28800

4) After analyzing these three outputs, we believe that the size of the pre-synaptic population is affecting the different printed values. In this sense, it seems that the number of bits needed for the number of neurons of the pre-synaptic population applies a shift-right operation.

5) The hypothesis that we are considering is an issue with the memory mapping of the allocated and copied input data regarding the STDP parameters: the LUT tables, the weight configuration, etc. Specifically, memory appears to be shifted, which is not a misguided observation since we have found that, (for example) for an STDP-regulated synapsis of 32x4, the following STDP values are printed when calling log_info at weight_additive_one_term_impl.h:120:

[INFO] (timing_pair_impl.h: 161):       time_since_last_pre_event=1, decayed_r1=634
[INFO] (synapse_dynamics_stdp_mad_impl.c: 204):     Applying pre-synaptic event at time:25 last post time:8
[INFO] (timing_pair_impl.h: 129):       time_since_last_post_event=17, decayed_o1=0
[INFO] (weight_additive_one_term_impl.h: 128):   old_weight:0, a2+:634, a2-:0, scaled a2+:-9827, scaled a2-:0, new_weight:0
[INFO] (synapse_dynamics_stdp_mad_impl.c: 414): Acummulation (stdp):0

It can be seen how the A2+ has an inconsistent value, and how the STDP does not properly perform the accumulation.

6) Although we have tried several options for countering this issue (such as modifying the memory pointer that is returned when initializing the LUT tables of the STDP), none of them have been successful. Thus, we think that this cannot be manually patched from the C backend of sPyNNaker since (1) the memory mapping is already given as input (at call initialise_synapse_regions() of c_main_synapses.c) and (2) no information on the number of pre-synaptic neurons is handled from the STDP code for us to make up for the memory mapping.

Please, correct any blunder that you may find in this text. The given analysis is based on preliminary work and I am not an expert on the Spinnaker toolset.

Thanks in advance.

Best regards,
Pablo

Andrew Rowley

unread,
Jan 6, 2025, 5:27:21 AMJan 6
to Pablo Sánchez, SpiNNaker Users Group

Hi,

 

You are correct that the number of pre-synaptic neurons will affect the values.  This is because of the automatic weight scaling that is currently operating in the software in an attempt to make the maximum summed weight received by any neuron fit within a 16-bit value of the ring buffers for the neuron.  More input neurons mean a potential for a larger sum value, so the scale will be different for these different scenarios. 

 

We have recently added some support to control this more, by specifying a “max_expected_summed_weight” for each of the synapse types, as shown in this example:

https://github.com/SpiNNakerManchester/sPyNNaker/blob/8b0a8410de673054e534d3791889bccdec289fa6/spynnaker_integration_tests/test_various/test_max_weight.py#L33

 

This then would keep these stable during changes.

 

Hope that helps,

 

Andrew :)

 

From: spinnak...@googlegroups.com <spinnak...@googlegroups.com> On Behalf Of Pablo Sánchez
Sent: 17 December 2024 13:15
To: SpiNNaker Users Group <spinnak...@googlegroups.com>
Subject: [SpiNNaker Mailing List] Re: Undesired behaviour STDP mechanism

 

Greetings, I am Daniel's colleague, currently working on the same project. I am writing this comment to update the thread with relevant information after the new debugging tests we have performed. Keep in mind that we are using the sPyNNaker

ZjQcmQRYFpfptBannerStart

This Message Is From a New External Sender

You have not previously corresponded with this sender. Please exercise caution when opening links or attachments included in this message.

ZjQcmQRYFpfptBannerEnd

--
You received this message because you are subscribed to the Google Groups "SpiNNaker Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spinnakeruser...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/spinnakerusers/3f7ab31e-2244-4057-ad62-4cb6ca5c6e1dn%40googlegroups.com [groups.google.com].

Reply all
Reply to author
Forward
0 new messages