Differentiable iLQR (parallel)#
Module solves the differential iterative linear quadratic regulator (DiLQR) problem with the parallel (associative-scan) iLQR solver.
- diffilqrax.parallel_dilqr.pdilqr(parallel_model, params, Us_init, exact_hessian=True, adjoint='parallel', **kwargs)[source]#
Solves the differential iLQR problem with
diffilqrax.parallel_ilqr.pilqr_solver(). Parallel counterpart ofdiffilqrax.diff_ilqr.dilqr().- Parameters:
parallel_model (
ParallelSystem|System) – The system model.params (
iLQRParams) – The iLQR parameters.Us_init (
Array) – The initial control sequence.exact_hessian (
bool) – If True (default), the implicit gradients use the Hessian of the Lagrangian and match direct differentiation; if False, only the cost Hessians (Gauss-Newton). Seedilqr().adjoint (
str) – Solver of the adjoint LQR problem in the reverse pass: “parallel” (associative scan, default) or “sequential” (Riccati recursion). Seediffilqrax.parallel_dlqr.pdllqr().**kwargs – Additional keyword arguments for
diffilqrax.parallel_ilqr.pilqr_solver(), e.g.rollout.
- Returns:
The optimized state-control trajectory [(T+1)x(n+m)].
- Return type:
Notes
The gradients are implicit: they are exact only if the solver has converged (see
kkt_tolandmax_iterofpilqr_solver()).Us_initreceives no gradient and the solver is never differentiated, so it can run as alax.while_loop(loop="while", the default).
- diffilqrax.parallel_dilqr.implicit_pdilqr(parallel_model, params, solution, exact_hessian=True, adjoint='parallel')[source]#
The differentiable part of
pdilqr(): the optimal trajectory, with implicit gradients wrtparams.- Parameters:
- Returns:
The optimized state-control trajectory [(T+1)x(n+m)].
- Return type:
- diffilqrax.parallel_dilqr.parallel_dilqr(parallel_model, params, Us_init, exact_hessian=True, adjoint='parallel', **kwargs)#
Solves the differential iLQR problem with
diffilqrax.parallel_ilqr.pilqr_solver(). Parallel counterpart ofdiffilqrax.diff_ilqr.dilqr().- Parameters:
parallel_model (
ParallelSystem|System) – The system model.params (
iLQRParams) – The iLQR parameters.Us_init (
Array) – The initial control sequence.exact_hessian (
bool) – If True (default), the implicit gradients use the Hessian of the Lagrangian and match direct differentiation; if False, only the cost Hessians (Gauss-Newton). Seedilqr().adjoint (
str) – Solver of the adjoint LQR problem in the reverse pass: “parallel” (associative scan, default) or “sequential” (Riccati recursion). Seediffilqrax.parallel_dlqr.pdllqr().**kwargs – Additional keyword arguments for
diffilqrax.parallel_ilqr.pilqr_solver(), e.g.rollout.
- Returns:
The optimized state-control trajectory [(T+1)x(n+m)].
- Return type:
Notes
The gradients are implicit: they are exact only if the solver has converged (see
kkt_tolandmax_iterofpilqr_solver()).Us_initreceives no gradient and the solver is never differentiated, so it can run as alax.while_loop(loop="while", the default).