-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introducing ProximalCore, cleaning up code #137
Introducing ProximalCore, cleaning up code #137
Conversation
Codecov Report
@@ Coverage Diff @@
## master #137 +/- ##
==========================================
+ Coverage 87.57% 95.88% +8.31%
==========================================
Files 79 79
Lines 2583 2382 -201
==========================================
+ Hits 2262 2284 +22
+ Misses 321 98 -223
Continue to review full report at Codecov.
|
6197471
to
6597b0b
Compare
This is a large-ish revision of the code base, with some breaking changes.
Goal
At the time of writing, more than 600 lines (~7% of the lines), and more than 32k characters (~12%) are gone from
src/
: this does not tell everything about how "simple" code is, but at least suggests an improvement in readability and maintainability.Summary of the changes
ProximableFunction
abstract type.prox
,prox!
,gradient
, andgradient!
.is_xyz
into properties of a function's type. This allows to specialize code, based on whether a function is e.g. convex or not, or quadratic or not, at compile time. This required:LeastSquares
types (type now has a parameter indicating whether the function is convex)SqrNormL2
type (was allowed not being strongly convex, but it didn't really make sense)SqrDistL2
entirely: now it is based onMoreauEnvelope
since it's a special case of it.TotalVariation1D.jl
intototalVariation1D.jl
for consistency.Tests
Tests are unchanged, so changes are non-breaking from a "functional" standpoint.
Benchmarks
I ran benchmarks locally and no significant performance degradation was detected: identical allocations, noisy ups and downs in the runtime for some cases. (I think some benchmark cases are too small to be reliable for runtime measurements.)
TODO
Epicompose
IndBox
IndGraph
IndPolyhedral
LeastSquares
NormL1
NuclearNorm
Quadratic
SqrHingeLoss
SqrNormL2
SumLargest