Record time at start of every LBFGS iteration#23
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #23 +/- ##
==========================================
+ Coverage 82.06% 82.35% +0.28%
==========================================
Files 5 5
Lines 513 527 +14
==========================================
+ Hits 421 434 +13
- Misses 92 93 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
I think this was actually intentional. See also the last code block after the loop: if _hasconverged
verbosity >= 2 &&
@info @sprintf("GD: converged after %d iterations and time %.2f s: f = %.12f, ‖∇f‖ = %.4e",
numiter, t, f, normgrad)
else
verbosity >= 1 &&
@warn @sprintf("GD: not converged to requested tol after %d iterations and time %.2f s: f = %.12f, ‖∇f‖ = %.4e",
numiter, t, f, normgrad)
endHence, I agree it would make sense to show some told = t
t = time() - t₀
Δt = t - toldCan you change PR accordingly, and maybe then make this uniform across LBFGS, CG and GD ? |
|
If you have time for this, it would be great to finish this and bundle this with the |
|
Totally forgot about this. I'll give it a go later today. |
|
I took the liberty of also updating the formatting of the time and cost function, since the current output sort of relied on both of these to be order 1 to be readable. |
Co-authored-by: Jutho <Jutho@users.noreply.github.com>
|
Thanks |
The starting time
t₀was only recorded once at the start of the LBFGS run, and was kept constant throughout the rest of the iterations such that the printed time was the elapsed time since the start of the algorithm, not the time of the single iteration.