Skip to content

Commit adefc9b

Browse files
author
Kye
committed
[README]
1 parent 16dfcca commit adefc9b

File tree

3 files changed

+329
-219
lines changed

3 files changed

+329
-219
lines changed

README.md

+25
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,31 @@ pip install mambabyte
1313

1414
# Usage
1515
```python
16+
import torch
17+
from mambabyte import MambaConfig, Mamba
18+
19+
x = torch.randn(2, 3, 4)
20+
config = MambaConfig(
21+
dim = 4,
22+
depth = 3,
23+
dt_rank = 2,
24+
d_state = 2,
25+
expand_factor = 2,
26+
d_conv = 3,
27+
dt_min = 0.001,
28+
dt_max = 0.1,
29+
dt_init = "random",
30+
dt_scale = 1.0,
31+
bias = False,
32+
conv_bias = True,
33+
pscan = True
34+
)
35+
36+
model = Mamba(config)
37+
38+
out = model(x)
39+
40+
print(out)
1641

1742
```
1843

example.py

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import torch
2+
from mambabyte import MambaConfig, Mamba
3+
4+
x = torch.randn(2, 3, 4)
5+
6+
config = MambaConfig(
7+
dim = 4,
8+
depth = 3,
9+
dt_rank = 2,
10+
d_state = 2,
11+
expand_factor = 2,
12+
d_conv = 3,
13+
dt_min = 0.001,
14+
dt_max = 0.1,
15+
dt_init = "random",
16+
dt_scale = 1.0,
17+
bias = False,
18+
conv_bias = True,
19+
pscan = True
20+
)
21+
22+
model = Mamba(config)
23+
24+
out = model(x)
25+
26+
print(out)

0 commit comments

Comments
 (0)