data
DreamerV3BehaviorOutput
extends
ModelOutputDreamerV3BehaviorOutput(actor_loss: Tensor, value_loss: Tensor, lambda_return: Tensor, return_scale: float, entropy: Tensor, imagined_reward: Tensor, imagined_value: Tensor, imagined_action: Tensor, imagined_discount: Tensor | None = None, replay_value_loss: Tensor | None = None)What the imagination pass produces.
Attributes
actor_loss, value_lossTensorScalars, each for its own optimiser.
value_loss already
carries the replayed-trajectory term when one is configured.lambda_returnTensorThe targets,
(N, H), bootstrapped from the live critic.return_scalefloatWhat the advantage was divided by —
max(1, S). Exposed
because it is the number that decides whether the entropy bonus
is currently doing anything.entropyTensorMean policy entropy over the scored states.
imagined_reward, imagined_valueTensorAlong the imagined trajectory,
(N, H + 1).imagined_actionTensorWhat the actor proposed,
(N, H, action_dim).imagined_discountTensor or NonePredicted continuation probability,
(N, H + 1); None when
the discount is held constant.replay_value_lossTensor or NoneThe critic's term over the replayed trajectory, before its scale
is applied;
None when that term is switched off.Examples
>>> import lucid
>>> from lucid.models import dreamer_v3_12m_world_model
>>> model = dreamer_v3_12m_world_model(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, horizon=3, pcont=False)
>>> out = model(lucid.randn((1, 4, 3, 64, 64)), lucid.randn((1, 4, 2)),
... lucid.randn((1, 4)))
>>> out.behavior.lambda_return.shape
(4, 3)