atoms.mixed_lasso¶
Module: atoms.mixed_lasso
¶
Inheritance diagram for regreg.atoms.mixed_lasso
:
Classes¶
mixed_lasso
¶
-
class
regreg.atoms.mixed_lasso.
mixed_lasso
(penalty_structure, lagrange, weights={}, offset=None, quadratic=None, initial=None)¶ Bases:
regreg.atoms.atom
-
__init__
(penalty_structure, lagrange, weights={}, offset=None, quadratic=None, initial=None)¶ Initialize self. See help(type(self)) for accurate signature.
-
apply_offset
(x)¶ If self.offset is not None, return x-self.offset, else return x.
-
property
conjugate
¶ The conjugate of an atom.
-
constraint
(x, bound=None)¶
-
property
dual
¶
-
get_conjugate
()¶
-
get_dual
()¶
-
get_offset
()¶
-
get_quadratic
()¶ Get the quadratic part of the composite.
-
latexify
(var=None, idx='')¶
-
property
linear_transform
¶ The linear transform applied before a penalty is computed. Defaults to regreg.affine.identity
>>> from regreg.api import l1norm >>> penalty = l1norm(30, lagrange=3.4) >>> type(penalty.linear_transform) <class 'regreg.affine.identity'>
-
nonsmooth_objective
(x, check_feasibility=False)¶
-
objective
(x, check_feasibility=False)¶
-
objective_template
= 'needs a template'¶ A class that defines the API for cone constraints.
-
objective_vars
= {'dualklass': 'dualnorm', 'klass': 'norm', 'offset': '\\alpha', 'shape': 'p', 'var': '\\beta'}¶
-
property
offset
¶
-
proximal
(proxq, prox_control=None)¶ The proximal operator. If the atom is in Lagrange mode, this has the form
\[v^{\lambda}(x) = \text{argmin}_{v \in \mathbb{R}^p} \frac{L}{2} \|x-v\|^2_2 + \lambda h(v+\alpha) + \langle v, \eta \rangle\]where \(\alpha\) is the offset of self.affine_transform and \(\eta\) is self.linear_term.
\[v^{\lambda}(x) = \text{argmin}_{v \in \mathbb{R}^p} \frac{L}{2} \|x-v\|^2_2 + \langle v, \eta \rangle \text{s.t.} \ h(v+\alpha) \leq \lambda\]
-
proximal_optimum
(quadratic)¶
-
proximal_step
(quadratic, prox_control=None)¶ Compute the proximal optimization
- Parameters
prox_control: [None, dict]
If not None, then a dictionary of parameters for the prox procedure
-
property
quadratic
¶ Quadratic part of the object, instance of regreg.identity_quadratic.identity_quadratic.
-
seminorm
(x, check_feasibility=False)¶
-
set_offset
(value)¶
-
set_quadratic
(quadratic)¶ Set the quadratic part of the composite.
-
smooth_objective
(x, mode='both', check_feasibility=False)¶ The zero function.
-
smoothed
(smoothing_quadratic)¶ Add quadratic smoothing term
-
solve
(quadratic=None, return_optimum=False, **fit_args)¶
-
tol
= 1e-05¶
-
mixed_lasso_dual
¶
-
class
regreg.atoms.mixed_lasso.
mixed_lasso_dual
(penalty_structure, bound, weights={}, offset=None, quadratic=None, initial=None)¶ Bases:
regreg.atoms.mixed_lasso.mixed_lasso
-
__init__
(penalty_structure, bound, weights={}, offset=None, quadratic=None, initial=None)¶ Initialize self. See help(type(self)) for accurate signature.
-
apply_offset
(x)¶ If self.offset is not None, return x-self.offset, else return x.
-
property
conjugate
¶ The conjugate of an atom.
-
constraint
(x, bound=None)¶ Verify \(\cdot needs a template \leq \lambda\), where \(\lambda\) is bound, \(\alpha\) is self.offset (if any).
If True, returns 0, else returns np.inf.
The class atom’s constraint just returns the appropriate bound parameter for use by the subclasses.
-
property
dual
¶
-
get_conjugate
()¶
-
get_dual
()¶
-
get_offset
()¶
-
get_quadratic
()¶ Get the quadratic part of the composite.
-
latexify
(var=None, idx='')¶
-
property
linear_transform
¶ The linear transform applied before a penalty is computed. Defaults to regreg.affine.identity
>>> from regreg.api import l1norm >>> penalty = l1norm(30, lagrange=3.4) >>> type(penalty.linear_transform) <class 'regreg.affine.identity'>
-
nonsmooth_objective
(x, check_feasibility=False)¶
-
objective
(x, check_feasibility=False)¶
-
objective_template
= 'needs a template'¶
-
objective_vars
= {'dualklass': 'dualnorm', 'klass': 'norm', 'offset': '\\alpha', 'shape': 'p', 'var': '\\beta'}¶
-
property
offset
¶
-
proximal
(proxq, prox_control=None)¶ The proximal operator. If the atom is in Bound mode, this has the form
\[v^{\lambda}(x) = \text{argmin}_{v \in \mathbb{R}^p} \frac{L}{2} \|x-v\|^2_2 + \lambda h(v+\alpha) + \langle v, \eta \rangle\]where \(\alpha\) is the offset of self.affine_transform and \(\eta\) is self.linear_term.
\[v^{\lambda}(x) = \text{argmin}_{v \in \mathbb{R}^p} \frac{L}{2} \|x-v\|^2_2 + \langle v, \eta \rangle \text{s.t.} \ h(v+\alpha) \leq \lambda\]
-
proximal_optimum
(quadratic)¶
-
proximal_step
(quadratic, prox_control=None)¶ Compute the proximal optimization
- Parameters
prox_control: [None, dict]
If not None, then a dictionary of parameters for the prox procedure
-
property
quadratic
¶ Quadratic part of the object, instance of regreg.identity_quadratic.identity_quadratic.
-
seminorm
(x, lagrange=1, check_feasibility=False)¶
-
set_offset
(value)¶
-
set_quadratic
(quadratic)¶ Set the quadratic part of the composite.
-
smooth_objective
(x, mode='both', check_feasibility=False)¶ The zero function.
-
smoothed
(smoothing_quadratic)¶ Add quadratic smoothing term
-
solve
(quadratic=None, return_optimum=False, **fit_args)¶
-
tol
= 1e-05¶
-