-
Notifications
You must be signed in to change notification settings - Fork 62
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
Inhomogeneous parameters #1887
Inhomogeneous parameters #1887
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi,
some minor comments, rest looks good.
The code style issues should be addressed now. I've also tried to improve the documentation with custom images for distance and interpolation expressions. |
doc/concepts/decor.rst
Outdated
|
||
4. Scaled mechanisms | ||
~~~~~~~~~~~~~~~~~~~~~ | ||
:ref:`Inhomogenous expressions <labels-iexpr>` can be applied to mechanisms, to scale parameters on a cable cell. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, if you want to keep iexpr
, motivate why they are called inhomogeneous
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's now "... to scale parameters on a cable cell, such that a parameter is inhomogenous along the cell." Did you have a longer explanation in mind or would this be fine?
doc/concepts/decor.rst
Outdated
4. Scaled mechanisms | ||
~~~~~~~~~~~~~~~~~~~~~ | ||
:ref:`Inhomogenous expressions <labels-iexpr>` can be applied to mechanisms, to scale parameters on a cable cell. | ||
These expressions are evaluated at mid-points of the internal cable partition of the cell and multiplied with the set parameter value. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Finally his could be made clearer and best split into two sentences.
- These expressions yield a scaling factor that can be applied to a base value of a parameter (currently only density mechanisms).
- Example
- The point of evaluation is the mid point...
Since 3. is a important detail, but does not add to the understanding of the concrete use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've reformulated the text and changed the example to use a distance expression.
3e6671a
to
b7b71c6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One last (I promise!) clarification in the docs.
doc/concepts/decor.rst
Outdated
|
||
4. Scaled mechanisms | ||
~~~~~~~~~~~~~~~~~~~~~ | ||
:ref:`Inhomogenous expressions <labels-iexpr>` can be applied to mechanisms, to scale parameters on a cable cell, such that a parameter is inhomogenous along the cell. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest to massage this a bit
Sometimes, it is useful to have parameters varying smoothly along the dendrite, for example with the distance from the root.
:ref:`Inhomogenous expressions <labels-iexpr>` allow modelling this behavior (the name is inspired by NeuroML's https://docs.neuroml.org/Userdocs/Schemas/Cells.html#schema-inhomogeneousparameter).
These can be applied to mechanisms (and a subset of their parameters) and yield a scaling factor which is multiplied with the base value of the selected parameter.
Currently Arbor supports only :ref:`density mechanisms <cablecell-density-mechs>` as targets.
Internally, the value of each expression is evaluated at mid-points of the cable partition of the cell.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about:
Mechanism parameters are usually homogeneous along a cell. However, sometimes it is useful to scale parameters based on inhomogeneous properties.
:ref:`Inhomogeneous expressions <labels-iexpr>` provide a way to describe a desired scaling formula, which for example can include the cell radius or the distance to a given set of locations.
The name is inspired by NeuroML's https://docs.neuroml.org/Userdocs/Schemas/Cells.html#schema-inhomogeneousparameter.
Such an expression is evaluated along the cell and yields a scaling factor, which is multiplied with the base value of the selected parameter.
Internally, this evaluation and scaling is done at mid-points of the cable partition of the cell.
Currently, only parameters of :ref:`density mechanisms <cablecell-density-mechs>` can be scaled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, that reads way smoother now!
I'll leave the commit message and merge to you @AdhocMan |
🎉 |
Implementation of #1650.
This PR adds inhomogeneous expressions (
iexpr
) and a wrapper structscaled_mechanism
(naming suggestions are welcome), to allow painting of mechanisms (currently limited to density), where selected parameters can be scaled byiexpr
evaluated along a cell. The wrapper allows for the current mechanism API to remain unchanged.Any
iexpr
can be converted from / to S-Expressions and added to the label dictionary.A python example: