{"id":28927072,"url":"https://github.com/frankroeder/dali","last_synced_at":"2026-03-02T04:03:48.161Z","repository":{"id":300212338,"uuid":"1003079290","full_name":"frankroeder/DALI","owner":"frankroeder","description":"Dynamics-Aligned Latent Imagination in Contextual World Models for Zero-Shot Generalization","archived":false,"fork":false,"pushed_at":"2026-01-17T06:53:53.000Z","size":166,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-17T17:58:41.052Z","etag":null,"topics":["contextual-reinforcement-learning","counterfactual-consistency","counterfactuals","dreamer","neurips-2025","representation-learning","worldmodel","zero-shot-generalization"],"latest_commit_sha":null,"homepage":"https://openreview.net/forum?id=41bIzD5sit","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/frankroeder.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-06-16T15:34:00.000Z","updated_at":"2026-01-17T06:58:25.000Z","dependencies_parsed_at":"2025-06-20T12:52:14.116Z","dependency_job_id":"b0b78a8b-4e74-4893-a732-79a923e82228","html_url":"https://github.com/frankroeder/DALI","commit_stats":null,"previous_names":["frankroeder/dali"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/frankroeder/DALI","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frankroeder%2FDALI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frankroeder%2FDALI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frankroeder%2FDALI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frankroeder%2FDALI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/frankroeder","download_url":"https://codeload.github.com/frankroeder/DALI/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frankroeder%2FDALI/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29992286,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-02T01:47:34.672Z","status":"online","status_checked_at":"2026-03-02T02:00:07.342Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["contextual-reinforcement-learning","counterfactual-consistency","counterfactuals","dreamer","neurips-2025","representation-learning","worldmodel","zero-shot-generalization"],"created_at":"2025-06-22T12:30:46.517Z","updated_at":"2026-03-02T04:03:48.153Z","avatar_url":"https://github.com/frankroeder.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dynamics-Aligned Latent Imagination (DALI)\n\n#### [[OpenReview]](https://openreview.net/forum?id=41bIzD5sit) [[arXiv]](https://arxiv.org/abs/2508.20294) [[Code]](https://github.com/frankroeder/DALI)\n\n[Frank Röder*](https://frankroeder.github.io/), [Jan Benad](https://scholar.google.com/citations?user=FWy1Ov0AAAAJ), [Manfred Eppe](https://scholar.google.de/citations?user=fG0VWroAAAAJ), [Pradeep Kr. Banerjee*](https://scholar.google.com/citations?user=cnSjMBwAAAAJ) (\u0026#42; equal contribution)\u003cbr/\u003e\nAll the listed authors are members of the [Institute for Data Science Foundations](https://www.tuhh.de/dsf/homepage).\n\n---\n\nThis is the official implementation of **Dynamics-Aligned Latent Imagination** (**DALI**) based on [Jax](https://github.com/jax-ml/jax).\nDALI introduces a Dreamer-based architecture with a self-supervised context encoder designed to infer latent environmental\nparameters, such as gravity or friction. This integration facilitates robust zero-shot adaptation to diverse and previously\nunseen dynamics. Furthermore, manipulating the learned context representation enables physically plausible counterfactual imagination directly within the world model.\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://github.com/user-attachments/assets/0f2ae302-4b55-40ea-98f9-c99b556b3cff\"\u003e\n\u003cimg src=\"https://github.com/user-attachments/assets/2285bb58-6943-462d-ac26-4ceeaa3ccba1\"\u003e\n\n\u003cimg src=\"https://github.com/user-attachments/assets/d7e2009b-4ecf-4c89-a3df-908ac58a0e0d\"\u003e\n\n\u003c/p\u003e\n\n### Citation\nIf this code or paper aids your research, please cite it as follows:\n```bib\n@inproceedings{\n  Roder_DynamicsAlignedLatent_2025,\n  title={Dynamics-Aligned Latent Imagination in Contextual World Models for Zero-Shot Generalization},\n  author={Frank R{\\\"o}der and Jan Benad and Manfred Eppe and Pradeep Kr. Banerjee},\n  booktitle={The Thirty-ninth Annual Conference on Neural Information Processing Systems},\n  year={2025},\n  url={https://openreview.net/forum?id=41bIzD5sit}\n}\n```\n\n## Setup\nUse [uv](https://github.com/astral-sh/uv) to setup your python environment.\n\n```bash\nuv sync\nuv pip install -e ./dreamerv3_compat\nuv pip install -e ./\n```\n\n## Training\n\nRun scripts in `./local_scripts/` to generate results for experts, random policies, and DALI variants.\n\n## Record Data for Analysis\n\n```bash\nuv run -m contextual_mbrl.dreamer.record_context --logdir logs/carl_dmc_walker_double_box_enc_img_dec_img_ctxencoder_transformer_normalized/1337\n```\n\n### Log data for counterfactual dreams\n```bash\nuv run -m contextual_mbrl.dreamer.record_counterfactual_plausibility --logdir logs/carl_dmc_ball_in_cup_double_box_enc_img_dec_img_ctxencoder_transformer_grssm_normalized/1337 --jax.platform cpu\n```\n\n### Log data for imagined counterfactual obs trajectories\n```bash\nuv run -m contextual_mbrl.dreamer.record_counterfactual_plausibility_obs --logdir logs/carl_dmc_walker_double_box_enc_img_dec_img_ctxencoder_transformer_normalized/1337 --jax.platform cpu\n```\n\n### Record dataset for counterfactual obs analysis\n```bash\nuv run -m contextual_mbrl.dreamer.record_counterfactual_plausibility_obs_dataset --logdir logs/carl_dmc_walker_double_box_enc_img_dec_img_ctxencoder_transformer_normalized/1337 --jax.platform cpu\n```\n\n## Plots\n\nTo generate the plots, run the scripts in the `./analysis` directory.\n\n## Acknowledgments\n\n- cRSSM variants: Prasanna et al. 2024 - [https://github.com/sai-prasanna/dreaming_of_many_worlds](https://github.com/sai-prasanna/dreaming_of_many_worlds) \n- DreamerV3: Hafner et al. 2023 - [https://github.com/danijar/dreamerv3](https://github.com/danijar/dreamerv3)\n- CARL benchmark: Benjamins et al. 2023 - [https://github.com/automl/CARL](https://github.com/automl/CARL) \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrankroeder%2Fdali","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffrankroeder%2Fdali","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrankroeder%2Fdali/lists"}