Skip to content
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

Auglag #50

Merged
merged 29 commits into from Jan 29, 2017
Merged

Auglag #50

merged 29 commits into from Jan 29, 2017

Conversation

syarra
Copy link
Collaborator

@syarra syarra commented Apr 17, 2016

auglag is back....

there is a bug with stopping criteria between TRON and auglag.
Needs more investigation.

@syarra
Copy link
Collaborator Author

syarra commented Apr 17, 2016

Maximum number of function calls in TRON is sometimes attained because of repeated use of the same model. TRON stopping criterion on maxfuncall should be relative to previous number of function calls in model.

@dpo
Copy link
Contributor

dpo commented Apr 17, 2016

Not sure I understand. When AugLag creates a TRON instance, can't it set the max number of function evals?

p = x - g
med = np.maximum(np.minimum(p, self.model.Uvar), self.model.Lvar)
q = x - med
return q
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is now available as a function in tools.utils.

@syarra
Copy link
Collaborator Author

syarra commented Apr 17, 2016

Yes it can, but the issue is that TRON checks the number of function calls directly from the model.
In the model the total number of function calls is stored. And in auglag, we perform multiple calls to TRON with the same model. So total counts of function calls might exceed the given limit.

for instance: let say maxfuncall = 100

nlp.auglag INFO iter f ‖P∇L‖ ‖c‖ ρ inner stat ω η
nlp.auglag INFO 0 0.0e+00 7.0e+00 0.0 10.0 1.0e-01 8.1e-01
Entering TRON: exitFunCall: False
nlp.auglag INFO 1 -1.2e+01 7.8e+00 2.1e-01 1.0e+01 76 gtol 1.0e-01 8.1e-01
Entering TRON: exitFunCall: True
nlp.auglag INFO 2 -1.2e+01 2.1e+00 2.1e-01 1.0e+01 0 gtol 1.0e-02 1.0e-01
Entering TRON: exitFunCall: True
nlp.auglag INFO 3 -1.2e+01 2.1e+00 2.1e-01 1.0e+02 0 gtol 1.0e-02 7.9e-02
Entering TRON: exitFunCall: True
nlp.auglag INFO 4 -1.2e+01 2.1e+00 2.1e-01 1.0e+03 0 gtol 1.0e-03 6.3e-02
Entering TRON: exitFunCall: True
nlp.auglag INFO 5 -1.2e+01 2.1e+00 2.1e-01 1.0e+04 0 gtol 1.0e-04 5.0e-02
Entering TRON: exitFunCall: True
nlp.auglag INFO 6 -1.2e+01 2.1e+00 2.1e-01 1.0e+05 0 gtol 7.0e-05 4.0e-02
Entering TRON: exitFunCall: True
nlp.auglag INFO 7 -1.2e+01 2.1e+00 2.1e-01 1.0e+06 0 gtol 7.0e-05 3.2e-02
Entering TRON: exitFunCall: True
nlp.auglag INFO 8 -1.2e+01 2.1e+00 2.1e-01 1.0e+07 0 gtol 7.0e-05 2.5e-02
Entering TRON: exitFunCall: True
nlp.auglag INFO 9 -1.2e+01 2.1e+00 2.1e-01 1.0e+08 0 gtol 7.0e-05 2.0e-02
Entering TRON: exitFunCall: True
nlp.auglag INFO 10 -1.2e+01 2.1e+00 2.1e-01 1.0e+09 0 gtol 7.0e-05 1.6e-02
Entering TRON: exitFunCall: True
nlp.auglag INFO 11 -1.2e+01 2.1e+00 2.1e-01 1.0e+10 0 gtol 7.0e-05 1.3e-02

@dpo
Copy link
Contributor

dpo commented Apr 17, 2016

Well yes, the model accumulates the total number of objective calls. Instead of setting the max number to a huge value, I think AugLag should set it to, say, 100 the first time, 200 the second time, etc., or something similar.

Another possibility is for TRON to record the number of objective evals stored in the model before starting the solve, and stop when there's been 100 other objective evaluations (or 1000, or ...)

@dpo dpo mentioned this pull request Jun 7, 2016
@dpo
Copy link
Contributor

dpo commented Jun 24, 2016

Where does this stand?

@dpo
Copy link
Contributor

dpo commented Oct 15, 2016

Rebased.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling cdcc6b7 on auglag into * on develop*.

@dpo
Copy link
Contributor

dpo commented Oct 16, 2016

I made a few local changes that fix some bugs. Among the equality-constrained problems in COPS, we're solving two sizes of elec and getting there on the third, but struggling on chain and channel. We need to pass appropriate stopping conditions to TRON in the inner loop!!!

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 5235c74 on auglag into * on develop*.

Andrew Lambe added 6 commits October 26, 2016 22:38
Removed an unnecessary import in the SlackNLP class definition.
- corrected size error in SlackNLP for range constraints
- fixed variable names in Auglag
- if the trust region solver made no progress, (because it thinks the
problem is already solved,) exit immediately
If the optimization fails, but the point is feasible, return "feas"
as the status. This is useful on problems such as HS013, where the
optimal solution doesn't satisfy a constraint qualification.
Documentation fix in trustregion.py
@dpo
Copy link
Contributor

dpo commented Oct 27, 2016

This should probably be backtracked and rebased to include #72 cleanly. scratch that; your changes were merged here.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling a137dcc on auglag into * on develop*.

If the final step is not a descent direction, (checked by Armijo
line search class,) reject the step and contract the trust
region. This will get around the few cases when projection causes
a problem with the final step.
@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 9ed55ee on auglag into * on develop*.

syarra and others added 9 commits December 13, 2016 17:55
- add a projection to prevent x_trial from going out of bounds
- treat successful N-Y backtracking as a regular iteration
- move convergence checks based on function values so that they are only checked on accepted steps
number of iterations. Updated some documentation as well.
quasi-Newton version of augmented Lagrangian model.
@dpo dpo mentioned this pull request Dec 13, 2016
@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 4987703 on auglag into ** on develop**.

@lambe
Copy link

lambe commented Dec 16, 2016

It looks like this pull request is ready to close. There may be more bugs to fix, but Auglag works pretty well with all of the work to this point. I recommend merging into the develop branch.

@dpo dpo merged commit 27aeb4b into develop Jan 29, 2017
@dpo
Copy link
Contributor

dpo commented Jan 29, 2017

Thanks all!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants