Allow both objective and solution sensitivities in reverse mode#338
Allow both objective and solution sensitivities in reverse mode#338klamike wants to merge 13 commits intojump-dev:masterfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #338 +/- ##
==========================================
+ Coverage 89.14% 89.88% +0.73%
==========================================
Files 16 16
Lines 1963 2105 +142
==========================================
+ Hits 1750 1892 +142
Misses 213 213 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
codecov is marking the |
|
not opposed to have this! LGTM. Should we add just a couple of tests more with: perturbation to the dual and objective, and another with all 3? We are missing some coupled tests in general and this could be a nice oportunity to add. |
|
I am not convinced about this one. |
|
One setting this would be useful for is implementing training objectives that look like Of course, users can just do it with the non-objective sensitivity API, it is just a bit less clean. A warning by default, that can be disabled via attribute, seems like a best solution to me. |
|
Fair enough, lets do it. Lets go for warn by default and flag to disable it. |
|
Any recommendation for attribute name? |
|
Not sure why the ┌ Warning: Computing reverse differentiation with both solution sensitivities and objective sensitivities. Set `DiffOpt.AllowObjectiveAndSolutionInput()` to `true` to silence this warning.
└ @ DiffOpt ~/work/DiffOpt.jl/DiffOpt.jl/src/moi_wrapper.jl:561
test_ObjectiveSensitivity_model1: Test Failed at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Test/src/Test.jl:671
Expression: contains_warn(read(fname, String), $(Expr(:escape, :warning)))
Stacktrace:
[1] macro expansion
@ /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Test/src/Test.jl:671 [inlined]
[2] test_ObjectiveSensitivity_model1()
@ Main.TestNLPProgram ~/work/DiffOpt.jl/DiffOpt.jl/test/nlp_program.jl:681 |
|
we can drop 1.6 in favour of current LTS |
|
Done, though I managed to fixed it for 1.6 too. The remaining CI failure is due to a coverage bug |
This one warrants some discussion. Allowing both is indeed error-prone, it may be better to have some flag to explicitly allow both, enable the currently commeted warning, or just keep the behavior/close this PR.
@andrewrosemberg