{"id":22701364,"url":"https://github.com/lucidrains/genie2-pytorch","last_synced_at":"2025-04-12T23:38:12.498Z","repository":{"id":256782582,"uuid":"848919543","full_name":"lucidrains/genie2-pytorch","owner":"lucidrains","description":"Implementation of a framework for Genie2 in Pytorch","archived":false,"fork":false,"pushed_at":"2025-01-07T16:36:03.000Z","size":1397,"stargazers_count":145,"open_issues_count":1,"forks_count":12,"subscribers_count":17,"default_branch":"main","last_synced_at":"2025-04-12T23:38:07.470Z","etag":null,"topics":["artificial-intelligence","attention","deep-learning","transformers","world-models"],"latest_commit_sha":null,"homepage":"","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/lucidrains.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}},"created_at":"2024-08-28T16:40:40.000Z","updated_at":"2025-04-03T04:08:36.000Z","dependencies_parsed_at":"2024-09-13T02:58:56.282Z","dependency_job_id":"05b79139-0f35-4540-9749-ce9c031da100","html_url":"https://github.com/lucidrains/genie2-pytorch","commit_stats":null,"previous_names":["lucidrains/gamengen-pytorch","lucidrains/genie2-pytorch"],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucidrains%2Fgenie2-pytorch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucidrains%2Fgenie2-pytorch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucidrains%2Fgenie2-pytorch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucidrains%2Fgenie2-pytorch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lucidrains","download_url":"https://codeload.github.com/lucidrains/genie2-pytorch/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248647255,"owners_count":21139081,"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","attention","deep-learning","transformers","world-models"],"created_at":"2024-12-10T07:01:43.978Z","updated_at":"2025-04-12T23:38:12.476Z","avatar_url":"https://github.com/lucidrains.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"\u003cimg src=\"./genie2.png\" width=\"400px\"\u003e\u003c/img\u003e\n\n## Genie2 - Pytorch (wip)\n\nImplementation of a framework for \u003ca href=\"https://deepmind.google/discover/blog/genie-2-a-large-scale-foundation-world-model/\"\u003eGenie2\u003c/a\u003e in Pytorch\n\n## Install\n\n```bash\n$ pip install genie2-pytorch\n```\n\n## Usage\n\n```python\nimport torch\nfrom genie2_pytorch import Genie2\n\ngenie = Genie2(\n    dim = 512,\n    depth = 12,\n    dim_latent = 768,\n    num_actions = 256,\n    latent_channel_first = True,\n    is_video_enc_dec = True\n)\n\nvideo = torch.randn(2, 768, 3, 2, 2)\nactions = torch.randint(0, 256, (2, 3))\n\nloss, breakdown = genie(video, actions = actions)\nloss.backward()\n\ngenerated_video = genie.generate(video[:, :, 0], num_frames = 16)\n\nassert generated_video.shape == (2, 768, 16 + 1, 2, 2)\n```\n\nInteractive\n\n```python\nimport torch\nfrom genie2_pytorch import Genie2\n\ngenie = Genie2(\n    dim = 512,\n    depth = 12,\n    dim_latent = 768,\n    num_actions = 256,\n    latent_channel_first = True,\n    is_video_enc_dec = True\n)\n\nvideo = torch.randn(1, 768, 3, 2, 2)\nactions = torch.randint(0, 256, (1, 3))\n\nloss, breakdown = genie(video, actions = actions)\nloss.backward()\n\ngenerated_video, actions = genie.generate(\n    video[:, :, 0],\n    num_frames = 16,\n    interactive = True,\n    init_action = 0\n)\n\n# you will be prompted to enter the next action id(s) at every next time frame of the video\n\nassert generated_video.shape == (1, 768, 16 + 1, 2, 2)\n```\n\n## Citations\n\n```bibtex\n@inproceedings{Valevski2024DiffusionMA,\n    title   = {Diffusion Models Are Real-Time Game Engines},\n    author  = {Dani Valevski and Yaniv Leviathan and Moab Arar and Shlomi Fruchter},\n    year    = {2024},\n    url     = {https://api.semanticscholar.org/CorpusID:271962839}\n}\n```\n\n```bibtex\n@article{Ding2024DiffusionWM,\n    title     = {Diffusion World Model},\n    author    = {Zihan Ding and Amy Zhang and Yuandong Tian and Qinqing Zheng},\n    journal   = {ArXiv},\n    year      = {2024},\n    volume    = {abs/2402.03570},\n    url       = {https://api.semanticscholar.org/CorpusID:267499902}\n}\n```\n\n```bibtex\n@inproceedings{Sadat2024EliminatingOA,\n    title   = {Eliminating Oversaturation and Artifacts of High Guidance Scales in Diffusion Models},\n    author  = {Seyedmorteza Sadat and Otmar Hilliges and Romann M. Weber},\n    year    = {2024},\n    url     = {https://api.semanticscholar.org/CorpusID:273098845}\n}\n```\n\n```bibtex\n@misc{ParkerHolder2024,\n    author  = {Jack Parker-Holder, Philip Ball, Jake Bruce, Vibhavari Dasagi, Kristian Holsheimer, Christos Kaplanis, Alexandre Moufarek, Guy Scully, Jeremy Shar, Jimmy Shi, Stephen Spencer, Jessica Yung, Michael Dennis, Sultan Kenjeyev, Shangbang Long, Vlad Mnih, Harris Chan, Maxime Gazeau, Bonnie Li, Fabio Pardo, Luyu Wang, Lei Zhang, Frederic Besse, Tim Harley, Anna Mitenkova, Jane Wang, Jeff Clune, Demis Hassabis, Raia Hadsell, Adrian Bolton, Satinder Singh, Tim Rocktäschel},\n    url     = {https://deepmind.google/discover/blog/genie-2-a-large-scale-foundation-world-model/}\n}\n```\n\n```bibtex\n@inproceedings{Nguyen2024TurningUT,\n    title   = {Turning Up the Heat: Min-p Sampling for Creative and Coherent LLM Outputs},\n    author  = {Minh Nguyen and Andrew Baker and Clement Neo and Allen Roush and Andreas Kirsch and Ravid Shwartz-Ziv},\n    year    = {2024},\n    url     = {https://api.semanticscholar.org/CorpusID:270870613}\n}\n```\n\n```bibtex\n@article{Lee2022AutoregressiveIG,\n    title   = {Autoregressive Image Generation using Residual Quantization},\n    author  = {Doyup Lee and Chiheon Kim and Saehoon Kim and Minsu Cho and Wook-Shin Han},\n    journal = {2022 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},\n    year    = {2022},\n    pages   = {11513-11522},\n    url     = {https://api.semanticscholar.org/CorpusID:247244535}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucidrains%2Fgenie2-pytorch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flucidrains%2Fgenie2-pytorch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucidrains%2Fgenie2-pytorch/lists"}