-
Notifications
You must be signed in to change notification settings - Fork 35
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
update_param! dirties the model definition #753
Comments
The reason it "dirties" the model is because after you update the parameter value, the model definition now does not match the model instance (the model instance still holds computed values from when the parameter in question was equal to the old value). I don't see this as a bug. However, we have previously discussed adding an unsafe version of |
Alternatively, we could add an option to the |
Or we just start to expose the whole model instance/definition distinction in the public API for advanced use cases? For example, this could be written as: m = MimiFUND.get_model()
mi = get_new_instance(m) # I guess this is just build, right?
for i=1:10
update_param!(mi, :foo, rand())
run(mi)
end And so the idea would be that an |
@davidanthoff is this resolved now? i.e. does |
No, I think we currently actually don't have the notion that a model instance can use a different instance of values for a parameter than its model definition, right? At least that is how the data structure looks to me right now. I think what we'll need to do in
I think that should probably do it? |
When I do this:
What this means is that code like this:
will rebuild the model instance in every loop.
That is not how it should be, right? We want to be able to update external parameter values and rerun without rebuilding, it seems to me?
Or do we need to manually construct a model instance in that case and then update the parameter values only in the model instance?
The text was updated successfully, but these errors were encountered: