identity_quadratic¶
Module: identity_quadratic
¶
Inheritance diagram for regreg.identity_quadratic
:
This module contains a single class that is meant to represent a quadratic of the form
\[\frac{L}{2} \|x-\mu\|^2_2 + \langle \eta, x \rangle + \gamma\]
with \(L, \mu, \eta, \gamma\) = (coef, center, linear_term, constant_term).
identity_quadratic
¶
-
class
regreg.identity_quadratic.
identity_quadratic
(coef, center, linear_term, constant_term=0)¶ Bases:
object
This object is a quadratic function
\[x \mapsto \frac{L}{2} \|x-\mu\|^2_2 + \langle \eta, x \rangle + \gamma\]used in the proximal methods of all atoms.
-
__init__
(coef, center, linear_term, constant_term=0)¶ Initialize self. See help(type(self)) for accurate signature.
-
collapsed
()¶ Return an identity quadratic with center of 0, would be nice to have None, but there are some places we are still multiplying by -1
-
property
conjugate
¶
-
get_shapes
()¶ Determine shape of any pieces and make sure they agree
-
property
iszero
¶
-
latexify
(var='\\beta', idx='')¶
-
noneify
()¶ replace zeros with nones
-
objective
(x, mode='both')¶
-
objective_vars
= {'offset': '\\alpha', 'shape': 'p', 'var': '\\beta'}¶
-
recenter
(offset)¶
-
property
true_center
¶
-
zeroify
()¶
-