newton.ik.IKOptimizerLBFGS#
- class newton.ik.IKOptimizerLBFGS(model, n_batch, objectives, *a, **kw)[source]#
Bases:
objectL-BFGS optimizer for batched inverse kinematics.
The optimizer maintains a limited-memory quasi-Newton approximation and chooses step sizes with a parallel strong-Wolfe line search. It supports the same Jacobian backends as
IKOptimizerLM.- Parameters:
model (Model) – Shared articulation model.
n_batch (int) – Number of evaluation rows solved in parallel. This is typically
n_problems * n_seedsafter any sampling expansion.objectives (Sequence[IKObjective]) – Ordered IK objectives applied to every batch row.
jacobian_mode – Jacobian backend to use.
history_len – Number of
(s, y)correction pairs retained in the L-BFGS history.h0_scale – Scalar used for the initial inverse-Hessian approximation.
line_search_alphas – Candidate step sizes tested in parallel during the line search.
wolfe_c1 – Armijo sufficient-decrease constant.
wolfe_c2 – Strong-Wolfe curvature constant.
problem_idx – Optional mapping from batch rows to base problem indices for per-problem objective data.
- __init__(model, n_batch, objectives, jacobian_mode=IKJacobianType.AUTODIFF, history_len=10, h0_scale=1.0, line_search_alphas=None, wolfe_c1=1e-4, wolfe_c2=0.9, *, problem_idx=None)#
- compute_costs(joint_q)#
Evaluate squared residual costs for a batch of joint configurations.
- Parameters:
joint_q (array(ndim=2, dtype=float32)) – Joint coordinates to evaluate, shape [n_batch, joint_coord_count].
- Returns:
Costs for each batch row, shape [n_batch].
- Return type:
array(ndim=1, dtype=float32)
- reset()#
Clear L-BFGS history and cached line-search state.
- step(joint_q_in, joint_q_out, iterations=50)#
Run several L-BFGS iterations on a batch of joint configurations.
- Parameters:
joint_q_in (array(ndim=2, dtype=float32)) – Input joint coordinates, shape [n_batch, joint_coord_count].
joint_q_out (array(ndim=2, dtype=float32)) – Output buffer for the optimized coordinates, shape [n_batch, joint_coord_count]. It may alias
joint_q_infor in-place updates.iterations (int) – Number of L-BFGS iterations to execute.