Skip to content

Commit

Permalink
Reduce peak memory usage when freezing parameters. (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
lkhphuc authored Aug 16, 2022
1 parent 61c76ea commit 1c6f5aa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion big_vision/optax.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def create_schedule(mult=1.0, **kw):
# Removes weight decay updates. Note that weight decay already has an
# independent mask (which cannot be combined easily with a second mask),
# so instead we multiply updates for frozen params with zero.
optax.masked(optax.scale(0.0), frozen_mask)
optax.masked(optax.set_to_zero(), frozen_mask)
]

# Gradient clipping.
Expand Down

0 comments on commit 1c6f5aa

Please sign in to comment.