MPPISolver

class MPPISolver(model: Costable, num_samples, num_elites, var_scale, n_steps, use_elites=True, temperature=0.5, device='cpu')[source]

Bases: object

Model Predictive Path Integral Solver.

proposed in https://arxiv.org/abs/1509.01149 algorithm from: https://acdslab.github.io/mppi-generic-website/docs/mppi.html

Note

The original MPPI compute the cost as a summation of costs along the trajectory. Here, we use the final cost only, which should be updated in future updates.

property action_dim: int
compute_trajectory_weights(costs: Tensor) Tensor[source]

Compute trajectory weights from costs using softmin with temperature.

Parameters:

costs (num_samples,) – Tensor of trajectory costs.

Returns:

Tensor of trajectory weights.

configure(*, action_space, n_envs: int, config) None[source]
property horizon: int
init_action_distrib(actions=None)[source]

Initialize the action distribution params (mu, sigma) given the initial condition.

Parameters:

actions (n_envs, T, action_dim) – initial actions, T <= horizon

property n_envs: int
solve(info_dict, init_action=None)[source]