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

Start using termination conditions from DiffEqBase #208

Merged
merged 14 commits into from
Oct 26, 2023

Conversation

utkarsh530
Copy link
Member

Requires #203

@utkarsh530
Copy link
Member Author

Based on: SciML/SimpleNonlinearSolve.jl#45

Should we keep the existing interface, i.e., providing options to specify abstol and reltol from the solve? Currently the handling is similar to that in Broyden in SimpleNonlinearSolve.

@codecov
Copy link

codecov bot commented Sep 13, 2023

Codecov Report

Merging #208 (350fac5) into master (191a237) will increase coverage by 0.49%.
The diff coverage is 93.46%.

@@            Coverage Diff             @@
##           master     #208      +/-   ##
==========================================
+ Coverage   92.42%   92.91%   +0.49%     
==========================================
  Files          19       19              
  Lines        1702     1806     +104     
==========================================
+ Hits         1573     1678     +105     
+ Misses        129      128       -1     
Files Coverage Δ
src/broyden.jl 100.00% <100.00%> (+12.82%) ⬆️
src/dfsane.jl 100.00% <100.00%> (ø)
src/klement.jl 86.60% <100.00%> (+1.31%) ⬆️
src/lbroyden.jl 90.90% <100.00%> (+0.50%) ⬆️
src/levenberg.jl 98.86% <100.00%> (+0.04%) ⬆️
src/pseudotransient.jl 100.00% <100.00%> (ø)
src/raphson.jl 100.00% <100.00%> (ø)
src/trustRegion.jl 99.37% <100.00%> (+0.01%) ⬆️
src/gaussnewton.jl 78.31% <81.25%> (-1.14%) ⬇️
src/utils.jl 82.63% <70.83%> (-1.99%) ⬇️

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@ChrisRackauckas
Copy link
Member

Should we keep the existing interface, i.e., providing options to specify abstol and reltol from the solve?

Yes, for simplicity and keeping the same interface. If abstol or reltol are used, that should specify the termination condition. If the termination condition is used, then that allows for a much more detailed specification. If both are specified, then error.

@utkarsh530 utkarsh530 force-pushed the u/termination_condition branch from 3eb98ae to a6d1020 Compare September 26, 2023 01:19
@utkarsh530
Copy link
Member Author

If both are specified, then error.

I based this check on the SimpleNonlinearSolve.jl behavior:

https://github.com/SciML/SimpleNonlinearSolve.jl/blob/main/src/batched/utils.jl#L17-L20

@utkarsh530 utkarsh530 marked this pull request as ready for review September 26, 2023 01:26
@ChrisRackauckas
Copy link
Member

@avik-pal can you work with @utkarsh530 to rebase this and get it in? Are the termination conditions all uniform after this?

@utkarsh530 utkarsh530 force-pushed the u/termination_condition branch 2 times, most recently from aff4595 to eefbca3 Compare October 10, 2023 07:29
@ChrisRackauckas
Copy link
Member

I think this is just about done, but we need to discuss a few last interface issues:

  1. Usually general solver controls go into solve. We should make this a solve keyword argument?
  2. We should make sure abstol and reltol lower in clearly documented ways that match how it's done in SteadyStateDiffEq.jl, i.e. if abstol and/or reltol is given, it defines a TerminationCondition that is sensible, and if abstol and/or reltol is given but also a TerminationCondition is given, it should check compatibility or error that incompatible termination condition combinations were seen.

What this does is effectively allow for the "simple" interface of abstol/reltol that everyone knows and loves to carry over to this domain, while allowing a much more detailed interface to control convergence if desired. However, we need to make sure it's fully uniform before adopting it.

@avik-pal can you chime in.

@avik-pal
Copy link
Member

Yeah I agree with the suggestions. The original implementation lived inside DEQs.jl so it was't fleshed out carefully.

@utkarsh530 utkarsh530 force-pushed the u/termination_condition branch from eefbca3 to 2763d65 Compare October 19, 2023 20:18
@ChrisRackauckas
Copy link
Member

Is this done?

src/gaussnewton.jl Outdated Show resolved Hide resolved
@avik-pal avik-pal mentioned this pull request Oct 20, 2023
6 tasks
@utkarsh530
Copy link
Member Author

No, not done yet

@utkarsh530
Copy link
Member Author

@ChrisRackauckas @avik-pal this should be good to merge now.

@ChrisRackauckas ChrisRackauckas merged commit dbed34c into SciML:master Oct 26, 2023
9 of 11 checks passed
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.

3 participants