{"id":13444625,"url":"https://github.com/danijar/dreamerv3","last_synced_at":"2025-05-14T00:07:04.808Z","repository":{"id":65924778,"uuid":"588898844","full_name":"danijar/dreamerv3","owner":"danijar","description":"Mastering Diverse Domains through World Models","archived":false,"fork":false,"pushed_at":"2025-04-11T03:07:01.000Z","size":26738,"stargazers_count":1819,"open_issues_count":37,"forks_count":307,"subscribers_count":28,"default_branch":"main","last_synced_at":"2025-05-12T14:09:43.193Z","etag":null,"topics":["artificial-intelligence","general","jax","minecraft","reinforcement-learning","world-models"],"latest_commit_sha":null,"homepage":"https://danijar.com/dreamerv3","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/danijar.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}},"created_at":"2023-01-14T12:08:18.000Z","updated_at":"2025-05-12T02:53:53.000Z","dependencies_parsed_at":"2024-07-31T05:13:05.947Z","dependency_job_id":"89f7f4ed-8222-4a32-af7c-c74c54ab7df7","html_url":"https://github.com/danijar/dreamerv3","commit_stats":{"total_commits":16,"total_committers":8,"mean_commits":2.0,"dds":0.4375,"last_synced_commit":"8fa35f83eee1ce7e10f3dee0b766587d0a713a60"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danijar%2Fdreamerv3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danijar%2Fdreamerv3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danijar%2Fdreamerv3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danijar%2Fdreamerv3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danijar","download_url":"https://codeload.github.com/danijar/dreamerv3/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254043664,"owners_count":22004991,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["artificial-intelligence","general","jax","minecraft","reinforcement-learning","world-models"],"created_at":"2024-07-31T04:00:32.465Z","updated_at":"2025-05-14T00:07:04.802Z","avatar_url":"https://github.com/danijar.png","language":"Python","funding_links":[],"categories":["ICLR 2024 submissions","largemodel","Python"],"sub_categories":[],"readme":"# Mastering Diverse Domains through World Models\n\nA reimplementation of [DreamerV3][paper], a scalable and general reinforcement\nlearning algorithm that masters a wide range of applications with fixed\nhyperparameters.\n\n![DreamerV3 Tasks](https://user-images.githubusercontent.com/2111293/217647148-cbc522e2-61ad-4553-8e14-1ecdc8d9438b.gif)\n\nIf you find this code useful, please reference in your paper:\n\n```\n@article{hafner2023dreamerv3,\n  title={Mastering Diverse Domains through World Models},\n  author={Hafner, Danijar and Pasukonis, Jurgis and Ba, Jimmy and Lillicrap, Timothy},\n  journal={arXiv preprint arXiv:2301.04104},\n  year={2023}\n}\n```\n\nTo learn more:\n\n- [Research paper][paper]\n- [Project website][website]\n- [Twitter summary][tweet]\n\n## DreamerV3\n\nDreamerV3 learns a world model from experiences and uses it to train an actor\ncritic policy from imagined trajectories. The world model encodes sensory\ninputs into categorical representations and predicts future representations and\nrewards given actions.\n\n![DreamerV3 Method Diagram](https://user-images.githubusercontent.com/2111293/217355673-4abc0ce5-1a4b-4366-a08d-64754289d659.png)\n\nDreamerV3 masters a wide range of domains with a fixed set of hyperparameters,\noutperforming specialized methods. Removing the need for tuning reduces the\namount of expert knowledge and computational resources needed to apply\nreinforcement learning.\n\n![DreamerV3 Benchmark Scores](https://github.com/danijar/dreamerv3/assets/2111293/0fe8f1cf-6970-41ea-9efc-e2e2477e7861)\n\nDue to its robustness, DreamerV3 shows favorable scaling properties. Notably,\nusing larger models consistently increases not only its final performance but\nalso its data-efficiency. Increasing the number of gradient steps further\nincreases data efficiency.\n\n![DreamerV3 Scaling Behavior](https://user-images.githubusercontent.com/2111293/217356063-0cf06b17-89f0-4d5f-85a9-b583438c98dd.png)\n\n# Instructions\n\nThe code has been tested on Linux and Mac and requires Python 3.11+.\n\n## Docker\n\nYou can either use the provided `Dockerfile` that contains instructions or\nfollow the manual instructions below.\n\n## Manual\n\nInstall [JAX][jax] and then the other dependencies:\n\n```sh\npip install -U -r requirements.txt\n```\n\nTraining script:\n\n```sh\npython dreamerv3/main.py \\\n  --logdir ~/logdir/dreamer/{timestamp} \\\n  --configs crafter \\\n  --run.train_ratio 32\n```\n\nTo reproduce results, train on the desired task using the corresponding config,\nsuch as `--configs atari --task atari_pong`.\n\nView results:\n\n```sh\npip install -U scope\npython -m scope.viewer --basedir ~/logdir --port 8000\n```\n\nScalar metrics are also writting as JSONL files.\n\n# Tips\n\n- All config options are listed in `dreamerv3/configs.yaml` and you can\n  override them as flags from the command line.\n- The `debug` config block reduces the network size, batch size, duration\n  between logs, and so on for fast debugging (but does not learn a good model).\n- By default, the code tries to run on GPU. You can switch to CPU or TPU using\n  the `--jax.platform cpu` flag.\n- You can use multiple config blocks that will override defaults in the\n  order they are specified, for example `--configs crafter size50m`.\n- By default, metrics are printed to the terminal, appended to a JSON lines\n  file, and written as Scope summaries. Other outputs like WandB and\n  TensorBoard can be enabled in the training script.\n- If you get a `Too many leaves for PyTreeDef` error, it means you're\n  reloading a checkpoint that is not compatible with the current config. This\n  often happens when reusing an old logdir by accident.\n- If you are getting CUDA errors, scroll up because the cause is often just an\n  error that happened earlier, such as out of memory or incompatible JAX and\n  CUDA versions. Try `--batch_size 1` to rule out an out of memory error.\n- Many environments are included, some of which require installing additional\n  packages. See the `Dockerfile` for reference.\n- To continue stopped training runs, simply run the same command line again and\n  make sure that the `--logdir` points to the same directory.\n\n# Disclaimer\n\nThis repository contains a reimplementation of DreamerV3 based on the open\nsource DreamerV2 code base. It is unrelated to Google or DeepMind. The\nimplementation has been tested to reproduce the official results on a range of\nenvironments.\n\n[jax]: https://github.com/google/jax#pip-installation-gpu-cuda\n[paper]: https://arxiv.org/pdf/2301.04104v1.pdf\n[website]: https://danijar.com/dreamerv3\n[tweet]: https://twitter.com/danijarh/status/1613161946223677441\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanijar%2Fdreamerv3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanijar%2Fdreamerv3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanijar%2Fdreamerv3/lists"}