STDP on both inhibitory and excitatory synapses?

Hi all,
I’m trying to implement a network containing both excitatory and inhibitory neurons( 80%-20%) whose weights are changing with STDP rule.
I have 2 types of synapses defined as follows:

inh_syn = Synapses(inh_neurons, neurons, model=synapses_eqs,
on_pre=stdp_pre,on_post=stdp_post’)

exc_syn = Synapses(exc_neurons, neurons, model=synapses_eqs,
on_pre=stdp_pre, on_post=stdp_post)

My ambiguity is that do I use similar stdp_pre and stdp_post for both type of synapses ? I mean

#excitatory
stdp_pre=‘’‘g_e_post += w_e
Apre += dApre
w_e_t = clip(w_e + Apost, 0, gmax)’‘’
stdp_post=‘’‘Apost += dApost
w_e= clip(w_e + Apre,0, gmax)’‘’
#inhibitory
stdp_pre=‘’‘g_i_post += w_i
Apre += dApre
w_i = clip(w_i + Apost, 0, gmax)’‘’
stdp_post=‘’‘Apost += dApost
w_i= clip(w_i + Apre,0, gmax)’‘’

Hi @Rihana . If you want to use the same learning rule, then indeed you’d use very similar on_pre and on_post statements for both, as in your example. If you want to repeat yourself a bit less, you could call the synaptic weights w in both cases, and then construct your on_pre/on_post statements like this:

stdp_pre = '''
Apre += dApre
w = clip(w + Apost, 0, gmax)'''
stdp_post = '''Apost += dApost
w= clip(w + Apre,0, gmax)'''
inh_syn = Synapses(inh_neurons, neurons, model=synapses_eqs,
                   on_pre='g_i_post += w' + stdp_pre, on_post=stdp_post)
exc_syn = Synapses(exc_neurons, neurons, model=synapses_eqs,
                   on_pre='g_e_post += w' + stdp_pre, on_post=stdp_post)

Thanks very much for you reply.
That was for expressing my meaning of question.
As I’ve mentioned, my question is when I have 2 types of synapses, how STDP defines on them.
In Brian2 sample for STDP, it is for excitatory ones in a network containing only excitatory synapses not both simultaneously.

Hi @Rihana. I’m afraid I am still having trouble understanding your question. You can add STDP equations for excitatory or inhibitory synapses, whether these synapses are excitatory or inhibitory does not make a difference from Brian’s point of view (from empirical observations or theoretical considerations, you might consider different rules for excitatory and inhibitory synapses, but this is up to you). In the basic Brian 2 STDP example, there are only excitatory synapses. But, e.g. in the example implementing Vogels et al. (2011), there are excitatory and inhibitory synapses, but only the inhibitory synapses are plastic.