{"id":19156162,"url":"https://github.com/kyegomez/mambaformer","last_synced_at":"2025-04-16T01:23:25.648Z","repository":{"id":231419407,"uuid":"781735336","full_name":"kyegomez/MambaFormer","owner":"kyegomez","description":"Implementation of MambaFormer in Pytorch ++ Zeta from the paper: \"Can Mamba Learn How to Learn? A Comparative Study on In-Context Learning Tasks\"","archived":false,"fork":false,"pushed_at":"2025-03-17T18:55:17.000Z","size":2274,"stargazers_count":20,"open_issues_count":4,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-24T11:55:24.660Z","etag":null,"topics":["ai","attention","attention-is-all-you-need","attention-mechanisms","mamba","ml","ssms","transformer"],"latest_commit_sha":null,"homepage":"https://discord.gg/7VckQVxvKk","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},"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":"2024-04-03T23:57:50.000Z","updated_at":"2025-01-09T23:20:46.000Z","dependencies_parsed_at":"2024-04-22T19:38:13.996Z","dependency_job_id":"7781b81e-2e16-456a-91e9-6df6b15f9633","html_url":"https://github.com/kyegomez/MambaFormer","commit_stats":null,"previous_names":["kyegomez/mambaformer"],"tags_count":0,"template":false,"template_full_name":"kyegomez/Python-Package-Template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kyegomez%2FMambaFormer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kyegomez%2FMambaFormer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kyegomez%2FMambaFormer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kyegomez%2FMambaFormer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kyegomez","download_url":"https://codeload.github.com/kyegomez/MambaFormer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249179677,"owners_count":21225583,"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","attention","attention-is-all-you-need","attention-mechanisms","mamba","ml","ssms","transformer"],"created_at":"2024-11-09T08:33:27.418Z","updated_at":"2025-04-16T01:23:25.618Z","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# MambaFormer\nImplementation of MambaFormer in Pytorch ++ Zeta from the paper: \"Can Mamba Learn How to Learn? A Comparative Study on In-Context Learning Tasks\"\n\n## install\n`pip3 install mamba-former`\n\n## usage\n```python\nimport torch\nfrom mamba_former.main import MambaFormer\n\n# Forward pass example\nx = torch.randint(1, 1000, (1, 100))  # Token\n# Tokens are integers representing input data\n\n# Model\nmodel = MambaFormer(\n    dim=512,  # Dimension of the model\n    num_tokens=1000,  # Number of unique tokens in the input data\n    depth=6,  # Number of transformer layers\n    d_state=512,  # Dimension of the transformer state\n    d_conv=128,  # Dimension of the convolutional layer\n    heads=8,  # Number of attention heads\n    dim_head=64,  # Dimension of each attention head\n    return_tokens=True,  # Whether to return the tokens in the output\n)\n\n# Forward pass\nout = model(x)  # Perform a forward pass through the model\n\n# If training\n# out = model(x, return_loss=True)  # Perform a forward pass and calculate the loss\n\n# Print the output\nprint(out)  # Print the output tensor\nprint(out.shape)  # Print the shape of the output tensor\n\n```\n\n\n# License\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkyegomez%2Fmambaformer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkyegomez%2Fmambaformer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkyegomez%2Fmambaformer/lists"}