PlaNetConfig
WorldModelConfigPlaNetConfig(sample_size: int | tuple[int, int] = WORLD_MODEL_IMAGE_SIZE, in_channels: int = 3, out_channels: int = 3, act_fn: GenerativeActivation = 'relu', action_dim: int = 1, stoch_size: int = 30, deter_size: int = 200, hidden_size: int = 200, cnn_depth: int = 32, min_std: float = 0.1, mean_only: bool = False, free_nats: float = 3.0, kl_weight: float = 1.0, overshoot_distance: int | None = None, overshoot_weight: float = 1.0, overshoot_reward_weight: float = 1.0, reward_hidden: int = 200, reward_layers: int = 2, reward_loss_scale: float = 1.0)Frozen configuration for the PlaNet family.
Defaults reproduce Hafner et al., 2019 on the DeepMind Control Suite.
Parameters
act_fn(silu, swish, relu, gelu, elu)= "silu""silu".
Dreamer uses ELU, which is why neither value sits on
WorldModelConfig.overshoot_distanceint or None= NoneNone overshoots as far as each batch allows (the paper's full
setting); 1 disables it, leaving the ordinary one-step bound.
Costs one extra recurrence sweep per distance — see Notes.overshoot_weightfloat= 1.0overshoot_reward_weightfloat= 1.0reward_hiddenint= 200reward_layersint= 2reward_loss_scalefloat= 1.0Notes
The state geometry, the frame size, the action width and the two KL
knobs are inherited from WorldModelConfig, which is where
Dreamer reads the same values from.
Reference: Hafner, Lillicrap, Fischer, Villegas, Ha, Lee, and Davidson, "Learning Latent Dynamics for Planning from Pixels", ICML, 2019 (arXiv:1811.04551).
sample_size is pinned to 64 rather than made general. The encoder
is four stride-2 convolutions with 4x4 kernels and the decoder four
transposed convolutions with kernels 5, 5, 6, 6 — an irregular
schedule that lands on 64 exactly (1 -> 5 -> 13 -> 30 -> 64) and
on nothing else. Generalising it would mean inventing a schedule the
paper does not give, so an unsupported size raises here instead of
silently reconstructing to the wrong shape. Scale the model with
cnn_depth / deter_size / stoch_size.
Examples
>>> from lucid.models.generative.planet import PlaNetConfig
>>> cfg = PlaNetConfig(action_dim=6)
>>> cfg.stoch_size, cfg.deter_size, cfg.free_nats
(30, 200, 3.0)
>>> cfg.latent_size
230Used by 3
Constructors
1__init__
→None__init__(sample_size: int | tuple[int, int] = WORLD_MODEL_IMAGE_SIZE, in_channels: int = 3, out_channels: int = 3, act_fn: GenerativeActivation = 'relu', action_dim: int = 1, stoch_size: int = 30, deter_size: int = 200, hidden_size: int = 200, cnn_depth: int = 32, min_std: float = 0.1, mean_only: bool = False, free_nats: float = 3.0, kl_weight: float = 1.0, overshoot_distance: int | None = None, overshoot_weight: float = 1.0, overshoot_reward_weight: float = 1.0, reward_hidden: int = 200, reward_layers: int = 2, reward_loss_scale: float = 1.0)