Skip to content

Manually updating parameters - documentation traverse util #1073

Answered by marcvanzee
GJBoth asked this question in Q&A
Discussion options

You must be logged in to vote

I think you proposed solution works fine and I don't think it is necessary to use traverse_util if you simply want to update a subtree of your variables. The unfreeze/freeze pattern is quite common, and it is for instance also used in our Model Surgery HOWTO.

traverse_util can be usee for more complex operations. For instance, if you would like to replace all occurrences of output_layer in your params with a different subtree. For more details on how this can be used, it may be insightful to take a look at some of the tests in tests/traverse_util_test.py.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@GJBoth
Comment options

Answer selected by GJBoth
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants