titans-pytorch 0.0.49__tar.gz → 0.0.50__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.49 → titans_pytorch-0.0.50}/PKG-INFO +1 -1
- {titans_pytorch-0.0.49 → titans_pytorch-0.0.50}/pyproject.toml +1 -1
- {titans_pytorch-0.0.49 → titans_pytorch-0.0.50}/titans_pytorch/titans.py +5 -1
- {titans_pytorch-0.0.49 → titans_pytorch-0.0.50}/train_mac.py +2 -2
- {titans_pytorch-0.0.49 → titans_pytorch-0.0.50}/.github/workflows/python-publish.yml +0 -0
- {titans_pytorch-0.0.49 → titans_pytorch-0.0.50}/.github/workflows/test.yaml +0 -0
- {titans_pytorch-0.0.49 → titans_pytorch-0.0.50}/.gitignore +0 -0
- {titans_pytorch-0.0.49 → titans_pytorch-0.0.50}/LICENSE +0 -0
- {titans_pytorch-0.0.49 → titans_pytorch-0.0.50}/README.md +0 -0
- {titans_pytorch-0.0.49 → titans_pytorch-0.0.50}/data/README.md +0 -0
- {titans_pytorch-0.0.49 → titans_pytorch-0.0.50}/data/enwik8.gz +0 -0
- {titans_pytorch-0.0.49 → titans_pytorch-0.0.50}/fig1.png +0 -0
- {titans_pytorch-0.0.49 → titans_pytorch-0.0.50}/fig2.png +0 -0
- {titans_pytorch-0.0.49 → titans_pytorch-0.0.50}/tests/test_titans.py +0 -0
- {titans_pytorch-0.0.49 → titans_pytorch-0.0.50}/titans_pytorch/__init__.py +0 -0
- {titans_pytorch-0.0.49 → titans_pytorch-0.0.50}/titans_pytorch/associative_scan.py +0 -0
- {titans_pytorch-0.0.49 → titans_pytorch-0.0.50}/titans_pytorch/mac_transformer.py +0 -0
|
@@ -162,7 +162,8 @@ class NeuralMemory(Module):
|
|
|
162
162
|
heads = 1,
|
|
163
163
|
model: Module | None = None,
|
|
164
164
|
store_memory_loss_fn: Callable = default_loss_fn,
|
|
165
|
-
adaptive_step_transform: Callable =
|
|
165
|
+
adaptive_step_transform: Callable | None = None,
|
|
166
|
+
default_step_transform_max_lr = 1e-2,
|
|
166
167
|
pre_rmsnorm = True,
|
|
167
168
|
post_rmsnorm = True,
|
|
168
169
|
max_grad_norm: float | None = None,
|
|
@@ -250,6 +251,9 @@ class NeuralMemory(Module):
|
|
|
250
251
|
Rearrange('b n h -> (b h) n')
|
|
251
252
|
)
|
|
252
253
|
|
|
254
|
+
if not exists(adaptive_step_transform):
|
|
255
|
+
adaptive_step_transform = partial(default_adaptive_step_transform, max_lr = default_step_transform_max_lr)
|
|
256
|
+
|
|
253
257
|
self.adaptive_step_transform = adaptive_step_transform
|
|
254
258
|
|
|
255
259
|
# allow for softclamp the gradient norms for storing memories
|
|
@@ -30,8 +30,8 @@ NUM_PERSIST_MEM = 4
|
|
|
30
30
|
NUM_LONGTERM_MEM = 4
|
|
31
31
|
NEURAL_MEM_LAYERS = (2, 4)
|
|
32
32
|
WINDOW_SIZE = 32
|
|
33
|
-
KV_RECON_LOSS_WEIGHT = 0.
|
|
34
|
-
RUN_NAME = f'mac - {NUM_LONGTERM_MEM} longterm mems, layers {NEURAL_MEM_LAYERS}
|
|
33
|
+
KV_RECON_LOSS_WEIGHT = 0.
|
|
34
|
+
RUN_NAME = f'mac - {NUM_LONGTERM_MEM} longterm mems, layers {NEURAL_MEM_LAYERS}'
|
|
35
35
|
|
|
36
36
|
# wandb experiment tracker
|
|
37
37
|
|
|
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
|