pysolvegn.GaussNewtonSolver#
- class GaussNewtonSolver(terms)[source]#
A class that implements the Gauss-Newton optimization method for solving non-linear least squares problems.
The Gauss-Newton method is an iterative optimization algorithm that minimizes the sum of squared residuals between a set of observed data points and a model defined by a set of parameters. It is particularly effective for solving non-linear least squares problems where the residuals are non-linear functions of the parameters.
The optimization is performed by linearizing the problem at each iteration and solving a linear least squares problem to update the parameters. The process is repeated until convergence, which is typically determined by a stopping criterion based on the change in parameters or the norm of the residuals.
The solved problem is defined by several terms (class
Term), such that :\[\min_{\mathbf{p}} \frac{1}{2} \sum_{i} w_i \sum_j \rho_i\left(\| \mathbf{r}_{i,j}(\mathbf{p}) \|^2\right)\]To perform the optimization, the user can create an instance of the GaussNewtonSolver class and call the
solve()method with the appropriate parameters and options.See also
For more details on notations for the optimization problem and the algorithm, please refer to the mathematical section of the documentation.
- Parameters:
terms (Union[Term, Sequence[Term]]) – An instance of the Term class or a sequence of Term instances that encapsulates terms of the optimization problem, including the residual functions, jacobian functions, and other properties of the terms.
Version#
0.1.0: Initial version for the GaussNewtonSolver class.
Methods
__init__(terms)get_term(index)Get the Term instance at the specified index.
has_callback_function()Check if a callback function is set for the optimization process.
remove_callback_function()Remove the callback function for the optimization process.
set_callback_function(callback)Set the callback function for the optimization process.
solve(x0, **kwargs)Solve the optimization problem using the Gauss-Newton method.
Attributes
n_termsGet the number of Term instances in the GaussNewtonSolver.