initium-deeplearning 0.1.0__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.
Files changed (71) hide show
  1. initium/LNN_controller/cfc_backbone_parallel.py +265 -0
  2. initium/LNN_controller/cfc_controller.py +325 -0
  3. initium/LNN_controller/chained_controller.py +83 -0
  4. initium/LNN_controller/hybrid_controller.py +90 -0
  5. initium/MoE/README.md +1 -0
  6. initium/MoE/moe_layer.py +552 -0
  7. initium/__init__.py +1 -0
  8. initium/config/controller_config.py +86 -0
  9. initium/config/train_config.py +64 -0
  10. initium/core_training.py +2182 -0
  11. initium/data/__init__.py +0 -0
  12. initium/data/audio/__init__.py +0 -0
  13. initium/data/audio/audio_dataset.py +96 -0
  14. initium/data/base_dataset.py +75 -0
  15. initium/data/common/__init__.py +0 -0
  16. initium/data/common/chain_task.py +542 -0
  17. initium/data/common/digit_codec.py +85 -0
  18. initium/data/common/graph_io.py +123 -0
  19. initium/data/common/real_data.py +747 -0
  20. initium/data/dataset_registry.py +59 -0
  21. initium/data/graph_traversal/__init__.py +0 -0
  22. initium/data/graph_traversal/graph_traversal.py +746 -0
  23. initium/data/multimodal/__init__.py +0 -0
  24. initium/data/multimodal/multimodal_dataset.py +401 -0
  25. initium/data/text/__init__.py +0 -0
  26. initium/data/text/text_dataset.py +79 -0
  27. initium/data/video/__init__.py +0 -0
  28. initium/data/video/video_dataset.py +85 -0
  29. initium/inference/__init__.py +1 -0
  30. initium/inference/cache/__init__.py +1 -0
  31. initium/inference/cache/base_cache.py +112 -0
  32. initium/inference/cache/cache_config.py +21 -0
  33. initium/inference/cache/cache_registry.py +99 -0
  34. initium/inference/cache/cached_engine.py +264 -0
  35. initium/inference/cache/keys.py +77 -0
  36. initium/inference/cache/prefix_cache.py +59 -0
  37. initium/inference/cache/result_cache.py +57 -0
  38. initium/inference/cache/state_utils.py +74 -0
  39. initium/inference/cache/stores.py +167 -0
  40. initium/inference/capabilities.py +86 -0
  41. initium/inference/checkpoint_io.py +63 -0
  42. initium/inference/engine.py +88 -0
  43. initium/inference/inference_config.py +22 -0
  44. initium/inference/metrics.py +103 -0
  45. initium/inference/model_loader.py +270 -0
  46. initium/inference/run_inference.py +526 -0
  47. initium/inference/run_logging.py +173 -0
  48. initium/inference/tasks/__init__.py +1 -0
  49. initium/inference/tasks/audio_task.py +114 -0
  50. initium/inference/tasks/base_task.py +60 -0
  51. initium/inference/tasks/graph_traversal_task.py +235 -0
  52. initium/inference/tasks/multimodal_task.py +74 -0
  53. initium/inference/tasks/task_registry.py +68 -0
  54. initium/inference/tasks/text_task.py +114 -0
  55. initium/inference/tasks/video_task.py +114 -0
  56. initium/mamba_controller/mamba2_controller.py +433 -0
  57. initium/mamba_controller/mamba3_controller.py +242 -0
  58. initium/mamba_controller/mamba_backbone_parallel.py +291 -0
  59. initium/mamba_controller/mamba_controller.py +983 -0
  60. initium/mamba_controller/split_graph_dnc.py +623 -0
  61. initium/memory_manipulation/dynamic_memory_resize.py +157 -0
  62. initium/memory_manipulation/dynamic_n_controller.py +152 -0
  63. initium/memory_manipulation/link_matrix_ablation.py +130 -0
  64. initium/memory_manipulation/nvrtc_compat.py +143 -0
  65. initium/memory_manipulation/stochastic_write_head_v2.py +545 -0
  66. initium/setup_wheels.py +175 -0
  67. initium_deeplearning-0.1.0.dist-info/METADATA +253 -0
  68. initium_deeplearning-0.1.0.dist-info/RECORD +71 -0
  69. initium_deeplearning-0.1.0.dist-info/WHEEL +4 -0
  70. initium_deeplearning-0.1.0.dist-info/entry_points.txt +3 -0
  71. initium_deeplearning-0.1.0.dist-info/licenses/LICENSE +674 -0
@@ -0,0 +1,175 @@
1
+ """Install the CUDA-matched binary wheels that PyPI metadata cannot express.
2
+
3
+ Run once after installing initium:
4
+
5
+ initium-setup # or: python -m initium.setup_wheels
6
+ initium-setup --dry-run # print the commands only
7
+
8
+ What it does (stdlib only, no torch reinstall):
9
+ 1. pytorch-dnc from git (PyPI's `dnc` is stale; direct URLs are forbidden in PyPI metadata).
10
+ 2. mamba-ssm + causal-conv1d prebuilt wheels matching the ACTIVE torch/CUDA build, from
11
+ the wheel index, so nothing is compiled locally.
12
+ Steps that are already satisfied are skipped, so re-running is cheap.
13
+ """
14
+
15
+ from __future__ import annotations
16
+
17
+ import argparse
18
+ import importlib.util
19
+ import json
20
+ import shlex
21
+ import shutil
22
+ import subprocess
23
+ import sys
24
+ from dataclasses import dataclass
25
+ from importlib import metadata
26
+
27
+ WHEEL_INDEX_TEMPLATE = "https://wheels.astral.sh/simple/{cuda_tag}/"
28
+ MAMBA_SSM_VERSION = "2.3.2.post1"
29
+ CAUSAL_CONV1D_VERSION = "1.6.2.post1"
30
+ DNC_SOURCE = "git+https://github.com/ixaxaar/pytorch-dnc.git" # pin "@<sha>" for reproducibility
31
+ SKIPPABLE = ("dnc", "gpu-wheels")
32
+
33
+
34
+ @dataclass(frozen=True)
35
+ class TorchEnv:
36
+ version: str # "2.10.0"
37
+ major_minor: str # "2.10"
38
+ cuda: str | None # "12.8", or None for CPU-only torch
39
+
40
+ @property
41
+ def cuda_tag(self) -> str | None:
42
+ return None if self.cuda is None else "cu" + self.cuda.replace(".", "")
43
+
44
+
45
+ def detect_torch() -> TorchEnv:
46
+ try:
47
+ import torch
48
+ except ImportError as exc:
49
+ raise SystemExit(
50
+ "PyTorch is required to install GPU wheels. Install a compatible PyTorch build first."
51
+ ) from exc
52
+ version = torch.__version__.split("+", 1)[0]
53
+ return TorchEnv(version, ".".join(version.split(".")[:2]), torch.version.cuda)
54
+
55
+
56
+ def gpu_requirements(env: TorchEnv) -> list[str]:
57
+ local = f"+cu.{env.cuda}.torch.{env.major_minor}"
58
+ return [
59
+ f"mamba-ssm=={MAMBA_SSM_VERSION}{local}",
60
+ f"causal-conv1d=={CAUSAL_CONV1D_VERSION}{local}",
61
+ ]
62
+
63
+
64
+ def resolve_installer(choice: str) -> str:
65
+ if choice != "auto":
66
+ return choice
67
+ if importlib.util.find_spec("pip") is not None:
68
+ return "pip"
69
+ if shutil.which("uv") is not None:
70
+ return "uv"
71
+ raise SystemExit("Neither pip nor uv is available in this environment.")
72
+
73
+
74
+ def _base_cmd(installer: str) -> list[str]:
75
+ if installer == "pip":
76
+ return [sys.executable, "-m", "pip", "install"]
77
+ return ["uv", "pip", "install", "--python", sys.executable]
78
+
79
+
80
+ def dnc_command(installer: str) -> list[str]:
81
+ force = ["--force-reinstall"] if installer == "pip" else ["--reinstall-package", "dnc"]
82
+ return [*_base_cmd(installer), *force, "--no-deps", DNC_SOURCE]
83
+
84
+
85
+ def gpu_command(installer: str, requirements: list[str], index_url: str) -> list[str]:
86
+ cmd = _base_cmd(installer)
87
+ if installer == "uv":
88
+ # uv's default "first-index" strategy would stop at PyPI (which lacks the +cu local
89
+ # versions) and never look at the extra index.
90
+ cmd += ["--index-strategy", "unsafe-best-match"]
91
+ return [*cmd, *requirements, "--extra-index-url", index_url]
92
+
93
+
94
+ def _installed_version(dist: str) -> str | None:
95
+ try:
96
+ return metadata.version(dist)
97
+ except metadata.PackageNotFoundError:
98
+ return None
99
+
100
+
101
+ def _dnc_from_git() -> bool:
102
+ try:
103
+ raw = metadata.distribution("dnc").read_text("direct_url.json")
104
+ except metadata.PackageNotFoundError:
105
+ return False
106
+ return raw is not None and "vcs_info" in json.loads(raw)
107
+
108
+
109
+ def _gpu_satisfied(requirements: list[str]) -> bool:
110
+ for req in requirements:
111
+ name, version = req.split("==", 1)
112
+ if _installed_version(name) != version:
113
+ return False
114
+ return True
115
+
116
+
117
+ def _parse_args(argv: list[str] | None) -> argparse.Namespace:
118
+ p = argparse.ArgumentParser(
119
+ prog="initium-setup",
120
+ description="Install CUDA-matched mamba-ssm / causal-conv1d wheels and pytorch-dnc (git).",
121
+ )
122
+ p.add_argument("--installer", choices=("auto", "pip", "uv"), default="auto")
123
+ p.add_argument(
124
+ "--skip",
125
+ nargs="+",
126
+ choices=SKIPPABLE,
127
+ default=[],
128
+ metavar="STEP",
129
+ help=f"steps to skip: {', '.join(SKIPPABLE)}",
130
+ )
131
+ p.add_argument(
132
+ "--wheel-index",
133
+ default=WHEEL_INDEX_TEMPLATE,
134
+ help="wheel index URL; may contain the {cuda_tag} placeholder (e.g. cu128)",
135
+ )
136
+ p.add_argument("--force", action="store_true", help="reinstall even if already satisfied")
137
+ p.add_argument("--dry-run", action="store_true", help="print commands without running them")
138
+ return p.parse_args(argv)
139
+
140
+
141
+ def main(argv: list[str] | None = None) -> int:
142
+ args = _parse_args(argv)
143
+ installer = resolve_installer(args.installer)
144
+
145
+ plan: list[tuple[str, list[str]]] = []
146
+ if "dnc" not in args.skip and (args.force or not _dnc_from_git()):
147
+ plan.append(("pytorch-dnc (git)", dnc_command(installer)))
148
+ if "gpu-wheels" not in args.skip:
149
+ env = detect_torch()
150
+ print(f"[initium-setup] torch={env.version} cuda={env.cuda or 'none (CPU build)'}")
151
+ if env.cuda_tag is None:
152
+ print("[initium-setup] CPU-only torch: skipping mamba-ssm/causal-conv1d (need CUDA).")
153
+ else:
154
+ reqs = gpu_requirements(env)
155
+ if args.force or not _gpu_satisfied(reqs):
156
+ index = args.wheel_index.format(cuda_tag=env.cuda_tag)
157
+ plan.append(("GPU wheels", gpu_command(installer, reqs, index)))
158
+
159
+ if not plan:
160
+ print("[initium-setup] nothing to do - everything is already installed.")
161
+ return 0
162
+ for label, cmd in plan:
163
+ print(f"[initium-setup] {label}: {shlex.join(cmd)}")
164
+ if args.dry_run:
165
+ continue
166
+ try:
167
+ subprocess.run(cmd, check=True)
168
+ except subprocess.CalledProcessError as exc:
169
+ print(f"[initium-setup] FAILED ({label}), exit code {exc.returncode}", file=sys.stderr)
170
+ return exc.returncode
171
+ return 0
172
+
173
+
174
+ if __name__ == "__main__":
175
+ sys.exit(main())
@@ -0,0 +1,253 @@
1
+ Metadata-Version: 2.5
2
+ Name: initium-deeplearning
3
+ Version: 0.1.0
4
+ Summary: Differentiable Neural Computer research framework with pluggable LSTM/Mamba/CfC controllers, MoE, split-graph and stochastic write heads.
5
+ Project-URL: Homepage, https://github.com/samueleternity/initium
6
+ Project-URL: Issues, https://github.com/samueleternity/initium/issues
7
+ Author: samueleternity
8
+ License-Expression: GPL-3.0
9
+ License-File: LICENSE
10
+ Keywords: differentiable-neural-computer,dnc,liquid-neural-networks,mamba,pytorch
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Science/Research
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
18
+ Requires-Python: >=3.10
19
+ Requires-Dist: dnc>=1.1.0
20
+ Requires-Dist: ncps>=0.0.7
21
+ Requires-Dist: numpy>=1.26
22
+ Requires-Dist: torch>=2.4
23
+ Provides-Extra: real-data
24
+ Requires-Dist: opencv-python>=4.8; extra == 'real-data'
25
+ Requires-Dist: tokenizers>=0.19; extra == 'real-data'
26
+ Provides-Extra: text
27
+ Requires-Dist: tokenizers>=0.19; extra == 'text'
28
+ Provides-Extra: video
29
+ Requires-Dist: opencv-python>=4.8; extra == 'video'
30
+ Description-Content-Type: text/markdown
31
+
32
+ # Initium
33
+
34
+ Initium is an experimental research framework for combining a Differentiable Neural Computer (DNC)/augmented memory with interchangeable sequence controllers and task/data pipelines. Its central idea is to keep an explicit, addressable external memory while exploring controllers such as LSTM, Mamba-family state-space models, and closed-form continuous-time (CfC) networks. The code also includes stochastic memory-write regularization, sparse expert layers, split-graph models, memory-structure experiments, and checkpoint-driven inference.
35
+
36
+ > **Research status:** Alpha and actively changing. Results below are experiment-specific observations, not guarantees that a configuration will reproduce on another machine, code revision, or dataset. This README is deliberately maintained as a working guide: update it when the code, default configuration, or evidence changes.
37
+
38
+ ## What the project is investigating
39
+
40
+ The project studies how a neural controller can interact with a differentiable external memory on sequential tasks, especially graph traversal. It asks questions at several levels:
41
+
42
+ 1. **Memory and controller:** Can a controller process a sequence and use DNC read/write operations to store and retrieve information needed later?
43
+ 2. **Generalization:** How does performance change between the training curriculum and a held-out or out-of-distribution (OOD) evaluation distribution?
44
+ 3. **Write regularization:** Does placing a probabilistic prior on each memory write improve generalization, and what are the costs or seed-to-seed variations?
45
+ 4. **Compute structure:** Can the controller's sequence computation be parallelized or sparsified while preserving the sequential memory interface?
46
+ 5. **Task breadth and deployment:** Can trained checkpoints be evaluated through a common inference interface across graph, text, audio, video, and multimodal tasks?
47
+
48
+ These are research questions, not all established project claims. In particular, supported dataset interfaces do not imply that every modality has been trained and validated to the same standard as graph traversal.
49
+
50
+ ## High-level flow
51
+
52
+ ```text
53
+ Configuration and random seed
54
+ │
55
+ ▼
56
+ Dataset registry ──► task episodes / curriculum ──► batch and sequence tensors
57
+ │
58
+ ▼
59
+ Controller + DNC external memory
60
+ ├─ controller processes sequence
61
+ ├─ write head updates memory
62
+ └─ read heads return memory content
63
+ │
64
+ ▼
65
+ task loss + optional KL / MoE auxiliary losses
66
+ │
67
+ ▼
68
+ optimizer, evaluation, logs, checkpoints, curriculum
69
+ │
70
+ ▼
71
+ checkpoint loader ──► task inference ──► metrics and run logs
72
+ ```
73
+
74
+ The training core delegates task construction and task-specific behavior to a dataset interface. The model combines a selected controller with DNC memory operations. During training, the loop computes task and optional auxiliary objectives, updates model parameters, periodically evaluates ID and OOD performance, advances the curriculum when its criteria are met, writes diagnostics, and saves resumable checkpoints. Inference reconstructs a model from a checkpoint, checks that the requested task and dimensions are supported, creates the task runner, and reports episode metrics. Optional inference caches can reuse eligible results or shared prefixes.
75
+
76
+ ## Architecture and major components
77
+
78
+ ### Differentiable external memory
79
+
80
+ The DNC supplies a memory matrix and differentiable read/write interface. The memory can retain information beyond a controller's immediate hidden state. Content-based addressing, read heads, and temporal-link structures are part of the underlying DNC implementation. The temporal link matrix has quadratic cost in the number of memory cells, which motivates the project's link-matrix ablations and memory-size investigations.
81
+
82
+ ### Controllers
83
+
84
+ The training core exposes controller choices through its command-line interface and configuration:
85
+
86
+ - **LSTM:** baseline recurrent controller.
87
+ - **Mamba:** selective state-space controller.
88
+ - **Mamba-2 and Mamba-3:** additional state-space variants; current experiment notes report that these configurations underperformed in earlier tests and need further investigation.
89
+ - **CfC:** closed-form continuous-time controller.
90
+ - **Hybrid chains:** compositions of supported controller stages, such as a Mamba/CfC sequence.
91
+ - **Split-graph:** a parallel sequence backbone plus a separate combiner for the sequential memory-addressing work. It is an experimental way to expose more of the controller computation to parallel execution while retaining the memory interface and currently performs the best out of all options.
92
+
93
+ Some options require optional or hardware-sensitive dependencies, particularly `mamba-ssm` and `causal-conv1d`. A controller being selectable in code should not be read as evidence that it is equally mature or portable on every platform.
94
+
95
+ ### Stochastic writes and KL regularization
96
+
97
+ The write-head extension models a write vector as a diagonal Gaussian. It can sample a write using the reparameterization trick and add a KL penalty to a prior distribution. The implementation supports a fixed standard-normal prior and a learned prior updated from recent write statistics on a periodic, detached snapshot schedule. The loss can include KL annealing and free bits; the learned-prior path logs its snapshot state separately.
98
+
99
+ The intended locality distinction is important: the per-write KL is computed from the current write distribution and a prior snapshot. In the learned-prior variant, the prior itself is fitted from recent writes periodically, outside the per-step gradient path. That makes the overall mechanism periodically data-conditioned even though the per-write calculation uses the current write and frozen prior snapshot.
100
+
101
+ Also KL regularization has specific, uninvestigated behaviour: it tends to stabilize grad_norms allowing the model to not collapse (detected once and needs further investigations) - it was mildly visible in graph-traversal experiments but its full strength occured in multimodal tasks where a model managed to collapse in lesson 14 with beta=0.0, meanwhile with beta=0.001(KL term active) the same model kept going with no issues.
102
+
103
+ ### Other experimental mechanisms
104
+
105
+ - **Mixture of Experts (MoE):** sparse expert feed-forward capacity with routing and load-balancing diagnostics. The current project notes caution that this overhead may be unnecessary or harmful at smaller model sizes; its motivation is future scaling, not a demonstrated benefit for the current compact experiments.
106
+ - **Dynamic memory size (Dynamic-N):** usage-triggered growth of the memory cell array within configured bounds.
107
+ - **Link-matrix options:** ablations or sparsification of temporal-link computation.
108
+ - **Dynamic beta:** an optional bounded controller for the KL weight, distinct from a fixed-beta sweep.
109
+ - **Multimodal and real-data loaders:** interfaces for synthetic and selected real text, audio, video, graph, and multimodal inputs. Their practical coverage and validation are still evolving.
110
+
111
+ ## Repository map
112
+
113
+ | Path | Role |
114
+ | --- | --- |
115
+ | `src/initium/core_training.py` | Dataset-agnostic training loop, CLI, evaluation, logging, checkpointing, and orchestration of model options. |
116
+ | `src/initium/config/` | Training, regularization, controller, and architecture defaults. |
117
+ | `src/initium/data/` | Dataset registry, task episodes, curriculum/data handling, codecs, and real-data utilities. |
118
+ | `src/initium/mamba_controller/` | DNC controller integration, Mamba variants, hybrid controllers, and split-graph implementation. |
119
+ | `src/initium/LNN_controller/` | CfC and hybrid continuous-time controller implementations. |
120
+ | `src/initium/memory_manipulation/` | Stochastic write heads, prior snapshots, memory resizing, link-matrix ablations, and compatibility helpers. |
121
+ | `src/initium/MoE/` | Sparse expert layer and its local usage notes. |
122
+ | `src/initium/inference/` | Checkpoint loading, task registry, inference engine, metrics, logging, and cache support. |
123
+ | `setup_wheels.py` | Environment/dependency setup entry point for specialized wheels. |
124
+ | `pyproject.toml` | Package metadata, base and optional dependencies, and development tooling groups. |
125
+
126
+ ## Setup
127
+
128
+ The PyPI distribution is named `initium-deeplearning`; its Python import package is `initium`. The project targets Python 3.10 or later. Core dependencies are declared in `pyproject.toml`; accelerated state-space controllers may need platform-specific PyTorch/CUDA wheels and additional packages. Install the project and optional task dependencies in an environment appropriate to your hardware. For specialized dependency setup, inspect the repository's `setup_wheels.py` and its help output before running it; GPU package compatibility depends on the installed PyTorch, CUDA, and Python versions.
129
+
130
+ Typical editable installation for development:
131
+
132
+ ```bash
133
+ python -m pip install -e .
134
+ ```
135
+
136
+ Optional dependencies are grouped by modality, for example `text`, `video`, and `real-data` in the project metadata. Audio/video processing may also rely on system tools such as FFmpeg. Mamba-family components can require packages beyond the base install. The default training path is intended to be usable without those optional controller dependencies.
137
+
138
+ The source tree is packaged as `initium`; internal modules use the `initium.*` namespace.
139
+
140
+ ## Training
141
+
142
+ The main entry point is `src/initium/core_training.py`. From the repository root, inspect the available arguments with:
143
+
144
+ ```bash
145
+ python -m initium.core_training --help
146
+ ```
147
+
148
+ The script accepts a positional KL weight (`beta`); omitting it runs the configured beta sweep. It also accepts a random seed and controller/task/architecture options. A representative graph-task run with the Mamba controller and the dynamic-memory/split-graph experiments enabled is:
149
+
150
+ ```bash
151
+ python -m initium.core_training 0.0 --seed 0 --controller mamba --dynamic-n-mode --split-graph
152
+ ```
153
+
154
+ This is an example of the CLI shape, not a universal best configuration. Check `src/initium/config/train_config.py` and `src/initium/config/controller_config.py` for the defaults in the checkout you're running. In particular, training duration, model size, beta sweep, dataset, evaluation cadence, and memory options may have changed since older experiment records were produced.
155
+
156
+ Training runs typically produce:
157
+
158
+ - periodic and final checkpoints, including model, optimizer, random-generator, curriculum, and architecture/prior state needed to resume or evaluate;
159
+ - step-level or periodic logs for task loss, KL, accuracy, OOD evaluation, and training health;
160
+ - additional CSV diagnostics for learned-prior snapshots and optional architecture features;
161
+ - a run identifier that encodes relevant settings to reduce accidental collisions.
162
+
163
+ Keep seeds, source revision, full command, configuration, device/dependency versions, and evaluation protocol with any result you intend to compare. A single final metric is not enough to characterize these experiments: curriculum position, checkpoint step, sampled versus deterministic writes, and evaluation sample count can change the interpretation.
164
+
165
+ ## Evaluation and inference
166
+
167
+ The checkpoint-based inference CLI lives at `src/initium/inference/run_inference.py`. Its help output is the current reference for arguments:
168
+
169
+ ```bash
170
+ python -m initium.inference.run_inference --help
171
+ ```
172
+
173
+ The command accepts a checkpoint, task type, optional data link, episode count, seed, device, and task-specific settings. It can inspect checkpoint capabilities, compare reset and persistent experience modes, report memory-ablation behavior, and optionally configure inference caches. A basic invocation has this form:
174
+
175
+ ```bash
176
+ python -m initium.inference.run_inference path/to/checkpoint.pt --dataset-type graph
177
+ ```
178
+
179
+ The loader checks checkpoint/task compatibility and refuses unsupported task types or dimensions. Graph, text, audio, and video task runners are registered; multimodal execution is also represented in the code but its input dimensions depend on the selected modality combination. Verify the checkpoint's recorded dataset configuration before comparing results across task types.
180
+
181
+ ## Experiments and current evidence
182
+
183
+ The supplied experiment records describe a staged investigation of a KL penalty on DNC memory writes. They are summarized here as results rather than by the names of the individual working files, so this overview can remain useful if those files are renamed or reorganized. -> If anyone wishes to see the original files, you can create an issue and will be contacted afterwards.
184
+
185
+ ### Fixed-prior multi-seed study
186
+
187
+ The first study compared a no-KL anchor with a small fixed-prior KL weight over multiple random seeds with --controller lstm. It found meaningful heterogeneity: several seeds showed non-collapsed OOD gains, some showed little benefit, and two seeds showed genuine reversals. The strongest observed seed improved OOD triple accuracy by roughly 11–12 percentage points over its own anchor. The study therefore supports a **conditional** positive result for the tested configuration, not a claim that the effect is universal or statistically settled. The measured OOD perfect-traversal fraction also did not track triple accuracy uniformly, so the metric definition matters.
188
+
189
+ ### Learned-prior study
190
+
191
+ The follow-up replaced the fixed prior with a prior periodically estimated from recent write statistics. Four deliberately selected seeds were tested: two previous reversal cases and two stronger fixed-prior cases. Outcomes were mixed: the two former reversals improved, one strong case was nearly flat, and the strongest fixed-prior result regressed by about five to six OOD points. Across the four seeds, the mean OOD change was small and not statistically distinguishable from zero; ID accuracy was lower by about 1.1–2.7 points in all four comparisons. Diagnostics did not indicate KL collapse. A regression-to-the-mean explanation is plausible (the reported correlation was large at n=4), but the sample is too small to distinguish that from a true repair of the earlier reversal cases. The structural audit found the learned prior's snapshot update was detached and periodic, with no second online posterior; that is a design characterization, not proof of a generalization benefit.
192
+
193
+ ### Alternate Mamba-controller study
194
+
195
+ A separate study compared beta 0 and beta 0.001 in a Mamba, dynamic-memory, split-graph configuration across five seeds. The logs showed no statistically clear OOD or ID-to-OOD offset improvement from the KL term; beta 0 had a small nominal OOD edge in four of five seeds. The beta 0.001 runs consistently left the first curriculum lesson later. The comparison is provisional: only one seed reached the final curriculum lesson, four runs were unfinished, and there was no wide-evaluation sweep for that batch. This configuration should not be described as a completed replication of the earlier study because its controller, memory size, training budget, and evaluation coverage differ.
196
+
197
+ ### Evidence boundaries and open work
198
+
199
+ - Results above apply to the exact runs and evaluation procedures recorded; they do not establish broad performance across modalities, hardware, or model scales.
200
+ - Phase 1's seed variation and Phase 2's four-seed selection limit aggregate claims. Report per-seed values and uncertainty alongside averages.
201
+ - The learned prior's apparent variance-dampening/mean-reversion effect needs more seeds and controls to separate it from failure-mode-specific repair.
202
+ - The alternate Mamba batch needs completion of unfinished seeds and late-curriculum evaluation before a gate-level conclusion.
203
+ - Mamba-2/Mamba-3 performance, MoE's useful scaling regime, memory-link trade-offs, dynamic memory growth, and real-data/multimodal behavior remain active investigation areas.
204
+ - Experiment status can change. Update this section when new runs are verified; retain the method, sample size, seed set, incompleteness, and uncertainty so summaries do not outrun evidence.
205
+
206
+ ## Research foundations
207
+
208
+ The project draws on several complementary lines of work. These references motivate components and questions; their inclusion does not imply that Initium reproduces each paper's results.
209
+
210
+ ### Differentiable memory and neural sequence models
211
+
212
+ - Graves et al., **“Hybrid computing using a neural network with dynamic external memory.”** DNC memory, differentiable addressing, and the graph-traversal motivation.
213
+ - Hasani et al., **“Closed-form Continuous-time Neural Networks.”** Continuous-time controller design.
214
+ - Gu and Dao, **“Mamba-3: Improved Sequence Modeling using State Space Principles.”** State-space sequence-modeling direction explored by controller variants.
215
+ - Dao and Gu, **“Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality.”** Structured state-space/sequence computation background.
216
+
217
+ ### Delta-rule and state-space improvements
218
+
219
+ - **“Gated Delta Networks: Improving Mamba 2 with Delta Rule.”** Gated delta-rule sequence processing.
220
+ - **“Parallelizing Linear Transformers with the Delta Rule over Sequence Length.”** Parallelization ideas related to sequence-length computation.
221
+
222
+ ### Sparse expert models
223
+
224
+ - Shazeer et al., **“Outrageously Large Neural Networks: The Sparsely-Gated Mixture-of-Experts Layer.”** Sparse expert routing foundations.
225
+ - Fedus et al., **“Switch Transformers: Scaling to Trillion Parameter Models with Simple and Efficient Sparsity.”** Simplified sparse expert scaling.
226
+ - **“Multi-Rate Mixture of Experts for Accelerating Liquid Neural Network Training.”** Motivation for combining expert computation with liquid-network training.
227
+ - **“MoE-Mamba: Efficient Selective State Space Models with Mixture of Experts.”** MoE and selective state-space combination.
228
+
229
+ ### Stochastic regularization and the DNC baseline
230
+
231
+ - Higgins et al., **“beta-VAE: Learning Basic Visual Concepts with a Constrained Variational Framework.”** Gaussian KL regularization and reparameterized latent sampling adapted here to memory writes.
232
+ - Graves et al., **“Hybrid computing using a neural network with dynamic external memory.”** Baseline memory architecture and task family used by the Q21 study.
233
+ - Additional work on local credit assignment, priors, and continual-learning regularization informed the experiment design and interpretation. Consult the experiment notes for the specific comparisons and caveats.
234
+
235
+ ## Development principles
236
+
237
+ Because the repository is new and research directions are still changing:
238
+
239
+ - Prefer describing mechanisms and measured outcomes over calling a configuration “best” without a scoped comparison.
240
+ - Distinguish implemented, exercised, and validated features. A registry entry is implementation coverage, not empirical validation.
241
+ - Preserve negative and mixed results; record the seed, comparison anchor, metric, evaluation window, and incomplete runs.
242
+ - Keep CLI help, configuration defaults, this README, and experiment records aligned as the project evolves.
243
+ - Treat research papers as motivation and technical background, not as evidence that this implementation matches their methods or results unless a reproduction has been explicitly checked.
244
+
245
+ ## License
246
+
247
+ Initium is distributed under the GNU General Public License v3.0. See [`LICENSE`](LICENSE).
248
+
249
+ ## Publishing to PyPI
250
+
251
+ Package versions come from `__version__` in `src/__init__.py`. After merging a version update into `main`, create a GitHub Release whose tag matches that version (for example, `v0.1.0`). The `Publish to PyPI` workflow builds and validates the wheel and source distribution, then publishes them automatically. It refuses releases whose tag points to a commit outside `main` or whose tag does not match the package version.
252
+
253
+ The PyPI distribution name is `initium-deeplearning`; the source directory and import namespace remain `initium`. The configured PyPI Trusted Publisher should target project `initium-deeplearning` with owner `samueleternity`, repository `initium`, workflow `publish-pypi.yml`, and GitHub environment `pypi`. Publishing uses short-lived OIDC credentials, so no PyPI API token is stored in GitHub.
@@ -0,0 +1,71 @@
1
+ initium/__init__.py,sha256=J-Uw6FY1qiYlb6ykNEfZppHeP82CCoSvWQtJDIKjR_o,65
2
+ initium/core_training.py,sha256=Zjmr1FqbGAlQ4ZI8q9jZD4TYctCZU6bCiIw1KaysPfg,98701
3
+ initium/setup_wheels.py,sha256=B_gThJYtSJSNdsEiQtmt-ZBeCebP0OGogWUxxNToSEk,6037
4
+ initium/LNN_controller/cfc_backbone_parallel.py,sha256=ARTOBZLaUoJzZ2pHBYRRyAbh4lsv8RvuNDSmi2t1ax0,9346
5
+ initium/LNN_controller/cfc_controller.py,sha256=lEUX0S4hU7o1Q45O6HTmk3VlFBym72ZIZ7Q9ClrNhWk,13480
6
+ initium/LNN_controller/chained_controller.py,sha256=Eh07-TxdzPgX-NDa19i5sBK5TMhw7CUf-P6t2QYAJg0,3621
7
+ initium/LNN_controller/hybrid_controller.py,sha256=48p1wIOykG7Wdh9Jh4zdFoG9IQREZcI6SaSVeP6Uz_Q,3668
8
+ initium/MoE/README.md,sha256=JCoF0kWBUraxvSF-JORleBsbp27EYHOsf09ELtid5Ss,306
9
+ initium/MoE/moe_layer.py,sha256=jJP8NDc0WDq9pwMpXFd48Q4ac9zJyjlgvOvTK-a1U3Q,25757
10
+ initium/config/controller_config.py,sha256=Q8z-mWqSaBGbm3MyioskX95T77B4AcBEL0hRRwtc9J4,3669
11
+ initium/config/train_config.py,sha256=h8U3P8jE95hxwksmJLr-EkXv0M5sUwpIBc5Dp8XNBoc,2870
12
+ initium/data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
+ initium/data/base_dataset.py,sha256=LqPQPRSM_ZbyssEvGjlld4TW46HldGqA048SKJxi_SM,3278
14
+ initium/data/dataset_registry.py,sha256=5bA48eNm5TC6RoK51vdYE7kMVm3TH5rX6fuhCOVhZlk,2687
15
+ initium/data/audio/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
+ initium/data/audio/audio_dataset.py,sha256=4wnGuFc3bkN49_WAcQiZxE_nGGQdY2jis4PFVFbHvGg,4141
17
+ initium/data/common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
18
+ initium/data/common/chain_task.py,sha256=__YtaJFY65_Y2HYqyDQI-AZxtWwb3fQrhctFrCkB07E,23532
19
+ initium/data/common/digit_codec.py,sha256=jFRkP7DUVOEz9USGh4hgodkjATW85Hcnizf6OVo8uv0,3067
20
+ initium/data/common/graph_io.py,sha256=63KbNyOF26LWs049ZdAUwoTwo-lU7ym5OKZ1D786Ysk,4972
21
+ initium/data/common/real_data.py,sha256=9Kld9kPfsVYhQTNP4ZTpMGFCHYs_UM2TI4oXdG-QGsU,33065
22
+ initium/data/graph_traversal/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
23
+ initium/data/graph_traversal/graph_traversal.py,sha256=Z_njRDPeuuT_QtNvmMuSasSJWXAJ9OXdhs7AUtbbajo,29897
24
+ initium/data/multimodal/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
25
+ initium/data/multimodal/multimodal_dataset.py,sha256=UVwpKHeZUGDGEJ8IDK4qKW4COYIRX041rqnr96n6tSI,16829
26
+ initium/data/text/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
27
+ initium/data/text/text_dataset.py,sha256=a-w1234N1eOGm9efNOxF65ZTi-THJMoXlIa9k4xsAvM,3372
28
+ initium/data/video/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
29
+ initium/data/video/video_dataset.py,sha256=EprUntYkJuY9URTsNf3gSXMNO9hqO7IY3R5OgFjXWVM,3523
30
+ initium/inference/__init__.py,sha256=J0YX8Uaq2ktnD3whEE85lS4QSl1IINHGjhmn3wDSke8,84
31
+ initium/inference/capabilities.py,sha256=3oCXNvGiBMDqyt8z4CqHr1osV0dl7ximi2323QQZXV8,3227
32
+ initium/inference/checkpoint_io.py,sha256=tbEV9SydQkmRSV5ZVYASGVpqj4avXhYEe13yrDanrD0,2605
33
+ initium/inference/engine.py,sha256=1rARwAW1YN0OmhQaXitEMgcddKpCI95A-IS1EZ59WLA,3365
34
+ initium/inference/inference_config.py,sha256=R81LGaynjA7byHoN7is3_ShLisKGIkRGt92Ja1irXOE,869
35
+ initium/inference/metrics.py,sha256=-VlilD57Vt0t9SRVKIT4hNRVotb4dEeiLk-ihE5Ym7s,3474
36
+ initium/inference/model_loader.py,sha256=_C3_B0U-GLvgy4drpDjJVwq-3EmfhSrul2jxUjSYq88,10058
37
+ initium/inference/run_inference.py,sha256=udXlHuK-ipseqdwRunYvewFbGgdaPQpbHMavWvHudok,20816
38
+ initium/inference/run_logging.py,sha256=MtuaGRjnOZmgNllPbU0VyQTUZ3qHn6Y7KiUcQnVdeVA,5889
39
+ initium/inference/cache/__init__.py,sha256=VNu0sYjmWR2q2zw2eJJwjuBW5Nxyyg0ln5uYZXl7j34,89
40
+ initium/inference/cache/base_cache.py,sha256=f0UO1noaBbkW_E1X-psXnwf99u_vV8kAupH7bJKBvuA,3633
41
+ initium/inference/cache/cache_config.py,sha256=6Wfppk4Mg2uoIPnPcoQILbSgtIN1LaPCP4y7d0F8jlE,834
42
+ initium/inference/cache/cache_registry.py,sha256=sv7kE3ZKET0ccdqSFSAO_6I-q2fLkZUMSk1lcDMizu8,3328
43
+ initium/inference/cache/cached_engine.py,sha256=8ye9U966xbfxhyI86Dn9MRHfhn2uxL-PJPniNUmpnwg,11342
44
+ initium/inference/cache/keys.py,sha256=Hb5kFyNDn-4OyJVANNTHjnR2yT-O2gY16-GV-hN2e2k,2444
45
+ initium/inference/cache/prefix_cache.py,sha256=xzBHVwFII-stz4DDfYOKQeNDERtlyt_wiZfJWjZSBTE,2526
46
+ initium/inference/cache/result_cache.py,sha256=Qdh9j5biz0trsRzzHvdIBeDuIY9fdMvJMgsQz9Ff0jc,2152
47
+ initium/inference/cache/state_utils.py,sha256=dbtU5xQ9B28JiVRJsQUSwv7mZxfyTBck-EtUExDdZes,2661
48
+ initium/inference/cache/stores.py,sha256=N9khCDJfdRe4Cv5bFcaYkKxwN2n3YXQhG3dpy0eU21g,4954
49
+ initium/inference/tasks/__init__.py,sha256=lTnmjF9a_sAl6OPwQc_eEzmP4J0nvWArndRaXIQpym8,63
50
+ initium/inference/tasks/audio_task.py,sha256=MKhlk_n4hnWeHPRvjxztCdKZ0SbHC_po7a2cYZbbVAA,4759
51
+ initium/inference/tasks/base_task.py,sha256=mVDgDfbsfW7zRzbGW37dypE7TD9pv8UD1a4kt3J2bqs,2274
52
+ initium/inference/tasks/graph_traversal_task.py,sha256=tZYFNhls03AxlAPLZ5XAjMXMZvUKgD2FSSXBrNBK8BI,9706
53
+ initium/inference/tasks/multimodal_task.py,sha256=DIl4dHvOwKU_ezMf4Yp6Y_vxujqIWSXTjODJIhfRkQk,3107
54
+ initium/inference/tasks/task_registry.py,sha256=SRn870HCMBv0NbBYipDQ4hjgrzXmhA8pjybIkRkkqbc,2251
55
+ initium/inference/tasks/text_task.py,sha256=ZdwOnMjl_IhnjHDme0nxdtFNOG0b5hRaK9qF-tY0Ntg,4745
56
+ initium/inference/tasks/video_task.py,sha256=uBbHpH8qEOkKb5_V_rzqg_m3d0XLhB3bl4ma04fa8Yw,4759
57
+ initium/mamba_controller/mamba2_controller.py,sha256=7oFL7oj3eatGV5Mowt8BOREBXwnQy7kVB02UdD8fnjE,19401
58
+ initium/mamba_controller/mamba3_controller.py,sha256=h76BUncvH0iquoct5ssgEY8DRL5UjdtD52VGQg7LuxE,8597
59
+ initium/mamba_controller/mamba_backbone_parallel.py,sha256=KaWWhLF-wAMXJxdk_OgMJwyWnVztccbJ05CmKCUkzZ4,12733
60
+ initium/mamba_controller/mamba_controller.py,sha256=XS5vM77UAM6NoJdA7-Oovnc6GYywePt5pmREBiwiMJ0,47063
61
+ initium/mamba_controller/split_graph_dnc.py,sha256=x9lJeu2MX34aSKfLbi-q_Hp0CgjbLhwwTnL2QQ9yPcg,31352
62
+ initium/memory_manipulation/dynamic_memory_resize.py,sha256=aJ96yQbGhCu8dKPpOjVYu5zdtJWFsgqoDweimXwqy5c,8445
63
+ initium/memory_manipulation/dynamic_n_controller.py,sha256=AmcaGBWR77prrsq_xjDiqI272JTFbaf-DCsvYB4oXuo,7510
64
+ initium/memory_manipulation/link_matrix_ablation.py,sha256=ot2T9JKYCaBBTirJRJHQa8H1-PHZKCeAgeayl4XxmBk,6884
65
+ initium/memory_manipulation/nvrtc_compat.py,sha256=VQ6Gpf1PgRMeOW2QHj7cl1ojFsLlFb_sy-CwG7xwqZc,6732
66
+ initium/memory_manipulation/stochastic_write_head_v2.py,sha256=wjMXNkhn3xrrMmPF-M_ivZb8a0mcU3yz7H2xm27M1Mo,26185
67
+ initium_deeplearning-0.1.0.dist-info/METADATA,sha256=1K1Kyu_cvEfxNcJlLtdIYFp48WUHbJNdO2S8K_o6lvE,22247
68
+ initium_deeplearning-0.1.0.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
69
+ initium_deeplearning-0.1.0.dist-info/entry_points.txt,sha256=upd8fKkrTScCaqfJSrFKgCwdDHUOSEO7EKUuB-RTC1k,113
70
+ initium_deeplearning-0.1.0.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
71
+ initium_deeplearning-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.32.4
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ initium-infer = initium.inference.run_inference:main
3
+ initium-setup = initium.setup_wheels:main