Skip to content
data

DreamerV3Output

extendsModelOutput
DreamerV3Output(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, dynamics_loss: Tensor | None = None, representation_loss: Tensor | None = None, kl_loss: Tensor | None = None, pcont_loss: Tensor | None = None, behavior: DreamerV3BehaviorOutput | None = None)

What DreamerV3Model returns after filtering a trajectory.

Attributes

observationTensor
Reconstruction, (B, T, C, 64, 64).
reward, valueTensor
Predictions at each posterior state, (B, T), decoded from their bin distributions and back in the target's own units.
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, pcont_lossTensor or None
World-model terms, set only by DreamerV3ForWorldModeling.
dynamics_loss, representation_lossTensor or None
The two halves of the divergence, already scaled and floored. Kept apart because their ratio is what a reader checks when a latent collapses.
kl_lossTensor or None
Their sum, for symmetry with the earlier families.
behaviorDreamerV3BehaviorOutput or None
Actor and critic terms, set only by that wrapper.

Examples

>>> import lucid
>>> from lucid.models import dreamer_v3_12m
>>> model = dreamer_v3_12m(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, num_bins=5)
>>> 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