inversion_ideas.base.Combo#
- class inversion_ideas.base.Combo(functions)#
Sum of objective functions.
Attributes
List of objective functions in the sum.
Number of model parameters.
Name of the objective function.
Methods
__call__(model)Evaluate the objective function for a given model.
contains(objective)Check if the
Combocontains 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 for a given model.
- Combo.contains(objective)#
Check if the
Combocontains the given objective function, recursively.
- Combo.flatten()#
Create a new flattened combo.
Create a new
Comboobject by unpacking nestedComboin 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.
- Parameters:
- Returns:
- (
n_params,n_params)arrayorLinearOperator 2D array or
LinearOperatorthat represents the Hessian matrix of the objective funciton, or an approximated version of it.
- (
- Combo.hessian_diagonal(model)#
Get the main diagonal of the Hessian.
- Combo.info()#
Get information about the combo objective function.
- Combo.set_name(value)#
Set name for the objective function.