titans-pytorch 0.4.9__tar.gz → 0.4.11__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.4.9 → titans_pytorch-0.4.11}/PKG-INFO +1 -1
- {titans_pytorch-0.4.9 → titans_pytorch-0.4.11}/pyproject.toml +1 -1
- {titans_pytorch-0.4.9 → titans_pytorch-0.4.11}/titans_pytorch/neural_memory.py +2 -4
- {titans_pytorch-0.4.9 → titans_pytorch-0.4.11}/.github/workflows/python-publish.yml +0 -0
- {titans_pytorch-0.4.9 → titans_pytorch-0.4.11}/.github/workflows/test.yaml +0 -0
- {titans_pytorch-0.4.9 → titans_pytorch-0.4.11}/.gitignore +0 -0
- {titans_pytorch-0.4.9 → titans_pytorch-0.4.11}/LICENSE +0 -0
- {titans_pytorch-0.4.9 → titans_pytorch-0.4.11}/README.md +0 -0
- {titans_pytorch-0.4.9 → titans_pytorch-0.4.11}/data/README.md +0 -0
- {titans_pytorch-0.4.9 → titans_pytorch-0.4.11}/data/enwik8.gz +0 -0
- {titans_pytorch-0.4.9 → titans_pytorch-0.4.11}/fig1.png +0 -0
- {titans_pytorch-0.4.9 → titans_pytorch-0.4.11}/fig2.png +0 -0
- {titans_pytorch-0.4.9 → titans_pytorch-0.4.11}/tests/test_titans.py +0 -0
- {titans_pytorch-0.4.9 → titans_pytorch-0.4.11}/titans_pytorch/__init__.py +0 -0
- {titans_pytorch-0.4.9 → titans_pytorch-0.4.11}/titans_pytorch/mac_transformer.py +0 -0
- {titans_pytorch-0.4.9 → titans_pytorch-0.4.11}/titans_pytorch/memory_models.py +0 -0
- {titans_pytorch-0.4.9 → titans_pytorch-0.4.11}/train_mac.py +0 -0
@@ -161,16 +161,14 @@ def newtonschulz5(
|
|
161
161
|
eps = 1e-7,
|
162
162
|
coefs = (3.4445, -4.7750, 2.0315)
|
163
163
|
):
|
164
|
-
|
165
|
-
return t
|
164
|
+
t, inv_pack = pack_one_with_inverse(t, '* i j')
|
166
165
|
|
167
166
|
shape = t.shape
|
168
|
-
should_transpose = shape[2] > shape[-1]
|
167
|
+
should_transpose = shape[-2] > shape[-1]
|
169
168
|
|
170
169
|
if should_transpose:
|
171
170
|
t = t.transpose(-1, -2)
|
172
171
|
|
173
|
-
t, inv_pack = pack_one_with_inverse(t, '* i j')
|
174
172
|
t = t / t.norm(dim = (-1, -2), keepdim = True).clamp(min = eps)
|
175
173
|
|
176
174
|
a, b, c = coefs
|
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
|