titans-pytorch 0.0.52__tar.gz → 0.0.53__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.52 → titans_pytorch-0.0.53}/PKG-INFO +1 -2
- {titans_pytorch-0.0.52 → titans_pytorch-0.0.53}/pyproject.toml +1 -2
- {titans_pytorch-0.0.52 → titans_pytorch-0.0.53}/titans_pytorch/mac_transformer.py +2 -1
- {titans_pytorch-0.0.52 → titans_pytorch-0.0.53}/titans_pytorch/titans.py +3 -3
- {titans_pytorch-0.0.52 → titans_pytorch-0.0.53}/.github/workflows/python-publish.yml +0 -0
- {titans_pytorch-0.0.52 → titans_pytorch-0.0.53}/.github/workflows/test.yaml +0 -0
- {titans_pytorch-0.0.52 → titans_pytorch-0.0.53}/.gitignore +0 -0
- {titans_pytorch-0.0.52 → titans_pytorch-0.0.53}/LICENSE +0 -0
- {titans_pytorch-0.0.52 → titans_pytorch-0.0.53}/README.md +0 -0
- {titans_pytorch-0.0.52 → titans_pytorch-0.0.53}/data/README.md +0 -0
- {titans_pytorch-0.0.52 → titans_pytorch-0.0.53}/data/enwik8.gz +0 -0
- {titans_pytorch-0.0.52 → titans_pytorch-0.0.53}/fig1.png +0 -0
- {titans_pytorch-0.0.52 → titans_pytorch-0.0.53}/fig2.png +0 -0
- {titans_pytorch-0.0.52 → titans_pytorch-0.0.53}/tests/test_titans.py +0 -0
- {titans_pytorch-0.0.52 → titans_pytorch-0.0.53}/titans_pytorch/__init__.py +0 -0
- {titans_pytorch-0.0.52 → titans_pytorch-0.0.53}/titans_pytorch/associative_scan.py +0 -0
- {titans_pytorch-0.0.52 → titans_pytorch-0.0.53}/train_mac.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: titans-pytorch
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.53
|
|
4
4
|
Summary: Titans
|
|
5
5
|
Project-URL: Homepage, https://pypi.org/project/titans-pytorch/
|
|
6
6
|
Project-URL: Repository, https://github.com/lucidrains/titans-pytorch
|
|
@@ -37,7 +37,6 @@ Requires-Python: >=3.9
|
|
|
37
37
|
Requires-Dist: accelerated-scan>=0.2.0
|
|
38
38
|
Requires-Dist: axial-positional-embedding>=0.3.5
|
|
39
39
|
Requires-Dist: einops>=0.8.0
|
|
40
|
-
Requires-Dist: einx>=0.3.0
|
|
41
40
|
Requires-Dist: hyper-connections>=0.1.8
|
|
42
41
|
Requires-Dist: ninja
|
|
43
42
|
Requires-Dist: rotary-embedding-torch
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "titans-pytorch"
|
|
3
|
-
version = "0.0.
|
|
3
|
+
version = "0.0.53"
|
|
4
4
|
description = "Titans"
|
|
5
5
|
authors = [
|
|
6
6
|
{ name = "Phil Wang", email = "lucidrains@gmail.com" }
|
|
@@ -27,7 +27,6 @@ classifiers=[
|
|
|
27
27
|
dependencies = [
|
|
28
28
|
"accelerated-scan>=0.2.0",
|
|
29
29
|
"axial_positional_embedding>=0.3.5",
|
|
30
|
-
"einx>=0.3.0",
|
|
31
30
|
"einops>=0.8.0",
|
|
32
31
|
"hyper-connections>=0.1.8",
|
|
33
32
|
"Ninja",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
|
+
from typing import Callable
|
|
2
3
|
from math import ceil
|
|
3
4
|
from functools import partial
|
|
4
5
|
|
|
@@ -32,7 +33,7 @@ def create_mac_block_mask(seq_len, window_size, persist_mem_len):
|
|
|
32
33
|
|
|
33
34
|
# einstein notation related
|
|
34
35
|
|
|
35
|
-
from einops import
|
|
36
|
+
from einops import repeat, rearrange, pack, unpack
|
|
36
37
|
from einops.layers.torch import Rearrange
|
|
37
38
|
|
|
38
39
|
# b - batch
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
|
+
from typing import Callable
|
|
2
3
|
import math
|
|
3
4
|
from functools import partial
|
|
4
5
|
|
|
@@ -16,7 +17,6 @@ from titans_pytorch.associative_scan import (
|
|
|
16
17
|
pad_at_dim
|
|
17
18
|
)
|
|
18
19
|
|
|
19
|
-
import einx
|
|
20
20
|
from einops import rearrange, repeat, pack, unpack
|
|
21
21
|
from einops.layers.torch import Rearrange, Reduce
|
|
22
22
|
|
|
@@ -338,9 +338,9 @@ class NeuralMemory(Module):
|
|
|
338
338
|
|
|
339
339
|
# take care of chunking
|
|
340
340
|
|
|
341
|
-
keys, values = tuple(rearrange(t, 'b (n c) d -> (b n) c d', c =
|
|
341
|
+
keys, values = tuple(rearrange(t, 'b (n c) d -> (b n) c d', c = chunk_size) for t in (keys, values))
|
|
342
342
|
|
|
343
|
-
adaptive_lr = rearrange(adaptive_lr, 'b (n c) -> (b n) c', c =
|
|
343
|
+
adaptive_lr = rearrange(adaptive_lr, 'b (n c) -> (b n) c', c = chunk_size)
|
|
344
344
|
|
|
345
345
|
# get grads and extra auxiliary loss (for backwarding through qkv projection in base neural memory module)
|
|
346
346
|
|
|
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
|