I have a model which I wish to feed with the same external inputs, arriving through few hundreds NetStim-s which I connect to my model using NetCon-s.
Even though I reset the inputs by called NetStim.seed() before each run and starting over from t=0, the resulting inputs are different.
Is this suppose to work? What's the best-practice to achieving my goal?
Thank!
Exactly regenerate inputs
Re: Exactly regenerate inputs
Ok, I was able to add a method reset() to all my NetStim instances to reset their state:
Which I call for each instance in hoc. This and resenting the random through ACG does cause the inputs to be precisely repeated.
Note, however, that most NEURON models have a lot of other 'state' in other mechanisms (e.g. open-state of voltage-gated channels) and thus the _output_ of my cell is not precisely repeated between trials.
Code: Select all
PROCEDURE reset() {
: randomize the first spike so on average it occurs at
: start + noise*interval
event = start + invl(interval)
: but not earlier than 0
while (event < 0) {
event = event + invl(interval)
}
}
Note, however, that most NEURON models have a lot of other 'state' in other mechanisms (e.g. open-state of voltage-gated channels) and thus the _output_ of my cell is not precisely repeated between trials.
-
- Site Admin
- Posts: 6300
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
Re: Exactly regenerate inputs
Given the same input, a model should produce exactly the same output on each run. If it doesn't, there is either a a bug in the model itself, or in the strategy used to specify the initial condition of the model at the start of each run.
It sounds like you have taken care of the most burdensome part of model initialization: ensuring that afferent spike trains are properly initialized. This is burdensome only because modelers (necessarily) invent their own individual designs for spatiotemporal patterns of afferent activity and consequently must also invent their own individual strategies for initializing this activity.
What remains to be done is to properly initialize everything else. Assuming you are using the standard run system, all of the "ordinary" stuff (voltage-gated channels, ion accumulation mechanisms, signal sources such as IClamps and SEClamps) is automatically initialized if you just call run(), which both initializes these things and launches a simulation. Anything else that needs initialization (e.g. your afferent spike trains) can be done by a procedure that is called by an FInitializeHandler.
It sounds like you have taken care of the most burdensome part of model initialization: ensuring that afferent spike trains are properly initialized. This is burdensome only because modelers (necessarily) invent their own individual designs for spatiotemporal patterns of afferent activity and consequently must also invent their own individual strategies for initializing this activity.
What remains to be done is to properly initialize everything else. Assuming you are using the standard run system, all of the "ordinary" stuff (voltage-gated channels, ion accumulation mechanisms, signal sources such as IClamps and SEClamps) is automatically initialized if you just call run(), which both initializes these things and launches a simulation. Anything else that needs initialization (e.g. your afferent spike trains) can be done by a procedure that is called by an FInitializeHandler.