matbesancon / MathOptSetDistances.jl

Distances to sets for MathOptInterface
MIT License
24 stars 4 forks source link

Implementing ChainRulesCore.rrule for projections #25

Closed matbesancon closed 3 years ago

codecov[bot] commented 3 years ago

Codecov Report

Merging #25 (6d40bb3) into master (acefd2e) will increase coverage by 4.85%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #25      +/-   ##
==========================================
+ Coverage   82.49%   87.34%   +4.85%     
==========================================
  Files           4        5       +1     
  Lines         257      332      +75     
==========================================
+ Hits          212      290      +78     
+ Misses         45       42       -3     
Impacted Files Coverage Δ
src/MathOptSetDistances.jl 100.00% <ø> (ø)
src/chainrules.jl 100.00% <100.00%> (ø)
src/projections.jl 100.00% <100.00%> (+2.97%) :arrow_up:

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 acefd2e...6d40bb3. Read the comment docs.

matbesancon commented 3 years ago

OK finite differences will be a pain with tolerances https://github.com/matbesancon/MathOptSetDistances.jl/runs/1590376960?check_suite_focus=true#step:6:97

matbesancon commented 3 years ago

@oxinabox if you want to take a look, that's the source of all these questions :)

matbesancon commented 3 years ago

the interesting case here is that we have a form with all explicit derivative maps

oxinabox commented 3 years ago

OK finite differences will be a pain with tolerances https://github.com/matbesancon/MathOptSetDistances.jl/runs/1590376960?check_suite_focus=true#step:6:97

isapprox(0.0, -0.09016088542119642; rtol = 1.0e-9, atol = 1.0e-9) that's so much error. So Much.

matbesancon commented 3 years ago

isapprox(0.0, -0.09016088542119642; rtol = 1.0e-9, atol = 1.0e-9) that's so much error. So Much.

yes I realized this one would be absurdly high. I suspect this occurs when we hit a non-differentiable point of the derivative.

I'll try to see if generating samples on the domain far enough from these is sufficient