Resetting NetStim rate immediately

Moderator: wwlytton

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

Resetting NetStim rate immediately

Post by vladimirov »

Hi, folks
I am using NetStim() instances to drive activity my IntFire4 neurons with a stimulus V of varying magnitude. The stimulus can change quickly (about every 50 ms), so I am trying to implement variation in spiking rate using NetStim() instances. So, in the beginning of simulation each cell in Vfcells list has instance of

Code: Select all

stim = new NetStim(0.5)
stim.interval = 500
stim.number = 1e9
stim.start = 0
stim.noise = 0.5
conn = new NetCon(stim,Vfcells.object(i).source)
When the stimulus V changes (quickly), I update each 'stim' instance by changing its interval

Code: Select all

VfStimList.object(i).interval = 20/V 
so the firing frequency of each neuron changes linearly with stimulus V. However, I noticed there is a delay in the firing response of cells, due to the fact that if there was another NetStim spike scheduled (with interval 500 ms) before the interval has been updated (to, say, 20 ms), the program keeps waiting about 500 ms for the older spike to happen, then it changes NetStim() state to 0, and only then it updates the spike interval to 20 ms. Is there any way to make NetStim() update (reset) its spiking interval immediately?
Many thanks in advance,
Nikita
ted
Site Admin
Posts: 6287
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Resetting NetStim rate immediately

Post by ted »

vladimirov wrote:if there was another NetStim spike scheduled (with interval 500 ms) before the interval has been updated (to, say, 20 ms), the program keeps waiting about 500 ms for the older spike to happen, then it changes NetStim() state to 0, and only then it updates the spike interval to 20 ms. Is there any way to make NetStim() update (reset) its spiking interval immediately?
No. NetStim works by launching self-events; arrival of a self-event triggers an output event. None of NEURON's built-in artificial spiking cells can act as a V->F converter with instantaneous response to changes in V because calculation of the next time at which a cell will spike is done only when that cell receives an event.

If it is true that
"V will only change at a few times"
then I suppose it would be possible to come up with an artificial spiking cell model that is designed to respond to a very particular input event (say, events associated with a particular weight) by using the current value of V to update the time of the next spike. Then you'd have to contrive to make sure that every time V changes, you also, after a very brief interval, deliver a "special" event to the artificial spiking cell that tells it to respond to the change of V.

If instead V changes continuously in a simulation, a different strategy (not quite sure what at this instant) might be more efficient.
vladimirov
Posts: 50
Joined: Thu Jul 07, 2011 6:20 pm

Re: Resetting NetStim rate immediately

Post by vladimirov »

:-(
The stimulus V is supposed to change continuously during simulation. If I switch conductance-based cell models instead of artificial spiking cells, would there be any way to instantly convert V->F (stimulus to firing rate)?
ted
Site Admin
Posts: 6287
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Resetting NetStim rate immediately

Post by ted »

vladimirov wrote:The stimulus V is supposed to change continuously during simulation.
Thinking about the problem a bit more--if firing rate f = F(t) and the integral of F over the interval 0..t is G(t), the problem becomes one of identifying the times ti where G(ti) = i and i = 1, 2, . . .. If G and F are tractable, this would allow a very efficient implementation as an artificial spiking cell.

If this is not the case, numerical integration is necessary. A quick and easy approach suitable for NEURON would use a single compartment model with nothing but membrane capacitance, which has a "current source" mechanism similar to the "constant current" mechanism that which is described in chapter 8 of the NEURON Book. This mechanism would generate a current whose magnitude can be changed in the course of a simulation*. To this model would be attached a point process like the one specified by spikeout.mod in the NEURON code from Brette et al. 2007 (see http://www.neuron.yale.edu/neuron/nrnpubs), which would monitor the "membrane potential" of this model for threshold crossings and produce events that can be conveyed by NetCons to targets.

*--The best way to implement the coupling between the current amplitude parameter and whatever is supposed to modulate it depends on details you haven't specified. Simplest and most efficient would be if the current amplitude can be declared a POINTER and linked to some variable.
vladimirov
Posts: 50
Joined: Thu Jul 07, 2011 6:20 pm

Re: Resetting NetStim rate immediately

Post by vladimirov »

Thanks for your response, Ted. These solutions with artificial spiking cells seem very counter-intuitive (to me). I think I should probably switch to single-compartment HH models, where injected current can immediately change the spiking rate of a cell. Thanks!
Post Reply