generated from kyegomez/Python-Package-Template
-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Kye
committed
Jan 13, 2024
1 parent
99ad44a
commit 854b370
Showing
5 changed files
with
339 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import torch | ||
from mamba_transformer.model import MambaTransformer | ||
|
||
# Generate a random tensor of shape (1, 10) with values between 0 and 99 | ||
x = torch.randint(0, 100, (1, 10)) | ||
|
||
# Create an instance of the MambaTransformer model | ||
model = MambaTransformer( | ||
num_tokens=100, # Number of tokens in the input sequence | ||
dim=512, # Dimension of the model | ||
heads=8, # Number of attention heads | ||
depth=4, # Number of transformer layers | ||
dim_head=64, # Dimension of each attention head | ||
d_state=512, # Dimension of the state | ||
dropout=0.1, # Dropout rate | ||
ff_mult=4 # Multiplier for the feed-forward layer dimension | ||
) | ||
|
||
# Pass the input tensor through the model and print the output shape | ||
print(model(x).shape) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from mamba_transformer.model import RMSNorm, MambaTransformerblock, MambaTransformer | ||
|
||
__all__ = [ | ||
"RMSNorm", | ||
"MambaTransformerblock", | ||
"MambaTransformer" | ||
] |
Oops, something went wrong.