Shortcuts

MPCPlannerBase

class torchrl.modules.MPCPlannerBase(*args, **kwargs)[source]

MPCPlannerBase abstract Module.

This class inherits from SafeModule. Provided a TensorDict, this module will perform a Model Predictive Control (MPC) planning step. At the end of the planning step, the MPCPlanner will return a proposed action.

Parameters:
  • env (EnvBase) – The environment to perform the planning step on (Can be ModelBasedEnvBase or EnvBase).

  • action_key (str, optional) – The key that will point to the computed action.

forward(tensordict: TensorDictBase, tensordict_out: Optional[TensorDictBase] = None, **kwargs) TensorDictBase[source]

When the tensordict parameter is not set, kwargs are used to create an instance of TensorDict.

abstract planning(td: TensorDictBase) Tensor[source]

Performs the MPC planning step.

Parameters:

td (TensorDict) – The TensorDict to perform the planning step on.

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources