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.
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.
- 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 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.