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

BiLQR & TriLQR #159

Merged
merged 13 commits into from
Dec 18, 2019
Merged

BiLQR & TriLQR #159

merged 13 commits into from
Dec 18, 2019

Conversation

amontoison
Copy link
Member

@amontoison amontoison commented Nov 14, 2019

  • BiLQR and TriLQR methods for solving adjoint systems Ax=b and Aᵀt = c
  • ODE and PDE adjoint problems used as tests
  • Generalized TriLQR for rectangular matrices
  • Allows inconsistent dual systems in TriLQR (solved by USYMQR)
  • Stop primal or dual system when it's solved and continues the other one
  • Improve verbose mode and statuses in both methods
  • Use BiLQ, QMR, USYMLQ and USYMQR residual norm estimates described in the BiLQR / TriLQR article

@coveralls
Copy link

coveralls commented Nov 15, 2019

Coverage Status

Coverage increased (+0.4%) to 96.837% when pulling e7af47e on amontoison:bilqr_trilqr into 54456f1 on JuliaSmoothOptimizers:master.

@codecov
Copy link

codecov bot commented Nov 16, 2019

Codecov Report

Merging #159 into master will increase coverage by 0.37%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #159      +/-   ##
==========================================
+ Coverage   97.05%   97.43%   +0.37%     
==========================================
  Files          26       28       +2     
  Lines        2176     2495     +319     
==========================================
+ Hits         2112     2431     +319     
  Misses         64       64
Impacted Files Coverage Δ
src/variants.jl 100% <ø> (ø) ⬆️
src/krylov_utils.jl 95% <ø> (ø) ⬆️
src/bilq.jl 100% <100%> (ø) ⬆️
src/trilqr.jl 100% <100%> (ø)
src/Krylov.jl 100% <100%> (ø) ⬆️
src/bilqr.jl 100% <100%> (ø)
src/usymlq.jl 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 54456f1...e7af47e. Read the comment docs.

@amontoison
Copy link
Member Author

The final home stretch before Krylov.jl v0.4.0 🎉

src/bilqr.jl Outdated
end

# Compute ⟨vₖ,vₖ₊₁⟩ and ‖vₖ₊₁‖
vₖᵀvₖ₊₁ = @kdot(n, vₖ₋₁, vₖ)
Copy link
Member

Choose a reason for hiding this comment

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

Actually here you compute the dot product with vₖ₋₁, not vₖ₊₁. The comment may need to be adjusted too. Algorithm 2.2 in the paper has vₖᵀvₖ₊₁ on line 22.

Copy link
Member Author

Choose a reason for hiding this comment

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

In BiLQ, vₖ is stored in vₖ₋₁ and vₖ₊₁ in vₖ it's why vₖᵀvₖ₊₁ = @kdot(n, vₖ₋₁, vₖ) but in BiLQR I moved the update of those vectors at the end to be able to stop primal / dual system before the other one and I forgot to update residual norm estimates...

Copy link
Member

Choose a reason for hiding this comment

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

Ok. It's confusing that there's no variable vₖ₊₁.

Also, please don't mark comments as resolved. The reviewer is supposed to do that ;-).

Copy link
Member Author

Choose a reason for hiding this comment

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

I will be able to use a variable vₖ₊₁ without allocations when y <- a * Ax + b * y operations will be added. I just need time to find a good way to implement them.

Ok, I won't mark comments resolved in the future :)

src/bilqr.jl Outdated
push!(sNorms, sNorm)

# Update dual stopping criterion
solved_dual = sNorm ≤ εQ || (sNorm + 1 ≤ 1)
Copy link
Member

Choose a reason for hiding this comment

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

Same comment here. This would allow you to set the final status based on which test triggered termination.

Copy link
Member Author

Choose a reason for hiding this comment

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

For the final status, we should find a solution for #158. The number of combination of stopping criterion becomes problematic.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks! I'm adding it.

@dpo dpo merged commit 480940e into JuliaSmoothOptimizers:master Dec 18, 2019
@dpo
Copy link
Member

dpo commented Dec 18, 2019

Thank you!

@amontoison amontoison deleted the bilqr_trilqr branch August 4, 2021 19:53
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.

3 participants