Skip to content

v1.2.0

Latest

Choose a tag to compare

@ParamThakkar123 ParamThakkar123 released this 23 Nov 16:40
· 20 commits to main since this release

Added

  • DreamerV3 demo results on Atari100k Boxing (83.3 at 400K frames with the 12M
    model; the paper reports 78 with 200M), a reduced Crafter run and BSuite
    (bandit, umbrella_length, memory_len), with gallery media and README clips.
    demos/bsuite_scores.py scores BSuite runs with BSuite's own analysis.
    BSuite mnist is not learned at 12M or 25M model size.
  • DreamerV3 Crafter preset. benchmark_config("crafter") and the shared
    crafter benchmark: 1M steps, action repeat 1, one environment, replay ratio
    512 and the 200m model, from Table A.1 of the paper's first arXiv version (the
    published Table 2 has no Crafter row).
  • Crafter (CrafterEnv, env_backend="crafter"): DreamerV3's Crafter
    benchmark with the reward and noreward tasks. crafter_score computes
    the benchmark score, the geometric mean of the 22 achievement success rates.
  • Memory Maze (MemoryMazeEnv, env_backend="memory_maze"): the 9x9 to
    15x15 long-horizon memory tasks, with the target colour as an observation.
    python -m simulusion.install_dmc --memory-maze installs it on CPython 3.13.
  • Atari 100k protocols (Atari100kEnv, env_backend="atari100k"): the 26
    games driven through ALE with the exact preprocessing of IRIS, DIAMOND, STORM
    or DreamerV3, taken from their reference code (sticky actions, no-op starts,
    life-loss episode ends, frame limit, resize filter and order), plus the IRIS
    and DIAMOND evaluation settings, which Dreamer's evaluation env uses.
  • Craftax (CraftaxEnv, env_backend="craftax"): Craftax and
    Craftax-Classic, pixel and symbolic, through jitted single-env steps.
  • Extras crafter, craftax, memory-maze and atari100k.
  • Minecraft Diamond (MinecraftDiamondEnv, env_backend="minecraft"): the
    DreamerV3 benchmark environment on MineRL 0.4.4, following the reference code:
    25 flat actions with abstract crafting, +1 per milestone item once per episode,
    a health reward, 36000-step episodes, 100x block breaking, held jumps, a pitch
    limit, and image plus inventory, equipped-item and status vectors. A Malmo
    failure cuts the episode short (truncated) and the next reset restarts it.
  • BSuite benchmark protocol. BSuiteImageEnv takes obs_type="state" (the
    flat observation vector DreamerV3 learns from), accepts bare names ("catch"
    is "catch/0"), records BSuite's CSV logs for scoring with results_dir=,
    and tracks the episode budget, at which Dreamer training now stops.
    list_bsuite_settings lists an environment's settings (468 in all).
  • DMLab-30 protocol. DMLabEnv offers the fixed PopArt/R2D2 (15) and IMPALA
    action sets by name, embeds the instruction of language_* levels as
    obs["instr"] as in the DreamerV3 reference, and has train/eval modes for
    *_train/held-out levels. DMLab-30 levels can be named without their folder
    (DMLAB30_LEVELS, resolve_dmlab_level), and Dreamer configs default to the
    PopArt actions and train mode, and count Lab frames.
  • Benchmark protocol in Dreamer's make_env. DMLab, Minecraft and BSuite
    end their own episodes, so time_limit does not apply to them, and they
    require action_repeat=1 (DMLab repeats 4 frames inside Lab), as in the
    DreamerV3 reference. minecraft_length sets Minecraft's episode length.
  • DreamerV3 presets for BSuite, DMLab-30 and Minecraft Diamond. A
    minecraft preset follows Table 2 (100M steps, replay ratio 32); the bsuite
    preset learns from the observation vector and bsuite_settings lists the 468
    settings; the dmlab preset uses the PopArt action set on training levels.
  • docker/envs image with DeepMind Lab (built from source), the patched
    MineRL 0.4.4 and BSuite on Python 3.11, for the benchmarks that cannot be
    pip-installed on every platform.
  • Proprioceptive DeepMind Control observations. DeepMindControlEnv takes
    obs_type="state" (Dreamer configs: dmc_obs_type="state"), which returns
    the task's state flattened into obs["state"] and skips rendering, for the
    Proprio Control benchmark. Pixel observations now carry obs["state"] too.

Changed

  • Every discrete adapter (BSuite, DMLab, Minecraft Diamond, Procgen and the new
    benchmarks) uses one shared one-hot action space instead of a private copy
    each. Procgen's now carries one_hot = True like the others, so agents treat
    its actions as categorical. Seeded action samples are unchanged.
  • The dmc extras and simulusion.install_dmc require labmaze-new>=0.0.3,
    which builds labmaze's native extension with setuptools instead of Bazel, so
    labmaze.RandomMaze works on CPython 3.13, including Windows.

Fixed

  • DreamerV3 used a Gaussian policy on Crafter, Craftax and the native Atari
    100k protocol: their one-hot action Box (one_hot = True) was not
    recognised as discrete, and make_env replaced it with a plain Box through
    NormalizeActions. One-hot spaces now keep their marker and get the
    categorical policy, as BSuite, DMLab and Minecraft already did.
  • DreamerV3 initializes its networks as the reference code does
    (simulusion.layers.initializers): every layer trunc-normal with fan-in
    scaling, the policy output scaled by policy_outscale (0.01), the reward
    and critic outputs zero. reference_init=False keeps PyTorch's defaults.
  • DreamerV3 benchmark presets train while they act, as the reference does:
    one update per batch's worth of policy steps (collect_steps = 16 x 64 /
    replay ratio, in frames), instead of collecting 1000 frames and then running
    every update in one burst. Those presets also average training metrics
    over log_every frames (1000) before logging; log_every defaults to 0,
    logging every training step as before.
  • A failed DreamerV3 CUDA graph capture no longer keeps the half-built graph's
    memory pool, which left the GPU full when training fell back to eager mode.
  • demos/dreamer_v3_demo.py takes --no-cuda-graphs, for model sizes whose
    graph memory pools do not fit a small GPU.
  • demos/dreamer_v3_demo.py sized its replay buffer for an action repeat of 2,
    so Atari100k runs (repeat 4) reserved twice the records they can store and
    ran out of memory on a 16 GB machine. The buffer now holds one record per
    agent step of the run.
  • DreamerV3 benchmark presets collected 5000 frames with a random policy
    before training. The reference has no random prefill: the agent acts from
    the start and trains once replay holds one batch (16 x 64 agent steps).
    benchmark_config now sets seed_steps to that batch, in frames. This
    matters most for BSuite, whose score counts every episode: bandit spent half
    of its 10,000-episode budget acting at random.
  • DreamerV3 updates were bound by kernel launches (about 90 small kernels per
    recurrent step): 2.4 s per update on an RTX 3050 laptop with the GPU mostly
    idle. The observe rollout (forward and backward) and imagination now replay
    as CUDA graphs (cuda_graphs=True, falling back to eager on CPU, under AMP,
    or if capture fails), taking an update to 0.36 s from joint states and 0.80 s
    from pixels. LaProp and adaptive gradient clipping use foreach kernels, and
    training metrics reach the host in one copy per update.
  • DreamerV3's actor_dist="auto" chose a Gaussian policy for DMLab, BSuite and
    Minecraft, whose discrete actions are one-hot Box spaces; it now picks the
    categorical policy the paper uses.
  • create_config("dreamer-v3", model_size=...) kept the 12M layer widths.
  • Training DreamerV3 through agent.train() crashed at its first checkpoint,
    which expected DreamerV1/V2 update objects.
  • BSuiteImageEnv.max_episode_steps returned the setting's episode count.
  • Plotting works with plotly 7, which removed plotly.graph_objs.Line:
    importing it disabled all plotting, so lineplot and plot_metrics (and so
    train_rssm) crashed. plotly and scikit-learn are now imported separately,
    so line plots no longer need scikit-learn, and a missing package raises an
    ImportError naming the viz extra.
  • @deprecated on a class recursed forever on construction; it now calls
    the original __init__. Deprecation warnings name the function (not
    "function"), point at the caller, and have no stray space before the reason.
  • DeepMind Control episodes that end at the time limit (discount 1) are
    reported as truncations rather than terminations, so learners bootstrap the
    value of the last state. Every DMC task ends this way.
  • The trained demo checkpoints for Dreamer, DreamerV2, PlaNet, IRIS, DiT and
    I-JEPA are on the Hugging Face Hub, in the
    Simulusion demo models
    collection. The README and the gallery link to them, and the gallery lists
    each repo with how to load it.
  • DreamerV3 (create_model("dreamer-v3")). Implements the paper's
    robustness techniques: categorical latents with 1% unimix and straight-through
    gradients, separate dynamics/representation KL terms with free bits, symexp
    two-hot reward and critic heads, percentile return normalization with a
    denominator limit, a critic EMA regularizer and replay loss, zero-initialized
    head outputs, and LaProp with adaptive gradient clipping. It trains through
    DreamerAgent on the shared Trainer, and its per-term losses, gradient norms
    and return scale are logged with the other training metrics.
  • DreamerV3Config with the paper's Table 4 defaults and the 12M-400M model-size
    presets from Table 3; widths resolve from model_size and update_steps
    derives from replay_ratio.
  • CategoricalRSSM, DreamerV3Encoder/Decoder/Head/Actor,
    DreamerV3ReplayBuffer, BlockGRUCell/BlockLinear, and a new
    simulusion.optim package exporting LaProp and adaptive_grad_clip_,
    all usable independently of the agent.
  • Discrete action support in the shared Dreamer make_env: environments with a
    discrete action space are wrapped with OneHotAction instead of failing in
    NormalizeActions.
  • examples/dreamer_v3_example.py and the dreamer_v3 documentation page.
  • DreamerV3 replay follows the paper's Methods section. Each record holds an
    observation with the action and reward that led to it, and the final
    observation of every episode gets its own record, so the reward and continue
    predictors at s_t learn r_t and c_t as in Eq. 1, and imagined rewards
    are read off at the state reached. Model states are stored in replay,
    replayed sequences start from them, and training writes fresh states back.
    Each minibatch is filled from the online queue first. Collection continues
    the open episode across calls instead of resetting the environment.
  • DreamerV3 encodes several observations at once (obs_keys), as in the
    paper: image inputs are stacked into one CNN, vector inputs into one symlog
    MLP, and the decoder reconstructs each of them. By default it encodes the
    image, or the state vector when there is no image (DMC Proprio Control), plus
    a DMLab language instruction when present. Replay and checkpoints keep every
    input.
  • DreamerV3's reward and continue predictors are 1-layer MLPs
    (reward_layers, cont_layers), the replay ratio counts policy steps
    (action repeat divided out, matching the paper's worked example), and replay
    capacity defaults to 5M (Table 4).
  • DreamerV3 benchmark presets (benchmark_config, BENCHMARKS) follow Table 2
    of the paper: task lists, step budget, action repeat, replay ratio and model
    size for DMC Proprio and Visual Control, Atari, Atari100k, ProcGen, DMLab-30
    and BSuite, with each benchmark's environment settings (sticky actions and the
    full action set for Atari but not Atari100k, ProcGen hard mode with unlimited
    levels). Gym environments take gym_make_kwargs, which the Atari presets use
    to set ALE's frameskip=1 so the action repeat of 4 is not applied twice.
  • demos/dreamer_v3_demo.py trains DreamerV3 from a benchmark preset
    (resumable with --resume) and records the real-vs-imagined video, a policy
    video and the learning curve. The gallery and README show two runs on
    cartpole swing-up: from joint states with the paper's protocol (500k steps,
    final evaluation return 866), and from pixels (300k steps at replay ratio
    128, return 740-840 at the end).
  • simulusion play -m diamond: press S in DREAM mode to save the last
    --dream-buffer dream frames (default 50) as dream_<timestamp>.mp4, with
    the actions and predicted rewards in dream_<timestamp>.json. Before, the
    only way to keep a dream was --record from the start.

Changed

  • DreamerAgent subclasses can pick their configuration class (_config_cls)
    and build their own algorithm core (_build_core) alongside core_cls.
    Passing a base DreamerConfig to a subclass agent carries over only the
    fields that were changed, so the subclass's tuned defaults are kept.