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

Update for new line search functionality. #613

Merged
merged 1 commit into from
Jun 6, 2018
Merged

Update for new line search functionality. #613

merged 1 commit into from
Jun 6, 2018

Conversation

pkofod
Copy link
Member

@pkofod pkofod commented Jun 6, 2018

@anriseth this should sync Optim with LineSearches.

Copy link
Contributor

@anriseth anriseth left a comment

Choose a reason for hiding this comment

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

Great :D

Shall we tag a new version of Optim with the last two months changes, or are there more things to address?

I guess that at some point we could possibly use the make_\phi functions from within Optim instead of passing df to the line search. That sounds like a non-breaking change, however, so it can possibly wait?

@@ -40,10 +40,8 @@ function perform_linesearch!(state, method, d)
state.alpha, ϕalpha =
method.linesearch!(d, state.x, state.s, state.alpha,
state.x_ls, phi_0, dphi_0)
state.dphi_0_previous = dphi_0
Copy link
Contributor

Choose a reason for hiding this comment

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

Should you not update dphi_0_previous if is is of type InitialConstantChange?

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, I don't see the value of dϕ_0_previous being assigned or updated anywhere in either Optim or LineSearches?

Copy link
Member Author

@pkofod pkofod Jun 6, 2018

Choose a reason for hiding this comment

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

That's an oversight. That's supposed to happen in LineSearches! Doesn't seem to cause any errors, so LineSearches probably needs a test and a bug fix :)

return true # lssuccess = true
catch ex
state.dphi_0_previous = dphi_0
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above

state.dphi_0_previous = state.nlpreconstate.dphi_0_previous # assumes precon is a linesearch based method. TODO: Deal with trust region based methods
if typeof(method.alphaguess!) <: LineSearches.InitialConstantChange
if typeof(state.nlpreconstate.alphaguess!) <: LineSearches.InitialConstantChange
method.alphaguess!.dphi_0_previous = state.nlpreconstate.alphaguess!.dphi_0_previous # assumes precon is a linesearch based method. TODO: Deal with trust region based methods
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't this property now called dϕ_0_previous?

Copy link
Contributor

Choose a reason for hiding this comment

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

@pkofod this will crash because the property in alphaguess! Is no longer called dphi_0_previous; it uses the symbolic version of phi.

Copy link
Member Author

Choose a reason for hiding this comment

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

Right. Since GMRES uses a specific type it should probably have tests with combinations of these line searches, right?

@@ -40,10 +40,8 @@ function perform_linesearch!(state, method, d)
state.alpha, ϕalpha =
method.linesearch!(d, state.x, state.s, state.alpha,
state.x_ls, phi_0, dphi_0)
state.dphi_0_previous = dphi_0
Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, I don't see the value of dϕ_0_previous being assigned or updated anywhere in either Optim or LineSearches?

@pkofod pkofod merged commit 504f632 into master Jun 6, 2018
@pkofod pkofod deleted the linesearch branch June 6, 2018 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants