{"id":15601089,"url":"https://github.com/lucidrains/metaformer-gpt","last_synced_at":"2025-05-05T03:25:53.738Z","repository":{"id":37338035,"uuid":"504895506","full_name":"lucidrains/metaformer-gpt","owner":"lucidrains","description":"Implementation of Metaformer, but in an autoregressive manner","archived":false,"fork":false,"pushed_at":"2022-06-21T03:36:34.000Z","size":35941,"stargazers_count":23,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-12T13:45:27.480Z","etag":null,"topics":["artificial-intelligence","autoregressive","deep-learning","token-mixing"],"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-18T16:32:13.000Z","updated_at":"2024-10-08T08:50:09.000Z","dependencies_parsed_at":"2022-09-11T10:00:26.431Z","dependency_job_id":null,"html_url":"https://github.com/lucidrains/metaformer-gpt","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucidrains%2Fmetaformer-gpt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucidrains%2Fmetaformer-gpt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucidrains%2Fmetaformer-gpt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucidrains%2Fmetaformer-gpt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lucidrains","download_url":"https://codeload.github.com/lucidrains/metaformer-gpt/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252431431,"owners_count":21746858,"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","autoregressive","deep-learning","token-mixing"],"created_at":"2024-10-03T02:14:22.496Z","updated_at":"2025-05-05T03:25:53.599Z","avatar_url":"https://github.com/lucidrains.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"./metaformer.png\" width=\"400px\"\u003e\u003c/img\u003e\n\n## Metaformer - GPT (wip)\n\nImplementation of \u003ca href=\"https://arxiv.org/abs/2111.11418\"\u003eMetaformer\u003c/a\u003e, but in an autoregressive manner. In particular, they propose simply using mean centering as a way to do token mixing in a parameter-less fashion, alternating with feedforwards.\n\n## Install\n\n```bash\n$ pip install metaformer-gpt\n```\n\n## Usage\n\n```python\nimport torch\nfrom metaformer_gpt import MetaformerGPT\n\ngpt = MetaformerGPT(\n    num_tokens = 256,\n    dim = 512,\n    depth = 8\n)\n\nids = torch.randint(0, 256, (1, 1024))\nlogits = gpt(ids) # (1, 1024, 256)\n```\n\n## Citations\n\n```bibtex\n@article{Yu2021MetaFormerIA,\n    title   = {MetaFormer is Actually What You Need for Vision},\n    author  = {Weihao Yu and Mi Luo and Pan Zhou and Chenyang Si and Yichen Zhou and Xinchao Wang and Jiashi Feng and Shuicheng Yan},\n    journal = {ArXiv},\n    year    = {2021},\n    volume  = {abs/2111.11418}\n}\n```\n\n```bibtex\n@misc{woo2022etsformer,\n    title   = {ETSformer: Exponential Smoothing Transformers for Time-series Forecasting},\n    author  = {Gerald Woo and Chenghao Liu and Doyen Sahoo and Akshat Kumar and Steven Hoi},\n    year    = {2022},\n    eprint  = {2202.01381},\n    archivePrefix = {arXiv},\n    primaryClass = {cs.LG}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucidrains%2Fmetaformer-gpt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flucidrains%2Fmetaformer-gpt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucidrains%2Fmetaformer-gpt/lists"}