-
Notifications
You must be signed in to change notification settings - Fork 7
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
Suggestion: standardize parameter retrieval / supply interface #241
Comments
Thanks, this is really good input and something I been thinking about myself! As a clarification, As of your thoughts:
What do you think? Also, @TorkelE you might be interested in this if you have time. |
Thanks for your reply, it makes more sense now.
Yes completely agree. But functions like
Yes for sure that would help a lot. |
I think the best solution here would just to add an order check in these function. And if the order is wrong, the error message can refer to an ordering function.
I think this is a valid point, but I also see this getting very complicated for the future when for example adding neural network support in PEtab (which definitely will happen within this year). Maybe what is needed is a |
Would it not be an option to handle that internally? The component array already has the axis names and the values. So technically it should be able to automatically infer the right order without the user having to specify it? If I compare it to using plain MTK, I specify: @parameters A B C D
params = [A, B, C, D]
values = [1, 2, 3, 4]
parammap = Dict(params .=> values) And |
Fair point, and Then the only thing left is the Lastly, do you think a |
To make the package even better I want to make the suggestion to standardize the way you retrieve parameters and supply them to constructors. This standardization should be independent of the scale of the parameters, be it problem or inference space.
To illustrate why this is useful, I am currently trying to achieve the following.
I have an optimisation result and the original problem:
Now I want to achieve the following:
problem.nllh
,problem.FIM
etc.How to achieve this?
I go to the API and see what's available. I can get
result.xmin
and pass it directly toproblem.nllh
and it works, great. Butxmin
is the in the inference scale, I want to save the parameters in linear scale. Well there is no method to do that, but I can do:xmin_lin = PEtab.get_ps(result, problem)
. But this method is missing the noise parameters? I want to save those too.I can get the noise parameters from xmin however, and combine them with the linear parameters:
But this is really ugly. If I want to
remake
the problem, I have to supply:But where to get this dict? Also why is it a dict, why can't I pass my ComponentArray? Yeah okay, you can hardcode it, but for larger models this is not doable.
Lastly, I can use the very convenient
get_x
to get my parameters on linear scale and in the right order. But to get my inference result in this format, I need toremake
it first withxmin
. But if I do that, the result fromremake
is missing all of the parameters.So this fails with
KeyError: key :log10_C_e not found
I think instead of passing results, dicts, componentarrays and parameter vectors around I think it would improve usability a lot if we had one single definition of a parameter object. So that each method takes the exact same object, knows at what scale (or is specified by the user) it is so that if it needs to put it in inference scale it can do that internally. It should not have to rely on the order of the parameter, or whether it's called
log10_C_e
instead ofC_e
.The text was updated successfully, but these errors were encountered: