-
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
We need a Neuroblox interface to change parameters for remake #407
Comments
I had implemented something along the same lines as what you propose, but using the get_inds(x::Vector{SymbolicUtils.BasicSymbolic{Real}}, name) = findall(x -> contains(string(x), name), x)
σ_ind = get_inds(parameters(sys), "σ")
setσ! = setp(prob, parameters(sys)[σ_ind])
σ_new = 1.0
prob_new = remake(prob)
setσ!(prob_new, fill(σ_new, length(setσ!.original_index))) This was for setting all the values of a class of parameter to the same value, but you could pass a vector with different values too. σ_new = rand(10)
setσ!(prob_new, σ_new) For reference, these are the relevant parts of my implementation, but was basically as shown above: https://github.com/Neuroblox/DBS-experiments/blob/13096ab0693860ca6a40a8181eb34e89f044a115/src/utils.jl#L45 |
German, thanks. I had looked at your code before I created the Issue. I want to get opinions from the whole Neuroblox development group on what strategy to implement for Neuroblox. |
Yeah, this is kinda a hard problem I think. I've played around with a couple ideas for this in GraphSystems but haven't developed any of them very far. I'll try to spend some time on this soon though because its an important usability problem. Maybe the way to do it would be to have an API for replacing a specific neuron or something? |
So I've got the This is actually quite convenient for GraphDynamics because we aren't necessarily storing those symbolic objects anyways, we're just storing symbols currently. So you can do e.g.
without having to have that thing defined in your namespace at all. |
I have been looking into different ways to change parameters in an already existing problem.
The MTK way is that you do the following:
prob_new = remake(prob, p = [p1 => 2.0])
The problem for us is that p1 is a symbolic parameter that has to be known in the namespace. But our parameters are not in the global namespace, and therefore we have to find them.
We can find them by doing:
parameters(sys)
and then searching for the name by:
sym_p = parameters(sys)
myp = sym_p[findall(x->contains(string(x),"p1"),sym_p)][1]
prob_new = remake(prob, p=[myp => 2.0])
is this a good way of approaching the problem? Shall we implement this method in blox_utilities?
The text was updated successfully, but these errors were encountered: