{"id":15600936,"url":"https://github.com/lucidrains/frame-averaging-pytorch","last_synced_at":"2025-06-10T09:06:22.705Z","repository":{"id":242537969,"uuid":"809840180","full_name":"lucidrains/frame-averaging-pytorch","owner":"lucidrains","description":"Pytorch implementation of a simple way to enable (Stochastic) Frame Averaging for any network","archived":false,"fork":false,"pushed_at":"2024-07-26T12:24:13.000Z","size":237,"stargazers_count":50,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-07T03:04:39.595Z","etag":null,"topics":["artificial-intelligence","deep-learning","geometric-learning"],"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-06-03T14:47:28.000Z","updated_at":"2025-05-14T08:29:45.000Z","dependencies_parsed_at":"2024-10-23T03:41:33.725Z","dependency_job_id":null,"html_url":"https://github.com/lucidrains/frame-averaging-pytorch","commit_stats":{"total_commits":25,"total_committers":1,"mean_commits":25.0,"dds":0.0,"last_synced_commit":"746032ba57b44038ac3fbfaa1632af86e69b1050"},"previous_names":["lucidrains/frame-averaging-pytorch"],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucidrains%2Fframe-averaging-pytorch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucidrains%2Fframe-averaging-pytorch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucidrains%2Fframe-averaging-pytorch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucidrains%2Fframe-averaging-pytorch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lucidrains","download_url":"https://codeload.github.com/lucidrains/frame-averaging-pytorch/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucidrains%2Fframe-averaging-pytorch/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259043763,"owners_count":22797161,"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","geometric-learning"],"created_at":"2024-10-03T02:09:46.124Z","updated_at":"2025-06-10T09:06:22.678Z","avatar_url":"https://github.com/lucidrains.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"./frame-averaging.png\" width=\"350px\"\u003e\u003c/img\u003e\n\n## Frame Averaging - Pytorch\n\nPytorch implementation of a simple way to enable \u003ca href=\"https://arxiv.org/abs/2305.05577\"\u003e(Stochastic)\u003c/a\u003e \u003ca href=\"https://arxiv.org/abs/2110.03336\"\u003eFrame Averaging\u003c/a\u003e for any network. This technique was recently adopted by Prescient Design in \u003ca href=\"https://arxiv.org/abs/2308.05027\"\u003eAbDiffuser\u003c/a\u003e\n\n## Install\n\n```bash\n$ pip install frame-averaging-pytorch\n```\n\n## Usage\n\n```python\nimport torch\nfrom frame_averaging_pytorch import FrameAverage\n\n# contrived neural network\n\nnet = torch.nn.Linear(3, 3)\n\n# wrap the network with FrameAverage\n\nnet = FrameAverage(\n    net,\n    dim = 3,           # defaults to 3 for spatial, but can be any value\n    stochastic = True  # whether to use stochastic variant from FAENet (one frame sampled at random)\n)\n\n# pass your input to the network as usual\n\npoints = torch.randn(4, 1024, 3)\nmask = torch.ones(4, 1024).bool()\n\nout = net(points, frame_average_mask = mask)\n\nout.shape # (4, 1024, 3)\n\n# frame averaging is automatically taken care of, as though the network were unwrapped\n```\n\nor you can also carry it out manually\n\n```python\nimport torch\nfrom frame_averaging_pytorch import FrameAverage\n\n# contrived neural network\n\nnet = torch.nn.Linear(3, 3)\n\n# frame average module without passing in network\n\nfa = FrameAverage()\n\n# pass the 3d points and mask to FrameAverage forward\n\npoints = torch.randn(4, 1024, 3)\nmask = torch.ones(4, 1024).bool()\n\nframed_inputs, frame_average_fn = fa(points, frame_average_mask = mask)\n\n# network forward\n\nnet_out = net(framed_inputs)\n\n# frame average\n\nframe_averaged = frame_average_fn(net_out)\n\nframe_averaged.shape # (4, 1024, 3)\n```\n\n## Citations\n\n```bibtex\n@article{Puny2021FrameAF,\n    title   = {Frame Averaging for Invariant and Equivariant Network Design},\n    author  = {Omri Puny and Matan Atzmon and Heli Ben-Hamu and Edward James Smith and Ishan Misra and Aditya Grover and Yaron Lipman},\n    journal = {ArXiv},\n    year    = {2021},\n    volume  = {abs/2110.03336},\n    url     = {https://api.semanticscholar.org/CorpusID:238419638}\n}\n```\n\n```bibtex\n@article{Duval2023FAENetFA,\n    title   = {FAENet: Frame Averaging Equivariant GNN for Materials Modeling},\n    author  = {Alexandre Duval and Victor Schmidt and Alex Hernandez Garcia and Santiago Miret and Fragkiskos D. Malliaros and Yoshua Bengio and David Rolnick},\n    journal = {ArXiv},\n    year    = {2023},\n    volume  = {abs/2305.05577},\n    url     = {https://api.semanticscholar.org/CorpusID:258564608}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucidrains%2Fframe-averaging-pytorch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flucidrains%2Fframe-averaging-pytorch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucidrains%2Fframe-averaging-pytorch/lists"}