-
Notifications
You must be signed in to change notification settings - Fork 0
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
DBS protocol #481
DBS protocol #481
Conversation
(I cancelled the last checks because I had only added some docstrings) |
offset=0.0, | ||
start_time=0.0, | ||
smooth=1e-4 | ||
p = paramscoping( |
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.
These parameters are set as tunable=true
in paramscoping
, was this intended for the current case? E.g. do you expect to fit such parameters in an inverse problem setting?
- If no, then I'd say just define your parameters explicitly here with
tunable=false
to avoid having them included in optimization/fitting problems. - If yes, then maybe consider moving the
paramscoping
call at the beginning of the function, in case any of these parameters areNum
s instead of numbers, so that the correctly scoped parameters will be used in your stimulus function. In atunable=true
setting it could be the case that multiple sources share the same parameters, so the input types could be the sameNum
s among multipleDBS
sources. In this case you would need to overwrite the input parameters with the return ofparamscoping
e.g. like here
Neuroblox.jl/src/blox/neural_mass.jl
Lines 202 to 203 in 02fd048
p = paramscoping(τ=τ, H=H, λ=λ, r=r) τ, H, λ, r = p
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 for noticing this! I'm not expecting to fit these parameters, at least for now. Maybe in the future we could fit them, but we can change it to tunable=false
for now and modify it in the future if needed.
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.
Ye I wasn't expecting to fit source parameters either to be honest. Usually these are known.
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.
For setting parameters as non-tunable, which option would you suggest?
- Use
paramscoping
and then untune all parameters withuntune!
- Manually set each parameter as @parameters $p = p [tunable=false]
- Add a tunable flag to paramscoping:
function paramscoping(;tunable=true, kwargs...)
paramlist = []
for (kw, v) in kwargs
if v isa Num
paramlist = vcat(paramlist, ParentScope(v))
else
paramlist = vcat(paramlist, @parameters $kw = v [tunable=tunable])
end
end
return paramlist
end
I would go with option 3).
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.
Sure, go for it.
Besides the one comment above, could you add some tests for the new source & protocol? |
On a different topic, regarding conventions, currently, I call Also, since Neuroblox's unit of time is ms, I'm using frequency here in units of 1/ms = kHz. However, I wonder if we should accept Hz as input and handle the conversion internally. This could be more user-friendly since users will be more likely to think in Hz, especially in the case of DBS, where frequencies are |
No strong feelings about it. Technically it is a constructor dispatch but I guess you use a different name (other than
Sure as long as you document that in the docstring. We should start using a units package soon. |
- set DBS and protocol_dbs parameters as not tunable
- change input frequency units to Hz
* initial DBS protocol for getting ERNAs * unify DBS and DBSProtocol into single type * add DBS protocol example * add docstrings for `DBS` and `protocol_dbs` constructors * add a tunable option to `paramscoping` function * set DBS and protocol_dbs parameters as not tunable * change constructor name to ProtocolDBS * change input frequency units to Hz * add tests for ProtocolDBS * adjust `frequency` in `compute_transition_times` --------- Co-authored-by: haris organtzidis <[email protected]>
Allows setting up DBS protocols similar to those empirically used in clinical studies to obtain ERNAs.