DreamerV3Config
WorldModelConfigDreamerV3Config(sample_size: int | tuple[int, int] = WORLD_MODEL_IMAGE_SIZE, in_channels: int = 3, out_channels: int = 3, act_fn: GenerativeActivation = 'silu', action_dim: int = 1, stoch_size: int = 32, deter_size: int = 4096, hidden_size: int = 512, cnn_depth: int = 32, min_std: float = 0.1, mean_only: bool = False, free_nats: float = 1.0, kl_weight: float = 1.0, discrete: int = 32, unimix: float = 0.01, blocks: int = 8, dyn_scale: float = 1.0, rep_scale: float = 0.1, pred_scale: float = 1.0, num_bins: int = 255, bin_range: float = 20.0, reward_hidden: int = 512, reward_layers: int = 1, actor_hidden: int = 512, actor_layers: int = 3, value_hidden: int = 512, value_layers: int = 3, horizon: int = 15, discount: float = 0.997, lambda_: float = 0.95, actor_entropy: float = 0.0003, actor_min_std: float = 0.1, return_ema_decay: float = 0.99, return_low: float = 5.0, return_high: float = 95.0, critic_ema: float = 0.02, critic_slowreg: float = 1.0, replay_value_scale: float = 0.3, pcont: bool = True, pcont_scale: float = 1.0, pcont_layers: int = 1, action_space: str = 'continuous')Frozen configuration for the DreamerV3 family.
Defaults are the paper's values at the 50m rung of the scaling
ladder, whose 32-class categorical grid is the one the paper
describes. Fields shared with the earlier world models are inherited
from WorldModelConfig.
Parameters
act_fn(silu, swish, relu, gelu, elu)= "silu"stoch_sizeint= 32deter_sizeint= 4096, 512hidden_sizeint= 4096, 512cnn_depthint= 32free_natsfloat= 1.0kl_weightfloat= 1.0discreteint= 32unimixfloat= 0.01blocksint= 8deter_size.dyn_scalefloat= 1.0, 0.1rep_scalefloat= 1.0, 0.1pred_scalefloat= 1.0num_binsint= 255bin_rangefloat= 20.0[-bin_range, +bin_range] in symlog space, so in
reward units it reaches symexp(20) — roughly 5e8.reward_hiddenint= 512, 1rewhead
has — the three-layer stack is the actor's and the critic's.reward_layersint= 512, 1rewhead
has — the three-layer stack is the actor's and the critic's.actor_hiddenint= 512, 3actor_layersint= 512, 3value_hiddenint= 512, 3value_layersint= 512, 3horizonint= 15H in the paper's Table 4.discountfloat= 0.997lambda_float= 0.95actor_entropyfloat= 3e-4actor_min_stdfloat= 0.1std = 2 * sigmoid(raw / 2) + min_std.
Without a floor the actor can drive the deviation to zero,
which ends exploration and leaves the entropy bonus fighting a
term that has already collapsed. Ignored when
action_space="discrete".return_ema_decayfloat= 0.99return_lowfloat= 5.0, 95.0return_highfloat= 5.0, 95.0critic_emafloat= 0.02critic_slowregfloat= 1.0replay_value_scalefloat= 0.3pcontbool= Truediscount, so a trajectory stops being credited
once the model expects it to have ended — the difference
between a world model that knows about termination and one that
assumes the episode runs forever. Costs one filtered step per
sequence, because the last one has no successor to label it, so
training needs sequences of at least two.pcont_scalefloat= 1.0pcont_layersint= 1action_space(continuous, discrete)= "continuous"Notes
Reference: Hafner, Pasukonis, Ba, and Norouzi, "Mastering Diverse Domains through World Models", Nature 640 (2025), 647-653 (arXiv:2301.04104).
The scaling ladder moves five quantities together, so it is a table
rather than a knob — see DREAMER_V3_SIZES and the factories
built from it:
======== ======= ======== ======= ===== =====
size deter hidden classes depth units
======== ======= ======== ======= ===== =====
12m 2048 256 16 16 256
25m 3072 384 24 24 384
50m 4096 512 32 32 512
100m 6144 768 48 48 768
200m 8192 1024 64 64 1024
400m 12288 1536 96 96 1536
======== ======= ======== ======= ===== =====
Two details of that table are worth writing down. Its 12m column
prints 1024 recurrent units where the stated rule — eight times the
hidden size — gives 2048; the released implementation uses 2048, and
so does this. And the paper's own default is the 200m rung for
every benchmark except the two control suites, which use 12m; the
defaults here are 50m, the middle of the ladder, because a 200M
default would make merely constructing the model an expensive
operation. Use dreamer_v3_200m for the paper's setting.
The released implementation carries a few things the paper does not
report — extra dynamics layers, an absolute posterior variant, and
a value- and advantage-normalisation pair disabled in every published
configuration. Where the two disagree the paper is followed, as it is
for the earlier families.
Examples
>>> from lucid.models.generative.dreamer_v3 import DreamerV3Config
>>> cfg = DreamerV3Config(action_dim=6)
>>> cfg.stoch_size, cfg.discrete, cfg.free_nats
(32, 32, 1.0)
>>> cfg.discount, cfg.horizon, cfg.num_bins
(0.997, 15, 255)Used 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 = 'silu', action_dim: int = 1, stoch_size: int = 32, deter_size: int = 4096, hidden_size: int = 512, cnn_depth: int = 32, min_std: float = 0.1, mean_only: bool = False, free_nats: float = 1.0, kl_weight: float = 1.0, discrete: int = 32, unimix: float = 0.01, blocks: int = 8, dyn_scale: float = 1.0, rep_scale: float = 0.1, pred_scale: float = 1.0, num_bins: int = 255, bin_range: float = 20.0, reward_hidden: int = 512, reward_layers: int = 1, actor_hidden: int = 512, actor_layers: int = 3, value_hidden: int = 512, value_layers: int = 3, horizon: int = 15, discount: float = 0.997, lambda_: float = 0.95, actor_entropy: float = 0.0003, actor_min_std: float = 0.1, return_ema_decay: float = 0.99, return_low: float = 5.0, return_high: float = 95.0, critic_ema: float = 0.02, critic_slowreg: float = 1.0, replay_value_scale: float = 0.3, pcont: bool = True, pcont_scale: float = 1.0, pcont_layers: int = 1, action_space: str = 'continuous')