You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I commonly create a sample_kwargs variable in notebooks and re-use it in multiple models. Such a dictionary ends up being modified in-place by pm.sample when entries are popped, for example here and here, leading to models beyond the first silently using defaults settings.
I guess the easiest fix would just be to deepcopykwargs, so that there are no side effects on user inputs. Using pop here is a bit overkill (why not just ,get?) but deepcopy is a 1-line change.
The text was updated successfully, but these errors were encountered:
Description
I commonly create a
sample_kwargs
variable in notebooks and re-use it in multiple models. Such a dictionary ends up being modified in-place bypm.sample
when entries are popped, for example here and here, leading to models beyond the first silently using defaults settings.I guess the easiest fix would just be to
deepcopy
kwargs
, so that there are no side effects on user inputs. Usingpop
here is a bit overkill (why not just,get
?) butdeepcopy
is a 1-line change.The text was updated successfully, but these errors were encountered: