{"id":13869908,"url":"https://github.com/lucidrains/geometric-vector-perceptron","last_synced_at":"2025-04-14T19:34:05.759Z","repository":{"id":53488385,"uuid":"329413178","full_name":"lucidrains/geometric-vector-perceptron","owner":"lucidrains","description":"Implementation of Geometric Vector Perceptron, a simple circuit for 3d rotation equivariance for learning over large biomolecules, in Pytorch. Idea proposed and accepted at ICLR 2021","archived":false,"fork":false,"pushed_at":"2021-06-08T16:31:32.000Z","size":1729,"stargazers_count":72,"open_issues_count":0,"forks_count":14,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-26T03:34:46.519Z","etag":null,"topics":["artficial-intelligence","biomolecule","deep-learning","equivariance","protein-structure"],"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-01-13T19:39:24.000Z","updated_at":"2025-03-25T23:48:00.000Z","dependencies_parsed_at":"2022-08-18T13:11:15.393Z","dependency_job_id":null,"html_url":"https://github.com/lucidrains/geometric-vector-perceptron","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucidrains%2Fgeometric-vector-perceptron","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucidrains%2Fgeometric-vector-perceptron/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucidrains%2Fgeometric-vector-perceptron/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucidrains%2Fgeometric-vector-perceptron/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lucidrains","download_url":"https://codeload.github.com/lucidrains/geometric-vector-perceptron/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248946403,"owners_count":21187500,"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":["artficial-intelligence","biomolecule","deep-learning","equivariance","protein-structure"],"created_at":"2024-08-05T20:01:21.556Z","updated_at":"2025-04-14T19:34:05.728Z","avatar_url":"https://github.com/lucidrains.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"\u003cimg src=\"./diagram.png\" width=\"500px\"\u003e\u003c/img\u003e\n\n## Geometric Vector Perceptron\n\nImplementation of \u003ca href=\"https://openreview.net/forum?id=1YLJDvSx6J4\"\u003eGeometric Vector Perceptron\u003c/a\u003e, a simple circuit with 3d rotation equivariance for learning over large biomolecules, in Pytorch. The repository may also contain experimentation to see if this could be easily extended to self-attention.\n\n## Install\n\n```bash\n$ pip install geometric-vector-perceptron\n```\n\n### Functionality\n\n* `GVP`: Implementing the basic geometric vector perceptron.\n* `GVPDropout`: Adapted dropout for GVP in MPNN context\n* `GVPLayerNorm`: Adapted LayerNorm for GVP in MPNN context\n* `GVP_MPNN`: Adapted instance of Message Passing class from `torch-geometric` package. Still not tested.\n* `GVP_Network`: Functional model architecture ready for working with arbitary point clouds.\n\n## Usage\n\n```python\nimport torch\nfrom geometric_vector_perceptron import GVP\n\nmodel = GVP(\n    dim_vectors_in = 1024,\n    dim_feats_in = 512,\n    dim_vectors_out = 256,\n    dim_feats_out = 512,\n    vector_gating = True   # use the vector gating as proposed in https://arxiv.org/abs/2106.03843\n)\n\nfeats, vectors = (torch.randn(1, 512), torch.randn(1, 1024, 3))\n\nfeats_out, vectors_out = model( (feats, vectors) ) # (1, 256), (1, 512, 3)\n```\n\nWith the specialized dropout and layernorm as described in the paper\n\n```python\nimport torch\nfrom torch import nn\nfrom geometric_vector_perceptron import GVP, GVPDropout, GVPLayerNorm\n\nmodel = GVP(\n    dim_vectors_in = 1024,\n    dim_feats_in = 512,\n    dim_vectors_out = 256,\n    dim_feats_out = 512,\n    vector_gating = True\n)\n\ndropout = GVPDropout(0.2)\nnorm = GVPLayerNorm(512)\n\nfeats, vectors = (torch.randn(1, 512), torch.randn(1, 1024, 3))\n\nfeats, vectors = model( (feats, vectors) )\nfeats, vectors = dropout(feats, vectors)\nfeats, vectors = norm(feats, vectors)  # (1, 256), (1, 512, 3)\n```\n\n#### TF implementation:\n\nThe original implementation in TF by the paper authors can be found here: https://github.com/drorlab/gvp/\n\n## Citations\n\n```bibtex\n@inproceedings{anonymous2021learning,\n    title   = {Learning from Protein Structure with Geometric Vector Perceptrons},\n    author  = {Anonymous},\n    booktitle = {Submitted to International Conference on Learning Representations},\n    year    = {2021},\n    url     = {https://openreview.net/forum?id=1YLJDvSx6J4}\n}\n```\n\n```bibtex\n@misc{jing2021equivariant,\n    title   = {Equivariant Graph Neural Networks for 3D Macromolecular Structure}, \n    author  = {Bowen Jing and Stephan Eismann and Pratham N. Soni and Ron O. Dror},\n    year    = {2021},\n    eprint  = {2106.03843},\n    archivePrefix = {arXiv},\n    primaryClass = {cs.LG}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucidrains%2Fgeometric-vector-perceptron","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flucidrains%2Fgeometric-vector-perceptron","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucidrains%2Fgeometric-vector-perceptron/lists"}