{"id":15601049,"url":"https://github.com/lucidrains/nwt-pytorch","last_synced_at":"2025-04-14T12:31:52.502Z","repository":{"id":44422745,"uuid":"375200317","full_name":"lucidrains/NWT-pytorch","owner":"lucidrains","description":"Implementation of NWT, audio-to-video generation, in Pytorch","archived":false,"fork":false,"pushed_at":"2022-03-17T00:54:18.000Z","size":11,"stargazers_count":90,"open_issues_count":1,"forks_count":8,"subscribers_count":13,"default_branch":"main","last_synced_at":"2025-03-28T01:49:39.502Z","etag":null,"topics":["artificial-intelligence","audio","deep-learning","video-generation"],"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}},"created_at":"2021-06-09T02:19:23.000Z","updated_at":"2025-03-27T18:54:12.000Z","dependencies_parsed_at":"2022-09-05T05:01:15.524Z","dependency_job_id":null,"html_url":"https://github.com/lucidrains/NWT-pytorch","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucidrains%2FNWT-pytorch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucidrains%2FNWT-pytorch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucidrains%2FNWT-pytorch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucidrains%2FNWT-pytorch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lucidrains","download_url":"https://codeload.github.com/lucidrains/NWT-pytorch/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248881621,"owners_count":21176886,"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","audio","deep-learning","video-generation"],"created_at":"2024-10-03T02:13:02.162Z","updated_at":"2025-04-14T12:31:52.471Z","avatar_url":"https://github.com/lucidrains.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## NWT - Pytorch (wip)\n\nImplementation of \u003ca href=\"https://arxiv.org/abs/2106.04283\"\u003eNWT\u003c/a\u003e, audio-to-video generation, in Pytorch.\n\n\u003ca href=\"https://next-week-tonight.github.io/NWT/\"\u003eGenerated samples\u003c/a\u003e\n\n## Install\n\n```bash\n$ pip install nwt-pytorch\n```\n\n## Usage\n\nThe paper proposes a new discrete latent representation named `Memcodes`, which can be succinctly described as a type of multi-head hard-attention to learned memory (codebook) key / values. They claim the need for less codes and smaller codebook dimension in order to achieve better reconstructions.\n\n```python\nimport torch\nfrom nwt_pytorch import Memcodes\n\ncodebook = Memcodes(\n    dim = 512,            # dimension of incoming features (codebook dimension will be dim / heads)\n    heads = 8,            # head dimension, which is equivalent ot number of codebooks\n    num_codes = 1024,     # number of codes per codebook\n    temperature = 1.      # gumbel softmax temperature\n)\n\nx = torch.randn(1, 1024, 512)\nout, codebook_indices = codebook(x) # (1, 1024, 512), (1, 1024, 8)\n# (batch, seq, dimension), (batch, seq, heads)\n\n# reconstruct output from codebook indices (codebook indices are autoregressed out from an attention net in paper)\n\nassert torch.allclose(codebook.get_codes_from_indices(codebook_indices), out)\n```\n\n## Citations\n\n```bibtex\n@misc{mama2021nwt,\n    title   = {NWT: Towards natural audio-to-video generation with representation learning}, \n    author  = {Rayhane Mama and Marc S. Tyndel and Hashiam Kadhim and Cole Clifford and Ragavan Thurairatnam},\n    year    = {2021},\n    eprint  = {2106.04283},\n    archivePrefix = {arXiv},\n    primaryClass = {cs.SD}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucidrains%2Fnwt-pytorch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flucidrains%2Fnwt-pytorch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucidrains%2Fnwt-pytorch/lists"}