titans-pytorch 0.0.8__tar.gz → 0.0.9__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.8 → titans_pytorch-0.0.9}/PKG-INFO +13 -1
- {titans_pytorch-0.0.8 → titans_pytorch-0.0.9}/README.md +12 -0
- {titans_pytorch-0.0.8 → titans_pytorch-0.0.9}/pyproject.toml +1 -1
- {titans_pytorch-0.0.8 → titans_pytorch-0.0.9}/titans_pytorch/titans.py +4 -1
- {titans_pytorch-0.0.8 → titans_pytorch-0.0.9}/.github/workflows/python-publish.yml +0 -0
- {titans_pytorch-0.0.8 → titans_pytorch-0.0.9}/.gitignore +0 -0
- {titans_pytorch-0.0.8 → titans_pytorch-0.0.9}/LICENSE +0 -0
- {titans_pytorch-0.0.8 → titans_pytorch-0.0.9}/data/README.md +0 -0
- {titans_pytorch-0.0.8 → titans_pytorch-0.0.9}/data/enwik8.gz +0 -0
- {titans_pytorch-0.0.8 → titans_pytorch-0.0.9}/fig1.png +0 -0
- {titans_pytorch-0.0.8 → titans_pytorch-0.0.9}/fig2.png +0 -0
- {titans_pytorch-0.0.8 → titans_pytorch-0.0.9}/titans_pytorch/__init__.py +0 -0
- {titans_pytorch-0.0.8 → titans_pytorch-0.0.9}/titans_pytorch/associative_scan.py +0 -0
- {titans_pytorch-0.0.8 → titans_pytorch-0.0.9}/train.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.9
|
|
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
|
|
@@ -77,6 +77,18 @@ retrieved = mem(seq)
|
|
|
77
77
|
assert seq.shape == retrieved.shape
|
|
78
78
|
```
|
|
79
79
|
|
|
80
|
+
## Experiments
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
$ pip install .[examples]
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Then
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
$ python train.py
|
|
90
|
+
```
|
|
91
|
+
|
|
80
92
|
## Citations
|
|
81
93
|
|
|
82
94
|
```bibtex
|
|
@@ -311,7 +311,10 @@ class NeuralMemory(Module):
|
|
|
311
311
|
past_state: tuple[dict[str, Tensor], dict[str, Tensor]] | None = None,
|
|
312
312
|
return_next_memories = False
|
|
313
313
|
):
|
|
314
|
-
batch = seq.shape[
|
|
314
|
+
batch, seq_len = seq.shape[:2]
|
|
315
|
+
|
|
316
|
+
if seq_len < self.chunk_size:
|
|
317
|
+
return torch.zeros_like(seq)
|
|
315
318
|
|
|
316
319
|
if exists(past_state):
|
|
317
320
|
past_state = tuple(TensorDict(d) for d in past_state)
|
|
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
|