{"id":19156242,"url":"https://github.com/kyegomez/aoa-torch","last_synced_at":"2025-05-07T07:41:21.102Z","repository":{"id":210789568,"uuid":"727454567","full_name":"kyegomez/AoA-torch","owner":"kyegomez","description":"Implementation of Attention on Attention in Zeta","archived":false,"fork":false,"pushed_at":"2025-04-19T12:55:33.000Z","size":2299,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-19T20:16:58.201Z","etag":null,"topics":["ai","artificial-intelligence","gpt4","machine-learning","multi-modal","multi-modality","research"],"latest_commit_sha":null,"homepage":"https://discord.gg/GYbXvDGevY","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/kyegomez.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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,"zenodo":null},"funding":{"github":["kyegomez"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2023-12-04T22:28:30.000Z","updated_at":"2024-07-01T20:24:53.000Z","dependencies_parsed_at":"2023-12-15T20:07:55.245Z","dependency_job_id":"dc6930c7-dac2-4181-882c-9ea4b491f4c8","html_url":"https://github.com/kyegomez/AoA-torch","commit_stats":{"total_commits":15,"total_committers":3,"mean_commits":5.0,"dds":"0.19999999999999996","last_synced_commit":"8ffa0e6dfdf618bea0d08439d50286f1e9fd894a"},"previous_names":["kyegomez/aoa-torch"],"tags_count":0,"template":false,"template_full_name":"kyegomez/Python-Package-Template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kyegomez%2FAoA-torch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kyegomez%2FAoA-torch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kyegomez%2FAoA-torch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kyegomez%2FAoA-torch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kyegomez","download_url":"https://codeload.github.com/kyegomez/AoA-torch/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252836059,"owners_count":21811654,"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":["ai","artificial-intelligence","gpt4","machine-learning","multi-modal","multi-modality","research"],"created_at":"2024-11-09T08:33:48.794Z","updated_at":"2025-05-07T07:41:21.080Z","avatar_url":"https://github.com/kyegomez.png","language":"Python","funding_links":["https://github.com/sponsors/kyegomez"],"categories":[],"sub_categories":[],"readme":"[![Multi-Modality](agorabanner.png)](https://discord.gg/qUtxnK2NMf)\n\n# Attention on Attention Implementation\nThis is a practice implementation after randomly finding it on Lucidrain's repo, I'm implementing the model architecture just for practice!\n\nBasically the architecture is:\nx =\u003e q, k, v -\u003e multihead attn with residual q -\u003e concat -\u003e 2 linear projects\n-\u003esigmoid -\u003e mult -\u003e add -\u003e norm -\u003e ffn -\u003e add -\u003e norm with residual of first add and norm\n\n\u003cimg src=\"./saoa.png\"\u003e\u003c/img\u003e\n\n# Install\n`pip3 install --upgrade aoa-torch `\n\n\n## Usage\n\n### `AoA` Module\n```python\n\nimport torch\n\nfrom aoa.main import AoA\n\nx = torch.randn(1, 10, 512)\nmodel = AoA(512, 8, 64, 0.1)\nout = model(x)\nprint(out.shape)\n\n\n```\n\n### `AoATransformer`\n```python\nimport torch \nfrom aoa.main import AoATransformer\n\n\nx = torch.randint(0, 100, (1, 10))\nmodel = AoATransformer(512, 1, 100)\nout = model(x)\nprint(out.shape)\n\n\n```\n\n\n\n\n\n## Citations\n\n```bibtex\n@misc{rahman2020improved,\n    title   = {An Improved Attention for Visual Question Answering}, \n    author  = {Tanzila Rahman and Shih-Han Chou and Leonid Sigal and Giuseppe Carenini},\n    year    = {2020},\n    eprint  = {2011.02164},\n    archivePrefix = {arXiv},\n    primaryClass = {cs.CV}\n}\n```\n\n```bibtex\n@misc{huang2019attention,\n    title   = {Attention on Attention for Image Captioning}, \n    author  = {Lun Huang and Wenmin Wang and Jie Chen and Xiao-Yong Wei},\n    year    = {2019},\n    eprint  = {1908.06954},\n    archivePrefix = {arXiv},\n    primaryClass = {cs.CV}\n}\n```\n\n# License\nMIT\n\n\n\n# Todo\n- [ ] Create sample training code using enwiki8\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkyegomez%2Faoa-torch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkyegomez%2Faoa-torch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkyegomez%2Faoa-torch/lists"}