-
Notifications
You must be signed in to change notification settings - Fork 311
Raise error on unused extra kwargs in backtracking linesearch #1559
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
base: main
Are you sure you want to change the base?
Raise error on unused extra kwargs in backtracking linesearch #1559
Conversation
|
Thanks! I have a few suggestions to wrap this up:
|
|
Thanks for the suggestions! This all makes sense — I’ll update the docstring to document the new validation, apply the same unused-argument check to I’ll follow up shortly with the updates. |
3a12fd7 to
37abe97
Compare
- Raise TypeError on unused keyword arguments - Apply validation consistently to backtracking and zoom linesearch - Update docstrings to document new behavior - Add tests for unused extra_args errors
37abe97 to
901a341
Compare
I’ve made the requested updates
I’ve squashed the changes into a single commit in line with the JAX contributing guidelines. Please let me know if you’d like any further tweaks or clarifications! |
|
LGTM, thank you! |
|
Thank you so much for the review and guidance — I really appreciate it! |
vroulet
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the catch
|
And thanks @selamw1 for the careful review! |
Motivation
scale_by_backtracking_linesearchaccepts extra keyword arguments that areforwarded to
value_fn. Currently, any unused keyword arguments are silentlydiscarded, which can lead to subtle bugs (e.g. in Flax training loops) and makes
misconfiguration hard to diagnose.
What this PR does
backtracking linesearch update.
Why this is safe
Tests added
test_linesearch_raises_on_unused_extra_args