titans-pytorch 0.2.27__tar.gz → 0.2.28__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.2.27 → titans_pytorch-0.2.28}/PKG-INFO +1 -1
- {titans_pytorch-0.2.27 → titans_pytorch-0.2.28}/pyproject.toml +1 -1
- {titans_pytorch-0.2.27 → titans_pytorch-0.2.28}/titans_pytorch/neural_memory.py +3 -1
- {titans_pytorch-0.2.27 → titans_pytorch-0.2.28}/.github/workflows/python-publish.yml +0 -0
- {titans_pytorch-0.2.27 → titans_pytorch-0.2.28}/.github/workflows/test.yaml +0 -0
- {titans_pytorch-0.2.27 → titans_pytorch-0.2.28}/.gitignore +0 -0
- {titans_pytorch-0.2.27 → titans_pytorch-0.2.28}/LICENSE +0 -0
- {titans_pytorch-0.2.27 → titans_pytorch-0.2.28}/README.md +0 -0
- {titans_pytorch-0.2.27 → titans_pytorch-0.2.28}/data/README.md +0 -0
- {titans_pytorch-0.2.27 → titans_pytorch-0.2.28}/data/enwik8.gz +0 -0
- {titans_pytorch-0.2.27 → titans_pytorch-0.2.28}/fig1.png +0 -0
- {titans_pytorch-0.2.27 → titans_pytorch-0.2.28}/fig2.png +0 -0
- {titans_pytorch-0.2.27 → titans_pytorch-0.2.28}/tests/test_titans.py +0 -0
- {titans_pytorch-0.2.27 → titans_pytorch-0.2.28}/titans_pytorch/__init__.py +0 -0
- {titans_pytorch-0.2.27 → titans_pytorch-0.2.28}/titans_pytorch/associative_scan.py +0 -0
- {titans_pytorch-0.2.27 → titans_pytorch-0.2.28}/titans_pytorch/mac_transformer.py +0 -0
- {titans_pytorch-0.2.27 → titans_pytorch-0.2.28}/titans_pytorch/memory_models.py +0 -0
- {titans_pytorch-0.2.27 → titans_pytorch-0.2.28}/train_mac.py +0 -0
@@ -869,13 +869,15 @@ class NeuralMemory(Module):
|
|
869
869
|
|
870
870
|
# update weights once batch size is fulfilled
|
871
871
|
|
872
|
-
last_update,
|
872
|
+
last_update, last_momentum = past_state
|
873
873
|
|
874
874
|
if exists(gate):
|
875
875
|
weights = TensorDict({param_name: one_weight.lerp(one_last_update, gate) for (param_name, one_weight), (_, one_last_update) in zip(weights.items(), last_update.items())})
|
876
876
|
else:
|
877
877
|
weights = last_update
|
878
878
|
|
879
|
+
past_state = (weights, last_momentum)
|
880
|
+
next_neural_mem_state = tuple_index_set(next_neural_mem_state, -2, past_state)
|
879
881
|
next_neural_mem_state = tuple_index_set(next_neural_mem_state, 1, weights)
|
880
882
|
|
881
883
|
next_neural_mem_state = tuple_index_set(next_neural_mem_state, -1, updates)
|
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
|