-
Notifications
You must be signed in to change notification settings - Fork 4
More flexible regularization of Newton step #44
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
Conversation
…cluding lagrangian hessian regularization for games
lassepe
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.
LGTM modulo minor comments
| mcp.∇F_z!(∇F, x, y, s; θ, ϵ) | ||
| end | ||
|
|
||
| if regularize_linear_solve === :identity |
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.
This could be folded into a elseif of above
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.
I considered that, but thought the logic was simpler this way. Basically, for :internal mode you need to regularize ∇F directly when computed in place, and for both :identity and :none you compute it without the extra parameter. Then, for :identity only do you modify it when passing to the linear solver by adding an explicit scaled identity (if ∇F is square).
src/mcp.jl
Outdated
| """ | ||
| struct PrimalDualMCP{T1,T2,T3} | ||
| "A callable `F!(result, x, y, s; θ, ϵ)` which computes the KKT error in-place." | ||
| "A callable `F!(result, x, y, s; θ, ϵ, [η])` to the KKT error in-place." |
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.
| "A callable `F!(result, x, y, s; θ, ϵ, [η])` to the KKT error in-place." | |
| "A callable `F!(result, x, y, s; θ, ϵ, [η])` to compute the KKT error in-place." |
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.
lol thanks
Adds an additional kwarg in the solver which allows the user to specify how the Newton step computation should be regularized. Currently supports three options:
:none(no regularization):identity(adds scaled identity to the KKT Jacobian):internal(assumes that the Symbolics-generated KKT Jacobian accepts a regularization parameter directly)Also adds an example of
:internalregularization ingame.jlwhere we add a scaled identity only to the blocks of the KKT Jacobian that correspond to the Hessian of each player's Lagrangian wrt its decision variable.Also adds some minimal logic to adjust regularization strength depending upon success/failure of inner loop solves.