Problem in recording netcon.weight[1]

82 views
Skip to first unread message

‍신기성[ 대학원석·박사통합과정재학 / 뇌공학과 ]

unread,
Dec 2, 2021, 4:53:40 AM12/2/21
to NetPyNE Q&A forum
Hello, 
I'm new to NetPyNE. I'm happy to be able to use an high level interface like NetPyNE.

I'm having trouble in recording NetCon's weights.

I want to use the Spike timing-dependent plasticity (STDP) synaptic mechanism and to track how the weights of individual netcons change over time.

I heard that the synaptic mechanism created using "stdp.mod" stores the initial weight in NetCon.weight[0], and the weight changed by STDP is stored in NetCon.weight[1] for each stream.

Here are part of the code I tried and "stdp.mod" file. (same mod file as https://neuron.yale.edu/neuron/static/news/news_2_23_06.html)

======== my code =======
# set netParams & simConfig
# ...

# exec NetPyNE & interact NEURON
sim.initialize(simConfig = simConfig, netParams = netParams)
sim.net.createPops()
sim.net.createCells()
sim.net.connectCells()
sim.net.addStims()
sim.setupRecording()

# set weight recording
w_vec_list = []
for cell in sim.net.cells:
   for conn in cell.conns:
       w_vec = h.Vector().record(conn['hObj']._ref_weight[1])
       w_vec_list.append(w_vec)

# run
sim.runSim()
sim.gatherData()
sim.saveData()
=======================

However, I was only able to get a value of 0.0 (means no change) in w_vec after running a simulation in which a lot of pre-post synaptic cell spikes occured.

Am I doing something wrong with the way of recording the weights?

Any advice on this would be really appreciated. 

Thanks!
- Kisung Shin


stdp.mod

Joe Graham

unread,
Dec 3, 2021, 8:37:27 PM12/3/21
to NetPyNE Q&A forum
Hello Kisung Shin,

If you can do it in NEURON you can do it in NetPyNE, but if it doesn't work in NEURON it won't work in NetPyNE.  If you can demonstrate with a simple NEURON/Python script that your mod file works as you think it does and share that here, then I can help you get it working in NetPyNE.  If you need help with mod files, the NEURON forum is the place to ask for help: https://www.neuron.yale.edu/phpBB/index.php

We have an example NetPyNE simulation that uses a STDP mod file to adjust connectivity weights: https://github.com/Neurosim-lab/netpyne/tree/development/examples/RL_arm

If you look at the STDP mod file, you can see that there is an example Python usage at the top, which I'd like to see for yours: 

Once you know how your mod file works, you'll need to specify which connections are plastic.  See the plasticity section at the bottom of connectivity rules on our website: http://netpyne.org/reference.html?#connectivity-rules

Then you can see here for an example of saving weights:

I hope this helps, and good luck!

Best wishes,
Joe
Reply all
Reply to author
Forward
0 new messages