titans-pytorch 0.2.25__py3-none-any.whl → 0.2.28__py3-none-any.whl

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.
@@ -869,14 +869,16 @@ class NeuralMemory(Module):
869
869
 
870
870
  # update weights once batch size is fulfilled
871
871
 
872
- last_update, _ = past_state
872
+ last_update, last_momentum = past_state
873
873
 
874
874
  if exists(gate):
875
- weights = TensorDict({param_name: v1.lerp(v2, gate) for (param_name, v1), (_, v2) in zip(weights.items(), last_update.items())})
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
- next_neural_mem_state = tuple_index_set(next_neural_mem_state, 1, last_update)
879
+ past_state = (weights, last_momentum)
880
+ next_neural_mem_state = tuple_index_set(next_neural_mem_state, -2, past_state)
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)
882
884
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: titans-pytorch
3
- Version: 0.2.25
3
+ Version: 0.2.28
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
@@ -2,8 +2,8 @@ titans_pytorch/__init__.py,sha256=Y3m_ZlpEqYwp-Md1ARhNGJxq8bQp8ty1o039nZOOJo0,27
2
2
  titans_pytorch/associative_scan.py,sha256=Y-iYqmFuG-NoCKu6kgql1mhowXTeJfyawi3eUIXamp0,2650
3
3
  titans_pytorch/mac_transformer.py,sha256=5rO4GQxSyFWWEc3pc3xNyG0sK5EXE7MmxKI-_kEMl2M,24941
4
4
  titans_pytorch/memory_models.py,sha256=Q9SAIyAbStF5Tz0EhvRbn3yAdE3nk3xKc1ndieIe714,4671
5
- titans_pytorch/neural_memory.py,sha256=D-xP4Qh4A1RlCyB8PPzhE48TugutFVyR8IXENWaGfr8,27563
6
- titans_pytorch-0.2.25.dist-info/METADATA,sha256=3D6otenDwMzkguATdtZBRq-Z6imPWWv-Th3AeGSfpzU,6816
7
- titans_pytorch-0.2.25.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
8
- titans_pytorch-0.2.25.dist-info/licenses/LICENSE,sha256=1yCiA9b5nhslTavxPjsQAO-wpOnwJR9-l8LTVi7GJuk,1066
9
- titans_pytorch-0.2.25.dist-info/RECORD,,
5
+ titans_pytorch/neural_memory.py,sha256=vFkyxO2WK-mEnf-KP3Za4oJ7_c1KrLHonCuelofJtFs,27754
6
+ titans_pytorch-0.2.28.dist-info/METADATA,sha256=HxSE1da0QnLMbJLpsO2-2wJYm_kFUmdezy2JCUEx6aU,6816
7
+ titans_pytorch-0.2.28.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
8
+ titans_pytorch-0.2.28.dist-info/licenses/LICENSE,sha256=1yCiA9b5nhslTavxPjsQAO-wpOnwJR9-l8LTVi7GJuk,1066
9
+ titans_pytorch-0.2.28.dist-info/RECORD,,