{"id":15600990,"url":"https://github.com/lucidrains/tranception-pytorch","last_synced_at":"2025-04-30T20:05:58.633Z","repository":{"id":43262412,"uuid":"499288885","full_name":"lucidrains/tranception-pytorch","owner":"lucidrains","description":"Implementation of Tranception, an attention network, paired with retrieval, that is SOTA for protein fitness prediction","archived":false,"fork":false,"pushed_at":"2022-06-19T15:42:16.000Z","size":211,"stargazers_count":31,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-26T07:16:58.399Z","etag":null,"topics":["artificial-intelligence","attention-mechanism","deep-learning","protein-fitness-prediction","retrieval","transformers"],"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":"2022-06-02T20:58:26.000Z","updated_at":"2024-08-12T20:23:47.000Z","dependencies_parsed_at":"2022-09-02T14:44:15.938Z","dependency_job_id":null,"html_url":"https://github.com/lucidrains/tranception-pytorch","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucidrains%2Ftranception-pytorch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucidrains%2Ftranception-pytorch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucidrains%2Ftranception-pytorch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucidrains%2Ftranception-pytorch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lucidrains","download_url":"https://codeload.github.com/lucidrains/tranception-pytorch/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251700062,"owners_count":21629830,"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-mechanism","deep-learning","protein-fitness-prediction","retrieval","transformers"],"created_at":"2024-10-03T02:11:07.457Z","updated_at":"2025-04-30T20:05:58.613Z","avatar_url":"https://github.com/lucidrains.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"./tranception.png\" width=\"450px\"\u003e\u003c/img\u003e\n\n## Tranception - Pytorch (wip)\n\nImplementation of \u003ca href=\"https://arxiv.org/abs/2205.13760\"\u003eTranception\u003c/a\u003e, an attention network, paired with retrieval, that is SOTA for protein fitness prediction. The Transformer architecture is inspired by \u003ca href=\"https://arxiv.org/abs/2109.08668\"\u003ePrimer\u003c/a\u003e, and uses \u003ca href=\"https://arxiv.org/abs/2108.12409\"\u003eALiBi relative positional encoding\u003c/a\u003e\n\n## Install\n\n```bash\n$ pip install tranception-pytorch\n```\n\n## Usage\n\n```python\nimport torch\nfrom tranception_pytorch import Tranception\n\nmodel = Tranception(\n    dim = 512,\n    depth = 6,\n    heads = 8,\n    dim_head = 64\n)\n\namino_acids = torch.randint(0, 21, (1, 512))\n\nlogits = model(amino_acids) # (1, 512, 21)\n```\n\n## Todo\n\n- [x] grouped heads with customizable depthwise convs (for variable k-mers), as well as grouped alibi pos bias\n- [ ] figure out attention to retrieved (looks like axial attention?)\n- [ ] play around with protein gym, and start betting on huggingface's accelerate\n\n## Citations\n\n```bibtex\n@article{Notin2022TranceptionPF,\n  title   = {Tranception: protein fitness prediction with autoregressive transformers and inference-time retrieval},\n  author  = {Pascal Notin and Mafalda Dias and Jonathan Frazer and Javier Marchena-Hurtado and Aidan N. Gomez and Debora S. Marks and Yarin Gal},\n  journal = {ArXiv},\n  year    = {2022},\n  volume  = {abs/2205.13760}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucidrains%2Ftranception-pytorch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flucidrains%2Ftranception-pytorch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucidrains%2Ftranception-pytorch/lists"}