titans-pytorch 0.0.5__tar.gz → 0.0.6__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.5 → titans_pytorch-0.0.6}/PKG-INFO +2 -1
- {titans_pytorch-0.0.5 → titans_pytorch-0.0.6}/pyproject.toml +4 -2
- {titans_pytorch-0.0.5 → titans_pytorch-0.0.6}/titans_pytorch/titans.py +2 -2
- {titans_pytorch-0.0.5 → titans_pytorch-0.0.6}/.github/workflows/python-publish.yml +0 -0
- {titans_pytorch-0.0.5 → titans_pytorch-0.0.6}/.gitignore +0 -0
- {titans_pytorch-0.0.5 → titans_pytorch-0.0.6}/LICENSE +0 -0
- {titans_pytorch-0.0.5 → titans_pytorch-0.0.6}/README.md +0 -0
- {titans_pytorch-0.0.5 → titans_pytorch-0.0.6}/fig1.png +0 -0
- {titans_pytorch-0.0.5 → titans_pytorch-0.0.6}/fig2.png +0 -0
- {titans_pytorch-0.0.5 → titans_pytorch-0.0.6}/titans_pytorch/__init__.py +0 -0
- {titans_pytorch-0.0.5 → titans_pytorch-0.0.6}/titans_pytorch/associative_scan.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.6
|
|
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
|
|
@@ -39,6 +39,7 @@ Requires-Dist: einx>=0.3.0
|
|
|
39
39
|
Requires-Dist: tensordict>=0.6.2
|
|
40
40
|
Requires-Dist: torch>=2.3
|
|
41
41
|
Provides-Extra: examples
|
|
42
|
+
Requires-Dist: local-attention>=1.9.15; extra == 'examples'
|
|
42
43
|
Provides-Extra: test
|
|
43
44
|
Requires-Dist: pytest; extra == 'test'
|
|
44
45
|
Description-Content-Type: text/markdown
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "titans-pytorch"
|
|
3
|
-
version = "0.0.
|
|
3
|
+
version = "0.0.6"
|
|
4
4
|
description = "Titans"
|
|
5
5
|
authors = [
|
|
6
6
|
{ name = "Phil Wang", email = "lucidrains@gmail.com" }
|
|
@@ -36,7 +36,9 @@ Homepage = "https://pypi.org/project/titans-pytorch/"
|
|
|
36
36
|
Repository = "https://github.com/lucidrains/titans-pytorch"
|
|
37
37
|
|
|
38
38
|
[project.optional-dependencies]
|
|
39
|
-
examples = [
|
|
39
|
+
examples = [
|
|
40
|
+
"local-attention>=1.9.15"
|
|
41
|
+
]
|
|
40
42
|
test = [
|
|
41
43
|
"pytest"
|
|
42
44
|
]
|
|
@@ -164,7 +164,7 @@ class NeuralMemory(Module):
|
|
|
164
164
|
# curtail sequence by multiple of the chunk size
|
|
165
165
|
# only a complete chunk of the sequence provides the memory for the next chunk
|
|
166
166
|
|
|
167
|
-
seq_len = seq.shape[-2]
|
|
167
|
+
seq_len, chunk_size = seq.shape[-2], self.chunk_size
|
|
168
168
|
round_down_seq_len = round_down_multiple(seq_len, self.chunk_size)
|
|
169
169
|
|
|
170
170
|
seq = seq[:, :round_down_seq_len]
|
|
@@ -234,7 +234,7 @@ class NeuralMemory(Module):
|
|
|
234
234
|
|
|
235
235
|
next_state = (curr_weights + last_update, next_momentum)
|
|
236
236
|
|
|
237
|
-
return updates, next_state, aux_store_loss.mean()
|
|
237
|
+
return updates, next_state, aux_store_loss.mean() / chunk_size
|
|
238
238
|
|
|
239
239
|
def retrieve_memories(
|
|
240
240
|
self,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|