Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Begin adding the most requested feature in the history of Arbor: Tuning parameters online.
The API is still rough, but centers on presenting a proxy object of the cell to an
editorspecific to the cell kind.The easy parts
This is quite easy for the simple cell kinds: bench, source, and lif, where the original description objects can be used.
In these cases, the
editoris a callable object that changes the description object. Examplelif_editor ed = [](lif_cell& lc) { lc.Cm = 42; }The descriptions will be pre-filled with the current status and map 1:1 on the lowered representations.
Cable Cells
For cable cells, however, we'll need to think a bit more. The most common request seems to be the ability to tweak mechanism parameters. The current, rough-cut, API allows for that, with some limitations.
All CVs with the given mechanism will be affected, ie, setting
hh:gkbar=42on a cell with two non-overlapping instances ofhhwill not distinguish between instances. Likewise, we currently do not honouriexprparameters nor do we allow editing withiexpr. Partially painted CVs are fine, though, by virtue of the weight construction.Editors here are, as the mapping between representations and editable parameters is no longer bijective, objects describing the action without access to current values.
Dealing with partially painted CVs
Due to Arbor model of orthogonal discretisation and decoration this situation might occur, using
hhas an example
Now,
CV 1has a value ofgkbar = w A + (1 - w) Bwherewis computed duringlowering. However, without having access to both
wandAwe cannot compute an updateto
gkbarinCV 1.The above layout can happen for parameters (like
Cm) too and requires the same solutions.A similar situation in which the two instances share but do not cover a CV
Now,
CV 1has a value ofgkbar = w A + v Bwherewandvthe respective weights of theleft and right instances of
hh. Again, we need access to both the old valueAand the weighton the CV to compute the update
gkbar' - gkbar = w (A' - A)whereA'is the desired new value.The above layout canont happen for parameters.
Dealing with partial / region-based edits
This is a similar, but not identical issue to above and consequently hits similar difficulties.
Depending on the usecase, modellers may want to tweak parameters in a specific region
of the morphology only. This is analog to the
paintinterface.Before
After editing with new value
Band appropriate region expressionProposed semantics (symbolically) if
(paint (region "paint-region") hh (gkbar=A))then
(set hh:gkbar=B (region "edit-region"))should setgkbar=Bin the regiondefined by
(intersect (region "paint-region") (region "edit-region"))The same holds for parameters.
Potential solutions
If we do not want to keep morphologies and CV discretisations alive inside the simulation
(hint: we dont), we need to store a map
cv -> (branch, prox, dist) = msegmentinstead.Then, the user can construct a list of
msegmentfrom a region and a morphologymrfthat is their responsibility to keep alive via this chain
which can then be used to update parameters.
However, this has problems.
mrfhas been used to construct the cell being edited.Dealing with derived mechanisms
i.e. those like
pas/e=-80. In the current status, we have no way of distinguishing the concreteinstance in a scenario like this:
in fact, the ABI interface presents the
namefield aspasand the global parameter defaulte=-70.By just iterating and looking for the first match on
name, we seem to find the last instance.A corollary of Arbor's rules
We do not allow two (or more) mechanisms with the same dynamics (base + GLOBAL values) to be present on the same
CV (keyword: overpainting). RANGE parameters are blended according to the relative coverage of the CV, but we cannot
do the the same to GLOBAL (how would we blend a reversal potential?)
Thus we cannot allow editing of GLOBAL parameters
Potential solutions
globalssection along the lines ofoverrideto storepas/e=-70somewhere (additionally to original name?)ppackfor a match on globals. That might clash with edits if we can allow those (likely, we cannot)TODO
pas/e=-80