Paper - Pytorch
Project description
MambaFormer
Implementation of MambaFormer in Pytorch ++ Zeta from the paper: "Can Mamba Learn How to Learn? A Comparative Study on In-Context Learning Tasks"
install
pip3 install mamba-former
usage
import torch
from mamba_former.main import MambaFormer
# Forward pass example
x = torch.randint(1, 1000, (1, 100)) # Token
# Tokens are integrers
# Model
model = MambaFormer(
dim = 512,
num_tokens = 1000,
depth = 6,
d_state = 512,
d_conv = 128,
heads = 8,
dim_head = 64,
return_tokens = True
)
# Forward
out = model(x)
print(out)
print(out.shape)
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mamba_former-0.0.2.tar.gz
(3.6 kB
view details)
Built Distribution
File details
Details for the file mamba_former-0.0.2.tar.gz
.
File metadata
- Download URL: mamba_former-0.0.2.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.2 CPython/3.11.0 Darwin/23.3.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5cacd9a64c208aae2520db5505e03bffcb7cbeda67e05224aef68a1fda35c143 |
|
MD5 | f0d10d284bdd9e84641212ab567656fd |
|
BLAKE2b-256 | 2ba0bf79b99183eeaf4c0372a9ed4d359998e780a0e6313de5818cf671152d8c |
File details
Details for the file mamba_former-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: mamba_former-0.0.2-py3-none-any.whl
- Upload date:
- Size: 3.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.2 CPython/3.11.0 Darwin/23.3.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1322b35a71f11acbf1824399b8dbf44e1ab648acb3c078e2884c144b0c71d7b4 |
|
MD5 | 4c7f5b4516f3fc7e0d5543b235d09fbd |
|
BLAKE2b-256 | 2629075f8b706b93f0a480a43c59f841b54085168a4977affe75f466cce3d1ce |