API Reference#
This page lists every public class, function, and constant exported from the
torchwm top-level package, grouped by category.
Factory helpers#
Name |
Description |
|---|---|
|
Return a default config dict for a model family, with optional overrides applied. Models: |
|
Instantiate a model or high-level agent by canonical name (see Public API Quick Reference). |
|
Create a TorchWM environment through a named backend. Backends: |
|
Return canonical model names accepted by |
|
Return backend names accepted by |
|
Return known environment IDs, optionally filtered by model family. |
|
Return metadata ( |
|
Return metadata ( |
|
Return an |
Data classes#
Name |
Description |
|---|---|
|
Named tuple describing a registered model (name, import_path, config_path, aliases, description). |
|
Named tuple describing a registered environment backend (name, factory_path, aliases, description). |
|
Specification for operator input/output tensors (shape, dtype, name). |
|
Abstract base class for inference operators. |
World model agents#
Name |
Source |
Description |
|---|---|---|
|
|
Base Dreamer world model (RSSM-based, V1-style). |
|
|
DreamerV1 (alias for base Dreamer). |
|
|
DreamerV2 (symlog two-hot heads, balanced KL). |
|
|
DreamerV3-style agent (currently mapped to DreamerAgent). |
|
|
High-level Dreamer agent with train/evaluate helpers. |
|
|
PlaNet: Deep Planning Network. |
|
|
I-JEPA agent for self-supervised visual representation learning. |
|
|
IRIS agent for sample-efficient RL with Transformers. |
|
|
Genie generative interactive environment. |
|
|
Create a Genie model with specified parameters. |
|
|
Create Genie-small variant (~50M params). |
|
|
Create Genie-large variant (~11B params). |
Genie subcomponents#
Name |
Source |
Description |
|---|---|---|
|
|
Learns latent actions from pairs of video frames. |
|
|
Transformer-based dynamics for future token prediction. |
|
|
Factory for LatentActionModel. |
|
|
Factory for DynamicsModel. |
State-space models#
Name |
Source |
Description |
|---|---|---|
|
|
Recurrent State-Space Model (standalone). |
|
|
Alias for RSSM. |
|
|
RSSM variant used in Dreamer training loop. |
|
|
Modular RSSM with swappable encoder/backbone/decoder. |
|
|
Factory for ModularRSSM. |
Diffusion models#
Name |
Source |
Description |
|---|---|---|
|
|
Diffusion Transformer model. |
|
|
Factory for DiT. |
|
|
Image-to-patch embedding layer. |
|
|
Patch-to-image un-embedding layer. |
|
|
Denoising Diffusion Probabilistic Model. |
|
|
Actor-critic head for DIAMOND-style RL. |
|
|
Reward + termination predictor for DIAMOND. |
|
|
Time-step embedding for diffusion. |
Vision components#
Name |
Source |
Description |
|---|---|---|
|
|
Dreamer convolutional encoder (image → embedding). |
|
|
PlaNet CNN encoder (image → embedding). |
|
|
IRIS encoder (image → discrete tokens). |
|
|
Dreamer convolutional decoder (latent → image distribution). |
|
|
PlaNet CNN decoder. |
|
|
MLP decoder for reward/value/discount. |
|
|
Dreamer policy head (latent → tanh-squashed action). |
|
|
IRIS decoder (tokens → image). |
|
|
Genie VQ-VAE video tokenizer. |
|
|
Factory for VideoTokenizer. |
|
|
VQ-VAE vector quantization layer. |
|
|
VQ-VAE with EMA codebook updates. |
|
|
Tanh bijection for action squashing. |
|
|
MC-sampled distribution statistics. |
Config classes#
Name |
Source |
Description |
|---|---|---|
|
|
Dreamer hyperparameter config. |
|
|
JEPA hyperparameter config. |
|
|
DiT hyperparameter config. |
|
|
Factory for DiTConfig with presets. |
|
|
DIAMOND hyperparameter config. |
|
|
IRIS hyperparameter config. |
|
|
Genie hyperparameter config. |
|
|
Genie-small preset config. |
|
|
ST-Transformer config. |
|
|
Video tokenizer config. |
|
|
Latent action model config. |
|
|
Dynamics model config. |
Constants#
Name |
Description |
|---|---|
|
Dict of all built-in model specs (name → |
|
Dict of all built-in environment backend specs. |
|
List of Atari 100K benchmark game names. |
|
Dict of human baseline scores for Atari 100K. |
|
Dict of random baseline scores for Atari 100K. |
Memory / replay buffers#
Name |
Source |
Description |
|---|---|---|
|
|
Dreamer ring buffer (transitions → sequences). |
|
|
Episode-based memory for PlaNet. |
|
|
Single episode recording. |
|
|
Ring buffer for IRIS (uint8 images). |
|
|
On-policy buffer for episode collection. |
Environments and wrappers#
Name |
Source |
Description |
|---|---|---|
|
|
DeepMind Control Suite adapter. |
|
|
DeepMind Lab adapter. |
|
|
Factory for DeepMind Lab. |
|
|
Available DMLab level names. |
|
|
Gymnasium image adapter. |
|
|
Factory for GymImageEnv. |
|
|
MuJoCo image adapter. |
|
|
Factory for MuJoCo environments. |
|
|
Raw MuJoCo environment wrapper. |
|
|
Brax image adapter. |
|
|
Factory for BraxImageEnv. |
|
|
BSuite image adapter. |
|
|
Factory for BSuiteImageEnv. |
|
|
List BSuite environment IDs. |
|
|
Factory for Atari ALE environments. |
|
|
List available Atari game IDs. |
|
|
Factory for vectorized Atari. |
|
|
DIAMOND-style Atari preprocessing. |
|
|
Factory for Procgen environments. |
|
|
Factory for Gymnasium Robotics. |
|
|
Register Robotics envs. |
|
|
List installed Robotics envs. |
|
|
Unity ML-Agents adapter. |
|
|
Factory for UnityMLAgentsEnv. |
|
|
Environment inside a learned world model. |
|
|
Factory for WorldModelEnv. |
|
|
Episode time limit wrapper. |
|
|
Action repeat wrapper. |
|
|
Action normalization to [-1, 1]. |
|
|
Observation-to-dict conversion. |
|
|
Discrete to one-hot action conversion. |
|
|
Reward observation injection. |
|
|
Image resizing wrapper. |
|
|
Render-based image observation. |
|
|
Action selection wrapper. |
Controllers and policies#
Name |
Source |
Description |
|---|---|---|
|
|
RSSM-based policy for Dreamer. |
|
|
Policy rollouts in the environment. |
|
|
IRIS actor head. |
|
|
IRIS critic head. |
|
|
IRIS combined actor-critic policy. |
|
|
CNN feature extractor for policy inputs. |
Inference operators#
Name |
Source |
Description |
|---|---|---|
|
|
Dreamer input preprocessing. |
|
|
JEPA image masking and patching. |
|
|
IRIS sequence tokenization. |
|
|
PlaNet action/state preprocessing. |
Export#
Name |
Source |
Description |
|---|---|---|
|
|
Export a model or agent to ONNX/TorchScript/TensorRT. |
|
|
Export a raw nn.Module. |
|
|
Mixin that adds |
Reward and value models#
Name |
Source |
Description |
|---|---|---|
|
|
Base reward model. |
|
|
Base value model. |
|
|
Dreamer reward predictor. |
|
|
Dreamer value function. |
Transformer blocks#
Name |
Source |
Description |
|---|---|---|
|
|
Spatiotemporal Transformer (Genie). |
|
|
Multi-head self-attention. |
|
|
Multi-head cross-attention. |
|
|
Adaptive layer norm for diffusion. |
|
|
Root mean square layer norm. |
Plugin registry#
Name |
Source |
Description |
|---|---|---|
|
|
Register a custom world model architecture. |
|
|
Remove a registered model. |
|
|
Look up a registered model spec. |
|
|
List all externally registered model names. |
|
|
Register a custom environment backend. |
|
|
Remove a registered env backend. |
|
|
List all registered env backends. |
Deprecation utilities#
Name |
Source |
Description |
|---|---|---|
|
|
Decorator to mark functions/classes as deprecated. |
|
|
Shortcut for deprecating a class. |
|
|
Shortcut for deprecating a function. |
General utilities#
Name |
Source |
Description |
|---|---|---|
|
|
Logging utility. |
|
|
Context manager to freeze model parameters. |
|
|
Compute GAE or λ-return. |
|
|
Observation preprocessing (resize, normalize). |
Version#
Name |
Description |
|---|---|
|
Package version string (semver). |