problems.composite

Module: problems.composite

Inheritance diagram for regreg.problems.composite:

digraph inheritance6673bcf0dd { rankdir=LR; size="8.0, 12.0"; "problems.composite.composite" [URL="#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.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)"]; "problems.composite.smooth" [URL="#regreg.problems.composite.smooth",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 has 0 as "]; "problems.composite.composite" -> "problems.composite.smooth" [arrowsize=0.5,style="setlinewidth(0.5)"]; "problems.composite.smooth_conjugate" [URL="#regreg.problems.composite.smooth_conjugate",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",target="_top"]; "problems.composite.smooth" -> "problems.composite.smooth_conjugate" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

Classes

composite

class regreg.problems.composite.composite(shape, offset=None, quadratic=None, initial=None)

Bases: object

A generic way to specify a problem in composite form.

__init__(shape, 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.

get_offset()
get_quadratic()

Get the quadratic part of the composite.

latexify(var=None, idx='')
nonsmooth_objective(x, check_feasibility=False)
objective(x, check_feasibility=False)
objective_template = 'f(%(var)s)'
objective_vars = {'offset': '\\alpha', 'shape': 'p', 'var': '\\beta'}
property offset
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.

set_offset(value)
set_quadratic(quadratic)

Set the quadratic part of the composite.

smooth_objective(x, mode='both', check_feasibility=False)

The smooth_objective and the quadratic_objective combined.

smoothed(smoothing_quadratic)

Add quadratic smoothing term

solve(quadratic=None, return_optimum=False, **fit_args)

nonsmooth

class regreg.problems.composite.nonsmooth(shape, offset=None, quadratic=None, initial=None)

Bases: regreg.problems.composite.composite

A composite subclass that explicitly returns 0 as smooth_objective.

__init__(shape, 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.

get_offset()
get_quadratic()

Get the quadratic part of the composite.

latexify(var=None, idx='')
nonsmooth_objective(x, check_feasibility=False)
objective(x, check_feasibility=False)
objective_template = 'f(%(var)s)'
objective_vars = {'offset': '\\alpha', 'shape': 'p', 'var': '\\beta'}
property offset
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.

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)

smooth

class regreg.problems.composite.smooth(shape, offset=None, quadratic=None, initial=None)

Bases: regreg.problems.composite.composite

A composite subclass that has 0 as nonsmooth_objective and the proximal is a null-op.

__init__(shape, 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.

get_lipschitz()
get_offset()
get_quadratic()

Get the quadratic part of the composite.

latexify(var=None, idx='')
property lipschitz
nonsmooth_objective(x, check_feasibility=False)
objective(x, check_feasibility=False)
objective_template = 'f(%(var)s)'
objective_vars = {'coef': 'C', 'offset': '\\alpha', 'shape': 'p', 'var': '\\beta'}
property offset
proximal(quadratic)
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.

set_lipschitz(value)
set_offset(value)
set_quadratic(quadratic)

Set the quadratic part of the composite.

smooth_objective(x, mode='func', check_feasibility=False)

The smooth_objective and the quadratic_objective combined.

smoothed(smoothing_quadratic)

Add quadratic smoothing term

solve(quadratic=None, return_optimum=False, **fit_args)

smooth_conjugate

class regreg.problems.composite.smooth_conjugate(atom, smoothing_quadratic=None)

Bases: regreg.problems.composite.smooth

__init__(atom, smoothing_quadratic=None)

Given an atom, compute the conjugate of this atom plus an identity_quadratic which will be a smooth version of the conjugate of the atom.

should we have an argument “collapse” that makes a copy?

apply_offset(x)

If self.offset is not None, return x-self.offset, else return x.

property conjugate
get_conjugate()
get_lipschitz()
get_offset()
get_quadratic()

Get the quadratic part of the composite.

latexify(var=None, idx='')
property lipschitz
nonsmooth_objective(x, check_feasibility=False)
objective(x, check_feasibility=False)
objective_template = 'f(%(var)s)'
objective_vars = {'coef': 'C', 'offset': '\\alpha', 'shape': 'p', 'var': '\\beta'}
property offset
proximal(proxq, prox_control=None)
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.

set_lipschitz(value)
set_offset(value)
set_quadratic(quadratic)

Set the quadratic part of the composite.

smooth_objective(x, mode='both', check_feasibility=False)

Evaluate a smooth function and/or its gradient

if mode == ‘both’, return both function value and gradient if mode == ‘grad’, return only the gradient if mode == ‘func’, return only the function value

smoothed(smoothing_quadratic)

Add quadratic smoothing term

solve(quadratic=None, return_optimum=False, **fit_args)