atoms.mixed_lasso

Module: atoms.mixed_lasso

Inheritance diagram for regreg.atoms.mixed_lasso:

digraph inheritance7cc86a6140 { rankdir=LR; size="8.0, 12.0"; "atoms.mixed_lasso.mixed_lasso" [URL="#regreg.atoms.mixed_lasso.mixed_lasso",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",target="_top"]; "regreg.atoms.atom" -> "atoms.mixed_lasso.mixed_lasso" [arrowsize=0.5,style="setlinewidth(0.5)"]; "atoms.mixed_lasso.mixed_lasso_dual" [URL="#regreg.atoms.mixed_lasso.mixed_lasso_dual",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",target="_top"]; "atoms.mixed_lasso.mixed_lasso" -> "atoms.mixed_lasso.mixed_lasso_dual" [arrowsize=0.5,style="setlinewidth(0.5)"]; "problems.composite.composite" [URL="regreg.problems.composite.html#regreg.problems.composite.composite",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",target="_top",tooltip="A generic way to specify a problem in composite form."]; "problems.composite.nonsmooth" [URL="regreg.problems.composite.html#regreg.problems.composite.nonsmooth",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",target="_top",tooltip="A composite subclass that explicitly returns 0"]; "problems.composite.composite" -> "problems.composite.nonsmooth" [arrowsize=0.5,style="setlinewidth(0.5)"]; "regreg.atoms.atom" [URL="regreg.atoms.html#regreg.atoms.atom",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",target="_top",tooltip="A class that defines the API for support functions."]; "problems.composite.nonsmooth" -> "regreg.atoms.atom" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

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

Functions

regreg.atoms.mixed_lasso.check_KKT(glasso, grad, solution, lagrange, tol=0.01)
regreg.atoms.mixed_lasso.strong_set(glasso, lagrange_cur, lagrange_new, grad, slope_estimate=1)