API reference¶
Everything below is importable from piazzi, except the optional backends in
piazzi.scipy, piazzi.pypose and piazzi.torchmin. Start with the high-level interfaces; the method-specific solvers are the
algorithms they run, for when you need a method’s full control.
High-level interfaces¶
SciPy-style entry points: give residuals or a scalar objective, choose the method by name.
finite_difference() wraps an objective that autograd cannot differentiate.
Minimise a sum of squared residuals, like |
|
Minimise a scalar function of a tensor, like |
|
Make a black-box function look differentiable, so that any solver can use it. |
The methods minimize() knows by name are in MINIMIZE_METHODS.
Method-specific solvers¶
The algorithms behind the interfaces, with every setting exposed. Use them directly when you build the normal equations yourself.
Gauss-Newton or Levenberg-Marquardt on user-supplied normal equations. |
|
Levenberg-Marquardt: |
|
Minimise a scalar function with L-BFGS and a line search. |
|
Build normal equations from residuals, for |
Results and callbacks¶
Outcome of a solver run, returned by every solver and wrapper. |
|
State of a solver run, passed to |
|
Make a |
Robust losses¶
Robust least-squares cost |
The built-in losses by name are in LOSSES.
Manifolds and Lie groups¶
Base class for manifolds: a parameter set with a retraction |
|
Plain vector space, with |
|
A vector with some entries held fixed, like Ceres Solver's |
|
Rotations, stored as |
|
Rigid transforms, stored as |
|
Cartesian product of manifolds, stored as one flat vector with the blocks concatenated. |
|
SO(3) exponential: the rotation matrix of a rotation vector (Rodrigues' formula). |
|
SO(3) logarithm: the rotation vector of a rotation matrix; inverts |
|
Skew-symmetric (cross-product) matrix of a vector, with |
|
SE(3) exponential: the rigid transform of a twist. |
|
SE(3) logarithm: the twist of a rigid transform; inverts |
Linear solvers¶
Solve the damped normal equations directly, with |
|
Make a preconditioned conjugate-gradient solver for large sparse normal equations. |
Custom solvers follow the LinearSolver signature.
SciPy backend¶
Requires the piazzi[scipy] extra.
Run |
|
Run |
|
Convert a tensor to a float64 NumPy array, as the SciPy wrappers do. |
|
Convert an array-like to a tensor, as the SciPy wrappers do. |
PyPose backend¶
Requires the piazzi[pypose] extra.
Minimise a sum of squared residuals with PyPose's Gauss-Newton or Levenberg-Marquardt. |
pytorch-minimize backend¶
Requires the piazzi[torchmin] extra.
Run |