-
Notifications
You must be signed in to change notification settings - Fork 129
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
Add a workaround for NonlinearOptimizer rejecting all batch steps #388
Conversation
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. Please make sure the predicted error for LM and dogleg is also divided by 2.
f8c4d48
to
a8d3dc7
Compare
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. Just one minor 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!
@@ -107,6 +107,8 @@ def resolve(key: Union[str, "BackwardMode"]) -> "BackwardMode": | |||
# ignoring indices given by `reject_indices` | |||
# 3. Check convergence | |||
class NonlinearOptimizer(Optimizer, abc.ABC): | |||
_MAX_ALL_REJECT_ATTEMPTS = 3 |
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.
Any tradeoff or overhead to consider here? Curious about the choice of 3
attempts. Are these all kept in the compute graph?
Also might be helpful to add in a comment that these max attempts are per iteration and not overall.
…cebookresearch#388) * Small refactor of nonlinear optimizer _step. * Included use of adaptive damping in end-to-end test. * Changed all reject logic to skip the latest iteration. * Added NonlinearOptimizer._error_metric() method. * Prevented incorrect combination of ellipsoidal and adaptive damping in LM. * Fix LM unit test to account for unsupported damping case (ellipsoidal + adaptive).
In this version we sometimes have to recompute the error norm if some steps are rejected, so optimizing error vectorization becomes important again. Will fix in a separate PR.