Fix penalty parameter setting in augmented Lagrangian method - #637
Conversation
|
Thanks for spotting! I am not sure how that happened – sorry. Will take a closer look tomorrow at your PR, but at first glance it looks fine. |
|
Ah – I see that we accidentally changed that (but I do not see why, sorry! We accidentally introduced a bug). Doo you think adding a small test somewhere would help to avoid that this accidentally happens again? If so feel free to add it. Again – very sorry, I am not sure how that happened. But it was also a super large PR over several weeks – and I tried for the first time a “find further typos” AI assisted check – hopefully that was not the reason it was introduced but really just me somewhere when refactoring. |
|
So feel free to also set the date of 0.6.6 to today, again, I can merge this later. |
|
No worries. These kind of issues can happen from time to time. My AI was pretty quick in identifying the issue. So it didn't take terribly long for me to debug this. I will add a test for this once I am back home (currently on my phone). |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #637 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 89 89
Lines 12536 12536
=========================================
Hits 12536 12536 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
I carefully checked on the branch the PR came from, when that happened – and I can not even really blame an AI, I fear, since at the time I did that, I did not yet have proper access to it. So I have no clue why I ever changed that to 1/3. Well – a good lesson to even be more careful. Let me know when you feel this is ready to merge and register; independent of whether you want to add a test or not. But we could do something like a single step and make sure the parameter is set correctly or so. |
|
I added a test (basically the MWE above), again, with the help of AI, which also tests if the Manopt.jl/test/solvers/test_augmented_lagrangian.jl Lines 17 to 18 in 5e3a1f6 |
|
Now I am confused. Very confused. You changed the |
|
Still working on it. Give me a minute. |
|
HM the Grad below is maybe then wrong? I am super confused how that came along. Maybe the large rework PR was not a good idea then. and now Manopt is super buggy and should no longer be used. I am super confused and sad, that there is so many bugs. Sorry. |
|
So what I can say is that with this additional change the MWE I posted above reproduces the exact same numbers as Manopt v0.6.3, which is why I was happy with what the AI found and hoped it was correct, but I have to say that I did not fully understand every part of it yet. |
|
The AIs explanation is (sorry for pasting AI messages here; I usually try to understand the answers myself first and rewrite it in my own words, but I need to eat something...):
|
|
Yes, the first T is wrong and should be CO in I am not sure how a T ever made it into the first parameter. since CO is nowhere used in the signature, a correct fix is to just remove the {T} for that case there. )yeah eating is important! I just had dinner. Guten Appetit!) I you allow me to push here, I can take a careful look tomorrow, though only after my lecture, so around 1015 probably |
|
I applied your suggestion for an alternative fix, however, note that (every?) other subtype(s) of Manopt.jl/src/commons/sub_functions.jl Line 789 in 5e3a1f6 Which solution do you prefer? If the currently implemented one, then the other subtypes of AbstractConstrainedFunction should probably follow the same logic (maybe in another PR?). Feel free to push to this PR. Do you need permissions because this comes from my fork?
|
kellertuer
left a comment
There was a problem hiding this comment.
Thanks for the fix. I can also check the other cases / subtypes of the AbstractConstrainedFunction later today on a new PR.
So I would merge yours, check and unify on a new PR and register both as a new version.
If for example all subtypes have dual variables, the super type could also have two parameters :)
But yeah I can check that probably easiest on a follow up PR.
Will probably work on that after my lecture today then
|
Sounds good. |
* Fix parameters of the abstract `AbstractConstrainedFunction` and further unify its usage. * Apply suggestions from code review * add more tests. * Rephrase a doc string. --------- Co-authored-by: Joshua Lampert <51029046+JoshuaLampert@users.noreply.github.com>
In #630, the penalty parameter in the augmented Lagrangian method was hardcoded to
1/3instead of inheriting it fromalms.ρ. This looks unintended to me and lead to failing tests for me in JoshuaLampert/SummationByPartsOperatorsExtra.jl#100.Note that I let an AI find what the issue is, but I reviewed the change it proposed manually. An MWE created by the AI is
Note that with the fix, we do not quite get the results from before v0.6.4, so it seems there is something else that changed with v0.6.4. But at least the results got better: