NET_RECEIVE block for STDP

NMODL and the Channel Builder.
Post Reply
guillaume

NET_RECEIVE block for STDP

Post by guillaume »

Hi,

I'm a very new user of neuron and I try to simulate spike-timing-dependent-plasticity in a very simple neuron network.
I found a hinces' code (stdp.mod) and I build mine starting with it.

I decided to not use FOR_NETCONS (if i understood FOR_NETCONS utility, and I'm not sure of that, Hinces uses FOR_NETCONS in case of post-synaptic event after multi pre-synaptic onces, what don't interst me now)

Each time I refer to a NET_RECEIVE argument for my post-synaptic case, my simulation stops with a segmentation violation..I just want to now why?

Should I need to use FOR_NETCONS ?
if I do, what NEURON version should I get?

Thank you,
Guillaume

Here's a bit of my code :

NET_RECEIVE (w (uS), dw, tpre (ms) ) {
INITIAL { dw = 0 tpre = 0 }

if (flag == 0) { : presynaptic spike

g = g + w + dw
tpre = t
dw = - exp((tpost - t)/tauQ)

} else if (flag == 2) { : postsynaptic spike
g = g + w + dw
tpost = t
dw = exp((t - tpre)/tauP)
....
ted
Site Admin
Posts: 6300
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: NET_RECEIVE block for STDP

Post by ted »

guillaume wrote:I found a hinces' code
It's Hines's code.
Specifically where did you find it? (just to make sure we're talking about the same thing)
A URL will be sufficient.
Each time I refer to a NET_RECEIVE argument for my post-synaptic case, my simulation stops with a segmentation violation..I just want to now why?
What happens if you use the original NMODL code?
what NEURON version should I get?
What version are you using now? The current standard distribution (5.9 from
http://www.neuron.yale.edu/neuron/install/install.html) will do the job.
guillaume

Post by guillaume »

It's Hines's code.
Oh sorry, I apologize.

I found the code here:
http://www.neuron.yale.edu/neuron/static/news/stdp.mod

Here's the message I get when I use the original code or any time I insert FOR_NETCONS :

loading membrane mechanisms from nrnmech.dll
Undefined symbol _add_nrn_fornetcons referenced from nrnmech.dll
1

I use the 5.9 standard version.

So I decided to gave up FOR_NETCONS (which is used when post-synaptic spike occurs in hines's code), and I try to replace it by a similar treatement than the one used when presynaptic spike occurs in hines's code, because this part seems to work well when I simulate.

THe problem is that it seems not to be possible because each time I refer to an arg of NET_RECEIVE in this part of the block (if I unquote the 2 lines quoted in the part flag==2 just below), simulations stop with segmentation violation.

Code: Select all

NET_RECEIVE (w (uS), dw, tpre (ms) ) {
	INITIAL { dw = 0  tpre = -1e9 }

if (flag == 0) { : presynaptic spike

g = g + w + dw
tpre = t
dw = dw - exp((tpost - t)/tauQ)

} else if (flag == 2) { : postsynaptic spike
: g = g + w + dw
tpost = t
: FOR_NETCONS(....
: dw = dw + exp((t - tpre)/tauP)
....
ted
Site Admin
Posts: 6300
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Discussion of stdp.mod

Post by ted »

Sorry about the very long delay of this reply.

From the brief code fragment that you provide, I can't tell what's wrong with the
mechanism you are trying to develop.

The mechanism in http://www.neuron.yale.edu/neuron/static/news/stdp.mod does work.
It implements spike timing dependent potentiation and depotentiation. Potentiation is
additive and nonsaturating, and depotentiation is multiplicative. Every input event elicits
a conductance transient that depends jointly on the past history of inputs from that
source, and the local spiking history of the postsynaptic cell.

In this mechanism, each NetCon's weight vector has three elements:
--w is the weight that was assigned to the NetCon before the start of the simulation
--A is that NetCon's history-dependent "potentiation," which is >=0
--tpre is the most recent time at which that NetCon delivered an event to the synaptic
mechanism

When an input event arrives from any NetCon, this statement
g = g + w*(1 + A)
increases conductance abruptly by the amount w*(1 + A), updates tpre to the current
model time t, and then multiplies A by a term
1 - d*exp((tpost - t)/dtau)
that represents the depotentiation caused by the time interval between the current input
event and tpost (the last time there was a spike in the postsynaptic cell at the synaptic
locus)--"if synaptic activation follows a postsynaptic spike, that synapse becomes
weaker".

When a postsynaptic spike occurs at the synaptic locus, two things happen:
1. tpost is updated
2. this code is executed

Code: Select all

FOR_NETCONS(w1, A1, tp) {
  A1 = A1 + p*exp((tp - t)/ptau)
}
FOR_NETCONS iterates over all NetCons that target this synaptic mechanism instance.
The statement
A1 = A1 + p*exp((tp - t)/ptau)
increases the second element of each NetCon's weight vector (i.e. that NetCon's
"potentiation") by an amount that depends on the time interval that has elapsed between
the most recent input event from that NetCon, and the time at which the postsynaptic
cell fired its spike--"if synaptic activation precedes a postsynaptic spike, that synapse
becomes stronger."

So "pre before post" spiking potentiates, and "post before pre" spiking depotentiates.
Effective synaptic weight is w*(1 + A) where A>=0, so "post before pre" can never
produce actual synaptic depression (the effective weight of any connection will never
fall below its initial value). However, using this mechanism as a starting point, only a few
changes are needed to implement a mechanism that manifests both potentiation and
true depression, i.e. a mechanism with effective synaptic weight w*(1 + A)*D, where D
is a depression term that lies in the range [0, 1].
Post Reply