inversion_ideas.base.Minimizer#

class inversion_ideas.base.Minimizer[source]#

Base class to represent minimizers as generators.

Methods

__call__(objective, initial_model, *[, callback])

Minimize objective function.

run(objective, initial_model, *args, **kwargs)

Run all iterations of the minimizer at once.

Methods#

Methods documentation

abstractmethod Minimizer.__call__(objective, initial_model, *, callback=None)[source]#

Minimize objective function.

Parameters:
objectivebase.Objective

Objective function to be minimized.

initial_model(n_params,) array

Initial model used to start the minimization.

callbackcallable(), optional

Callable that gets called after each iteration. Takes a inversion_ideas.base.MinimizerResult as argument.

Returns:
Generator[Model]

Generator that yields models after each iteration of the minimizer.


Minimizer.run(objective, initial_model, *args, **kwargs)[source]#

Run all iterations of the minimizer at once.

Parameters:
objectivebase.Objective

Objective function to be minimized.

initial_model(n_params,) array

Initial model used to start the minimization.

*args

Any extra positional argument will be passed to the __call__ method.

*kwargs

Any extra keyword argument will be passed to the __call__ method.

Returns:
inverted_model(n_params,) array

Final inverted model.