How to implement a Conductance Base synapse?

The conductance base synapse is defined by :

g_{syn}(t) = \bar{g}_{syn} s(t) \\ \frac{ds}{dt} = \frac{1+\tanh(v/10)}{2} \frac{1-s}{\tau_r}\frac{s}{\tau_d}

\tau_r, \tau_d are rise and decay time, respectively.

something like this?

S = b2.Synapses(neuron, 
                    neuron,
                   '''
                   g_post = g_syn :1 (summed)
                   ds/dt = 0.5 * (1 + tanh(0.1*vm/mV)) * (1-s)/tau_r - s/tau_d : 1 (clock-driven)
                   w : 1 # synaptic weight
                   '''
                   on_pre='s *= w')

I don’t if anybody read here but thanks for any guide.

I am using this synapse to connect two RTM or Wang-Buszaki neurons .
If you are interested, you can find full code of the RTM & WB neurons here. chapter 5 and 20.

Hi. This is a great first question for the forum :slightly_smiling_face: I agree that our documentation does not help much for complex synapse models like that. The complex part is not that it is a conductance-based synapse – the very simple models in the COBAHH example are conductance-based as well (that’s actually what “COBA” stands for). Here, the complexity rather stems from the fact that the synaptic conductance is a continuous function of the membrane potential, instead of being triggered by individual spikes. This can be useful in particular when analyzing models mathematically, but I personally would not recommend such models in most cases because they tend to be less efficient. As a minor inconvenience, also note that this model only works with (pre-synaptic) neuron models that model the action potential in detail, i.e. not with integrate-and-fire type models.

All that said, you can of course model this type of synapse with Brian. There are two broad approaches (s as part of the pre-synaptic neuron or s as part of the Synapses object), all depends on whether your time constants are the same across all synapses or whether they can vary between synapses. In your case I assume that they are supposed to be the same?

1 Like

@mstimberg Thank you for detailed answer.
Based on COBAHH example:
I supposed the synaptic time constant are the same for each neuron and I defined the synapse as part of presynaptic neuron (I don’t know whether or not it is more efficient compared to s as part of Synapse object).

w = 1* b2.msiemens
'''
membrane_Im = I_ext + gNa*m**3*h*(ENa-vm) + \
        gl*(El-vm) + gK*n**4*(EK-vm) + gSyn*s*(-vm): amp
I_ext : amp
... (some more code)
ds/dt = 0.5 * (1 + tanh(0.1*vm/mV)) * (1-s)/tau_r - s/tau_d : 1
'''

neuron = b2.NeuronGroup(N, eqs, method="euler", 
                            dt=0.01*ms,
                            threshold='vm>-55*mV')
S = b2.Synapses(neuron, neuron, on_pre='s += w')
S.connect(i=0, j=1)   

The synapse variable is continuously changing and has a rise time, so using on_pre='s += w' probably is not true.
The full code is here in case you want to try.

Hi again. Yes, putting s into the pre-synaptic neuron code is the right approach if the time constants are the same across synapses. The only necessary change is in the Synapses object where you will need a summed variable for the continuous interaction between the pre- and post-synaptic cells.

Something like

S = b2.Synapses(neuron, neuron, '''w : 1
                                   s_in_post = w*s_pre : 1 (summed)''')
S.connect(i=0, j=1)
S.w[0, 1] = ... # set weight

should work. But note that you’ll also have to add

s_in : 1

to the neuron equations and change gSyn*s*(-vm) to gSyn*s_in*(-vm). This is to make the difference between the s representing the synaptic activation of synapses originating from this cell, and s_in for the (summed) synaptic activation of synapses targetting on this cell. In your code above, spikes in neuron 0 would trigger synaptic currents in neuron 0, even though it does not have any synapses connecting to itself.

1 Like

Great,
Probably I have missed something because the second neuron sense nothing from the synapse. I give external current only to the first neuron.
download (2)

Maybe it is just a matter of parameters, e.g. the weight or the gSyn is too small? Can you record s_in in the target neuron to see whether it looks reasonable (and also make sure that it is used in the gSyn*... expression instead of s)?

Yeah I made the changes.

'''
membrane_Im = I_ext + gNa*m**3*h*(ENa-vm) + \
        gl*(El-vm) + gK*n**4*(EK-vm) + gSyn*s_in*(-vm): amp
I_ext : amp
s_in  : 1
ds/dt = 0.5 * (1 + tanh(0.1*vm/mV)) * (1-s)/tau_r - s/tau_d : 1
'''

download (4)
s_in is not updating. [LINK]

All is looking good, but I noticed that in your linked code, you are not adding the Synapses object to the network. This means it is not simulated and therefore there’s no link between the neurons.

PS: If it works for you, it would be great if you could mark this topic as solved by clicking on the “…” below my post and then select the “:white_check_mark: Solution” button.

Awesome, Thank you for your time. :+1:t2:

The answer updated HERE.
download

Great to hear it works. Thanks for sharing the code, that could be very useful for others. :+1:

1 Like