Skip to content
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

Gradients2 #44

Merged
merged 3 commits into from
Oct 24, 2017
Merged

Gradients2 #44

merged 3 commits into from
Oct 24, 2017

Conversation

mfalt
Copy link
Collaborator

@mfalt mfalt commented Oct 23, 2017

Implemented most of the gradients according to issue #43, test still missing.
Update: Tests added, still missing: NormL21, Maximum, NuclearNorm, but those can be added at a later date if needed.

@codecov
Copy link

codecov bot commented Oct 23, 2017

Codecov Report

Merging #44 into master will increase coverage by 0.74%.
The diff coverage is 98.14%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #44      +/-   ##
==========================================
+ Coverage   91.99%   92.74%   +0.74%     
==========================================
  Files          63       64       +1     
  Lines        1861     1901      +40     
==========================================
+ Hits         1712     1763      +51     
+ Misses        149      138      -11
Impacted Files Coverage Δ
src/ProximalOperators.jl 100% <ø> (ø) ⬆️
src/functions/elasticNet.jl 100% <100%> (ø) ⬆️
src/functions/quadratic.jl 85.71% <100%> (+2.38%) ⬆️
src/utilities/vecnormdiff.jl 100% <100%> (ø)
src/functions/sumPositive.jl 100% <100%> (ø) ⬆️
src/calculus/distL2.jl 100% <100%> (+3.33%) ⬆️
src/functions/normL2.jl 95.83% <100%> (+1.09%) ⬆️
src/calculus/sqrDistL2.jl 96.87% <100%> (+0.44%) ⬆️
src/functions/logBarrier.jl 100% <100%> (+2.27%) ⬆️
src/functions/indSOC.jl 94.28% <100%> (ø) ⬆️
... and 11 more

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 2350084...d750efa. Read the comment docs.

@mfalt mfalt requested a review from lostella October 24, 2017 16:20
@@ -28,7 +31,6 @@ function prox!(y::AbstractArray{RC}, f::Linear{RC, A}, x::AbstractArray{RC}, gam
end
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not changed in PR, but should be
y .= x .- gamma.*(f.c)
for efficiency.

@@ -75,3 +75,9 @@ Maximum
Quadratic
SumPositive
```

## Distances
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This I have also put in the section describing calculus rules, since these are really modifiers of some other (indicator) functions; but I guess they can stay in both places.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They were in the FUNCTIONS.md in the root, so I copied them here. But you are right, we should think of how we can unify the different documentations.

@@ -27,7 +27,7 @@ is_convex(f::IndSOC) = true
is_set(f::IndSOC) = true

function prox!{T <: Real}(y::AbstractArray{T,1}, f::IndSOC, x::AbstractArray{T,1}, gamma::T=one(T))
nx = norm(x[2:end])
@views nx = norm(x[2:end])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, I didn’t know this!

@@ -17,6 +17,9 @@ end

Linear(c::A) where {R <: RealOrComplex, A <: AbstractArray{R}} = Linear{R, A}(c)

is_separable(f::Linear) = true
is_convex(f::Linear) = true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would also add is_smooth = true if not already there.

@@ -19,6 +19,7 @@ If `iterative=true`, then `prox!` is evaluated approximately using an iterative

abstract type Quadratic <: ProximableFunction end

is_convex(f::Quadratic) = true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This I have not previously put because one should really check that Q is positive semidefinite...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any thoughts on this @mfalt ? Of course checking the eigenvalues is not viable, but maybe the user should be able to assert whether the function is convex or not?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No ok, the docstring says we assume Q to be positive definite (should be semidefinite, to be corrected). We may want to change this in the near future, not all quadratics are convex!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I added this because of the documentation, but you are right, maybe some keyword from the user, acknowledging if it is positive(semi)-definite would be good.

@lostella lostella merged commit 02f7852 into master Oct 24, 2017
@lostella lostella deleted the gradients2 branch August 15, 2021 06:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants