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

Add NormL1plusL2 #133

Merged
merged 12 commits into from
Nov 6, 2021
Merged

Add NormL1plusL2 #133

merged 12 commits into from
Nov 6, 2021

Conversation

fabian-sp
Copy link
Contributor

I created the function for the sum of L1 and L2. I think together with SlicedSeparableSum this is exactly what you need for the Group Lasso penalty.
Regarding tests: could add that it has to match NormL1 and NormL2 for one of the two parameters being zero, but was not so sure how/where to do that.
Another question: I had some problems importing the prox!-function from NormL1/2, and solved it with

import ProximalOperators: prox!

Is this the intended way in Julia to import functions from other files within a module?

Cheers,
Fabian

@codecov
Copy link

codecov bot commented Sep 6, 2021

Codecov Report

Merging #133 (d2689ea) into master (fcd3d98) will decrease coverage by 0.13%.
The diff coverage is 70.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #133      +/-   ##
==========================================
- Coverage   87.42%   87.29%   -0.14%     
==========================================
  Files          78       79       +1     
  Lines        2490     2510      +20     
==========================================
+ Hits         2177     2191      +14     
- Misses        313      319       +6     
Impacted Files Coverage Δ
src/ProximalOperators.jl 68.75% <ø> (ø)
src/functions/normL1plusL2.jl 70.00% <70.00%> (ø)

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 fcd3d98...d2689ea. Read the comment docs.

src/functions/L1plusL2.jl Outdated Show resolved Hide resolved
src/functions/L1plusL2.jl Outdated Show resolved Hide resolved
docs/src/functions.md Outdated Show resolved Hide resolved
src/functions/L1plusL2.jl Outdated Show resolved Hide resolved
@mfalt
Copy link
Collaborator

mfalt commented Sep 8, 2021

I wasn't completely happy with the implementation of prox! so I made a suggestion in a PR to your branch: https://github.com/fabian-sp/ProximalOperators.jl/pull/1

I didn't like that we created the L1 and L2 norms in the prox! call because it forces us to recheck that the parameters are positive every time. I rewrote the struct to contain the norm functions instead, and allowed lambda1 to be a vector. I think the code looks slightly better this way.
This PR also defer almost all computations to existing implementations.

@mfalt
Copy link
Collaborator

mfalt commented Sep 9, 2021

I made a couple of changes, for example allowing complex domain, added more tests, and fixed the printing for Array case. I hope you don't mind.
I am not too happy about my implementation of prox_naive do we have a better way to verify all cases?
Can someone verify that the same rule works for complex arguments and vector lambla1?

@fabian-sp
Copy link
Contributor Author

Hi Mattias, I am not sure whether the proof would work for complex lambda1 as it involves the subdifferential, and I have never encountered that for complex-valued function.

@fabian-sp
Copy link
Contributor Author

Hi all, is this still open/ under discussion?

Best, Fabian

@lostella
Copy link
Member

lostella commented Nov 5, 2021

@fabian-sp this looks good to me! Thanks for implementing this!

@lostella
Copy link
Member

lostella commented Nov 5, 2021

Hi Mattias, I am not sure whether the proof would work for complex lambda1 as it involves the subdifferential, and I have never encountered that for complex-valued function.

I think the general setting of the package is that of (extended) real valued functions, so all coefficients in front of norms and penalties should have no imaginary part

@lostella lostella changed the title initial L1plusL2 Add NormL1plusL2 Nov 6, 2021
@lostella lostella merged commit 93354f2 into JuliaFirstOrder:master Nov 6, 2021
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.

3 participants