Getting Started#
Installation#
Install from PyPI:
pip install torchwm
Install from source:
git clone https://github.com/ParamThakkar123/torchwm.git
cd torchwm
pip install -e .
For development and tests:
pip install -e ".[dev]"
Docker#
Build the Docker image:
docker build -t torchwm .
Run the container:
docker run -p 8000:8000 torchwm
Docker Compose#
Build and run all services:
docker compose up -d
This starts both the backend (port 8000) and frontend (port 5173) services.
Quick Start: Dreamer#
from world_models.models import DreamerAgent
from world_models.configs import DreamerConfig
cfg = DreamerConfig()
cfg.env_backend = "gym"
cfg.env = "Pendulum-v1"
cfg.total_steps = 10_000
agent = DreamerAgent(cfg)
agent.train()
Quick Start: JEPA#
from world_models.models import JEPAAgent
from world_models.configs import JEPAConfig
cfg = JEPAConfig()
cfg.dataset = "imagefolder"
cfg.root_path = "./data"
cfg.image_folder = "train"
cfg.epochs = 10
agent = JEPAAgent(cfg)
agent.train()
Environment Backends#
Dreamer supports multiple backends through DreamerConfig.env_backend:
dmc: DeepMind Control Suite tasks (for examplewalker-walk)gym: Gym/Gymnasium environment IDs or an existing environment instanceunity_mlagents: Unity ML-Agents executable environments
Important Unity settings are available in DreamerConfig:
unity_file_nameunity_behavior_nameunity_no_graphicsunity_time_scale
Typical Training Flow#
Create a config object (
DreamerConfigorJEPAConfig).Override dataset/environment and optimization fields.
Instantiate the corresponding agent (
DreamerAgent,JEPAAgent).Call
train()and monitor logs/checkpoints.
For complete API details, see API Reference.