{"id":15601043,"url":"https://github.com/lucidrains/triangle-multiplicative-module","last_synced_at":"2025-07-05T19:33:19.198Z","repository":{"id":57477058,"uuid":"387544353","full_name":"lucidrains/triangle-multiplicative-module","owner":"lucidrains","description":"Implementation of the Triangle Multiplicative module, used in Alphafold2 as an efficient way to mix rows or columns of a 2d feature map, as a standalone package for Pytorch","archived":false,"fork":false,"pushed_at":"2021-08-03T05:18:08.000Z","size":53,"stargazers_count":30,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-03T15:11:47.946Z","etag":null,"topics":["artificial-intelligence","deep-learning","protein-folding"],"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-07-19T17:28:12.000Z","updated_at":"2025-06-03T07:41:32.000Z","dependencies_parsed_at":"2022-09-14T12:31:02.625Z","dependency_job_id":null,"html_url":"https://github.com/lucidrains/triangle-multiplicative-module","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/lucidrains/triangle-multiplicative-module","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucidrains%2Ftriangle-multiplicative-module","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucidrains%2Ftriangle-multiplicative-module/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucidrains%2Ftriangle-multiplicative-module/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucidrains%2Ftriangle-multiplicative-module/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lucidrains","download_url":"https://codeload.github.com/lucidrains/triangle-multiplicative-module/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucidrains%2Ftriangle-multiplicative-module/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263794657,"owners_count":23512556,"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","deep-learning","protein-folding"],"created_at":"2024-10-03T02:12:55.076Z","updated_at":"2025-07-05T19:33:19.176Z","avatar_url":"https://github.com/lucidrains.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"./figure.png\" width=\"500px\"\u003e\u003c/img\u003e\n\n## Triangle Multiplicative Module - Pytorch\n\nImplementation of the Triangle Multiplicative module, used in \u003ca href=\"https://github.com/deepmind/alphafold\"\u003e Alphafold2\u003c/a\u003e as an efficient way to mix rows or columns of a 2d feature map, as a standalone package for Pytorch\n\n## Install\n\n```bash\n$ pip install triangle-multiplicative-module\n```\n\n## Usage\n\n```python\nimport torch\nfrom triangle_multiplicative_module import TriangleMultiplicativeModule\n\nmodel = TriangleMultiplicativeModule(\n    dim = 64,            # feature map dimension\n    hidden_dim = 128,    # intermediate dimension size\n    mix = 'outgoing'     # either 'ingoing' or 'outgoing'\n)\n\nfmap = torch.randn(1, 256, 256, 64)\nmask = torch.ones(1, 256, 256).bool()\n\nmodel(fmap, mask = mask) # (1, 256, 256, 64)\n```\n\n## Citations\n\n```bibtex\n@Article{AlphaFold2021,\n    author  = {Jumper, John and Evans, Richard and Pritzel, Alexander and Green, Tim and Figurnov, Michael and Ronneberger, Olaf and Tunyasuvunakool, Kathryn and Bates, Russ and {\\v{Z}}{\\'\\i}dek, Augustin and Potapenko, Anna and Bridgland, Alex and Meyer, Clemens and Kohl, Simon A A and Ballard, Andrew J and Cowie, Andrew and Romera-Paredes, Bernardino and Nikolov, Stanislav and Jain, Rishub and Adler, Jonas and Back, Trevor and Petersen, Stig and Reiman, David and Clancy, Ellen and Zielinski, Michal and Steinegger, Martin and Pacholska, Michalina and Berghammer, Tamas and Bodenstein, Sebastian and Silver, David and Vinyals, Oriol and Senior, Andrew W and Kavukcuoglu, Koray and Kohli, Pushmeet and Hassabis, Demis},\n    journal = {Nature},\n    title   = {Highly accurate protein structure prediction with {AlphaFold}},\n    year    = {2021},\n    doi     = {10.1038/s41586-021-03819-2},\n    note    = {(Accelerated article preview)},\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucidrains%2Ftriangle-multiplicative-module","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flucidrains%2Ftriangle-multiplicative-module","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucidrains%2Ftriangle-multiplicative-module/lists"}