STDP

NMODL and the Channel Builder.
Post Reply
ekaraviotou
Posts: 4
Joined: Wed Oct 28, 2009 7:53 am

STDP

Post by ekaraviotou » Wed Nov 25, 2009 5:10 pm

Hello!!
I implemented a model in neuron that is composed by a target neuron that has synaptic inputs from two neurons A and B that tend to fire successivly with a time interval Δt. How can i insert an STDP mechanism (STDP Rule) into my model?

Thanks,
Eleni

ted
Site Admin
Posts: 5684
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: STDP

Post by ted » Thu Nov 26, 2009 9:59 am

See
http://www.neuron.yale.edu/neuron/stati ... 23_06.html
for a mechanism with AMPAergic conductance time course (synaptic conductance rises fast, decays monoexponentially) that implements STDP governed by the rule described by Bi & Poo (1998, 2001).

This mechanism watches postsynaptic membrane potential at the location of the synapse. If your synapse will be too far from the spiking zone in the postsynaptic cell to see a significant depolarization when the cell spikes, or if local epsps caused by ordinary synaptic events are so large that they are mistaken for spikes, let me know.

If you don't want to see the diagnostic messages, comment out the printf statements--that is, change each

Code: Select all

printf( . . . 
to

Code: Select all

: printf( . . . 

ekaraviotou
Posts: 4
Joined: Wed Oct 28, 2009 7:53 am

Re: STDP

Post by ekaraviotou » Sun Dec 06, 2009 5:02 am

Thanks for your help but my problem is that i dont know how to use the STDP mechanism in my own model
My model is simple : has a target neurone that has synaptic inputs from two neurons A and B that tend to fire successively with a time interval, as shown below:

create soma, dend

objectvar stim, stim_A, syn_A, syn_B

proc init_cell() {

soma {
nseg = 1
diam = 12 // makes it smaller, like in cortex
L = 12 // makes it smaller, like in cortex
Ra = 330 // Ohm cm from Stratford et al
cm = 1

}

dend {
nseg = 50
diam = 2 // um
L = 1000 // um
Ra = 330 // Ohm cm from Stratford et al
cm = 1

insert pas
g_pas = 0.00004 // Stratford et al values were 0.00002
insert na2
gna2bar_na2 = 0.00023 // with 24 the potential gets out of control

objectvar syn_A
syn_A = new AlphaSynapse(0.8)
syn_A.tau = 0.1
syn_A.onset = 0 // fires when the simulation starts
syn_A.gmax = 0.1
syn_A.e = 15

objectvar syn_B
syn_B = new AlphaSynapse(0.1)
syn_B.tau = 0.1
syn_B.onset = 15 //note a 15ms onset delay here
syn_B.gmax = 0.1
syn_B.e = 15

}

// connect:

connect soma(1), dend(0)

} // end init cell

init_cell()

xopen("prog1.ses") // to be added once a session has been saved ?

proc ru() { // rununtil x milliseconds
tstop = $1
run()
print "V = ", soma.v, "mV"
}

ted
Site Admin
Posts: 5684
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: STDP

Post by ted » Sun Dec 06, 2009 11:03 am

i dont know how to use the STDP mechanism
It's a synaptic mechanism with STDP. Use it like any other synaptic mechanism. Attach it to the target neuron wherever you want to put it, then connect spike sources to it with NetCons.

Here are some suggestions that may help with future program development and debugging. You already appear know most of this, so what follows is largely for the benefit of others who may read this discussion thread.

The recommended outline for specifying the properties of a model cell generally follows the sequence that is embodied in the radio button menu at the top of the CellBuilder.

Code: Select all

1. Topology--create all sections, then connect sections
    Connect child section to parent section, e.g. connect dend(0), soma(1).
      Connecting parent to child will make shape plots look strange,
      and will violate somaotfugal order when iterating with forall for (x).
2. Subsets (optional)--append sections with shared properties to SectionLists
3. Geometry--specify length and diameter of each section
4. Biophysics
  specify Ra and cm of each section
  insert density (distributed) mechanisms and specify their parameters
5. Specify nseg. d_lambda rule is suggested.
It is best to defer attachment of synaptic mechanisms and other point processes until after cell properties have been completely specified--and certainly after nseg has been specified.

ekaraviotou
Posts: 4
Joined: Wed Oct 28, 2009 7:53 am

Re: STDP

Post by ekaraviotou » Wed Dec 09, 2009 10:34 am

Hello again!
I used the STDP mechanism you proposed at
http://www.neuron.yale.edu/neuron/stati ... 23_06.html in my model

As you can see in my code i create a pre synapse at location 0,8 (called A2) from dendrite that fires when the simulation starts (onset = 0).The EPSP that is produced at location A2 propagates to location B(location 0.1) that fires after Dt=15ms. If B fires Dt after A this means that EPSP-A2 reaches B the same time that B fires.As I can see from the results that flag2 is produced, so this means that we have LTP?
How can i have LTD??
Can you pls help me??

Code: Select all


create soma, dend
//access soma

//create point processes
objref netconpre,netconpost,pre,post,pre2post
Dt = 0
objectvar stim, stim_A,stim_B,stim_A1,stim_B1, syn_A, syn_B

proc init_cell() {

soma {
	nseg = 1
	diam = 12 // makes it smaller, like in cortex
	L = 12    // makes it smaller, like in cortex
	Ra = 330 // Ohm cm from Stratford et al
	cm = 1

     }

dend {
	nseg = 50 
	diam = 2  // um
	L = 1000   // um
	Ra = 330 // Ohm cm from Stratford et al
	cm = 1

	insert pas
	g_pas = 0.00004 
	insert na2
	gna2bar_na2 = 0.0023  
	
     		
	stim_A = new AlphaSynapse(0.8)
      stim_A.onset = 0
	stim_A.tau = 0.1
      stim_A.gmax = 0.02
      stim_A.e = 15     
  
	stim_B = new AlphaSynapse(0.1)
	stim_B.onset = 15
	stim_B.tau = 0.1
      stim_B.gmax = 0.02
      stim_B.e = 15

	stim_A2 = new AlphaSynapse(0.8)
        stim_A2.onset = 30
	stim_A2.tau = 0.1
        stim_A2.gmax = 0.02
        stim_A2.e = 15     
  
	stim_B1 = new AlphaSynapse(0.1)
	stim_B1.onset = 45
	stim_B1.tau = 0.1
      stim_B1.gmax = 0.02
      stim_B1.e = 15
      
	pre = new ExpSynSTDP(0.8)
     
	
      post = new ExpSynSTDP(0.1)
 
    
// to see properties of dendrite: dend psection()
    }

// connect:

connect soma(1), dend(0)

      //NetCon(source stim,target synapse)
      netconpre = new NetCon(stim_A,pre)    
      netconpost = new NetCon(stim_B,post)
      pre2post = new NetCon(pre,post)

      netconpre = new NetCon(stim_A2,pre)  
      netconpost = new NetCon(stim_B1,post)
      pre2post = new NetCon(pre,post)

} // end init cell

init_cell()

ted
Site Admin
Posts: 5684
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: STDP

Post by ted » Wed Dec 09, 2009 12:31 pm

When a postsynaptic spike occurs, the mechanism receives an event with flag == 2. The FOR_NETCONS loop iterates over all NetCons that target this particular instance of the synaptic mechanism. It increases each NetCon's weight by a multiplicative factor that depends on the latency between the time of the most recent event (spike) that was delivered by that NetCon and the time of the postsynaptic spike.

When a presynaptic spike occurs, the mechanism receives an event with flag == 0. The weight A associated with the NetCon that delivered the spike event is depressed by a multiplicative factor that depends on tpost-t, which is the length of time that has elapsed since the most recent postsynaptic spike.

ekaraviotou
Posts: 4
Joined: Wed Oct 28, 2009 7:53 am

Re: STDP

Post by ekaraviotou » Wed Dec 09, 2009 2:25 pm

Thanks for your answer but can you pls if it is possible to help me with with some code in order to understand practically how LTD works in the mechanism?

ted
Site Admin
Posts: 5684
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: STDP

Post by ted » Wed Dec 09, 2009 8:09 pm

How to fish

Create a single compartment model cell with a resting potential of -70 mV.

Attach an SEClamp to it. Set the SEClamp's dur1 = 11 ms, dur2 = 1 ms, and dur3 = 1e9.
Also set amp1 = -70 mV, amp2 = 10 mV, and amp3 = -70 mV.
Create a graph that shows the time course of v and verify that the SEClamp has good control of v.
Adjust rs if you need to improve voltage control during the 1 ms depolarization.
Now set dur1 = 1e9 so that the SEClamp just holds v at -70 mV "forever."

Attach one instance of the STDP synaptic mechanism to your model cell.
Create a NetStim that generates two events--one at t = 1 ms and another at t = 21 ms (start = 1 ms, interval = 20 ms).
Attach it to the synaptic mechanism.
To keep things simple, set the NetCon's delay to 0 ms.
Set the weight of the NetCon to 0.1.
Create a graph that shows the time course of the synaptic mechanism's conductance.
Adjust the synaptic mechanism's parameters so that the synaptic conductance decays to 0 nearly completely in about 1 ms.

Now you have a synapse with STDP that is driven by two events: a "control" stimulus (the first event) and a "test" stimulus (the second event). The first event elicits the "control" response and the second stimulus elicits the "test" response.

Change the interstimulus latency (change the NetStim's "interval" parameter). How does this affect the amplitudes of the control and test responses?

Now restore the interstimulus latency to 20 ms, and change the SEClamp's dur1 to 11 ms.
What happens to the amplitude of the test response?
What happens if you decrease dur1? increase dur1?

chalspark
Posts: 17
Joined: Tue Jun 01, 2010 1:19 am

Re: STDP

Post by chalspark » Tue Jun 28, 2011 1:27 am

We should turn on the value of LTP and LTD.
These values are turns off basically in the mod file.

sy = new ExpSynSTDP(0.5)
sy.d = 1 : LTD
sy.p = 1 : LTP

This is my example source code.

Code: Select all

load_file("nrngui.hoc")

create soma
soma {
nseg = 1
diam = 18.8
L = 18.8
Ra = 123.0

insert hh
}

proc init() {
        Vrest = -70
        tstop = 30
	t = 0
	forall {
	v = Vrest
	finitialize(Vrest)
	}
}

objref stim,ns,sy, nc
stim = new SEClamp(0.5)
stim.dur1 =  11        //1e9
stim.dur2 =  1
stim.dur3 = 1e9
stim.amp1 = -70
stim.amp2 = -10
stim.amp3 = -70

ns = new NetStim(0.5)
ns.start = 1
ns.interval = 25
ns.noise = 0
ns.number = 2

sy = new ExpSynSTDP(0.5)
sy.d = 1
sy.p = 1

nc = new NetCon(ns,sy)
nc.weight = 0.1
nc.delay = 0

proc advance() {
   fadvance()
}

load_file("call.ses")

run()
* "call.ses" is graph ses file.

vladimirov
Posts: 50
Joined: Thu Jul 07, 2011 6:20 pm

Re: STDP

Post by vladimirov » Wed May 09, 2012 1:49 pm

How to fish
...
I was tinkering around this example for couple of hours trying to understand why it does not work out for me (no synapse potentiation occurs). Finally I found the reason: in provided stdp.mod file, both potentiation (p) and depression (d) parameters were set to zero :)))

Post Reply