Commit adefc9b Kye
committed
1 parent 16dfcca commit adefc9b Copy full SHA for adefc9b
File tree 3 files changed +329
-219
lines changed
3 files changed +329
-219
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,31 @@ pip install mambabyte
13
13
14
14
# Usage
15
15
``` 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)
16
41
17
42
```
18
43
Original file line number Diff line number Diff line change
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 )
You can’t perform that action at this time.
0 commit comments