Skip to content
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

make make_rng default to 'params' #3699

Merged
merged 1 commit into from
Feb 21, 2024
Merged

Conversation

chiamp
Copy link
Collaborator

@chiamp chiamp commented Feb 15, 2024

Following #3669.

The Flax team has decided to switch the default make_rng name to 'params' instead of 'default'.

This would have the following effect (see the original proposal with 'default' in #3668):

  • Make self.make_rng(name='params') callable without explicitly passing in a string name, in which it would default to the 'params' RNG stream
    • This would allow the user to pass in a single RNG mapping (e.g. {'params': random.key(0)}) to .init() and .apply() that self.make_rng('other_rng_stream') will use as the RNG seed if, for example, {'other_rng_stream': random.key(1)} wasn't in the RNG mapping that was passed into .init() or .apply()

@chiamp chiamp self-assigned this Feb 15, 2024
@chiamp chiamp requested a review from cgarciae February 15, 2024 21:00
@codecov-commenter
Copy link

codecov-commenter commented Feb 15, 2024

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (736d133) 59.10% compared to head (c6b5de0) 59.10%.

Files Patch % Lines
flax/core/scope.py 33.33% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3699   +/-   ##
=======================================
  Coverage   59.10%   59.10%           
=======================================
  Files         103      103           
  Lines       12426    12426           
=======================================
  Hits         7345     7345           
  Misses       5081     5081           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@copybara-service copybara-service bot merged commit c83ee86 into google:main Feb 21, 2024
19 checks passed
@chiamp chiamp deleted the make_rng branch March 16, 2024 00:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants