inversion_ideas.GaussNewtonConjugateGradient#
- class inversion_ideas.GaussNewtonConjugateGradient(*, maxiter=100, maxiter_line_search=10, rtol=1e-05, stopping_criterion=None, cg_kwargs=None)#
Minimize non-linear objective functions using a Gauss-Newton Conjugate Gradient.
Apply Gauss-Newton iterations using a Conjugate Gradient to find search directions, and use a backtracking line search to update the model after each iteration.
- Parameters:
- maxiter
int, optional Maximum number of Gauss-Newton iterations.
- maxiter_line_search
int, optional Maximum number of line search iterations.
- rtol
float, optional Relative tolerance for the objective function. If the relative difference between the current and previous value of the objective function is below
rtol, then the minimization is considered as converged.- stopping_criterion
Condition,CallableorNone, optional Additional stopping condition that will make the Gauss-Newton iterations to finish. When a condition is passed, the Gauss-Newton iterations will finish if the condition is met, the Gauss-Newton converges (relative difference below
rtol), or if maximum number of iterations are reached. If None, Gauss-Newton iterations will finish if convergence or maximum number of iterations are reached.- cg_kwargs
dictorNone, optional Dictionary with extra arguments passed to the
scipy.sparse.linalg.cg()function.
- maxiter
Methods
Methods#
Methods documentation
- GaussNewtonConjugateGradient.__call__(objective, initial_model, *, preconditioner=None, callback=None)#
Create iterator over Gauss-Newton minimization.
- Parameters:
- objective
Objective Objective function to be minimized.
- initial_model(
n_params)array Initial model used to start the minimization.
- preconditioner(
n_params,n_params)array,sparsearrayorLinearOperator, optional Matrix used as preconditioner in the conjugate gradient algorithm. If None, no preconditioner will be used. If the preconditioner implements an
updatemethod, the preconditioner will be updated before every conjugate gradient minimization.- callback
callable(), optional Callable that gets called after each iteration.
- objective
- GaussNewtonConjugateGradient.run(objective, initial_model, *args, **kwargs)#
Run all iterations of the minimizer at once.
- Parameters:
- objective
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.
- objective
- Returns:
- inverted_model(
n_params)array Final inverted model.
- inverted_model(