inversion_ideas.base.Combo#

class inversion_ideas.base.Combo(functions)#

Sum of objective functions.

Attributes

functions

List of objective functions in the sum.

n_params

Number of model parameters.

name

Name of the objective function.

Methods

__call__(model)

Evaluate the objective function.

contains(objective)

Check if the Combo contains the given objective function, recursively.

flatten()

Create a new flattened combo.

gradient(model)

Evaluate the gradient of the objective function for a given model.

hessian(model)

Evaluate the hessian of the objective function for a given model.

hessian_diagonal(model)

Get the main diagonal of the Hessian.

info()

Get information about the combo objective function.

set_name(value)

Set name for the objective function.

Attributes#

Combo.functions#

List of objective functions in the sum.

Combo.n_params#

Number of model parameters.

Combo.name#

Name of the objective function.

Methods#

Methods documentation

Combo.__call__(model)#

Evaluate the objective function.


Combo.contains(objective)#

Check if the Combo contains the given objective function, recursively.


Combo.flatten()#

Create a new flattened combo.

Create a new Combo object by unpacking nested ``Combo``s in the current one.


Combo.gradient(model)#

Evaluate the gradient of the objective function for a given model.


Combo.hessian(model)#

Evaluate the hessian of the objective function for a given model.


Combo.hessian_diagonal(model)#

Get the main diagonal of the Hessian.

Parameters:
model(n_params) array

Array with model values.

Returns:
(n_params,) array

Array containing the diagonal of the Hessian.


Combo.info()#

Get information about the combo objective function.


Combo.set_name(value)#

Set name for the objective function.