optax icon indicating copy to clipboard operation
optax copied to clipboard

MultiSteps does not work with update functions that require parameters

Open msdejong opened this issue 5 years ago • 1 comments

The MultiSteps wrapper https://github.com/deepmind/optax/blob/30947fbc5743adc3e997c6242fa3775834862a74/optax/_src/wrappers.py#L179 for gradient accumulation does not feed parameters to the wrapped optimizer. These are needed for e.g. weight decay https://github.com/deepmind/optax/blob/30947fbc5743adc3e997c6242fa3775834862a74/optax/_src/transform.py#L547 which I think is used in almost every optimizer chain.

As far as I can tell every transformation accepts params, so is there any reason not to pipe them through?

msdejong avatar Jun 24 '21 01:06 msdejong

As I understand, this bug was fixed by #150 at the time so I am closing this issue. Thanks a lot for reporting!

mkunesch avatar Oct 21 '21 10:10 mkunesch