A Modular Pytorch Based library for training world models
Project description
TorchWM
Modular PyTorch Library for World Models
Quick Start
TorchWM provides a unified interface for training and deploying world models.
Installation
pip install torchwm
# or with uv
uv add torch torchvision torchaudio
Training a Dreamer Agent
from world_models.models import DreamerAgent
from world_models.configs import DreamerConfig
cfg = DreamerConfig()
cfg.env = "walker-walk"
cfg.total_steps = 1_000_000
agent = DreamerAgent(cfg)
agent.train()
Using Inference Operators
from world_models.inference.operators import DreamerOperator
op = DreamerOperator(image_size=64, action_dim=6)
processed = op.process({'image': image, 'action': action})
# Returns standardized tensors for inference
Features
- 🎯 Unified Interface: Consistent API across all world model algorithms
- 🔧 Modular Components: Swappable encoders, decoders, and backbones
- 🚀 High Performance: Optimized for both training and inference
- 🌍 Multi-Environment: Support for DMC, Gym, Unity, and custom environments
- 📊 Rich Monitoring: Integrated logging with Weights & Biases and TensorBoard
- 🧠 Research Ready: Easy experimentation with different architectures
Supported Algorithms
| Algorithm | Description | Key Features |
|---|---|---|
| Dreamer | Model-based RL with latent dynamics | Imagination, actor-critic |
| JEPA | Self-supervised visual representations | Masked prediction, ViT |
| IRIS | Sample-efficient RL with Transformers | Discrete VAEs, world models |
| Diamond | Diffusion + RL for continuous control | EDM sampling, value functions |
Documentation
Get Started
User Guides
Algorithms
Community
- 🐛 Issue Tracker
- 💬 Discussions
- 📧 PyPI
TorchWM is under active development. APIs may change between versions.
:hidden:
:maxdepth: 1
:caption: Get Started
getting_started
installation
:hidden:
:maxdepth: 1
:caption: User Guides
operators_guide
training_guide
inference_guide
environments_guide
package_overview
:hidden:
:maxdepth: 1
:caption: Algorithms
dreamer
jepa
iris
dit
:hidden:
:maxdepth: 1
:caption: Reference
api_reference
configs_reference
:hidden:
:maxdepth: 1
:caption: Development
contributing
benchmarks
:hidden:
:maxdepth: 1
:caption: User Guides
operators_guide
training_guide
inference_guide
environments_guide
package_overview
:hidden:
:maxdepth: 1
:caption: Algorithms
dreamer
jepa
iris
dit
:hidden:
:maxdepth: 1
:caption: Reference
api_reference
configs_reference
:hidden:
:maxdepth: 1
:caption: Development
contributing
benchmarks
Quick Start
TorchWM provides a unified interface for training and deploying world models.
Installation
pip install torchwm
# or with uv
uv add torch torchvision torchaudio
Training a Dreamer Agent
from world_models.models import DreamerAgent
from world_models.configs import DreamerConfig
cfg = DreamerConfig()
cfg.env = "walker-walk"
cfg.total_steps = 1_000_000
agent = DreamerAgent(cfg)
agent.train()
Using Inference Operators
from world_models.inference.operators import DreamerOperator
op = DreamerOperator(image_size=64, action_dim=6)
processed = op.process({'image': image, 'action': action})
Features
- 🎯 Unified Interface: Consistent API across all world model algorithms
- 🔧 Modular Components: Swappable encoders, decoders, and backbones
- 🚀 High Performance: Optimized for both training and inference
- 🌍 Multi-Environment: Support for DMC, Gym, Unity, and custom environments
- 📊 Rich Monitoring: Integrated logging with Weights & Biases and TensorBoard
- 🧠 Research Ready: Easy experimentation with different architectures
Supported Algorithms
| Algorithm | Description | Key Features |
|---|---|---|
| Dreamer | Model-based RL with latent dynamics | Imagination, actor-critic |
| JEPA | Self-supervised visual representations | Masked prediction, ViT |
| IRIS | Sample-efficient RL with Transformers | Discrete VAEs, world models |
| Diamond | Diffusion + RL for continuous control | EDM sampling, value functions |
Community
- 📖 Documentation
- 🐛 Issue Tracker
- 💬 Discussions
- 📧 PyPI
TorchWM is under active development. APIs may change between versions.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
torchwm-0.3.2.tar.gz
(151.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
torchwm-0.3.2-py3-none-any.whl
(154.4 kB
view details)
File details
Details for the file torchwm-0.3.2.tar.gz.
File metadata
- Download URL: torchwm-0.3.2.tar.gz
- Upload date:
- Size: 151.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fbe0566f11b4a5629f9b5450d8239b148133ccdd684b30639c41918d758b56fe
|
|
| MD5 |
4341110a94a68cb4ccdf14b45f36f9d6
|
|
| BLAKE2b-256 |
a3d7747e9710f84354d25c914601ac017ec9ffc36bcddf61e9e154811dbb71dd
|
File details
Details for the file torchwm-0.3.2-py3-none-any.whl.
File metadata
- Download URL: torchwm-0.3.2-py3-none-any.whl
- Upload date:
- Size: 154.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
67bd367c10bffd92a38ab19fbd890fcf53db4317dfb6aef8e6ad92512095ea2d
|
|
| MD5 |
19adacb3b3b18f717f492b1d2f5c346c
|
|
| BLAKE2b-256 |
7beaac9c4db0ebd4baf3eedde4f8023443d4aa66051fb3869dc538720c992424
|