Package parsimony :: Package functions :: Module combinedfunctions :: Class CombinedFunction
[hide private]
[frames] | no frames]

Class CombinedFunction

source code

               object --+        
                        |        
      properties.Function --+    
                            |    
 properties.CompositeFunction --+
                                |
                   object --+   |
                            |   |
          properties.Gradient --+
                                |
                   object --+   |
                            |   |
  properties.ProximalOperator --+
                                |
                   object --+   |
                            |   |
properties.ProjectionOperator --+
                                |
                   object --+   |
                            |   |
          properties.StepSize --+
                                |
                               CombinedFunction

Combines one or more loss functions, any number of penalties and zero
or one proximal operator.

This function thus represents

    f(x) = f_1(x) [ + f_2(x) ... ] [ + p_1(x) ... ] [ + P(x)],

subject to [ C_1(x) <= c_1,
             C_2(x) <= c_2,
             ... ],

where f_i are differentiable Functions, p_j are differentiable penalties
and P is a ProximalOperator. All functions and penalties must thus be
Gradient, unless it is a ProximalOperator.

If no ProximalOperator is given, then prox is the identity.

Instance Methods [hide private]
 
__init__(self, functions=[], penalties=[], prox=[], constraints=[])
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
reset(self)
Free any cached computations from previous use of this Function.
source code
 
add_loss(self, function) source code
 
add_function(*args, **kwargs) source code
 
add_penalty(self, penalty) source code
 
add_constraint(self, constraint) source code
 
add_smooth_penalty(self, penalty) source code
 
add_prox(self, penalty) source code
 
add_nesterov(self, penalty) source code
 
f(self, x)
Function value.
source code
 
grad(self, x)
Gradient of the differentiable part of the function.
source code
 
prox(self, x, factor=1.0, **kwargs)
The proximal operator of the non-differentiable part of the function.
source code
 
proj(self, x)
The projection operator corresponding to the function.
source code
 
step(self, x)
The step size to use in descent methods.
source code

Inherited from properties.Function: get_params, set_params

Inherited from properties.Gradient: approx_grad

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  __abstractmethods__ = frozenset([])

Inherited from properties.CompositeFunction: __metaclass__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, functions=[], penalties=[], prox=[], constraints=[])
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

reset(self)

source code 

Free any cached computations from previous use of this Function.

Overrides: properties.Function.reset
(inherited documentation)

add_function(*args, **kwargs)

source code 
Decorators:
  • @deprecated("add_loss")

f(self, x)

source code 

Function value.

Overrides: properties.Function.f

grad(self, x)

source code 

Gradient of the differentiable part of the function.

From the interface "Gradient".

Overrides: properties.Gradient.grad

prox(self, x, factor=1.0, **kwargs)

source code 

The proximal operator of the non-differentiable part of the function.

From the interface "ProximalOperator".

Overrides: properties.ProximalOperator.prox

proj(self, x)

source code 

The projection operator corresponding to the function.

Overrides: properties.ProjectionOperator.proj
(inherited documentation)

step(self, x)

source code 
The step size to use in descent methods.

From the interface "StepSize".

Parameters
----------
x : Numpy array. The point at which to evaluate the step size.

Overrides: properties.StepSize.step