Repository navigation
Search every L-BFGS step with a zoom line search by default - #170
Merged
jessegrabowski merged 6 commits intoOct 6, 2026
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
lbfgs_updates, the L-BFGS rule, now takes an optionalline_search. With one set, it searches along the step-learning_rate * H gand moves by the step size the search accepts, solearning_ratebecomes the first trial. Thelbfgsalias defaults tozoom_line_search(), and on Rosenbrock it reproduces the first 12 losses ofoptax.lbfgs()to 1e-10.With the search on,
lbfgs()raises when it is given precomputed gradients, when it is placed after another transform in a chain, or when the loss draws random numbers. The search evaluates the loss at several trial points, so it needs the loss itself, and the loss has to be deterministic.line_search=Nonerestores the fixed step.On mlx, every search runs all
max_stepstrials, becausemx.compilecannot stop a loop early. Each step there costs that many loss and gradient evaluations.LineSearchandzoom_line_searchare now exported frompytensor_ml.optim.Closes #58
📚 Documentation preview 📚: https://pytensor-ml--170.org.readthedocs.build/en/170/