Skip to content

Avoid passing deterministic to complicated nested modules by using variable dict #2928

Answered by cgarciae
JyChang012 asked this question in Ideas
Discussion options

You must be logged in to vote

First thing to note is that Flax is very explicit about everything, it doesn't try to do anything for you to give you maximum control. That said, I share the sentiment and in the past created the Scope Flags FLIP (#2131) to try to minimize passing down these parameters, take a look at some of the comments.

The current situation is that flags are indeed implemented (Module.scope.flags exists) but currently we only use it to power the Module.is_initializing method, but we don't expose them and our layers don't use them (apart from their use of is_initializing). In theory we could have something like this:

y = module.apply({'params': params}, x, flags={'deterministic': False})

I'll try to br…

Replies: 1 comment 1 reply

Comment options

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

Answer selected by JyChang012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
2 participants