Don't print debug actions when k=-1#609
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #609 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 91 91
Lines 10054 10054
=========================================
Hits 10054 10054 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Failing tests with Julia nightly seem unrelated and an issue of HSL.jl. |
|
For the “normal” debugs I agree, the idea would be to never print with negative k, the implementation was not consistent there – thanks for spotting and making it consistent! For the Warnings, you are right that was also not consistent. but I am just not sure which mode is the better one: If one activates / adds a warning I think always warning would be better? So we could also remove the |
|
...and yes, I have not yet understood the nightly errors, but they are there for a while already and not your fault. I should maybe check whom to ask on slack somewhen. |
Yes, I mostly agree with that. But you could also say "I ask the algorithm to only give debug output every so and so iterations via |
|
Sure, as I wrote, both sides have their good arguments. This looks good now. Could you specify the two aspects we unified the actions to in the changes as well? Then this should be good to go and I can register it after merge. |
|
Done in 35dc2c5. |
Co-authored-by: Ronny Bergmann <git@ronnybergmann.net>
kellertuer
left a comment
There was a problem hiding this comment.
Nice. As soon as the tests pass, I can merge this and register the new version for you.
Thanks for spotting this and unifying the behaviour.
* don't print DebugTime when k=-1 * add k < 0 guards to remaining DebugActions * add changelog entry * warning should warn also when k < 0 * update Changelog Co-authored-by: Ronny Bergmann <git@ronnybergmann.net> --------- Co-authored-by: Ronny Bergmann <git@ronnybergmann.net>
This fixes a small bug, when using some debug actions (
DebugTime,DebugEntryChange,DebugWarnIfCostNotFinite,DebugWarnIfFieldNotFinite, andDebugWarnIfGradientNormTooLarge) together withDebugEvery(withalways_update = true), where the actions ignore theDebugEveryand print their output at each iteration instead of only everyeveryiterations. This is because they don't add a guard fork = -1, which is passed byDebugEveryfor the iterations that should be skipped. For the warnings it might be debatable whether they should intentionally skip theDebugEveryor not, but sinceDebugWarnIfCostIncreasesandDebugWarnIfStepsizeCollapsedalready had thek < 0included, I also added it to the other three warning debug actions for consistency. I can also remove it consistently for all five warning debug actions if preferred.