titans-pytorch 0.0.62__tar.gz → 0.0.63__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {titans_pytorch-0.0.62 → titans_pytorch-0.0.63}/PKG-INFO +1 -1
- {titans_pytorch-0.0.62 → titans_pytorch-0.0.63}/pyproject.toml +1 -1
- {titans_pytorch-0.0.62 → titans_pytorch-0.0.63}/titans_pytorch/titans.py +3 -2
- {titans_pytorch-0.0.62 → titans_pytorch-0.0.63}/.github/workflows/python-publish.yml +0 -0
- {titans_pytorch-0.0.62 → titans_pytorch-0.0.63}/.github/workflows/test.yaml +0 -0
- {titans_pytorch-0.0.62 → titans_pytorch-0.0.63}/.gitignore +0 -0
- {titans_pytorch-0.0.62 → titans_pytorch-0.0.63}/LICENSE +0 -0
- {titans_pytorch-0.0.62 → titans_pytorch-0.0.63}/README.md +0 -0
- {titans_pytorch-0.0.62 → titans_pytorch-0.0.63}/assert_flex.py +0 -0
- {titans_pytorch-0.0.62 → titans_pytorch-0.0.63}/data/README.md +0 -0
- {titans_pytorch-0.0.62 → titans_pytorch-0.0.63}/data/enwik8.gz +0 -0
- {titans_pytorch-0.0.62 → titans_pytorch-0.0.63}/fig1.png +0 -0
- {titans_pytorch-0.0.62 → titans_pytorch-0.0.63}/fig2.png +0 -0
- {titans_pytorch-0.0.62 → titans_pytorch-0.0.63}/tests/test_titans.py +0 -0
- {titans_pytorch-0.0.62 → titans_pytorch-0.0.63}/titans_pytorch/__init__.py +0 -0
- {titans_pytorch-0.0.62 → titans_pytorch-0.0.63}/titans_pytorch/associative_scan.py +0 -0
- {titans_pytorch-0.0.62 → titans_pytorch-0.0.63}/titans_pytorch/mac_transformer.py +0 -0
- {titans_pytorch-0.0.62 → titans_pytorch-0.0.63}/train_mac.py +0 -0
|
@@ -168,13 +168,14 @@ class MemoryAttention(Module):
|
|
|
168
168
|
):
|
|
169
169
|
super().__init__()
|
|
170
170
|
self.scale = scale
|
|
171
|
+
dim_ff_hidden = int(dim * expansion_factor)
|
|
171
172
|
|
|
172
173
|
self.weights = nn.ParameterList([
|
|
173
174
|
nn.Parameter(torch.randn(dim, dim)), # queries
|
|
174
175
|
nn.Parameter(torch.randn(dim, dim)), # keys
|
|
175
176
|
nn.Parameter(torch.randn(dim, dim)), # values
|
|
176
|
-
nn.Parameter(torch.randn(dim,
|
|
177
|
-
nn.Parameter(torch.randn(
|
|
177
|
+
nn.Parameter(torch.randn(dim, dim_ff_hidden)), # ff w1
|
|
178
|
+
nn.Parameter(torch.randn(dim_ff_hidden, dim)), # ff w2
|
|
178
179
|
])
|
|
179
180
|
|
|
180
181
|
for weight in self.weights:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|