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
854b370
commit aa5d384
Showing
3 changed files
with
24 additions
and
29 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,20 @@ | ||
import torch | ||
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 | ||
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
from mamba_transformer.model import RMSNorm, MambaTransformerblock, MambaTransformer | ||
from mamba_transformer.model import ( | ||
RMSNorm, | ||
MambaTransformerblock, | ||
MambaTransformer, | ||
) | ||
|
||
__all__ = [ | ||
"RMSNorm", | ||
"MambaTransformerblock", | ||
"MambaTransformer" | ||
] | ||
__all__ = ["RMSNorm", "MambaTransformerblock", "MambaTransformer"] |
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