Simulation with external feedback
Posted: Wed Jan 08, 2020 7:26 pm
I want to perform multiple runs for the same simulation. Between runs I want to give new stimulations to my neurons, but do not reset the simulation - the network (and its state) must remain the same.
The motivation for this comes from the artificial neural network field (ANN). Just like for ANN you can input many baches and each time read the output from the network, want to do the same for my network with NEURON.
So the activity of my neurons will be entirely driven by external feedback, which depends on the output from a single neuron (reading is performed by a rate codding).
I Tried to use VecStim, so assuming that I have a synaptic PointProcess named target my feedback input may look like this:
Unfortunately after a first run, the second run haven't produce any stimulation at all. I assume that the NEURON creates an event_array of stimulation which can't be change this way. But there should be another way to change the pointer to the stimulation vector.
Thanks for your help!
EDIT1:
I found on the NetStim documentation that "NetStim can also be be triggered by an input event."
So I assume this can do the trick? But still I don't know how to change parameters of interval and number - which may express the intensity of the stimuli. I assume the workaround here is to create the NetStim with number=1 and then switch it on and off by NetCon signal, but how in that case control those events timing, if each time I want to create different burst Hz?
Maybe should I use:
But in that case you commit for the variable timestep, but I use the model where as I assume - it may give inconsistent result while timestep is variable.
EDIT2:
My current workaround is as follows:
In this case I completely omit NetStim after the first run and deliver events directly to the NetCon.
It works nice, but if I have 300Hz burst to 2000 synapses I'm not sure about the efficacy of this solution.
The motivation for this comes from the artificial neural network field (ANN). Just like for ANN you can input many baches and each time read the output from the network, want to do the same for my network with NEURON.
So the activity of my neurons will be entirely driven by external feedback, which depends on the output from a single neuron (reading is performed by a rate codding).
I Tried to use VecStim, so assuming that I have a synaptic PointProcess named target my feedback input may look like this:
Code: Select all
stim = h.VecStim()
stim.play(h.Vector(np.array([10, 20])))
nc = con = h.NetCon(source, target, 1, 0)
h.continuerun(100 * ms)
stim.play(h.Vector(np.array([110, 120])))
h.continuerun(100 * ms)
Thanks for your help!
EDIT1:
I found on the NetStim documentation that "NetStim can also be be triggered by an input event."
So I assume this can do the trick? But still I don't know how to change parameters of interval and number - which may express the intensity of the stimuli. I assume the workaround here is to create the NetStim with number=1 and then switch it on and off by NetCon signal, but how in that case control those events timing, if each time I want to create different burst Hz?
Maybe should I use:
Code: Select all
h.cvode.event(...)
EDIT2:
My current workaround is as follows:
Code: Select all
stim = h.VecStim()
stim.play(h.Vector(np.array([10, 20])))
nc = con = h.NetCon(source, target, 1, 0)
h.continuerun(100 * ms)
nc.event(110)
nc.event(120)
h.continuerun(100 * ms)
It works nice, but if I have 300Hz burst to 2000 synapses I'm not sure about the efficacy of this solution.