titans-pytorch 0.2.16__py3-none-any.whl → 0.2.17__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.
@@ -564,7 +564,12 @@ class NeuralMemory(Module):
564
564
  # maybe add previous layer weight
565
565
 
566
566
  if exists(prev_weights):
567
- prev_weights = prev_weights.apply(lambda t: t[:, -1:])
567
+
568
+ start_index = math.ceil(seq_index / chunk_size)
569
+ end_index = start_index + num_chunks
570
+
571
+ prev_weights = prev_weights.apply(lambda t: t[:, start_index:end_index])
572
+
568
573
  weights_for_surprise = weights_for_surprise + prev_weights
569
574
 
570
575
  # flatten batch and time if surprise depends on previous layer memory model
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: titans-pytorch
3
- Version: 0.2.16
3
+ Version: 0.2.17
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=QhdSPgWntfWILMJ1t0xLKgvZfPZWu9vhzZWaesftaPg,24724
4
4
  titans_pytorch/memory_models.py,sha256=Q9SAIyAbStF5Tz0EhvRbn3yAdE3nk3xKc1ndieIe714,4671
5
- titans_pytorch/neural_memory.py,sha256=pOoDhYrUgQ5EaUyiEvwDu7mfcaH6Jqqod5NwIFLbD9U,25798
6
- titans_pytorch-0.2.16.dist-info/METADATA,sha256=TxyjTuJmP0o2NhrHmlzJCU3JivOA1rTY-xQp3Ir_igY,6812
7
- titans_pytorch-0.2.16.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
8
- titans_pytorch-0.2.16.dist-info/licenses/LICENSE,sha256=1yCiA9b5nhslTavxPjsQAO-wpOnwJR9-l8LTVi7GJuk,1066
9
- titans_pytorch-0.2.16.dist-info/RECORD,,
5
+ titans_pytorch/neural_memory.py,sha256=M7vB6AgrphY3_cdELyWXF8qS9cjYUvv1NVCUqQOlA8M,25928
6
+ titans_pytorch-0.2.17.dist-info/METADATA,sha256=8oBe_7SkPmHvHVGXpoRvGWMTldfl2pzXIztOaM_qGrI,6812
7
+ titans_pytorch-0.2.17.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
8
+ titans_pytorch-0.2.17.dist-info/licenses/LICENSE,sha256=1yCiA9b5nhslTavxPjsQAO-wpOnwJR9-l8LTVi7GJuk,1066
9
+ titans_pytorch-0.2.17.dist-info/RECORD,,