levenberg-marquardt 0.2.0

Levenberg-Marquardt algorithm built on top of nalgebra
docs.rs failed to build levenberg-marquardt-0.2.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: levenberg-marquardt-0.13.1

levenberg-marquardt

Crates.io MIT/Apache docs.rs LoC

Provides abstractions to run Levenberg-Marquardt optimization

To add it, install cargo-edit (cargo install cargo-edit) and run cargo add levenberg-marquardt.

Usage (see the docs for more detailed information):

levenberg_marquardt::optimize(
    // The max number of iterations before terminating
    50,
    // The max number of times it can fail to find a better solution in a row before terminating.
    10,
    // A lambda parameter of `0.0` is Gauss-Newton and a high lambda is gradient descent.
    50.0,
    // If lambda * lambda_converge performs better than the current lambda, that solution is used.
    0.8,
    // If lambda and lambda * lambda_converge fail to find a better solution, lambda is multiplied by this.
    2.0,
    // If the average of residuals squared falls below this value, the algorithm terminates.
    0.0,
    // The initial model.
    initial_model,
    |v| // Normalize your model here if it can become degenerate (rotations, normal vectors).,
    |v| // Compute your residuals here. Multiply these by a constant to scale the speed of convergence.,
    |v| // Compute the Jacobian for each column of the residual matrix here.,
)