Fixing parameter values when solving inverse problem using DiffEqFlux

Is there a way to fix certain parameters when using sciml_train? I could manually override them in the loss function like below but am curious if theres a better way

function loss(p)
    overridden_p = p but with some parameters fixed
    sol = solve(prob, Rodas4(), p=overridden_p)
    ...
end

My use case is that I am modeling a pipe thats got some geometric parameters like length, and sometimes maybe I do want the optimizer to change those values during optimization but maybe some other times I already have a certain pipe in mind with a certain length and dont want the optimizer to change that parameter and just leave it to whatever I set initially.

For right now, manually override. We should set this up in the optimizer some time, but it’s not in the interface right now.

1 Like