-
Hi all, I'm working with models with states and parameters and having to manually split the parameters and variables, and then delete the original variables feels not very streamlined. Would it be an idea to add an option split_params=True/False to the init function, which if true would return a tuple (params, variables)? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
Related to this: the recurrent examples don't initialize the state as a variable, but as a separate carry. Is there any specific reason for this? |
Beta Was this translation helpful? Give feedback.
-
Currently the easiest thing to split of the params is to call
That's pretty short and you can even just write the one-liner: On a side note: We are thinking about patterns that avoid having to split the two in the first place. The main reason why you need this is because the optimizer holds the params and the user code holds the state. |
Beta Was this translation helpful? Give feedback.
Currently the easiest thing to split of the params is to call
FrozenDict.pop
:That's pretty short and you can even just write the one-liner:
Model().init(...).pop("params")
On a side note: We are thinking about patterns that avoid having to split the two in the first place. The main reason why you need this is because the optimizer holds the params and the user code holds the state.