Skip to content
data

DreamerV2Output

extendsModelOutput
DreamerV2Output(observation: Tensor, reward: Tensor, value: Tensor, posterior_stoch: Tensor, posterior_logits: Tensor, prior_logits: Tensor, deter: Tensor, loss: Tensor | None = None, recon_loss: Tensor | None = None, reward_loss: Tensor | None = None, kl_loss: Tensor | None = None, pcont_loss: Tensor | None = None, behavior: DreamerV2BehaviorOutput | None = None)

What DreamerV2Model returns after filtering a trajectory.

Attributes

observationTensor
Reconstruction, (B, T, C, 64, 64).
reward, valueTensor
Predictions at each posterior state, (B, T).
posterior_stochTensor
The filtered latent, flattened, (B, T, stoch_size * discrete).
posterior_logits, prior_logitsTensor
Class scores before and after seeing the frame, (B, T, stoch_size, discrete).
deterTensor
The deterministic path, (B, T, D).
loss, recon_loss, reward_loss, kl_loss, pcont_lossTensor or None
World-model terms, set only by DreamerV2ForWorldModeling.
behaviorDreamerV2BehaviorOutput or None
Actor and critic terms, set only by that wrapper.

Examples

>>> import lucid
>>> from lucid.models import dreamer_v2
>>> model = dreamer_v2(action_dim=2, cnn_depth=2, stoch_size=3, discrete=4,
...     deter_size=8, hidden_size=8, actor_hidden=8, value_hidden=8,
...     reward_hidden=8)
>>> out = model(lucid.randn((1, 2, 3, 64, 64)), lucid.randn((1, 2, 2)))
>>> out.posterior_stoch.shape, out.posterior_logits.shape
((1, 2, 12), (1, 2, 3, 4))

Used by 1