class torchrl.modules.RSSMPosterior(hidden_dim=200, state_dim=30, scale_lb=0.1)[source]

The posterior network of the RSSM.

This network takes as input the belief and the associated encoded observation. It returns the parameters of the posterior as well as a state sampled according to this distribution.


  • hidden_dim (int, optional) – Number of hidden units in the linear network. Defaults to 200.

  • state_dim (int, optional) – Size of the state. Defaults to 30.

  • scale_lb (float, optional) – Lower bound of the scale of the state distribution. Defaults to 0.1.

forward(belief, obs_embedding)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.


Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.


Access comprehensive developer documentation for PyTorch

View Docs


Get in-depth tutorials for beginners and advanced developers

View Tutorials


Find development resources and get your questions answered

View Resources