newton.ik.IKLMOptimizer#

class newton.ik.IKLMOptimizer(model, n_batch, objectives, *a, **kw)[source]#

Bases: object

Modular inverse-kinematics solver.

The solver uses an adaptive Levenberg-Marquardt loop and supports three Jacobian back-ends:

  • AUTODIFF: Warp’s reverse-mode autodiff for every objective.

  • ANALYTIC: Objective-specific analytic Jacobians only.

  • MIXED: Analytic where available, autodiff fallback elsewhere.

Parameters:
  • model (newton.Model) – Singleton articulation shared by all problems.

  • n_batch (int) – Number of rows processed in parallel (e.g., n_problems * n_seeds).

  • objectives (Sequence[IKObjective]) – Ordered list of objectives shared by all problems. Each IKObjective instance can carry arrays of per-problem parameters (sized by the true problem count) and should dereference them via problem_idx.

  • jacobian_mode (IKJacobianMode, optional) – Backend used in compute_jacobian. Defaults to IKJacobianMode.AUTODIFF.

  • lambda_initial (float, optional) – Initial LM damping per problem. Defaults to 0.1.

  • lambda_factor (float, optional) – Multiplicative update factor for λ. Defaults to 2.0.

  • lambda_min (float, optional) – Lower clamp for λ. Defaults to 1e-5.

  • lambda_max (float, optional) – Upper clamp for λ. Defaults to 1e10.

  • rho_min (float, optional) – Acceptance threshold on predicted vs. actual reduction. Defaults to 1e-3.

Batch Structure:

The solver handles a batch of independent IK problem instances (possibly expanded by sampling) that all reference the same articulation (model) and objective list. Per-problem parameters (targets, weights, …) live in problem space and are accessed through the problem_idx indirection supplied by IKSolver.

__init__(model, n_batch, objectives, lambda_initial=0.1, jacobian_mode=IKJacobianMode.AUTODIFF, lambda_factor=2.0, lambda_min=1e-5, lambda_max=1e10, rho_min=1e-3, *, problem_idx=None)#

Construct a batch IK solver.

See class doc-string for parameter semantics.

step(joint_q_in, joint_q_out, iterations=10, step_size=1.0)#

Run LM iterations using the provided joint buffers.