Description of problem
I am working on implementing the paper: Pattern recognition using Spiking Neural Networks. This is also posted under the Projects category. As per the paper, STDP is the learning rule applied. I have used the Brian2 STDP example from the official Brian2 tutorials. The problem is on running the script, the weight converges to 0 despite getting the correct firing pattern of neurons as given in the paper
Minimal code to reproduce problem
taupre = taupost = 20*ms
wmax = 1
Apre = 0.01
Apost = -Apre*taupre/taupost*1.05
stdp_eqs = '''
         w : 1
         dapre/dt = -apre/taupre : 1 (event-driven)
         dapost/dt = -apost/taupost : 1 (event-driven)
       '''
stdp_pre = '''
      v_post += w * mV
      apre += Apre
      w = clip(w+apost, 0, wmax * mV)
'''
stdp_post = '''
        apost += Apost
        w = clip(w+apre, 0, wmax * mV)
'''
# Inp -> Hidden
Syn_inp_hid = b2.Synapses(izh , 
                          izh_hidden , 
                          model = stdp_eqs , 
                          on_pre = stdp_pre , 
                          on_post = stdp_post , 
                          method = 'euler' , 
                          name = 'Syn_inp_hid')
# Hidden -> Output
Syn_hid_out = b2.Synapses(izh_hidden , 
                          izh_output , 
                          ''' w : 1''' , on_pre = 'v += w * mV' , 
                          method = 'euler' , 
                          name = 'Syn_hid_out')
# MAKE CONNECTIONS
Syn_inp_hid.connect()
Syn_hid_out.connect()
Syn_inp_hid.w = 'rand() * 0.8'
Syn_hid_out.w = 'rand() * 0.8'
========
What you have aready tried
On setting wmax to very high values like say 500, I get the following actiivty from the weights
Expected output (if relevant)
This is the graph taken from the above paper, the weights can be seen climbing to higher values and 0.8 is considered to be the max value specified by the authors.
Actual output (if relevant)
The STDP plot is at the bottom. This is the graph generated when I run the script.
The architecture is feedforward (i.e.) Input -> Hidden Layer -> Output. I have made the Synapses connections accordingly. Any suggestion on what to look for would be appreciated.





. TBH this is kind of upsetting when the post is made to learn and contribute as a way of expressing genuine thanks and gratitude for this wonderful Brian simulator library. I hope different users dont have different standards. Sadly, for Brian there is not much user support available in any outside forums like Stackexchange for example and hope my future posts here is not criticized and commented as to whether it is filled under the right category or has the proper code representation etc. Before posting I make sure to thoroughly check the standards and guidelines and only after that I post here or in any forums.