-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[neuron-writer] how can one set the tolerance value? #103
Comments
IIRC generated neuron code does not use the variable stepsize solver (cvode) - but it could: we would first need a way to specify that cvode is to be used. Not sure if that would go in the Lems definition, but jLems implements two integration methods, 4th order Runge Kutta (default) or Euler, which can be selected using the method attribute). So, we could have an additional (neuron specific) integration method (jlems would have to ignore it). Once cvode is selected, we won't have evenly spaced points in time (i.e. time won't necessarily be an integer multiple of the dt attribute), and error tolerances should be specified instead, using eg atol as mentioned (yet another new attribute, also disregarded by jLems). If those |
Thanks @borismarin , that makes sense. I think the ability to specify arbitrary simulator specific integration methods (or just a way to provide simulator specific code snippets that LEMS can ignore and "pass through" to the simulation engines) is perhaps a good general addition that we should look into. @pgleeson : what do you think? |
The closest thing to this is the Though these go in the network file and are generally used if the nml file is found on its own, to help generate a useful lems file (e.g. simulating on osb v1, but copuld be used when importing the nml (not lems) into netpyne...). I can't think of any example of a lems file that has metadata/properties with some simulator specific values. It certainly could be implemented in jnml, with jlems ignoring those options or refusing to run it, but it may be better to add general options for simulator specific info to neuromllite simulation files and more easily handle options for running them there, e.g. https://github.com/NeuroML/NeuroMLlite/blob/master/examples/Example4.py#L117, but that might require an update to the hoc/py files generated by NeuronWriter too... |
Just making a note: we do have a "Meta" tag that seems like it was included for this purpose. The LEMS interpreter ignores it, but it should be accessible in the neuron writer; I'll take a look to see if we can use this to specify cvode etc. |
Final PRs: and So, a file like this:
generates:
|
I think this is also needed: |
Great! It might be best though if you just make the Idea there is that if it is run as main, it will use the set values, otherwise it is a class that can be imported elsewhere which requires these values to be set for it to be used correctly (think this is what happens in openworm's c302...) |
Cool, I'll go update it now. |
How does this look? It includes both, and setting the params for the cvode "enables it":
|
We also need to do this for netpyne, should be doable using the simconfig bit by setting http://www.netpyne.org/user_documentation.html https://github.com/search?q=repo%3Asuny-downstate-medical-center%2Fnetpyne%20cvode&type=code |
I'm running some sims here and getting lots of nan values. Apparently, to workaround this, one has to reduce the
tolerance
value used in NEURON:https://nrn.readthedocs.io/en/8.2.2/hoc/simctrl/cvode.html#CVode.atol
How would one do this while using NeuroML to generate NEURON code? (I don't think we have a way to do it yet?)
A workaround would be to generate the python script and then add a line to it, but this isn't ideal.
Edit: tasks:
The text was updated successfully, but these errors were encountered: