-
Notifications
You must be signed in to change notification settings - Fork 34
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
FEAT Add log-sum penalty #127
Conversation
@PABannier can you resurrect this? It would be a nice addition |
@mathurinm @Badr-MOUFAD The following script converges. import numpy as np
from skglm.datafits import Quadratic
from skglm.penalties import LogSumPenalty
from skglm import GeneralizedLinearEstimator
from skglm.solvers import AndersonCD, FISTA
from skglm.utils.data import make_correlated_data
random_state = 113
n_samples, n_features = 50, 60
rng = np.random.RandomState(random_state)
X, y, _ = make_correlated_data(n_samples, n_features, random_state=rng)
rng.seed(random_state)
alpha = 1e-5
eps = 1e-2
tol = 1e-5
est = GeneralizedLinearEstimator(
datafit=Quadratic(),
penalty=LogSumPenalty(alpha=alpha, eps=eps),
solver=AndersonCD(tol=tol, ws_strategy="fixpoint", verbose=2),
).fit(X, y)
print("Done.") I did not find the definition of the subdifferential of the log-sum penalty. |
For the subdifferential, since the penalty log(1 + |x|) is differentiable left and right at 0, I'd say [-1/eps, 1/eps] at 0, and {sign(x)/(eps + |x|)} elsewhere? |
Co-authored-by: mathurinm <[email protected]>
We talked about testing the prox procedure with @Badr-MOUFAD and came up with the following suggestion:
WDYT? |
Currently, the unit test checking prox computation of the penalty fails, which hints at (perhaps) a wrong prox result. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
Many thanks @PABannier for the hard work 🙏
@Badr-MOUFAD Thank you for giving it the final touch :) Much appreciated. |
Context of the PR
This PR adds the log-sum penalty. Details about the penalty can be found in [1].
Closes #108.
Contributions of the PR
LogSumPenalty
Checks before merging PR
[1] Prater-Bennette, A., Shen, L. and Tripp, E.E., 2022. The Proximity Operator of the Log-Sum Penalty. Journal of Scientific Computing, 93(3), p.67.