kiruluta commited on
Commit
4fd79a1
·
verified ·
1 Parent(s): 5ead333

Upload folder using huggingface_hub

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. COLLABORATORS.md +24 -0
  2. HF_README.md +48 -0
  3. HUGGINGFACE_UPLOAD.md +71 -0
  4. LICENSE +21 -0
  5. LONG_HORIZON_BENCHMARK.md +35 -0
  6. README.md +98 -0
  7. README_SOURCE.md +167 -0
  8. SHA256SUMS.txt +174 -0
  9. STABILITY_REFACTOR.md +27 -0
  10. V10_COUNTERFACTUAL_INTEGRITY.md +29 -0
  11. V11_CAUSAL_GAIN_CALIBRATION.md +14 -0
  12. V12_CAUSAL_RESPONSE_DECOMPOSITION.md +33 -0
  13. V13_AXIS_SYMMETRY_EQUIVARIANCE.md +19 -0
  14. V13_SMOKE_VALIDATION.md +7 -0
  15. V14_EXTERNAL_CONTROL_BENCHMARK.md +45 -0
  16. V15_1_BUGFIX.md +34 -0
  17. V15_EXTERNAL_DYNAMICS_DIAGNOSTIC.md +14 -0
  18. V4_MULTIMODAL_STABILITY.md +19 -0
  19. V5_HARD_DYNAMICS.md +13 -0
  20. V6_STRUCTURED_TRANSPORT.md +11 -0
  21. V7_COUNTERFACTUAL_TRAINING.md +13 -0
  22. V8_GENERALIZATION_AND_PLANNING.md +25 -0
  23. V8_SMOKE_VALIDATION.md +9 -0
  24. V9_CAUSAL_GENERALIZATION.md +21 -0
  25. configs/prototype.json +1 -0
  26. data/generate_benchmark.py +7 -0
  27. data/hard_controlled_dynamics_v6.npz +3 -0
  28. data/hard_controlled_dynamics_v6_rollout_h6.npz +3 -0
  29. data/mini_moving_shapes.npz +3 -0
  30. data/mini_moving_shapes_rollout_h11.npz +3 -0
  31. data/mini_moving_shapes_rollout_h31.npz +3 -0
  32. data/v9_extrapolation_h6.npz +3 -0
  33. data/v9_interpolation_h6.npz +3 -0
  34. data/v9_structural_ood_h6.npz +3 -0
  35. data/v9_train_family.npz +3 -0
  36. docs/HF_RELEASE_STEPS.md +14 -0
  37. docs/REPRODUCIBILITY_RELEASE.md +36 -0
  38. hf/configuration_swm.py +10 -0
  39. pyproject.toml +24 -0
  40. requirements.txt +4 -0
  41. results/README.md +19 -0
  42. results/dreamer.pt +3 -0
  43. results/dreamer_history.csv +4 -0
  44. results/dreamer_metrics.json +61 -0
  45. results/koopman.pt +3 -0
  46. results/koopman_history.csv +4 -0
  47. results/koopman_metrics.json +61 -0
  48. results/metrics.csv +10 -0
  49. results/metrics.json +543 -0
  50. results/neural_operator.pt +3 -0
COLLABORATORS.md ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Collaborator Roadmap
2
+
3
+ This repository is the small, runnable reference implementation for the Spectral World Models (SWM) research program.
4
+
5
+ ## What is implemented now
6
+
7
+ The prototype follows the manuscript's concrete architecture: a 2-level Haar image representation, a DCT-style spectral text representation, multimodal fusion, an action-conditioned low-rank spectral transition, image/text decoders, and recursive latent rollouts. The bundled Mini Moving Shapes benchmark exercises image + symbolic-text + action next-state prediction.
8
+
9
+ ## What we want collaborators to test
10
+
11
+ 1. **Replication first.** Re-run the included benchmark across multiple seeds and report confidence intervals rather than optimizing against the test set.
12
+ 2. **Harder visual dynamics.** Replace Mini Moving Shapes with larger physical/video/control benchmarks while retaining matched baselines.
13
+ 3. **Multimodal grounding.** Test whether language actually changes future-state predictions in instruction-conditioned environments.
14
+ 4. **Long-horizon imagination.** Measure error-vs-horizon, latent norm growth, planning return, and rollout throughput.
15
+ 5. **Scale and systems.** Optimize sparse/low-rank operator kernels on A100/H100/H200/B200-class GPUs and multi-GPU systems.
16
+ 6. **Ablations and controls.** Preserve Dreamer/PlaNet-style, transformer, Koopman, and neural-operator controls, plus spectral-state/transition/text/stability ablations.
17
+
18
+ ## Evidence standard
19
+
20
+ The manuscript explicitly states that its results tables are illustrative placeholders until real experiments are run. Do not copy those placeholder values into claims. The `results/` directory in this repo contains measured *quick smoke-benchmark* values only. Treat them as engineering validation, not paper-grade evidence.
21
+
22
+ ## Contributions
23
+
24
+ Open an issue/discussion with hardware, software versions, dataset, exact command/config, seeds, wall time, peak memory, and result files. Pull requests for reproducibility, GPU kernels, distributed training, stronger baselines, datasets, and HF integration are welcome.
HF_README.md ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ library_name: pytorch
4
+ tags:
5
+ - world-models
6
+ - spectral-learning
7
+ - operator-learning
8
+ - multimodal
9
+ - wavelets
10
+ - pytorch
11
+ - research
12
+ ---
13
+
14
+ # Spectral World Models — small runnable prototype
15
+
16
+ This is a collaborator-oriented Hugging Face prototype of **Spectral World Models: Multimodal Operator Learning in Hilbert Space for Imagination-Based Planning** by Andrew J. Kiruluta.
17
+
18
+ The implementation is grounded in the accompanying manuscript and source repository. It uses a fixed 2-level Haar image encoder, DCT-style spectral text encoder, low-rank multimodal fusion, an action-conditioned low-rank spectral transition operator, modality decoders, and recursive imagination rollouts.
19
+
20
+ ## First benchmark
21
+
22
+ The included **Mini Moving Shapes** dataset is a deliberately small multimodal smoke benchmark: 32×32 grayscale moving shapes, symbolic text descriptions, and five discrete actions. The repository compares SWM with Dreamer-style, transformer, Koopman, and neural-operator baselines and includes architecture ablations.
23
+
24
+ The checked-in results are actual quick CPU measurements from the source repository, not the hypothetical tables in the manuscript. They are intended to validate the pipeline, not establish superiority.
25
+
26
+ | Method | Params | Test PSNR ↑ | Test SSIM ↑ | Test NLL ↓ | Rollout MSE@5 ↓ |
27
+ |---|---:|---:|---:|---:|---:|
28
+ | Dreamer-style | 497,682 | 14.571 | 0.072 | 0.0107 | 0.03490 |
29
+ | Transformer | 503,322 | 14.368 | 0.017 | 0.0687 | 0.03657 |
30
+ | Koopman | 465,306 | 14.619 | 0.090 | -0.0027 | 0.03487 |
31
+ | Neural operator | 403,794 | 14.534 | 0.058 | 0.0210 | 0.03511 |
32
+ | SWM | 405,422 | 14.591 | 0.080 | 0.0050 | 0.03577 |
33
+
34
+ These smoke results are mixed: SWM is competitive on some one-step metrics, while Koopman has lower rollout MSE@5 in this short run. That is precisely why larger multi-seed experiments are needed.
35
+
36
+ ## Run
37
+
38
+ `python -m venv .venv`
39
+
40
+ `source .venv/bin/activate`
41
+
42
+ `pip install -e .`
43
+
44
+ `PYTHONPATH=. python scripts/run_quick_benchmark.py`
45
+
46
+ Tests: `PYTHONPATH=. python -m pytest -q`
47
+
48
+ See `COLLABORATORS.md` for the GPU scaling and experimental roadmap.
HUGGINGFACE_UPLOAD.md ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Upload V14 to Hugging Face
2
+
3
+ Suggested model/research repository: `kiruluta/Spectral-World-Models-External-Control`
4
+
5
+ ## 1. Unpack and enter the repository
6
+
7
+ `unzip Spectral-World-Models-HF-v14.zip`
8
+
9
+ `cd Spectral-World-Models-HF-v14`
10
+
11
+ ## 2. Create an environment
12
+
13
+ `conda create -n swm-v14 python=3.11 -y`
14
+
15
+ `conda activate swm-v14`
16
+
17
+ `pip install -e '.[external]'`
18
+
19
+ ## 3. Validate before publishing
20
+
21
+ `PYTHONPATH=. pytest -q`
22
+
23
+ Optional external smoke run:
24
+
25
+ `PYTHONPATH=. python scripts/run_v14_external_benchmark.py --envs CartPole-v1 --models swm_structured_cf_v9 no_spectral_transition --seeds 0 --horizons 5 10 --epochs 1 --train-episodes 16 --val-episodes 4 --test-episodes 4 --device cpu --out results/v14_smoke`
26
+
27
+ ## 4. Run the benchmark on DGX Spark
28
+
29
+ `PYTHONPATH=. python scripts/run_v14_external_benchmark.py --seeds 0 1 2 3 4 5 6 7 8 9 --epochs 5 --device cuda`
30
+
31
+ Review `results/v14_external_control/metrics_summary.csv` before publishing benchmark claims.
32
+
33
+ ## 5. Install and authenticate the Hugging Face CLI
34
+
35
+ `pip install -U huggingface_hub`
36
+
37
+ `hf auth login`
38
+
39
+ Use a Hugging Face access token with write permission. Do not put the token in the repository.
40
+
41
+ ## 6. Create the Hub repository
42
+
43
+ `hf repos create kiruluta/Spectral-World-Models-External-Control`
44
+
45
+ The Hub creates model repositories by default. This project is a research/model repository rather than a Space.
46
+
47
+ ## 7. Upload the complete repository
48
+
49
+ From the directory containing `Spectral-World-Models-HF-v14/`:
50
+
51
+ `hf upload kiruluta/Spectral-World-Models-External-Control ./Spectral-World-Models-HF-v14 . --exclude '.pytest_cache/**' --exclude '**/__pycache__/**'`
52
+
53
+ The current `hf upload` path handles large files through the Hub upload stack. Re-run the same command if an upload is interrupted.
54
+
55
+ ## 8. Verify the Hub page
56
+
57
+ Confirm that the root contains `README.md`, `V14_EXTERNAL_CONTROL_BENCHMARK.md`, `pyproject.toml`, `spectral_world_models/`, `scripts/`, and `tests/`. Check that no access token, local cache, or private data was uploaded.
58
+
59
+ ## 9. Add trained V14 checkpoints after the full run
60
+
61
+ After inspecting the ten-seed results, upload the generated checkpoint and metric directories:
62
+
63
+ `hf upload kiruluta/Spectral-World-Models-External-Control ./results/v14_external_control results/v14_external_control`
64
+
65
+ If you want checkpoints in the same repository:
66
+
67
+ `hf upload kiruluta/Spectral-World-Models-External-Control ./results/v14_external_control/checkpoints checkpoints`
68
+
69
+ ## 10. Tag the milestone
70
+
71
+ For a reproducible release, clone the Hub repo with Git, create a `v14.0` tag, and push the tag, or record the Hub commit hash in the manuscript. Do not update paper numbers from an unversioned moving `main` branch.
LICENSE ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Andrew J. Kiruluta
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
LONG_HORIZON_BENCHMARK.md ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Long-Horizon Multi-Seed Benchmark
2
+
3
+ This repository is the integrated SWM prototype with multi-seed and long-horizon evaluation support.
4
+
5
+ ## Recommended DGX Spark run
6
+
7
+ Install the project first:
8
+
9
+ pip install -e .
10
+
11
+ Run the five-seed benchmark on CUDA:
12
+
13
+ PYTHONPATH=. python scripts/run_quick_benchmark.py --seeds 0 1 2 3 4 --horizons 5 10 20 30 --device cuda
14
+
15
+ The runner keeps the original short-sequence training/validation/test benchmark unchanged. For rollout horizons longer than the original sequence length, it creates a separate held-out synthetic rollout dataset with enough time steps for the largest requested horizon.
16
+
17
+ Primary aggregate output:
18
+
19
+ results/multiseed_horizons/metrics_summary.csv
20
+
21
+ Per-seed output:
22
+
23
+ results/multiseed_horizons/metrics_by_seed.csv
24
+
25
+ Run metadata:
26
+
27
+ results/multiseed_horizons/run_config.json
28
+
29
+ ## Fairness
30
+
31
+ For a given seed, every model receives the same seed. The long-horizon rollout dataset is held out from training. This is still a compact synthetic benchmark and should be treated as prototype evidence, not a paper-grade claim of superiority.
32
+
33
+ ## Quick smoke test
34
+
35
+ PYTHONPATH=. python scripts/run_quick_benchmark.py --seeds 0 --horizons 5 10 --models swm koopman --epochs 1 --device auto
README.md ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # V13: Axis Symmetry & Intervention Equivariance Audit
2
+
3
+ ## V15.1 bug-fix release
4
+
5
+ V15.1 replaces V15 after correcting the external state-token diagnostic. The original runner called the flat `text_decoder` layer directly; V15.1 uses the canonical `decode_text()` API and validates `[B,L,V]` logits against `[B,L]` discretized Gym-state token targets. No model architecture, checkpoint, dataset, training recipe, or scientific protocol changed. See `V15_1_BUGFIX.md`.
6
+
7
+
8
+ V13 freezes the V9 learning recipe and diagnoses the V12 vertical-action collapse with exact rotations/reflections/x-y swaps plus deliberately constructed collision episodes. See `V13_AXIS_SYMMETRY_EQUIVARIANCE.md`.
9
+
10
+ Main run: `PYTHONPATH=. python scripts/run_v13_axis_audit.py --seeds 0 1 2 3 4 5 6 7 8 9 --pairs 64 --horizon 30 --device cuda`
11
+
12
+ ---
13
+
14
+ # V12: Causal Response Decomposition
15
+
16
+ V12 freezes the V9 learning recipe and decomposes causal-response behavior by action program, horizon, effect size, initial speed, boundary contact, occlusion-zone exposure, and physics regime. It adds paired episode-clustered bootstrap confidence intervals against neural-operator and no-spectral-transition controls. See `V12_CAUSAL_RESPONSE_DECOMPOSITION.md`.
17
+
18
+ Main run: `PYTHONPATH=. python scripts/run_v12_decomposition.py --seeds 0 1 2 3 4 5 6 7 8 9 --cf-horizon 30 --cf-pairs 64 --bootstrap 2000 --device cuda`
19
+
20
+ ---
21
+
22
+ ---
23
+
24
+ ## V9: causal generalization across physics regimes
25
+
26
+ V9 freezes the structured spectral transport mechanism and targets the failure exposed by V8: excellent in-distribution counterfactual alignment did not extrapolate to changed physics. V9 trains on a family of dynamics regimes and adds trajectory-level counterfactual supervision, then evaluates interpolation, parameter extrapolation, and structural OOD shifts separately. See `V9_CAUSAL_GENERALIZATION.md`.
27
+
28
+ Run: `PYTHONPATH=. python scripts/run_v9_benchmark.py --seeds 0 1 2 3 4 --horizons 5 10 20 30 50 100 --cf-horizon 30 --planning-horizon 20 --planning-episodes 64 --device cuda`
29
+
30
+ license: mit
31
+ library_name: pytorch
32
+ tags:
33
+ - world-models
34
+ - spectral-learning
35
+ - operator-learning
36
+ - multimodal
37
+ - wavelets
38
+ - pytorch
39
+ - research
40
+ ---
41
+
42
+ # Spectral World Models — V7
43
+
44
+ V7 is the counterfactual-action training revision of the runnable Spectral World Models research prototype.
45
+
46
+ ## Why V7
47
+
48
+ V6 showed that structured transport can preserve long-horizon latent state, but the model substantially under-reacted to interventions. V7 keeps the V6 structured transition and adds a paired counterfactual objective so action response is learned explicitly rather than expected to emerge from reconstruction loss alone.
49
+
50
+ The new `swm_structured_cf` model uses the same architecture as `swm_structured`; only the training objective changes. For the same starting state it rolls out opposing left/right interventions and optimizes: action-effect direction alignment, action-effect magnitude calibration, and endpoint reconstruction. Defaults are intentionally modest so the auxiliary objective does not overwhelm next-state learning.
51
+
52
+ ## Main experiment
53
+
54
+ Install with `pip install -e .` and run:
55
+
56
+ `PYTHONPATH=. python scripts/run_v7_benchmark.py --seeds 0 1 2 3 4 --horizons 5 10 20 30 50 100 --cf-horizon 30 --device cuda`
57
+
58
+ Results are written to `results/v7_counterfactual_training/metrics_summary.csv` and `metrics_by_seed.csv`.
59
+
60
+ The primary comparison is `swm_structured_cf` versus unchanged `swm_structured`, `swm_selective`, `no_spectral_transition`, and `neural_operator`. Inspect counterfactual direction cosine and magnitude ratio together with H100 image MSE, text accuracy, and latent cosine. Do not select a model from a single scalar metric.
61
+
62
+ ## Tunable V7 objective
63
+
64
+ The runner exposes `--cf-train-horizon`, `--cf-pairs`, `--cf-every`, `--lambda-cf-dir`, `--lambda-cf-mag`, and `--lambda-cf-branch`. Defaults are 8, 64, 4, 0.02, 0.005, and 0.10 respectively. Hyperparameters should be selected using training/validation evidence, not the held-out test set.
65
+
66
+ ## Validation
67
+
68
+ Run `PYTHONPATH=. python -m pytest -q`. The V7 suite includes the earlier architecture/stability tests plus a backward-pass test for the new counterfactual objective.
69
+
70
+ See `V7_COUNTERFACTUAL_TRAINING.md` for the experiment rationale. Earlier stages are documented in `V4_MULTIMODAL_STABILITY.md`, `V5_HARD_DYNAMICS.md`, and `V6_STRUCTURED_TRANSPORT.md`.
71
+
72
+ ## V8: frozen-architecture generalization and planning
73
+
74
+ V8 freezes the V7 architectures and evaluates OOD dynamics, unseen intervention conditions, and imagination-based planning. See `V8_GENERALIZATION_AND_PLANNING.md`.
75
+
76
+ Run: `PYTHONPATH=. python scripts/run_v8_benchmark.py --seeds 0 1 2 3 4 --horizons 5 10 20 30 50 100 --cf-horizon 30 --planning-horizon 20 --planning-episodes 96 --device cuda`
77
+
78
+ ## V10 — counterfactual benchmark integrity
79
+
80
+ V10 freezes the learned architectures and audits the causal benchmark itself. See `V10_COUNTERFACTUAL_INTEGRITY.md`.
81
+
82
+ Run: `PYTHONPATH=. python scripts/run_v10_audit.py --seeds 0 1 2 3 4 --cf-horizon 30 --cf-pairs 48 --device cuda`
83
+
84
+ ## V11: causal gain calibration
85
+ V11 freezes the V9 structured transport architecture and replaces endpoint-oriented causal magnitude fitting with scale-aware trajectory-effect calibration. It reports direction, gain error, magnitude correlation, and calibration slope/intercept across interpolation, extrapolation, and structural OOD. See `V11_CAUSAL_GAIN_CALIBRATION.md`.
86
+
87
+ ## V14: external control benchmark
88
+
89
+ V14 freezes the V9 architecture family and moves evaluation outside the project's synthetic simulator. The external suite uses Gymnasium Classic Control (`CartPole-v1`, `MountainCar-v0`, `Acrobot-v1`) with official RGB rendering converted to the model's 32×32 grayscale input. Models are trained from scratch per environment; architecture and comparison logic are frozen. See `V14_EXTERNAL_CONTROL_BENCHMARK.md`.
90
+
91
+ ## V15 — External Dynamics Diagnostic
92
+ V15 is intentionally the **final diagnostic milestone**, not another model revision. It reloads the frozen V14 checkpoints and tests whether V14's negative full-frame MSE result reflects genuine dynamics failure or static-background metric confounding. See `V15_EXTERNAL_DYNAMICS_DIAGNOSTIC.md`.
93
+
94
+ ---
95
+
96
+ ## Final reproducibility release (V6–V15.1)
97
+
98
+ This tree is the frozen final reproducibility artifact for the SWM falsification program. See `docs/REPRODUCIBILITY_RELEASE.md` for the experimental history and interpretation, and `results/` for the measured V12–V15.1 audit CSVs included with this release. The project intentionally stops architecture iteration at V15.1.
README_SOURCE.md ADDED
@@ -0,0 +1,167 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Spectral World Models
2
+
3
+ ### Andrew Kiruluta, UC Berkeley, June 2026
4
+
5
+ This repository is a compact PyTorch implementation of the manuscript architecture **Spectral World Models: Multimodal Operator Learning in Hilbert Space for Imagination-Based Planning**.
6
+
7
+ It implements a concrete Spectral World Model (SWM) rather than a broad design space:
8
+
9
+ - fixed 2-level Haar wavelet image encoder and inverse spectral decoder,
10
+ - DCT-style spectral text encoder over token-position embeddings,
11
+ - low-rank multimodal fusion into a shared latent Hilbert-style state,
12
+ - action-conditioned low-rank spectral transition operator,
13
+ - predictive, reconstruction, latent consistency, text, and stability losses,
14
+ - imagination rollout evaluation,
15
+ - benchmark baselines and ablations.
16
+
17
+ The bundled benchmark is **Mini Moving Shapes**, a generated multimodal next-state prediction dataset. Each sequence contains a moving square or circle, a symbolic text description, and discrete action controls. The task is to predict the next image/text state and maintain stable multi-step rollouts.
18
+
19
+ Core idea:
20
+ Fuse image and text modalities into a shared spectral latent and use low-rank spectral (or baseline) transition operators to predict next-frame images and text, enabling short rollouts for imagination-based evaluation.
21
+
22
+ Key components
23
+ Models:
24
+ - models.py — wavelet/DCT/FFT/conv encoders, decoders, and transition modules (low-rank spectral, Koopman, MLP, transformer) plus build_model.
25
+ - Data: data.py — Mini Moving Shapes synthetic generator and TransitionDataset / SequenceDataset.
26
+ - Training: train.py — training loop, validation/test evaluation, rollout evaluation, checkpointing, and metric export.
27
+ - Metrics: metrics.py — MSE, PSNR, SSIM, Gaussian NLL, token accuracy, parameter counting.
28
+ - Utilities: haar.py — dependency-free 2D Haar wavelet transform.
29
+
30
+ ## Repository layout
31
+
32
+ ```text
33
+ spectral-world-models/
34
+ ├── data/
35
+ │ ├── generate_benchmark.py
36
+ │ └── mini_moving_shapes.npz
37
+ ├── spectral_world_models/
38
+ │ ├── data.py
39
+ │ ├── haar.py
40
+ │ ├── metrics.py
41
+ │ ├── models.py
42
+ │ └── train.py
43
+ ├── scripts/
44
+ │ └── run_quick_benchmark.py
45
+ ├── results/
46
+ │ ├── README.md
47
+ │ ├── metrics.csv
48
+ │ ├── metrics.json
49
+ │ └── *_metrics.json / *_history.csv / *.pt
50
+ ├── tests/
51
+ │ └── test_smoke.py
52
+ ├── pyproject.toml
53
+ └── requirements.txt
54
+ ```
55
+
56
+ ## Installation
57
+
58
+ ```bash
59
+ python -m venv .venv
60
+ source .venv/bin/activate
61
+ pip install -e .
62
+ ```
63
+
64
+ Or, without editable installation:
65
+
66
+ ```bash
67
+ pip install -r requirements.txt
68
+ export PYTHONPATH=$PWD
69
+ ```
70
+
71
+ ## Generate the benchmark dataset
72
+
73
+ The dataset is already included at `data/mini_moving_shapes.npz`. To regenerate it:
74
+
75
+ ```bash
76
+ PYTHONPATH=. python data/generate_benchmark.py
77
+ ```
78
+
79
+ Default split sizes:
80
+
81
+ - train: 256 sequences
82
+ - validation: 64 sequences
83
+ - test: 64 sequences
84
+ - sequence length: 8
85
+ - image size: 32x32 grayscale
86
+ - actions: stay, up, down, left, right
87
+
88
+ ## Run the full quick benchmark
89
+
90
+ ```bash
91
+ PYTHONPATH=. python scripts/run_quick_benchmark.py
92
+ ```
93
+
94
+ This trains and evaluates:
95
+
96
+ 1. Dreamer-style latent baseline
97
+ 2. Transformer latent predictor baseline
98
+ 3. Koopman baseline
99
+ 4. Neural-operator / Fourier-feature baseline
100
+ 5. Spectral World Model (ours)
101
+ 6. SWM ablations:
102
+ - no spectral state
103
+ - no spectral transition
104
+ - no text branch
105
+ - no stability penalty
106
+
107
+ ## Train selected models
108
+
109
+ ```bash
110
+ PYTHONPATH=. python -m spectral_world_models.train \
111
+ --data data/mini_moving_shapes.npz \
112
+ --out results \
113
+ --epochs 3 \
114
+ --batch-size 64 \
115
+ --models swm dreamer transformer koopman neural_operator
116
+ ```
117
+
118
+ ## Metrics
119
+
120
+ The repo reports:
121
+
122
+ - training loss per epoch,
123
+ - validation loss, PSNR, SSIM, NLL, text accuracy,
124
+ - test loss, PSNR, SSIM, NLL, text accuracy,
125
+ - rollout MSE over horizon 5,
126
+ - average rollout step time.
127
+
128
+ The included `results/` folder contains actual quick CPU benchmark metrics generated in the sandbox. These are meant as reproducibility smoke-test metrics, not final paper-grade multi-seed values.
129
+
130
+ ### Main quick benchmark results
131
+
132
+ | Method | Params | Test PSNR ↑ | Test SSIM ↑ | Test NLL ↓ | Rollout MSE@5 ↓ | Time/step ms ↓ |
133
+ |---|---:|---:|---:|---:|---:|---:|
134
+ | Dreamer-style latent model | 497,682 | 14.571 | 0.072 | 0.0107 | 0.03490 | 0.0528 |
135
+ | Transformer latent predictor | 503,322 | 14.368 | 0.017 | 0.0687 | 0.03657 | 0.0290 |
136
+ | Koopman baseline | 465,306 | 14.619 | 0.090 | -0.0027 | 0.03487 | 0.0170 |
137
+ | Neural-operator baseline | 403,794 | 14.534 | 0.058 | 0.0210 | 0.03511 | 0.0194 |
138
+ | Spectral World Model (ours) | 405,422 | 14.591 | 0.080 | 0.0050 | 0.03577 | 0.0343 |
139
+
140
+ ### Ablation quick benchmark results
141
+
142
+ | Variant | Params | Test PSNR ↑ | Test NLL ↓ | Rollout MSE@5 ↓ | Time/step ms ↓ |
143
+ |---|---:|---:|---:|---:|---:|
144
+ | Spectral World Model (ours) | 405,422 | 14.591 | 0.0050 | 0.03577 | 0.0343 |
145
+ | No spectral state | 497,682 | 14.567 | 0.0117 | 0.03492 | 0.0184 |
146
+ | No spectral transition | 446,802 | 14.562 | 0.0131 | 0.03505 | 0.0318 |
147
+ | No text branch | 402,350 | 14.729 | -0.0325 | 0.03508 | 0.0302 |
148
+ | No stability penalty | 405,422 | 14.433 | 0.0498 | 0.03609 | 0.0294 |
149
+
150
+ ## Important interpretation note
151
+
152
+ The quick benchmark is deliberately small so the repository can be run on CPU. It verifies that the architecture, baselines, ablations, dataset, training loop, validation loop, test loop, and rollout metrics are implemented end-to-end. It is not intended as a final NeurIPS-grade empirical study. For paper-quality claims, rerun with larger sequence sets, longer training, multiple seeds, and a harder image/control benchmark.
153
+
154
+ ## Test
155
+
156
+ ```bash
157
+ PYTHONPATH=. python -m pytest -q
158
+ ```
159
+
160
+ Expected result:
161
+
162
+ ```text
163
+ 1 passed
164
+ ```
165
+ This repo is based on the following citation. Please cite this reference when using this repo in your work:
166
+
167
+ <https://www.researchgate.net/publication/404985395_Spectral_World_Models_Multimodal_Operator_Learning_in_Hilbert_Space_for_Imagination-Based_Planning>
SHA256SUMS.txt ADDED
@@ -0,0 +1,174 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 3ed731b65d06150c138e2dadb0be0697550888a6b47eb8c45ecc9adba8b8e9bd ./.pytest_cache/.gitignore
2
+ 37dc88ef9a0abeddbe81053a6dd8fdfb13afb613045ea1eb4a5c815a74a3bde4 ./.pytest_cache/CACHEDIR.TAG
3
+ 73fd6fccdd802c419a6b2d983d6c3173b7da97558ac4b589edec2dfe443db9ad ./.pytest_cache/README.md
4
+ 44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a ./.pytest_cache/v/cache/lastfailed
5
+ b01b056f0602ebcafba839b5c7e8823af7636e5f0d586da920ca01d6b6d31c33 ./.pytest_cache/v/cache/nodeids
6
+ bf571929e8e8c20597c605c7d4a982e6d612a60cbf0cd2b70fc0cde0002ce279 ./COLLABORATORS.md
7
+ a3caa209da0594667ce389291a99fe89ab202ba7e57b46819862b55730be0b7e ./HF_README.md
8
+ 63510bf8419fa733ec1d56692c3d1edc9191320b446e73a893d9549574171e35 ./HUGGINGFACE_UPLOAD.md
9
+ a08f3530b8ae26ac3b4bd0dd3aba206bab940e978c3dcaf7b3a5681cf352c8bd ./LICENSE
10
+ 29512728279597fdc3661f9cd033574ccc96756dc1bbf9f20cd29f0ab348c1fd ./LONG_HORIZON_BENCHMARK.md
11
+ 9796e532c7cc33964600a6c4ff0fc59470c1e0f382f873e87737e126e0319f86 ./README.md
12
+ 83e1be70172dbb9df5868f199813e8855022d46815a2d7a565dbf70139be2147 ./README_SOURCE.md
13
+ 33b0723122c453f978502192ac0b81bb11f9beee7b694678b1756776c0aad647 ./SHA256SUMS.txt
14
+ 9801b3c771837f52c7bc6ec7b305b025cff397fc2e408e35db25da54e8eedb69 ./STABILITY_REFACTOR.md
15
+ 2ce36a27a5d90882897199044e15f5b44387a639d061483d08601a77d46b03f6 ./V10_COUNTERFACTUAL_INTEGRITY.md
16
+ 0191c5e5589884aaabdeaf2a50d353b170257b1994bfccd0cc8e632a12d1bea7 ./V11_CAUSAL_GAIN_CALIBRATION.md
17
+ ea626169ecba36a1a83f686ccca6f08d53c4bc95bcc0e36749456577fdb1b811 ./V12_CAUSAL_RESPONSE_DECOMPOSITION.md
18
+ ad6b59f95d4d8f2c0db18b4e4400390befac13d7ca1c670cdd233a42ba8c1890 ./V13_AXIS_SYMMETRY_EQUIVARIANCE.md
19
+ bedc9f71a8ec8f190e05b6b9e0cd6179921365ac9d43a0ed6bdf4ed23eee68cc ./V13_SMOKE_VALIDATION.md
20
+ fb6d5a3a3f01ca1337b4dcfa567dd835cf05cc5005feba751089317fb6f6119e ./V14_EXTERNAL_CONTROL_BENCHMARK.md
21
+ 16c5a849801d2514bf3447d2d1446cd8caebe54009282137550286b2ad177b09 ./V15_1_BUGFIX.md
22
+ f84953431287830f30bf695634143bd83be939e5ce9a1dfdfb5a0471958c3474 ./V15_EXTERNAL_DYNAMICS_DIAGNOSTIC.md
23
+ 8b9b326921aa8ba82488ed8723467f08836e36b70a1ddedbe28ce92d4bc92a84 ./V4_MULTIMODAL_STABILITY.md
24
+ ac3e7e9b93f0576297a89b7d864db4a62362f2d74cf182ee0f572b642fb9d047 ./V5_HARD_DYNAMICS.md
25
+ 724d8aabaf1f7e2273d13ee6642e1c7151449ce51ce5b3a4065cde03b1c1e7f2 ./V6_STRUCTURED_TRANSPORT.md
26
+ 2883f7995d57b6f2f3ee353c7b36253c5bdabfd68feb17ac84c6909208e291d9 ./V7_COUNTERFACTUAL_TRAINING.md
27
+ e20a30f8238e336e6e3c18e54631104c1d3a1aa5196d6c932171a5c7425f1ae0 ./V8_GENERALIZATION_AND_PLANNING.md
28
+ 4517cd17b2fecb9830ca58cb290ebb2a77e1ac910601180106d7467118f48739 ./V8_SMOKE_VALIDATION.md
29
+ cf111fe065bc41b2b56bfdd289432a4ae1d2ead8e54a7fd821c7612967db8805 ./V9_CAUSAL_GENERALIZATION.md
30
+ 24ec48221c3469fabbf2cb0c130af1cd755644a0e161b98d5595bfecc3cde9ff ./configs/prototype.json
31
+ 02e24aa69ebd0c13cb675faf51cb0c8a437d5bd04150e431704e3c66012b2534 ./data/generate_benchmark.py
32
+ 3688d9b074059a297d2f9163a93b8a07a5aaeaf5a94f5e7b7792421350acbd71 ./data/hard_controlled_dynamics_v6.npz
33
+ 15b91073dfd882b528416bb1fb53d08c53eeaae201fbd468ac9f1bce041b73b4 ./data/hard_controlled_dynamics_v6_rollout_h6.npz
34
+ e3dea41e2fd4303760e7abb526f4404434cfca74093d45df235a27f7828cc190 ./data/mini_moving_shapes.npz
35
+ 4593ad92dab9ff7ffc6250d368a7b6eb68ab1d09c3bae749209f6dbc4cbcf491 ./data/mini_moving_shapes_rollout_h11.npz
36
+ 4593ad92dab9ff7ffc6250d368a7b6eb68ab1d09c3bae749209f6dbc4cbcf491 ./data/mini_moving_shapes_rollout_h31.npz
37
+ 7dcc2e791d591c7810dc2295779e816e3b4cf38e8554397c33a4949538860143 ./data/v9_extrapolation_h6.npz
38
+ 0aab7d41b0596bd72a24100710f6f7aafe8a94289ed33a6bd921fcbcee0c97be ./data/v9_interpolation_h6.npz
39
+ 288cd80b247bb1396897579bd2b86363c1936d60e904431a22eee9a0642c42c6 ./data/v9_structural_ood_h6.npz
40
+ d26d2a2c08b9c84f7613e31099b6274e29a326f58f7dadb50b3ce4dc5d9d1181 ./data/v9_train_family.npz
41
+ 2cb323a3a4adb7970631b5bd300d28d3dcdc9a813b2c75202f436beae63295b6 ./docs/HF_RELEASE_STEPS.md
42
+ 9132263a8b224d800e22df68e6670a80f0aa3e18b3f4b2fcb01ae312904f546c ./docs/REPRODUCIBILITY_RELEASE.md
43
+ 5538a4705bbe9dbcbe5662d5055769f26589735d216e28431a9505afd71bb737 ./hf/configuration_swm.py
44
+ 7c8e0e9a56b2cae193e53955c1b3c696ae79bc27a6fd197961f8a8db69700ecd ./pyproject.toml
45
+ c24a1f9491090ed37fd2382de19d5b82dd2afd5dc94fbd0cd33687422d93eac5 ./requirements.txt
46
+ 8affbf4f9c7e1a74747e71075f7ae1ec96cc639c761c70b9591110e732030a34 ./results/README.md
47
+ 7754579118d0a89cfb2781b7e97f5b2c4f02dc950cc6269339ec7daefcd04ecc ./results/dreamer.pt
48
+ 8fcc90ed9a6230ce17bdaccaacc7beda5c3e6cadd46f6cf6138e9a4d532009e9 ./results/dreamer_history.csv
49
+ aa1e9cbf5da301d04ec319b94cd6268646683deb979ada0c1f94d9dfe6b711c1 ./results/dreamer_metrics.json
50
+ a24d327994545a03f46d9f9db6b7fe6ea29b1bf407bcaac76bcb88f897377a23 ./results/koopman.pt
51
+ cdcf7c3980af6372de63ae908f96cc88f8e3dd5de2f07e5703048053bcfcf087 ./results/koopman_history.csv
52
+ 7ce64e628468149203e217b49d5e9d5b59fb032d8631a3400afe67142e497a4e ./results/koopman_metrics.json
53
+ c296bf1f9a61fc48ce6c1ead8e2e511eff8a0e956e1d94c553d80949016ddf76 ./results/metrics.csv
54
+ 1b2ef28d4d169ec60993a01865600dfc139a76bbb50e334b836851ccf5471aef ./results/metrics.json
55
+ d2b7aea7c1936d2e3bcda86bf27e6148bd96889448259f009ba20daae42abeb7 ./results/neural_operator.pt
56
+ 52852d61012de0ce6dc2c950b85893f1630a369542593043c75d9006838f1748 ./results/neural_operator_history.csv
57
+ 23859f5efea3a990cc4a99a014b77616d63025e5161a82a87e9066709b02874b ./results/neural_operator_metrics.json
58
+ 610d0e774236353811f1958c2ae12008ee102d32c2ccd1e74531f6a5acb2dede ./results/no_spectral_state.pt
59
+ e968e0acd2f85163cf96fc80b9cc032999656701bb29ece1a5458efd2f4a868b ./results/no_spectral_state_history.csv
60
+ ca896a44c825acf931cc7ed42f0789f61ff071f8050d3ab2173f8235750a7520 ./results/no_spectral_state_metrics.json
61
+ 9cf788c11ec1cc7d72a39fb8237ce49be12da3aa7fc195ccb301afca5beca0e8 ./results/no_spectral_transition.pt
62
+ 29aab44eee560594f44571f93822b7cb80ab81a003bdd9a3d10005d882e99740 ./results/no_spectral_transition_history.csv
63
+ d06ee5e855eef67f64459fd164ba2d1d14e4cedfdaa91573067d5f187e24b79c ./results/no_spectral_transition_metrics.json
64
+ c35225bb09b697aedad2dd26b20f57f2ed42619cad1ae2f32fdf4fa0379cb2af ./results/no_stability_penalty.pt
65
+ 11755c07b5a689b567affeaaefc2d980fe7b4a8b31cb563bc8d3a509d1ddb166 ./results/no_stability_penalty_history.csv
66
+ c72922852bcd46f7f2f446436d26355807d425dd01af54660eb13cfa9a0b314a ./results/no_stability_penalty_metrics.json
67
+ b2c9b293ea4f61d9202182b1ffd13dceeb9f76d1c48630da2f03caef4b7ef835 ./results/no_text_branch.pt
68
+ 249b3761157a99e2ef73b22d3727cea2ca4e79b81156bb2cd3646f9025fc1746 ./results/no_text_branch_history.csv
69
+ 988259dc26dd92810aa8d075b07b82d8bd733a948f578260649e71e1605384b0 ./results/no_text_branch_metrics.json
70
+ 39c834750c8f021f7880a0b18dbd3c3e557df8198a0dc5dcd002214aaeed0482 ./results/swm.pt
71
+ 732cdec082c187acbf67124912233a33ee6a9e5b442a94577ae68eb08eedab2c ./results/swm_history.csv
72
+ f30f06654accaef32d05bf15f93d3851110cd09fd5f640949aa37b1261951c36 ./results/swm_metrics.json
73
+ 46656b6ee4f1f06f4768b06e68df7a2079f2adacc28de3bffb5c8e4b45b481fa ./results/transformer.pt
74
+ 2944519b035562ddd7fede340e09102c935c0579d49fb2732a259857b04a8c12 ./results/transformer_history.csv
75
+ ca29fbf514dd76f64a453c6f479601fd4d1e96170177ee5cd85f0c4e35fa183c ./results/transformer_metrics.json
76
+ cc0df50a489358558bd68f25e73d7689afd1b98112bcd5af6703b6403a3e9115 ./results/v10_cf_integrity/metrics_by_seed.csv
77
+ f7c77ec1d724385b596b2de3e7860c7b3fe3330de4a44138be88cb8d0db724be ./results/v10_cf_integrity/metrics_summary.csv
78
+ c5923fe86118a65a91093d7d4e21f4204171ce8ccbbb54d9b8600594e72ae31e ./results/v10_cf_integrity/oracle_physics_audit.csv
79
+ d0c46469f469e1df40db0405ef7d52f8e0136f5c80f36136aca231001a8c807a ./results/v10_cf_integrity/run_config.json
80
+ 3eaba744687ad48f1dfa96a62c2a93f5c01747793f5eb1233345020f8d4bc633 ./results/v10_cf_integrity/seed_0/no_spectral_transition.pt
81
+ d4906b6fa6bd2afe8366cefa1f94c5101784b1c97a4a6f5753e015473e9dca02 ./results/v10_cf_integrity/seed_0/no_spectral_transition_history.csv
82
+ 17dedaa3d4ab3ec79f95c72ff73c18d06de287b8c1f44b47e5326370d0693388 ./results/v10_cf_integrity/seed_0/no_spectral_transition_metrics.json
83
+ 34d1b6a9b1593f44db69357bad97d29541ca32e311b0083027739a78d032b9bc ./results/v10_cf_integrity/seed_0/swm_structured_cf_v9.pt
84
+ fbe41c47207dd739510756b1c02f18cc78c5eef60fb164cbe540f0deb6bbe29a ./results/v10_cf_integrity/seed_0/swm_structured_cf_v9_history.csv
85
+ dfd9695fb723fd36a9bf7af658a8d43836796cd3cfd44dd05e73d5273893b8aa ./results/v10_cf_integrity/seed_0/swm_structured_cf_v9_metrics.json
86
+ 6b26cd6b9c8e3c75711fd02207709a223994f705aaa2a6806d47b7fbfb9e6289 ./results/v12_causal_decomposition/paired_bootstrap_v9_vs_controls.csv
87
+ 8b4c72089ed638907dc1f65985a43c1093f4a261cffa89f4b49bde81225d5b29 ./results/v12_causal_decomposition/stratified_metrics_summary.csv
88
+ 183712aafe59c29cfe576f725b73c3aa34f4b121f8a9c52fb6620dba96b03744 ./results/v13_axis_equivariance/axis_equivariance_summary.csv
89
+ 4cfb2ad9348ff93ef88402d768b18272fe7d92c468fffd8ce891711b24aab464 ./results/v13_axis_equivariance/forced_collision_summary.csv
90
+ 8a01d838e931bab4a3078e840dce0a4c77dda5cf77c0f6b5f518370337583459 ./results/v14_external_control/metrics_summary.csv
91
+ c888e7c9faca105d5d7503ce36411a6912ea9cad4ab72ef0b24258cb49ed7d56 ./results/v15_external_diagnostics/diagnostics_by_seed.csv
92
+ a5324309539550513108b9a65620775f37bc1a5e37ab57ad7e296c0af1bc5324 ./results/v15_external_diagnostics/diagnostics_summary.csv
93
+ c942607a39c008c952979a5823b3852f003fd2b4dd44b2e6a5c2a297540e5a9d ./results/v6_structured_transport/metrics_by_seed.csv
94
+ ed217f086d40894b4d13494ddfc8773fab621195d56ca4452cc9036dced49e97 ./results/v6_structured_transport/metrics_summary.csv
95
+ 59308c3a4abce83e107c4b6368d95f3d5dee9c9ef25f90c1674ce0cb3230c560 ./results/v6_structured_transport/run_config.json
96
+ b55e6b924e0ef2595042db0e607d01eddb069207e17d5e8ec1e18ef752765bb2 ./results/v6_structured_transport/seed_0/no_spectral_transition.pt
97
+ a7fbbb511b9ec055e96a3e3fa365d72e8bfb382a11e84a177f4bdc8ec6baea8c ./results/v6_structured_transport/seed_0/no_spectral_transition_history.csv
98
+ e3eb7947a654ff3d877cf832228e184543cc12eaa9f3f19f25ca33caa0d4c5f2 ./results/v6_structured_transport/seed_0/no_spectral_transition_metrics.json
99
+ 9e232e5f3e0d28283c4e7ae16c19f423734a6e9d80d3970ef6dc94675f283a6c ./results/v6_structured_transport/seed_0/swm_structured.pt
100
+ 4bcbdca4b9275bf925015fa7318ffa73c3116e8fd46e856991a32f739dbd0fc1 ./results/v6_structured_transport/seed_0/swm_structured_history.csv
101
+ 9ea995efe9c7eb306a6ced9cf57925ed5a0ca313c9fb09c7f5f82ed2bdf38cc3 ./results/v6_structured_transport/seed_0/swm_structured_metrics.json
102
+ 6e59f78ae13ca5e3992ffe439992bb1daf54c17c4739028b1f567ac9b48214d0 ./scripts/__pycache__/run_v15_external_diagnostics.cpython-313.pyc
103
+ 291532f8cd8d3a224bd8989925bc822972f21b6e75cfdc40a2305ba0d3064524 ./scripts/run_quick_benchmark.py
104
+ 467ac49c4f9e5c816432afcc15fd4ba5d1319398a8a31db55a20a26ab3c04ba7 ./scripts/run_stability_benchmark.py
105
+ 7db49776922dce21b8ed7f64a3f1d19059f1c07f51f62363943b4f0065128ec0 ./scripts/run_v10_audit.py
106
+ 3e11ff518ff6fd455e35de6a077726fbd43e2fdbca007ba3bcbf4a3885112b38 ./scripts/run_v11_benchmark.py
107
+ f9459e5e383f4b714e542658c9f24d58871ee3ed37ba5bff1ab96b748f0b10ad ./scripts/run_v12_decomposition.py
108
+ 5f83890b73d6cb6a9159a317957c19fb6fd76f7d25c308d32d75c734ddddf886 ./scripts/run_v13_axis_audit.py
109
+ e4b797fadb87241cfd8cb5952eb18a6a2d872d1dcc0d5d31297e0b4aca23c841 ./scripts/run_v14_external_benchmark.py
110
+ 3304c32537129587acf9dd9dac0ed64e00faee5be90f61672e4c396922bb8b9d ./scripts/run_v15_external_diagnostics.py
111
+ 7f30119ceb40b3a6e75d2f09ccfab5cc6daf56e8c171107f6f50787dd01c5ca0 ./scripts/run_v5_benchmark.py
112
+ 5d66b632bc04c185e2eb9799d4f8a2be4ea15083a60d0f7be706bd8d23058e0d ./scripts/run_v6_benchmark.py
113
+ 4c1213fe463c0c2c561ff20d4e2623b0ba1dd459c8dfa457c8f4563e66e06a85 ./scripts/run_v7_benchmark.py
114
+ 97e185c74a973c80a28e5dee4859254577f17cdafea51196eaa3de096d33dce7 ./scripts/run_v8_benchmark.py
115
+ 66e4ffa268f8692cf58309a4bf076ae143d8c91e409efcaa666a7f1479aaecae ./scripts/run_v9_benchmark.py
116
+ 39777f448c9519e9dca29bf61bb4eb7140a2fc4e85b8bd9b616ff9e9820e0076 ./scripts/system_check.py
117
+ f97b4a3577609d33d76b7015c74648e6568ae038b15a8cbb9742f13f37452664 ./spectral_world_models/__init__.py
118
+ 726010ce8be26595d175feb4406d1d1d061562c98cc243df32c8587909c91b30 ./spectral_world_models/__pycache__/__init__.cpython-313.pyc
119
+ 5d554017109781ebb2c2e76185a14d3e5afe258d5bf6c018e207d803a0423a02 ./spectral_world_models/__pycache__/counterfactual.cpython-313.pyc
120
+ 88981ab807349fefdc000d6fc4ec68ab9b66447ad25667b37d30af1f816fb236 ./spectral_world_models/__pycache__/data.cpython-313.pyc
121
+ 2824638abc6745f82b8e91219606057581fb28c8b6e3fc62b1ec515bfbccf7d3 ./spectral_world_models/__pycache__/haar.cpython-313.pyc
122
+ 7f0f406b3948fb585cfa3a72a96dabf6b196000c254aa4af64a7e694c1097508 ./spectral_world_models/__pycache__/hard_dynamics.cpython-313.pyc
123
+ d1566985362ee3d303c7d5d66a86b403c7bf66b8799e7542628971d1f4f7c2b1 ./spectral_world_models/__pycache__/models.cpython-313.pyc
124
+ c3384e41ae2574a9c879d34122e29c9f2bfb8ddfbadfdaab50dc059b75e5ddd0 ./spectral_world_models/__pycache__/v10_cf_audit.cpython-313.pyc
125
+ a3eac2249f23e1c4ecd5a2e9ce8c0d7aaded46fc3a51aa868ab0c61da858d842 ./spectral_world_models/__pycache__/v11_causal_calibration.cpython-313.pyc
126
+ 7e539c5c1e43a243588894297f13dedd7a09c95a92a0c6ed9ac5521df3deb5e0 ./spectral_world_models/__pycache__/v12_causal_decomposition.cpython-313.pyc
127
+ d62494f6c1951afa737a0d19dcddd407dad8e4c7dd87b3988fad75612a2ad7e1 ./spectral_world_models/__pycache__/v13_axis_equivariance.cpython-313.pyc
128
+ 70dc53cb53c9dd986d5b7cfb3f02fed92fdc6b8896f2ad6d105ead7b53c52989 ./spectral_world_models/__pycache__/v14_external_control.cpython-313.pyc
129
+ 192df8d927d44eadff2b182affbfe9d26df0ca23921d9db121412bf4a3eb594a ./spectral_world_models/__pycache__/v8_generalization.cpython-313.pyc
130
+ c65a6faa10d07b54e7b7bb9e40b74e17cd42639cc165d38287ddd06ac0992571 ./spectral_world_models/__pycache__/v9_causal_generalization.cpython-313.pyc
131
+ e3ae7e1167dcd7d512718eac9c9d995d2a22386c095d4e0beef9527abd02e9e5 ./spectral_world_models/counterfactual.py
132
+ 3fc2ece9186263b4678cfdb3a548b708c82379b7b7715fd9bfe2dbf744d8af18 ./spectral_world_models/data.py
133
+ 74d0fd184709031ed50b9fd2cac6b5e5481293d74c0b69b19c997107ab95b5ba ./spectral_world_models/haar.py
134
+ 656e54ed27e711cac2a3cdf93987d78f01497ed74346b116d6d1ae1694b00ebd ./spectral_world_models/hard_dynamics.py
135
+ e3e5996dfd31a57a241178ccf0e86220bd9fb8ec1c73cfd4516292045c094c07 ./spectral_world_models/metrics.py
136
+ baa1c87e76de49b6f40e53871fd7de139634f694d053b3194451d63c94394db5 ./spectral_world_models/models.py
137
+ f0671bb715f7606753000091eb13e969969d907f4ae94bd43d6564930e82990b ./spectral_world_models/train.py
138
+ 681f70d09ade8b429509ad875ff8831df877ebf41d80f1bf7ce767caa5a9ad56 ./spectral_world_models/v10_cf_audit.py
139
+ 030576b5437f99c204fd9955582cb297ce5aeed205317c7ca2764a1142f7be65 ./spectral_world_models/v11_causal_calibration.py
140
+ 84e0055e6cd70f9fa6358656fb7f81e76270278b2ec7880681d3619dc6a57c1f ./spectral_world_models/v12_causal_decomposition.py
141
+ ef4b9dca0532f2eda7ece8ae9fbb7ce08d9d25e98138254ebf3366c5c6bc7a03 ./spectral_world_models/v13_axis_equivariance.py
142
+ 43122e7d4065d998948f434633c823e26ecf9750b81cbe804ebe679a018cb3c5 ./spectral_world_models/v14_external_control.py
143
+ f141a401541fb9369d20ed97bef8468a4c4645726b21ad784832c27878ddb0ad ./spectral_world_models/v8_generalization.py
144
+ 1e71a1f372e6dbcb78a91ac97d5a1bca618783ba5541861539294e6e117e264d ./spectral_world_models/v9_causal_generalization.py
145
+ 95d1fea81d96cea36f8ccded6ea1ec75e714da84e62f353d8f30b70b60d4669b ./tests/__pycache__/test_smoke.cpython-313-pytest-9.0.2.pyc
146
+ 583d4a9f5fdfd22e36e58ecaaea7f809a3dff1050aa91941d34f95dad1653282 ./tests/__pycache__/test_stability_constraint.cpython-313-pytest-9.0.2.pyc
147
+ 4141ec2598cf166493059d7b6b16ac4e79b7a95d1718c83632152116ceab0eb8 ./tests/__pycache__/test_v10_cf_audit.cpython-313-pytest-9.0.2.pyc
148
+ 86d146aaf18c0caa5f19ee709b4acc55ba03a7d726b3a23f1e77a199d0dc1cfd ./tests/__pycache__/test_v11_calibration.cpython-313-pytest-9.0.2.pyc
149
+ 7e42fd4ef45424dd5876a1cc23e4625fca2c07ff7a710909d8fd0bcefcad654b ./tests/__pycache__/test_v12_decomposition.cpython-313-pytest-9.0.2.pyc
150
+ ab959b3e9d7be194f9ceedb8049a995972580b5600696b7352367579de267dbd ./tests/__pycache__/test_v13_axis_equivariance.cpython-313-pytest-9.0.2.pyc
151
+ 509776790ff7b89ebfd4749a2ee93735759861c71387719aca87b4834afcdb6b ./tests/__pycache__/test_v14_external_control.cpython-313-pytest-9.0.2.pyc
152
+ e79dfb8bf4d366f5a1a02a5846093e1c9e8aeb99b7f9ac6705eb43ac0c4e7acb ./tests/__pycache__/test_v15_1_state_token_decode.cpython-313-pytest-9.0.2.pyc
153
+ 26f83a960a0750a4f0f0c1897626de7c0e53927d6a71b317ec666371946a8a96 ./tests/__pycache__/test_v15_diagnostics.cpython-313-pytest-9.0.2.pyc
154
+ 5f807a38e2113fa94ad13c4dd81e5b7ebfca575dc7e989fb891216af4507ecf1 ./tests/__pycache__/test_v4_selective.cpython-313-pytest-9.0.2.pyc
155
+ 1114b5fa6a3b784a256e73315160a4480206f27f8ca9c098fd60f4f334afdd44 ./tests/__pycache__/test_v5_hard_dynamics.cpython-313-pytest-9.0.2.pyc
156
+ a600a9eb3d3b86eaef730347c7a527bfdcdf302f057c784ef378a842b345ccec ./tests/__pycache__/test_v6_structured.cpython-313-pytest-9.0.2.pyc
157
+ fd8d9de4a26f075221638e0143b3affd4c659091926955901db389a369a4f8e3 ./tests/__pycache__/test_v7_counterfactual_training.cpython-313-pytest-9.0.2.pyc
158
+ 2f8475c83eba08a537164ff7bee4102228e2c948f20422e80a9dce20b15f1608 ./tests/__pycache__/test_v8_generalization.cpython-313-pytest-9.0.2.pyc
159
+ 9499c06a9c9d3998cfb787b5c9b12b9910d0f82243a7d3a8a78bd346c471c586 ./tests/__pycache__/test_v9_causal_generalization.cpython-313-pytest-9.0.2.pyc
160
+ d45c477853469ba42a643f2476b4a5c7b88075a662d91c793cdcd2bb68f6385b ./tests/test_smoke.py
161
+ 4c3ca6cf55763475b01b2833d264f57101d30e6fb9170df057444503b00a95e5 ./tests/test_stability_constraint.py
162
+ 198d3795b20d3edc3bcf0261d2e89d1e3090192eb65c22e80851970c7d86e5ef ./tests/test_v10_cf_audit.py
163
+ f119a86597445b83ff941da301a97e7de6201c651a356b2fa4c6489b5d81f54f ./tests/test_v11_calibration.py
164
+ 5a657d824c3b1931e65197c8950475645c79a014e7d82c3ce0d514706a1d2828 ./tests/test_v12_decomposition.py
165
+ 31c6511e30869159e23b0baeed999817a783412ee4c7a4f9d13d3cc8945ba583 ./tests/test_v13_axis_equivariance.py
166
+ f9d30b3d98964a206f49895182111a32bfe6cfa75becbbc18dce5eead42432ad ./tests/test_v14_external_control.py
167
+ 68a7c2f6ed0169c0d309f60fdf51d169bd823900910142843940e6b4aec339cb ./tests/test_v15_1_state_token_decode.py
168
+ 1ae4c75254a63188fb40fb4f4611739408d8d5d7ae4294bfaa002a8ca1327ad3 ./tests/test_v15_diagnostics.py
169
+ 481ded46bb953cd21b63115241f7d6b6c9dab4b3f87d77096af23c816a4bfd79 ./tests/test_v4_selective.py
170
+ fe8a68538759fc011c0a7131d909506410f69b300349a47888a8bebb4c6ab942 ./tests/test_v5_hard_dynamics.py
171
+ daba44887294567466959c4743e29a5bb6dc97852d2a20b7dc91166ba3678914 ./tests/test_v6_structured.py
172
+ 904c55073258023939e029823cee314800c81d89896a20f4772dae70046ee598 ./tests/test_v7_counterfactual_training.py
173
+ b29fa14d5c1cb39992283f418ab3cfa874f0e05c5d42f386af0b195bf4027cdc ./tests/test_v8_generalization.py
174
+ b8785289ac99b79da780bb946561f4f85799cd3676dafad0a2a8c6a048750706 ./tests/test_v9_causal_generalization.py
STABILITY_REFACTOR.md ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # SWM stability-attribution refactor
2
+
3
+ This revision responds directly to the five-seed H=5/10/20/30 finding that full SWM remained much flatter than the Koopman baseline, while the existing Frobenius-energy stability penalty had effectively no measurable effect and removing the spectral transition improved rollout MSE.
4
+
5
+ ## New controlled variant
6
+
7
+ `swm_spectral_norm` retains the SWM wavelet image state, DCT text state, fusion, and low-rank action-conditioned operator dictionary. For each discrete action it explicitly constructs the effective linear operator
8
+
9
+ `A(a) = W0 + sum_r beta_r(a) U_r V_r`
10
+
11
+ and caps its largest singular value at `rho=0.95` in the forward pass. The unconstrained nonlinear residual is omitted in this diagnostic variant, making the contraction mechanism directly testable rather than conflating a linear operator bound with an unbounded learned correction. `tanh` is retained and is non-expansive.
12
+
13
+ The auxiliary stability loss now measures violations of the same spectral-norm threshold before forward rescaling. The benchmark records raw and effective operator norms so a claimed constraint can be checked from the results rather than inferred from a training hyperparameter.
14
+
15
+ ## Attribution experiment
16
+
17
+ The targeted benchmark compares `koopman`, `neural_operator`, `swm`, `swm_spectral_norm`, `no_spectral_transition`, and `no_stability_penalty` using identical seeds. Default rollout horizons are 5, 10, 20, 30, 50, and 100. A separate held-out long-sequence dataset is generated automatically, so the original short training data are not changed to make the long-horizon test easier.
18
+
19
+ Run on CUDA:
20
+
21
+ `PYTHONPATH=. python scripts/run_stability_benchmark.py --seeds 0 1 2 3 4 --horizons 5 10 20 30 50 100 --device cuda`
22
+
23
+ Primary output: `results/stability_attribution/metrics_summary.csv`.
24
+
25
+ ## Interpretation rule
26
+
27
+ The hard-constrained variant supports the stability-mechanism hypothesis only if its long-horizon behavior improves reproducibly relative to ordinary SWM/current-penalty SWM without an unacceptable collapse in one-step predictive or multimodal metrics. If it does not, the correct conclusion is that this benchmark does not attribute SWM's observed rollout flatness to the proposed operator-norm mechanism.
V10_COUNTERFACTUAL_INTEGRITY.md ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # V10 — Counterfactual Benchmark Integrity & Physics Audit
2
+
3
+ V10 is an evaluation-integrity release. It does **not** introduce a new world-model architecture.
4
+
5
+ V9 produced nearly identical endpoint counterfactual cosine values across interpolation, extrapolation, and structural-OOD regimes. That repetition is not sufficient evidence of an evaluator bug: cosine can remain unchanged when physics changes only the magnitude of a collinear intervention effect. V10 therefore makes the oracle causal signal observable and auditable.
6
+
7
+ ## What changes
8
+
9
+ - freezes the V9 comparison architectures;
10
+ - uses identical initial physical states across regimes so physics is the controlled variable;
11
+ - records acceleration, speed cap, damping, restitution, occlusion and a physics fingerprint;
12
+ - hashes every oracle counterfactual trajectory and asserts hashes differ across regimes;
13
+ - replaces the single constant left/right probe with left/right, up/down, turning and impulse/reversal interventions;
14
+ - records oracle endpoint magnitude, path magnitude, RMS effect and temporal variation;
15
+ - reports both endpoint and trajectory-level counterfactual direction/magnitude metrics;
16
+ - fails fast if the oracle trajectories or causal-effect diagnostics are insensitive to the regime.
17
+
18
+ ## Full run
19
+
20
+ `PYTHONPATH=. python scripts/run_v10_audit.py --seeds 0 1 2 3 4 --cf-horizon 30 --cf-pairs 48 --device cuda`
21
+
22
+ Primary outputs:
23
+
24
+ - `results/v10_cf_integrity/oracle_physics_audit.csv`
25
+ - `results/v10_cf_integrity/metrics_by_seed.csv`
26
+ - `results/v10_cf_integrity/metrics_summary.csv`
27
+ - `results/v10_cf_integrity/run_config.json`
28
+
29
+ Interpret V10 as an audit first. Only after `oracle_physics_audit.csv` demonstrates distinct regime-specific oracle trajectories should learned-model OOD counterfactual metrics be used for manuscript claims.
V11_CAUSAL_GAIN_CALIBRATION.md ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # V11 — Causal Gain Calibration
2
+
3
+ V11 follows the V10 integrity audit. The architecture remains the V9 structured spectral transport model; the intervention objective is changed to target causal gain calibration.
4
+
5
+ ## Change
6
+ At every counterfactual rollout step V11 compares the predicted action-effect vector with the oracle action-effect vector after normalization by the oracle effect scale. A symmetric log-gain penalty remains as a calibration term, and branch reconstruction prevents degenerate effect matching.
7
+
8
+ ## Evaluation
9
+ The benchmark reports trajectory cosine, mean magnitude ratio, magnitude-ratio MAE from 1, absolute log-gain calibration error, predicted-vs-oracle magnitude correlation, and a linear calibration fit (slope/intercept) for interpolation, parameter extrapolation, and structural OOD.
10
+
11
+ Ten seeds are the default. V9, neural-operator, and no-transition controls are trained and evaluated under the same protocol. No composite score or superiority claim is built into the benchmark.
12
+
13
+ ## Main run
14
+ `PYTHONPATH=. python scripts/run_v11_benchmark.py --seeds 0 1 2 3 4 5 6 7 8 9 --cf-horizon 30 --cf-pairs 64 --device cuda`
V12_CAUSAL_RESPONSE_DECOMPOSITION.md ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # V12 — Causal Response Decomposition
2
+
3
+ V12 is a diagnostic release. It introduces **no new model architecture and no new training loss**. The V9 structured counterfactual model is treated as the primary frozen experimental recipe, with neural-operator and no-spectral-transition controls.
4
+
5
+ ## Question
6
+
7
+ V11 showed that a scalar gain-calibration objective can lower log-gain error while suppressing intervention magnitude. V12 therefore asks *where* V9's causal response succeeds and fails before another optimization change is attempted.
8
+
9
+ ## Decomposition axes
10
+
11
+ The evaluator reports causal trajectory cosine, magnitude ratio, magnitude-ratio absolute error, and log-gain error by physics regime; intervention program (`left_right`, `up_down`, `turn_cw`, `impulse_reverse`); rollout horizon (5, 10, 20, 30); oracle-effect tertile; initial-speed tertile; boundary-contact status; and central occlusion-zone exposure.
12
+
13
+ The effect and speed bins are computed from matched oracle episodes within each regime. Boundary contact is derived from oracle target trajectories. Occlusion-zone exposure records whether the target path enters the central occluder strip; it is not a claim that every such frame is stochastically occluded.
14
+
15
+ ## Statistical comparison
16
+
17
+ `paired_bootstrap_v9_vs_controls.csv` reports episode-clustered paired bootstrap 95% intervals for V9 minus each control on trajectory cosine, magnitude-ratio MAE, and log-gain error. The bootstrap preserves the matched episode/program/horizon structure. No composite score is produced.
18
+
19
+ ## Main run
20
+
21
+ `PYTHONPATH=. python scripts/run_v12_decomposition.py --seeds 0 1 2 3 4 5 6 7 8 9 --cf-horizon 30 --cf-pairs 64 --bootstrap 2000 --device cuda`
22
+
23
+ ## Outputs
24
+
25
+ - `decomposition_by_episode.csv`: finest-grained matched observations.
26
+ - `stratified_metrics_by_seed.csv`: seed-level stratum summaries.
27
+ - `stratified_metrics_summary.csv`: across-seed descriptive summaries.
28
+ - `paired_bootstrap_v9_vs_controls.csv`: paired uncertainty analysis.
29
+ - `run_config.json`: complete invocation metadata.
30
+
31
+ ## Interpretation rule
32
+
33
+ A positive V9-minus-control trajectory-cosine interval supports stronger directional alignment on this synthetic benchmark only when the interval excludes zero. For magnitude error, negative V9-minus-control deltas are favorable. Subgroup findings are diagnostic and should not be presented as confirmatory without multiplicity-aware follow-up.
V13_AXIS_SYMMETRY_EQUIVARIANCE.md ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # V13 — Axis Symmetry & Intervention Equivariance Audit
2
+
3
+ V13 is a diagnostic release. It freezes the V9 architecture, training distribution, and counterfactual objective. It does **not** tune away the V12 vertical-action failure.
4
+
5
+ ## Question
6
+ V12 found that V9's causal direction was strong for left/right, turning, and impulse/reverse interventions but nearly collapsed for up/down. V13 asks whether this is genuine learned axis anisotropy.
7
+
8
+ ## Exact symmetry tests
9
+ For each matched episode and action program, V13 constructs identity, 90-degree rotation, horizontal reflection, vertical reflection, and x/y-swap versions. The image, controlled state, velocity, text position tokens, and action sequence are transformed consistently. The isotropic ground-truth dynamics provide an oracle commutation check.
10
+
11
+ The central diagnostic is whether the model's transformed causal-effect trajectory, mapped back into the original coordinates, matches its original prediction. Outputs include transformed causal cosine, causal-gain ratio, equivariance-effect cosine, relative equivariance error, and oracle equivariance error.
12
+
13
+ A 90-degree rotation of a successful horizontal intervention is especially diagnostic: if the rotated equivalent collapses, the failure is attributable to model/data anisotropy rather than a different set of sampled episodes.
14
+
15
+ ## Collision audit
16
+ V12's incidental boundary-contact stratum did not activate. V13 therefore creates near-wall states with velocities directed toward each of the four walls and verifies contact from oracle trajectories. Collision metrics are reported by wall, action program, and physics regime.
17
+
18
+ ## Interpretation
19
+ This release is intentionally falsification-oriented. A strong result is not required. If V9 violates these exact symmetries, the anisotropy should be reported as a limitation rather than hidden by another loss change. After this audit, the recommended next step is an external dynamics/control benchmark.
V13_SMOKE_VALIDATION.md ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ # V13 smoke validation
2
+
3
+ Validated before packaging:
4
+
5
+ - Full test suite: 25 passed (one pre-existing tensor-to-scalar warning in the stability test).
6
+ - End-to-end CPU smoke run: seed 0, `swm_structured_cf_v9` and `no_spectral_transition`, one epoch, two paired episodes, horizon 5, collision horizon 5.
7
+ - The smoke run produced both axis-equivariance and forced-collision outputs successfully; generated smoke results were removed before packaging.
V14_EXTERNAL_CONTROL_BENCHMARK.md ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # V14 — External Control Benchmark
2
+
3
+ V14 is the first SWM milestone outside the project's synthetic Moving Shapes / hard-controlled-dynamics simulator. It freezes the V9 architecture family and evaluates fresh training runs on established Gymnasium Classic Control environments.
4
+
5
+ ## Environments
6
+
7
+ - `CartPole-v1`
8
+ - `MountainCar-v0`
9
+ - `Acrobot-v1`
10
+
11
+ Each environment is rendered with Gymnasium's official `rgb_array` renderer, converted to 32×32 grayscale, and paired with a compact quantized text/state description. Models are trained **from scratch per environment**. This is architecture transfer, not checkpoint transfer.
12
+
13
+ ## Frozen comparison
14
+
15
+ The primary comparison is:
16
+
17
+ - `swm_structured_cf_v9` — frozen structured SWM architecture alias
18
+ - `neural_operator` — Fourier image-state control
19
+ - `no_spectral_transition` — spectral state without the structured spectral transition
20
+
21
+ No V12/V13 diagnostic result is used to tune the V14 architecture.
22
+
23
+ ## Primary endpoint
24
+
25
+ Long-horizon pixel prediction MSE at H=5,10,20,30, reported per seed and as mean±SD. The benchmark is deliberately simple: it asks whether the V9 architecture's long-horizon advantage or failure modes survive outside the project's own simulator.
26
+
27
+ ## Run
28
+
29
+ Install the external benchmark dependency:
30
+
31
+ `pip install -e '.[external]'`
32
+
33
+ Five-seed full suite:
34
+
35
+ `PYTHONPATH=. python scripts/run_v14_external_benchmark.py --seeds 0 1 2 3 4 --epochs 5 --device cuda`
36
+
37
+ Ten-seed publication run:
38
+
39
+ `PYTHONPATH=. python scripts/run_v14_external_benchmark.py --seeds 0 1 2 3 4 5 6 7 8 9 --epochs 5 --device cuda`
40
+
41
+ Outputs are written under `results/v14_external_control/`.
42
+
43
+ ## Interpretation rules
44
+
45
+ V14 is an external benchmark milestone, not a claim that Classic Control fully represents real-world world-modeling. A favorable result must be replicated across environments and seeds. A negative result is informative because V9 is frozen rather than retuned to the external suite.
V15_1_BUGFIX.md ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # V15.1 — External Dynamics Diagnostic Bug-Fix Release
2
+
3
+ V15.1 is a **bug-fixed replacement for V15**, not a new research iteration and not a new model version.
4
+ It uses the same frozen V14 checkpoints and the same diagnostic protocol.
5
+
6
+ ## Bug fixed
7
+
8
+ V15 called `model.text_decoder(z)` directly. `text_decoder` is a flat linear layer whose raw output has shape
9
+ `[B, max_text_len * vocab_size]`. V15 then took `argmax(-1)` and compared that result with the environment-state
10
+ token tensor `[B, max_text_len]`. This caused the observed dimension mismatch and, more importantly, would not
11
+ have been a valid state-token diagnostic.
12
+
13
+ V15.1 calls `model.decode_text(z)`, the model's canonical decoder API. It reshapes logits to
14
+ `[B, max_text_len, vocab_size]`; `argmax(-1)` therefore yields `[B, max_text_len]`, exactly matching the discretized
15
+ Gym observation tokens used as the target. Padding tokens are excluded from accuracy.
16
+
17
+ An explicit shape assertion now fails early with an informative error if a future model violates this contract.
18
+
19
+ ## Interpretation
20
+
21
+ `token_acc_h*` is **discretized Gym-state token accuracy**, not continuous-state regression accuracy. The tokens were
22
+ created by V14 from the Gym observation vector using the fixed binning procedure in `obs_to_tokens`. It is a
23
+ state-sensitive auxiliary diagnostic because the model is trained to predict these tokens, but it should not be
24
+ reported as exact continuous environment-state error.
25
+
26
+ No V9 architecture, training objective, V14 checkpoint, dataset, horizon, or primary diagnostic has been changed.
27
+
28
+ ## Run
29
+
30
+ `PYTHONPATH=. python scripts/run_v15_external_diagnostics.py --v14-results ../Spectral-World-Models-HF-v14/results/v14_external_control --seeds 0 1 2 3 4 5 6 7 8 9 --device cuda`
31
+
32
+ Outputs remain:
33
+ - `results/v15_external_diagnostics/diagnostics_by_seed.csv`
34
+ - `results/v15_external_diagnostics/diagnostics_summary.csv`
V15_EXTERNAL_DYNAMICS_DIAGNOSTIC.md ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # V15 — External Dynamics Diagnostic
2
+
3
+ V15 is a **stop/go diagnostic milestone**, not another architecture iteration. It freezes and reloads the exact V14 checkpoints. There is no retraining and no V15 model.
4
+
5
+ ## Question
6
+ Did V14 expose a genuine dynamics failure, or is full-frame MSE dominated by sparse moving foregrounds and static backgrounds?
7
+
8
+ ## Diagnostics
9
+ For H5/H10/H20/H30 V15 reports full-frame MSE, static-frame baseline MSE, foreground-weighted MSE (pixels whose oracle frame differs from the initial frame), one-step-at-horizon motion-increment MSE, PSNR, dependency-free SSIM, latent rollout cosine, and state-token accuracy. The state-token metric uses the Gym observation bins already supplied to every V14 model; it is a coarse state diagnostic, **not continuous state RMSE**.
10
+
11
+ For models exposing stability diagnostics, V15 also records spectral/operator diagnostics per seed so catastrophic rollout seeds can be compared with transition statistics.
12
+
13
+ ## Decision rule
14
+ This is the final diagnostic before a decision. If V9 remains substantially worse than controls on foreground motion, latent consistency, and state-token prediction, treat V14 as a genuine external-transfer failure and stop iterating on this architecture. If the gap largely disappears on dynamics-sensitive metrics while static prediction is competitive on full-frame MSE, revise the interpretation of V14 and move directly to a more appropriate external benchmark/task metric. Do not create V16 merely to optimize these three environments.
V4_MULTIMODAL_STABILITY.md ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # SWM v4 — Selective Spectral Regulation + Multimodal Rollout Evaluation
2
+
3
+ v3 showed that a hard `rho=0.95` contraction cap was numerically enforced but damaged predictive rollouts, while the original stability penalty was empirically inert. v4 therefore tests a different hypothesis: preserve near-unit transport modes and constrain only genuinely expansive modes.
4
+
5
+ ## New model: `swm_selective`
6
+
7
+ The action-conditioned low-rank operator is decomposed with an SVD. Singular values at or below `max_gain=1.05` are left unchanged; only values above the threshold are clipped. The nonlinear residual is retained. This is intentionally not a claim that 1.05 is theoretically optimal; it is a diagnostic architecture designed to separate selective control of expansive modes from uniform contraction.
8
+
9
+ ## New long-horizon metrics
10
+
11
+ For every requested horizon, the benchmark reports image rollout MSE, text accuracy decoded from the recurrent latent, cosine alignment between recurrent and target multimodal latent states, and a bounded joint diagnostic score. The components remain the primary metrics; the joint score is only a compact diagnostic and should not be used as a sole publication claim.
12
+
13
+ ## Recommended DGX Spark experiment
14
+
15
+ `PYTHONPATH=. python scripts/run_stability_benchmark.py --seeds 0 1 2 3 4 --horizons 5 10 20 30 50 100 --device cuda`
16
+
17
+ Output: `results/stability_attribution/metrics_summary.csv`
18
+
19
+ The key comparisons are `swm_selective` vs `swm`, `swm_spectral_norm`, `no_spectral_transition`, `neural_operator`, and `koopman`.
V5_HARD_DYNAMICS.md ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # V5 — Hard Controlled Dynamics
2
+
3
+ V4 showed that selective spectral regulation repaired the failure of global contraction, but the no-spectral-transition control remained highly competitive. V5 therefore changes the **benchmark difficulty rather than the stability mechanism**.
4
+
5
+ The new benchmark preserves the same image/text/action API while adding inertial velocity, action-conditioned acceleration, wall bounces, a moving distractor, a central occluder, stochastic target occlusion, and longer training sequences. This is designed to make simple latent persistence insufficient.
6
+
7
+ ## Primary experiment
8
+
9
+ `PYTHONPATH=. python scripts/run_v5_benchmark.py --seeds 0 1 2 3 4 --horizons 5 10 20 30 50 100 --device cuda`
10
+
11
+ Primary output: `results/v5_hard_dynamics/metrics_summary.csv`.
12
+
13
+ Interpret the benchmark as an attribution experiment. Compare `swm_selective` with `swm`, `no_spectral_transition`, `koopman`, and `neural_operator`. Report image MSE, recurrent text accuracy, latent cosine separately; the joint score is diagnostic only.
V6_STRUCTURED_TRANSPORT.md ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # V6 — Structured spectral transport and counterfactual control
2
+
3
+ V6 follows the V5 finding that selective clipping prevents catastrophic rollout growth, while the no-spectral-transition control remains highly competitive. It therefore changes the transition hypothesis rather than increasing benchmark difficulty again.
4
+
5
+ `swm_structured` decomposes latent dynamics into: (1) an approximately energy-preserving Cayley/orthogonal transport block, (2) learned diagonal dissipation, and (3) low-rank action-conditioned transport. Only expansive singular modes of the composed operator are clipped at 1.05.
6
+
7
+ The new counterfactual benchmark fixes the same initial observation and compares opposing persistent action sequences. It reports final counterfactual image MSE, cosine agreement of the predicted versus true action-effect displacement vector, and action-effect magnitude ratio. This is intended to distinguish causal control sensitivity from simple persistence.
8
+
9
+ Run: `PYTHONPATH=. python scripts/run_v6_benchmark.py --seeds 0 1 2 3 4 --horizons 5 10 20 30 50 100 --cf-horizon 30 --device cuda`
10
+
11
+ Primary output: `results/v6_structured_transport/metrics_summary.csv`.
V7_COUNTERFACTUAL_TRAINING.md ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # V7 — Counterfactual Action-Contrastive Training
2
+
3
+ V7 keeps the V6 structured transport architecture and changes the learning objective. V6 was very stable at H=100 but under-reacted to interventions: the structured model's counterfactual effect-vector cosine was about 0.44 and its effect-magnitude ratio about 0.021. V7 therefore trains an explicit paired-intervention objective.
4
+
5
+ For the same initial image/text state, the auxiliary training batch rolls out persistent left and right interventions. The loss has three terms: (1) direction loss, `1 - cosine(delta_pred, delta_true)`; (2) magnitude loss, the absolute log ratio of predicted to true action-effect magnitude; and (3) branch reconstruction MSE for both counterfactual endpoints. The default weights are deliberately modest so the counterfactual objective augments rather than replaces next-state prediction.
6
+
7
+ The primary comparison is `swm_structured_cf` against the unchanged `swm_structured`, `swm_selective`, `no_spectral_transition`, and `neural_operator` controls. The target is not a single winner metric: V7 should improve causal action sensitivity while preserving the long-horizon stability achieved by V6.
8
+
9
+ Run:
10
+
11
+ `PYTHONPATH=. python scripts/run_v7_benchmark.py --seeds 0 1 2 3 4 --horizons 5 10 20 30 50 100 --cf-horizon 30 --device cuda`
12
+
13
+ Output: `results/v7_counterfactual_training/metrics_summary.csv`.
V8_GENERALIZATION_AND_PLANNING.md ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # V8 — Frozen Architecture: OOD Generalization, Causal Control, and Planning
2
+
3
+ V8 freezes the V7 model architectures and changes the scientific question. V7 showed that explicit counterfactual training can produce accurate action-effect direction and magnitude while preserving stable long-horizon rollouts. V8 tests whether that behavior generalizes rather than adding another transition mechanism.
4
+
5
+ ## Distribution shift
6
+
7
+ Training remains on the V5/V7 controlled-dynamics distribution (acceleration 0.70, max speed 3.0, occlusion probability 0.12). OOD evaluation increases acceleration to 1.10, max speed to 4.0, and occlusion probability to 0.28. No OOD examples are used for optimization or model selection.
8
+
9
+ ## Three evaluation axes
10
+
11
+ 1. **ID/OOD prediction and rollout:** one-step MSE/text accuracy and H=5,10,20,30,50,100 image MSE, recurrent text accuracy, and latent cosine.
12
+ 2. **ID/OOD interventions:** paired left/right action interventions report endpoint image MSE, action-effect vector cosine, and action-effect magnitude ratio.
13
+ 3. **Imagination-based planning:** from the same observed initial state, each model imagines a fixed library of candidate action sequences toward a randomly selected corner target. The chosen sequence is executed in the ground-truth simulator. Primary planning metrics are normalized regret (lower is better) and oracle-action agreement (higher is better).
14
+
15
+ The planning candidate set is identical for every model and seed. V8 does not train on the planning targets.
16
+
17
+ ## Main command
18
+
19
+ `PYTHONPATH=. python scripts/run_v8_benchmark.py --seeds 0 1 2 3 4 --horizons 5 10 20 30 50 100 --cf-horizon 30 --planning-horizon 20 --planning-episodes 96 --device cuda`
20
+
21
+ Primary output: `results/v8_generalization/metrics_summary.csv`.
22
+
23
+ ## Interpretation discipline
24
+
25
+ V8 is designed as a generalization/falsification experiment. Strong ID counterfactual performance alone is insufficient. The structured counterfactual SWM is supported only if its intervention behavior survives OOD shift and, separately, if its imagined rollouts produce useful action selection. Planning metrics should be reported independently from reconstruction metrics; no arbitrary composite winner score is used.
V8_SMOKE_VALIDATION.md ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ # V8 validation
2
+
3
+ Repository validation completed before packaging:
4
+
5
+ - `PYTHONPATH=. python -m pytest -q` — 12 tests passed.
6
+ - `PYTHONPATH=. python scripts/run_v8_benchmark.py --help` — CLI parsed successfully.
7
+ - End-to-end CPU smoke benchmark completed for `swm_structured_cf` and `no_spectral_transition` with a one-seed/two-step configuration.
8
+
9
+ The smoke outputs were removed before packaging so the five-seed DGX run writes a clean `results/v8_generalization/` directory.
V9_CAUSAL_GENERALIZATION.md ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # V9 — Causal Generalization
2
+
3
+ V8 showed that near-perfect in-distribution counterfactual alignment did not survive a physics shift. V9 freezes the structured transport design and changes the training/evaluation protocol rather than adding another stability operator.
4
+
5
+ ## What changes
6
+
7
+ - Training data is a mixture of three controlled-dynamics regimes spanning acceleration, speed, occlusion, damping, and restitution.
8
+ - `swm_structured_cf_v9` uses the same structured transition as V7 but replaces endpoint-only counterfactual supervision with a discounted trajectory-level intervention loss.
9
+ - Evaluation is separated into **interpolation**, **parameter extrapolation**, and **structural OOD** (changed damping/restitution).
10
+ - Every regime reports one-step prediction, H=5/10/20/30/50/100 rollout metrics, counterfactual direction/magnitude/endpoint error, and planning regret/oracle agreement.
11
+ - Controls remain neural operator, selective SWM, endpoint-CF structured SWM, and no-spectral-transition.
12
+
13
+ ## Main hypothesis
14
+
15
+ Trajectory-level counterfactual training across a family of physics regimes should reduce the V8 gap between ID causal response and OOD causal response without sacrificing the stable long-horizon rollout behavior of structured SWM.
16
+
17
+ ## DGX Spark command
18
+
19
+ `PYTHONPATH=. python scripts/run_v9_benchmark.py --seeds 0 1 2 3 4 --horizons 5 10 20 30 50 100 --cf-horizon 30 --planning-horizon 20 --planning-episodes 64 --device cuda`
20
+
21
+ Primary output: `results/v9_causal_generalization/metrics_summary.csv`.
configs/prototype.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"model":"swm","image_size":32,"max_text_len":5,"latent_dim":96,"image_latent_dim":48,"text_latent_dim":32,"benchmark":"mini_moving_shapes","epochs":3,"batch_size":64,"seed":13}
data/generate_benchmark.py ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ from pathlib import Path
2
+ from spectral_world_models.data import DatasetConfig, generate_benchmark_npz
3
+
4
+ if __name__ == "__main__":
5
+ out = Path(__file__).resolve().parent / "mini_moving_shapes.npz"
6
+ generate_benchmark_npz(out, DatasetConfig())
7
+ print(f"wrote {out}")
data/hard_controlled_dynamics_v6.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3688d9b074059a297d2f9163a93b8a07a5aaeaf5a94f5e7b7792421350acbd71
3
+ size 25959244
data/hard_controlled_dynamics_v6_rollout_h6.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:15b91073dfd882b528416bb1fb53d08c53eeaae201fbd468ac9f1bce041b73b4
3
+ size 1361864
data/mini_moving_shapes.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e3dea41e2fd4303760e7abb526f4404434cfca74093d45df235a27f7828cc190
3
+ size 6822485
data/mini_moving_shapes_rollout_h11.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4593ad92dab9ff7ffc6250d368a7b6eb68ab1d09c3bae749209f6dbc4cbcf491
3
+ size 1617145
data/mini_moving_shapes_rollout_h31.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4593ad92dab9ff7ffc6250d368a7b6eb68ab1d09c3bae749209f6dbc4cbcf491
3
+ size 1617145
data/v9_extrapolation_h6.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7dcc2e791d591c7810dc2295779e816e3b4cf38e8554397c33a4949538860143
3
+ size 9733974
data/v9_interpolation_h6.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0aab7d41b0596bd72a24100710f6f7aafe8a94289ed33a6bd921fcbcee0c97be
3
+ size 9730656
data/v9_structural_ood_h6.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:288cd80b247bb1396897579bd2b86363c1936d60e904431a22eee9a0642c42c6
3
+ size 9741893
data/v9_train_family.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d26d2a2c08b9c84f7613e31099b6274e29a326f58f7dadb50b3ce4dc5d9d1181
3
+ size 28287014
docs/HF_RELEASE_STEPS.md ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Hugging Face release steps
2
+
3
+ Suggested repository ID: `kiruluta/Spectral-World-Models-Reproducibility`
4
+
5
+ 1. Install/update CLI: `pip install -U huggingface_hub`
6
+ 2. Authenticate: `hf auth login`
7
+ 3. Create repository: `hf repos create kiruluta/Spectral-World-Models-Reproducibility --exist-ok`
8
+ 4. From the directory containing this folder, upload it to repository root:
9
+ `hf upload kiruluta/Spectral-World-Models-Reproducibility ./Spectral-World-Models-HF-Reproducibility-Final . --exclude '.pytest_cache/**' --exclude '**/__pycache__/**' --exclude '*.pyc'`
10
+ 5. Verify README, source, scripts, tests, versioned V6–V15.1 documents, and `results/` on the Hub.
11
+ 6. Create a frozen tag after verification:
12
+ `hf repos tag create kiruluta/Spectral-World-Models-Reproducibility v15.1-final -m "Final SWM reproducibility release through V15.1"`
13
+
14
+ Do not upload access tokens, virtual environments, caches, or unrelated local checkpoints.
docs/REPRODUCIBILITY_RELEASE.md ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Spectral World Models — Final Reproducibility Release
2
+
3
+ This repository freezes the Spectral World Models experimental program at V15.1. It is a reproducibility artifact, not a claim that the final structured SWM outperforms all baselines.
4
+
5
+ ## Experimental history
6
+
7
+ - **V6 — Structured Transport:** separated transport, dissipation, and action-conditioned response; exposed the tension between stability and causal responsiveness.
8
+ - **V7 — Counterfactual Training:** restored strong in-distribution intervention direction/magnitude on the synthetic benchmark.
9
+ - **V8 — Generalization and Planning:** showed that strong in-distribution counterfactual response did not automatically generalize under shifted physics.
10
+ - **V9 — Causal Generalization:** introduced multi-physics trajectory supervision and became the frozen principal SWM variant used in later audits.
11
+ - **V10 — Counterfactual Integrity Audit:** verified that interpolation, extrapolation, and structural-OOD regimes generated genuinely different oracle trajectories; trajectory-level metrics replaced insensitive endpoint-only interpretation.
12
+ - **V11 — Causal Gain Calibration:** tested scale-aware calibration; reduced some log-gain errors but tended to suppress intervention magnitude, so V9 remained the principal variant.
13
+ - **V12 — Causal Response Decomposition:** paired/stratified analysis found an aggregate V9 trajectory-direction advantage over the neural-operator and no-transition controls while exposing a severe up/down action failure.
14
+ - **V13 — Axis Symmetry & Equivariance:** controlled rotations/reflections/x-y swaps showed that the vertical failure was learned axis anisotropy rather than asymmetric simulator physics; forced-collision evaluation repaired the V12 contact-data gap.
15
+ - **V14 — External Control Benchmark:** froze V9 and moved to CartPole-v1, MountainCar-v0, and Acrobot-v1. V9 did not transfer competitively on long-horizon full-frame rollout MSE.
16
+ - **V15/V15.1 — External Dynamics Diagnostic:** tested whether V14 was mainly a static-background metric artifact. Foreground, motion, latent, and discretized-state diagnostics supported a genuine external dynamics-transfer limitation. V15.1 fixes the state-token diagnostic shape/API bug without changing the model or protocol.
17
+
18
+ ## Included measured result files
19
+
20
+ This package contains the measured CSVs available from the final audit sequence:
21
+
22
+ - `results/v12_causal_decomposition/stratified_metrics_summary.csv`
23
+ - `results/v12_causal_decomposition/paired_bootstrap_v9_vs_controls.csv`
24
+ - `results/v13_axis_equivariance/axis_equivariance_summary.csv`
25
+ - `results/v13_axis_equivariance/forced_collision_summary.csv`
26
+ - `results/v14_external_control/metrics_summary.csv`
27
+ - `results/v15_external_diagnostics/diagnostics_summary.csv`
28
+ - `results/v15_external_diagnostics/diagnostics_by_seed.csv`
29
+
30
+ Earlier V6–V11 protocols and rationale are preserved in their versioned Markdown documents in the repository. Raw per-run artifacts for those earlier versions are not reconstructed here unless already present in the source tree; this release does not fabricate missing historical files.
31
+
32
+ ## Final scientific interpretation
33
+
34
+ The experiments support a narrower conclusion than the original architectural hypothesis. Structured spectral/operator dynamics can yield stable and useful counterfactual behavior in controlled synthetic settings, but the frozen V9 model developed strong coordinate anisotropy and did not transfer competitively to the three external Classic Control visual-dynamics tasks. V15.1 indicates that this external result is not explained solely by static-background bias in full-frame pixel MSE.
35
+
36
+ This release intentionally stops architecture iteration after V15.1.
hf/configuration_swm.py ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ from transformers import PretrainedConfig
2
+
3
+ class SpectralWorldModelConfig(PretrainedConfig):
4
+ model_type = "spectral_world_model"
5
+ def __init__(self, image_size=32, max_text_len=5, vocab_size=15, action_dim=5,
6
+ latent_dim=96, image_latent_dim=48, text_latent_dim=32, **kwargs):
7
+ super().__init__(**kwargs)
8
+ self.image_size=image_size; self.max_text_len=max_text_len; self.vocab_size=vocab_size
9
+ self.action_dim=action_dim; self.latent_dim=latent_dim
10
+ self.image_latent_dim=image_latent_dim; self.text_latent_dim=text_latent_dim
pyproject.toml ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [build-system]
2
+ requires = ["setuptools>=68", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "spectral-world-models"
7
+ version = "0.1.0"
8
+ description = "Spectral World Models: multimodal operator learning in Hilbert space for imagination-based planning"
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ authors = [{name="Andrew J. Kiruluta"}]
12
+ dependencies = [
13
+ "torch>=2.0",
14
+ "numpy>=1.23",
15
+ "tqdm>=4.0",
16
+ "matplotlib>=3.6"
17
+ ]
18
+
19
+ [tool.setuptools.packages.find]
20
+ where = ["."]
21
+ include = ["spectral_world_models*"]
22
+
23
+ [project.optional-dependencies]
24
+ external = ["gymnasium[classic-control]>=1.0,<2"]
requirements.txt ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ torch>=2.0
2
+ numpy>=1.23
3
+ tqdm>=4.0
4
+ matplotlib>=3.6
results/README.md ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Quick Benchmark Results
2
+ These metrics were generated by running `scripts/run_quick_benchmark.py` on CPU with the bundled Mini Moving Shapes dataset. They are intended as reproducibility smoke-test metrics, not final paper-grade multi-seed numbers.
3
+ ## Main baselines
4
+ | Method | Params | Test PSNR ↑ | Test SSIM ↑ | Test NLL ↓ | Rollout MSE@5 ↓ | Time/step ms ↓ |
5
+ |---|---:|---:|---:|---:|---:|---:|
6
+ | Dreamer-style latent model | 497,682 | 14.571 | 0.072 | 0.0107 | 0.03490 | 0.0528 |
7
+ | Transformer latent predictor | 503,322 | 14.368 | 0.017 | 0.0687 | 0.03657 | 0.0290 |
8
+ | Koopman baseline | 465,306 | 14.619 | 0.090 | -0.0027 | 0.03487 | 0.0170 |
9
+ | Neural-operator baseline | 403,794 | 14.534 | 0.058 | 0.0210 | 0.03511 | 0.0194 |
10
+ | Spectral World Model (ours) | 405,422 | 14.591 | 0.080 | 0.0050 | 0.03577 | 0.0343 |
11
+
12
+ ## Ablations
13
+ | Variant | Params | Test PSNR ↑ | Test NLL ↓ | Rollout MSE@5 ↓ | Time/step ms ↓ |
14
+ |---|---:|---:|---:|---:|---:|
15
+ | Spectral World Model (ours) | 405,422 | 14.591 | 0.0050 | 0.03577 | 0.0343 |
16
+ | No spectral state | 497,682 | 14.567 | 0.0117 | 0.03492 | 0.0184 |
17
+ | No spectral transition | 446,802 | 14.562 | 0.0131 | 0.03505 | 0.0318 |
18
+ | No text branch | 402,350 | 14.729 | -0.0325 | 0.03508 | 0.0302 |
19
+ | No stability penalty | 405,422 | 14.433 | 0.0498 | 0.03609 | 0.0294 |
results/dreamer.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7754579118d0a89cfb2781b7e97f5b2c4f02dc950cc6269339ec7daefcd04ecc
3
+ size 2002301
results/dreamer_history.csv ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ model,epoch,train_loss,val_loss,val_mse,val_psnr,val_ssim,val_nll,val_text_acc
2
+ dreamer,1,0.23922246268817357,0.18563266098499298,0.03763256222009659,14.244362116517717,0.00794300902634859,0.1053612008690834,0.45267857142857143
3
+ dreamer,2,0.2113134688032525,0.11774692365101405,0.03554206341505051,14.49257362581445,0.054459843784570694,0.03277435526251793,0.4200892857142857
4
+ dreamer,3,0.11036801284977368,0.10580005390303475,0.035179004073143005,14.537164596955208,0.07900667190551758,0.02016819454729557,0.5526785714285715
results/dreamer_metrics.json ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "model": "dreamer",
3
+ "params": 497682,
4
+ "epochs": 3,
5
+ "best_val_loss": 0.10580005390303475,
6
+ "val": {
7
+ "loss": 0.10580005390303475,
8
+ "mse": 0.035179004073143005,
9
+ "psnr": 14.537164596955208,
10
+ "ssim": 0.07900667190551758,
11
+ "nll": 0.02016819454729557,
12
+ "text_acc": 0.5526785714285715
13
+ },
14
+ "test": {
15
+ "loss": 0.10651075627122607,
16
+ "mse": 0.03490705043077469,
17
+ "psnr": 14.570868465670038,
18
+ "ssim": 0.07190005481243134,
19
+ "nll": 0.010725376196205616,
20
+ "text_acc": 0.5008928571428571
21
+ },
22
+ "rollout": {
23
+ "rollout_mse": 0.034899838268756866,
24
+ "time_per_rollout_step_ms": 0.052804646875070915
25
+ },
26
+ "history": [
27
+ {
28
+ "model": "dreamer",
29
+ "epoch": 1,
30
+ "train_loss": 0.23922246268817357,
31
+ "val_loss": 0.18563266098499298,
32
+ "val_mse": 0.03763256222009659,
33
+ "val_psnr": 14.244362116517717,
34
+ "val_ssim": 0.00794300902634859,
35
+ "val_nll": 0.1053612008690834,
36
+ "val_text_acc": 0.45267857142857143
37
+ },
38
+ {
39
+ "model": "dreamer",
40
+ "epoch": 2,
41
+ "train_loss": 0.2113134688032525,
42
+ "val_loss": 0.11774692365101405,
43
+ "val_mse": 0.03554206341505051,
44
+ "val_psnr": 14.49257362581445,
45
+ "val_ssim": 0.054459843784570694,
46
+ "val_nll": 0.03277435526251793,
47
+ "val_text_acc": 0.4200892857142857
48
+ },
49
+ {
50
+ "model": "dreamer",
51
+ "epoch": 3,
52
+ "train_loss": 0.11036801284977368,
53
+ "val_loss": 0.10580005390303475,
54
+ "val_mse": 0.035179004073143005,
55
+ "val_psnr": 14.537164596955208,
56
+ "val_ssim": 0.07900667190551758,
57
+ "val_nll": 0.02016819454729557,
58
+ "val_text_acc": 0.5526785714285715
59
+ }
60
+ ]
61
+ }
results/koopman.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a24d327994545a03f46d9f9db6b7fe6ea29b1bf407bcaac76bcb88f897377a23
3
+ size 1870988
results/koopman_history.csv ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ model,epoch,train_loss,val_loss,val_mse,val_psnr,val_ssim,val_nll,val_text_acc
2
+ koopman,1,0.1982219240495137,0.1363554298877716,0.036813490092754364,14.339930074331706,0.022857418283820152,0.07692114263772964,0.5790178571428571
3
+ koopman,2,0.12113601448280471,0.11492279065506798,0.035316966474056244,14.520166069109159,0.06720736622810364,0.024958457797765732,0.7040178571428571
4
+ koopman,3,0.10989103439663138,0.10961772288594927,0.034873176366090775,14.575084938216127,0.09624947607517242,0.009549240581691265,0.8486607142857143
results/koopman_metrics.json ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "model": "koopman",
3
+ "params": 465306,
4
+ "epochs": 3,
5
+ "best_val_loss": 0.10961772288594927,
6
+ "val": {
7
+ "loss": 0.10961772288594927,
8
+ "mse": 0.034873176366090775,
9
+ "psnr": 14.575084938216127,
10
+ "ssim": 0.09624947607517242,
11
+ "nll": 0.009549240581691265,
12
+ "text_acc": 0.8486607142857143
13
+ },
14
+ "test": {
15
+ "loss": 0.1099218875169754,
16
+ "mse": 0.034520506858825684,
17
+ "psnr": 14.61922836236809,
18
+ "ssim": 0.0897933691740036,
19
+ "nll": -0.0026963024865835905,
20
+ "text_acc": 0.8419642857142857
21
+ },
22
+ "rollout": {
23
+ "rollout_mse": 0.034873973578214645,
24
+ "time_per_rollout_step_ms": 0.01702466562498728
25
+ },
26
+ "history": [
27
+ {
28
+ "model": "koopman",
29
+ "epoch": 1,
30
+ "train_loss": 0.1982219240495137,
31
+ "val_loss": 0.1363554298877716,
32
+ "val_mse": 0.036813490092754364,
33
+ "val_psnr": 14.339930074331706,
34
+ "val_ssim": 0.022857418283820152,
35
+ "val_nll": 0.07692114263772964,
36
+ "val_text_acc": 0.5790178571428571
37
+ },
38
+ {
39
+ "model": "koopman",
40
+ "epoch": 2,
41
+ "train_loss": 0.12113601448280471,
42
+ "val_loss": 0.11492279065506798,
43
+ "val_mse": 0.035316966474056244,
44
+ "val_psnr": 14.520166069109159,
45
+ "val_ssim": 0.06720736622810364,
46
+ "val_nll": 0.024958457797765732,
47
+ "val_text_acc": 0.7040178571428571
48
+ },
49
+ {
50
+ "model": "koopman",
51
+ "epoch": 3,
52
+ "train_loss": 0.10989103439663138,
53
+ "val_loss": 0.10961772288594927,
54
+ "val_mse": 0.034873176366090775,
55
+ "val_psnr": 14.575084938216127,
56
+ "val_ssim": 0.09624947607517242,
57
+ "val_nll": 0.009549240581691265,
58
+ "val_text_acc": 0.8486607142857143
59
+ }
60
+ ]
61
+ }
results/metrics.csv ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ model,params,epochs,val_loss,val_psnr,val_ssim,val_nll,val_text_acc,test_loss,test_psnr,test_ssim,test_nll,test_text_acc,rollout_mse_h5,time_per_rollout_step_ms
2
+ dreamer,497682,3,0.10580005390303475,14.537164596955208,0.07900667190551758,0.02016819454729557,0.5526785714285715,0.10651075627122607,14.570868465670038,0.07190005481243134,0.010725376196205616,0.5008928571428571,0.034899838268756866,0.052804646875070915
3
+ transformer,503322,3,0.13327171334198543,14.30404067586808,0.01684718206524849,0.08752818405628204,0.47098214285714285,0.13411018465246474,14.368045538061631,0.016545191407203674,0.06867272406816483,0.4120535714285714,0.036570727825164795,0.029027615625043524
4
+ koopman,465306,3,0.10961772288594927,14.575084938216127,0.09624947607517242,0.009549240581691265,0.8486607142857143,0.1099218875169754,14.61922836236809,0.0897933691740036,-0.0026963024865835905,0.8419642857142857,0.034873973578214645,0.01702466562498728
5
+ neural_operator,403794,3,0.12681868778807776,14.497417828561044,0.06291486322879791,0.0313987098634243,0.6058035714285714,0.12872901665312902,14.534133092218475,0.05829298496246338,0.02102111093699932,0.584375,0.035108547657728195,0.01941507500005102
6
+ swm,405422,3,0.11073624342679977,14.562615702489506,0.0878821536898613,0.013030804693698883,0.8651785714285715,0.11030659292425428,14.591434429751091,0.08014871180057526,0.004999135155230761,0.8535714285714285,0.03577370569109917,0.03425489374997426
7
+ no_spectral_state,497682,3,0.11848256630556923,14.530032390072872,0.06655468046665192,0.022175762802362442,0.5571428571428572,0.11922914321933474,14.56741968803547,0.0609237365424633,0.011688289232552052,0.4861607142857143,0.0349217914044857,0.018417671874981778
8
+ no_spectral_transition,446802,3,0.11065810599497386,14.530231662570795,0.07634083926677704,0.02211970090866089,0.7464285714285714,0.11198038820709501,14.562336300836341,0.06826915591955185,0.013108844868838787,0.765625,0.035049136728048325,0.03176636875004135
9
+ no_text_branch,402350,3,0.1184177217738969,14.66014843918864,0.12382669746875763,-0.013937046751379967,0.725,0.11902656512601036,14.728564469992364,0.12929166853427887,-0.032495759427547455,0.7026785714285714,0.03507991507649422,0.03016817812504513
10
+ no_stability_penalty,405422,2,0.12874157088143484,14.36634023825047,0.044199828058481216,0.06917144358158112,0.6120535714285714,0.13050702214241028,14.43291172530207,0.04435477778315544,0.04984518140554428,0.584375,0.03608756139874458,0.029396649999924307
results/metrics.json ADDED
@@ -0,0 +1,543 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "note": "Actual quick CPU benchmark metrics generated in sandbox. These are smoke-test metrics, not paper-grade multi-seed results.",
3
+ "models": [
4
+ {
5
+ "model": "dreamer",
6
+ "params": 497682,
7
+ "epochs": 3,
8
+ "best_val_loss": 0.10580005390303475,
9
+ "val": {
10
+ "loss": 0.10580005390303475,
11
+ "mse": 0.035179004073143005,
12
+ "psnr": 14.537164596955208,
13
+ "ssim": 0.07900667190551758,
14
+ "nll": 0.02016819454729557,
15
+ "text_acc": 0.5526785714285715
16
+ },
17
+ "test": {
18
+ "loss": 0.10651075627122607,
19
+ "mse": 0.03490705043077469,
20
+ "psnr": 14.570868465670038,
21
+ "ssim": 0.07190005481243134,
22
+ "nll": 0.010725376196205616,
23
+ "text_acc": 0.5008928571428571
24
+ },
25
+ "rollout": {
26
+ "rollout_mse": 0.034899838268756866,
27
+ "time_per_rollout_step_ms": 0.052804646875070915
28
+ },
29
+ "history": [
30
+ {
31
+ "model": "dreamer",
32
+ "epoch": 1,
33
+ "train_loss": 0.23922246268817357,
34
+ "val_loss": 0.18563266098499298,
35
+ "val_mse": 0.03763256222009659,
36
+ "val_psnr": 14.244362116517717,
37
+ "val_ssim": 0.00794300902634859,
38
+ "val_nll": 0.1053612008690834,
39
+ "val_text_acc": 0.45267857142857143
40
+ },
41
+ {
42
+ "model": "dreamer",
43
+ "epoch": 2,
44
+ "train_loss": 0.2113134688032525,
45
+ "val_loss": 0.11774692365101405,
46
+ "val_mse": 0.03554206341505051,
47
+ "val_psnr": 14.49257362581445,
48
+ "val_ssim": 0.054459843784570694,
49
+ "val_nll": 0.03277435526251793,
50
+ "val_text_acc": 0.4200892857142857
51
+ },
52
+ {
53
+ "model": "dreamer",
54
+ "epoch": 3,
55
+ "train_loss": 0.11036801284977368,
56
+ "val_loss": 0.10580005390303475,
57
+ "val_mse": 0.035179004073143005,
58
+ "val_psnr": 14.537164596955208,
59
+ "val_ssim": 0.07900667190551758,
60
+ "val_nll": 0.02016819454729557,
61
+ "val_text_acc": 0.5526785714285715
62
+ }
63
+ ]
64
+ },
65
+ {
66
+ "model": "transformer",
67
+ "params": 503322,
68
+ "epochs": 3,
69
+ "best_val_loss": 0.13327171334198543,
70
+ "val": {
71
+ "loss": 0.13327171334198543,
72
+ "mse": 0.03711897134780884,
73
+ "psnr": 14.30404067586808,
74
+ "ssim": 0.01684718206524849,
75
+ "nll": 0.08752818405628204,
76
+ "text_acc": 0.47098214285714285
77
+ },
78
+ "test": {
79
+ "loss": 0.13411018465246474,
80
+ "mse": 0.036575935781002045,
81
+ "psnr": 14.368045538061631,
82
+ "ssim": 0.016545191407203674,
83
+ "nll": 0.06867272406816483,
84
+ "text_acc": 0.4120535714285714
85
+ },
86
+ "rollout": {
87
+ "rollout_mse": 0.036570727825164795,
88
+ "time_per_rollout_step_ms": 0.029027615625043524
89
+ },
90
+ "history": [
91
+ {
92
+ "model": "transformer",
93
+ "epoch": 1,
94
+ "train_loss": 0.23709710474525178,
95
+ "val_loss": 0.13327171334198543,
96
+ "val_mse": 0.03711897134780884,
97
+ "val_psnr": 14.30404067586808,
98
+ "val_ssim": 0.01684718206524849,
99
+ "val_nll": 0.08752818405628204,
100
+ "val_text_acc": 0.47098214285714285
101
+ },
102
+ {
103
+ "model": "transformer",
104
+ "epoch": 2,
105
+ "train_loss": 0.16270889874015534,
106
+ "val_loss": 0.1869750597647258,
107
+ "val_mse": 0.035343486815690994,
108
+ "val_psnr": 14.516906073444048,
109
+ "val_ssim": 0.06779398024082184,
110
+ "val_nll": 0.025879332795739174,
111
+ "val_text_acc": 0.5580357142857143
112
+ },
113
+ {
114
+ "model": "transformer",
115
+ "epoch": 3,
116
+ "train_loss": 0.1466867652322565,
117
+ "val_loss": 0.13392244918005808,
118
+ "val_mse": 0.035102479159832,
119
+ "val_psnr": 14.54662209818714,
120
+ "val_ssim": 0.07712315022945404,
121
+ "val_nll": 0.01751108281314373,
122
+ "val_text_acc": 0.7321428571428571
123
+ }
124
+ ]
125
+ },
126
+ {
127
+ "model": "koopman",
128
+ "params": 465306,
129
+ "epochs": 3,
130
+ "best_val_loss": 0.10961772288594927,
131
+ "val": {
132
+ "loss": 0.10961772288594927,
133
+ "mse": 0.034873176366090775,
134
+ "psnr": 14.575084938216127,
135
+ "ssim": 0.09624947607517242,
136
+ "nll": 0.009549240581691265,
137
+ "text_acc": 0.8486607142857143
138
+ },
139
+ "test": {
140
+ "loss": 0.1099218875169754,
141
+ "mse": 0.034520506858825684,
142
+ "psnr": 14.61922836236809,
143
+ "ssim": 0.0897933691740036,
144
+ "nll": -0.0026963024865835905,
145
+ "text_acc": 0.8419642857142857
146
+ },
147
+ "rollout": {
148
+ "rollout_mse": 0.034873973578214645,
149
+ "time_per_rollout_step_ms": 0.01702466562498728
150
+ },
151
+ "history": [
152
+ {
153
+ "model": "koopman",
154
+ "epoch": 1,
155
+ "train_loss": 0.1982219240495137,
156
+ "val_loss": 0.1363554298877716,
157
+ "val_mse": 0.036813490092754364,
158
+ "val_psnr": 14.339930074331706,
159
+ "val_ssim": 0.022857418283820152,
160
+ "val_nll": 0.07692114263772964,
161
+ "val_text_acc": 0.5790178571428571
162
+ },
163
+ {
164
+ "model": "koopman",
165
+ "epoch": 2,
166
+ "train_loss": 0.12113601448280471,
167
+ "val_loss": 0.11492279065506798,
168
+ "val_mse": 0.035316966474056244,
169
+ "val_psnr": 14.520166069109159,
170
+ "val_ssim": 0.06720736622810364,
171
+ "val_nll": 0.024958457797765732,
172
+ "val_text_acc": 0.7040178571428571
173
+ },
174
+ {
175
+ "model": "koopman",
176
+ "epoch": 3,
177
+ "train_loss": 0.10989103439663138,
178
+ "val_loss": 0.10961772288594927,
179
+ "val_mse": 0.034873176366090775,
180
+ "val_psnr": 14.575084938216127,
181
+ "val_ssim": 0.09624947607517242,
182
+ "val_nll": 0.009549240581691265,
183
+ "val_text_acc": 0.8486607142857143
184
+ }
185
+ ]
186
+ },
187
+ {
188
+ "model": "neural_operator",
189
+ "params": 403794,
190
+ "epochs": 3,
191
+ "best_val_loss": 0.12681868778807776,
192
+ "val": {
193
+ "loss": 0.12681868778807776,
194
+ "mse": 0.035502441227436066,
195
+ "psnr": 14.497417828561044,
196
+ "ssim": 0.06291486322879791,
197
+ "nll": 0.0313987098634243,
198
+ "text_acc": 0.6058035714285714
199
+ },
200
+ "test": {
201
+ "loss": 0.12872901665312902,
202
+ "mse": 0.03520356863737106,
203
+ "psnr": 14.534133092218475,
204
+ "ssim": 0.05829298496246338,
205
+ "nll": 0.02102111093699932,
206
+ "text_acc": 0.584375
207
+ },
208
+ "rollout": {
209
+ "rollout_mse": 0.035108547657728195,
210
+ "time_per_rollout_step_ms": 0.01941507500005102
211
+ },
212
+ "history": [
213
+ {
214
+ "model": "neural_operator",
215
+ "epoch": 1,
216
+ "train_loss": 0.22099271257008826,
217
+ "val_loss": 0.14159053351197923,
218
+ "val_mse": 0.03796600177884102,
219
+ "val_psnr": 14.206051362501022,
220
+ "val_ssim": 0.0035837760660797358,
221
+ "val_nll": 0.11693888902664185,
222
+ "val_text_acc": 0.4611607142857143
223
+ },
224
+ {
225
+ "model": "neural_operator",
226
+ "epoch": 2,
227
+ "train_loss": 0.16356867498585156,
228
+ "val_loss": 0.19191501821790422,
229
+ "val_mse": 0.03761623427271843,
230
+ "val_psnr": 14.246246834384031,
231
+ "val_ssim": 0.014090199954807758,
232
+ "val_nll": 0.10479438304901123,
233
+ "val_text_acc": 0.5651785714285714
234
+ },
235
+ {
236
+ "model": "neural_operator",
237
+ "epoch": 3,
238
+ "train_loss": 0.16067370080522128,
239
+ "val_loss": 0.12681868778807776,
240
+ "val_mse": 0.035502441227436066,
241
+ "val_psnr": 14.497417828561044,
242
+ "val_ssim": 0.06291486322879791,
243
+ "val_nll": 0.0313987098634243,
244
+ "val_text_acc": 0.6058035714285714
245
+ }
246
+ ]
247
+ },
248
+ {
249
+ "model": "swm",
250
+ "params": 405422,
251
+ "epochs": 3,
252
+ "best_val_loss": 0.11073624342679977,
253
+ "val": {
254
+ "loss": 0.11073624342679977,
255
+ "mse": 0.034973446279764175,
256
+ "psnr": 14.562615702489506,
257
+ "ssim": 0.0878821536898613,
258
+ "nll": 0.013030804693698883,
259
+ "text_acc": 0.8651785714285715
260
+ },
261
+ "test": {
262
+ "loss": 0.11030659292425428,
263
+ "mse": 0.03474213927984238,
264
+ "psnr": 14.591434429751091,
265
+ "ssim": 0.08014871180057526,
266
+ "nll": 0.004999135155230761,
267
+ "text_acc": 0.8535714285714285
268
+ },
269
+ "rollout": {
270
+ "rollout_mse": 0.03577370569109917,
271
+ "time_per_rollout_step_ms": 0.03425489374997426
272
+ },
273
+ "history": [
274
+ {
275
+ "model": "swm",
276
+ "epoch": 1,
277
+ "train_loss": 0.21506715645747526,
278
+ "val_loss": 0.12526373671633856,
279
+ "val_mse": 0.03644835948944092,
280
+ "val_psnr": 14.383220141420779,
281
+ "val_ssim": 0.047720521688461304,
282
+ "val_nll": 0.06424301862716675,
283
+ "val_text_acc": 0.5825892857142857
284
+ },
285
+ {
286
+ "model": "swm",
287
+ "epoch": 2,
288
+ "train_loss": 0.1268984486481973,
289
+ "val_loss": 0.1202295475772449,
290
+ "val_mse": 0.03607780858874321,
291
+ "val_psnr": 14.427598499194552,
292
+ "val_ssim": 0.05312095209956169,
293
+ "val_nll": 0.05137684568762779,
294
+ "val_text_acc": 0.7339285714285714
295
+ },
296
+ {
297
+ "model": "swm",
298
+ "epoch": 3,
299
+ "train_loss": 0.12062653500054564,
300
+ "val_loss": 0.11073624342679977,
301
+ "val_mse": 0.034973446279764175,
302
+ "val_psnr": 14.562615702489506,
303
+ "val_ssim": 0.0878821536898613,
304
+ "val_nll": 0.013030804693698883,
305
+ "val_text_acc": 0.8651785714285715
306
+ }
307
+ ]
308
+ },
309
+ {
310
+ "model": "no_spectral_state",
311
+ "params": 497682,
312
+ "epochs": 3,
313
+ "best_val_loss": 0.11848256630556923,
314
+ "val": {
315
+ "loss": 0.11848256630556923,
316
+ "mse": 0.03523682430386543,
317
+ "psnr": 14.530032390072872,
318
+ "ssim": 0.06655468046665192,
319
+ "nll": 0.022175762802362442,
320
+ "text_acc": 0.5571428571428572
321
+ },
322
+ "test": {
323
+ "loss": 0.11922914321933474,
324
+ "mse": 0.03493478149175644,
325
+ "psnr": 14.56741968803547,
326
+ "ssim": 0.0609237365424633,
327
+ "nll": 0.011688289232552052,
328
+ "text_acc": 0.4861607142857143
329
+ },
330
+ "rollout": {
331
+ "rollout_mse": 0.0349217914044857,
332
+ "time_per_rollout_step_ms": 0.018417671874981778
333
+ },
334
+ "history": [
335
+ {
336
+ "model": "no_spectral_state",
337
+ "epoch": 1,
338
+ "train_loss": 0.231919277459383,
339
+ "val_loss": 0.16919530289513723,
340
+ "val_mse": 0.037993550300598145,
341
+ "val_psnr": 14.202901219778813,
342
+ "val_ssim": 0.0032276848796755075,
343
+ "val_nll": 0.11789543181657791,
344
+ "val_text_acc": 0.40267857142857144
345
+ },
346
+ {
347
+ "model": "no_spectral_state",
348
+ "epoch": 2,
349
+ "train_loss": 0.22328585758805275,
350
+ "val_loss": 0.16194516633238112,
351
+ "val_mse": 0.03718814626336098,
352
+ "val_psnr": 14.295954696017212,
353
+ "val_ssim": 0.031110256910324097,
354
+ "val_nll": 0.08993015438318253,
355
+ "val_text_acc": 0.45669642857142856
356
+ },
357
+ {
358
+ "model": "no_spectral_state",
359
+ "epoch": 3,
360
+ "train_loss": 0.13657328113913536,
361
+ "val_loss": 0.11848256630556923,
362
+ "val_mse": 0.03523682430386543,
363
+ "val_psnr": 14.530032390072872,
364
+ "val_ssim": 0.06655468046665192,
365
+ "val_nll": 0.022175762802362442,
366
+ "val_text_acc": 0.5571428571428572
367
+ }
368
+ ]
369
+ },
370
+ {
371
+ "model": "no_spectral_transition",
372
+ "params": 446802,
373
+ "epochs": 3,
374
+ "best_val_loss": 0.11065810599497386,
375
+ "val": {
376
+ "loss": 0.11065810599497386,
377
+ "mse": 0.0352352075278759,
378
+ "psnr": 14.530231662570795,
379
+ "ssim": 0.07634083926677704,
380
+ "nll": 0.02211970090866089,
381
+ "text_acc": 0.7464285714285714
382
+ },
383
+ "test": {
384
+ "loss": 0.11198038820709501,
385
+ "mse": 0.034975696355104446,
386
+ "psnr": 14.562336300836341,
387
+ "ssim": 0.06826915591955185,
388
+ "nll": 0.013108844868838787,
389
+ "text_acc": 0.765625
390
+ },
391
+ "rollout": {
392
+ "rollout_mse": 0.035049136728048325,
393
+ "time_per_rollout_step_ms": 0.03176636875004135
394
+ },
395
+ "history": [
396
+ {
397
+ "model": "no_spectral_transition",
398
+ "epoch": 1,
399
+ "train_loss": 0.2562547139823437,
400
+ "val_loss": 0.1607078973736082,
401
+ "val_mse": 0.036143843084573746,
402
+ "val_psnr": 14.419656718722425,
403
+ "val_ssim": 0.04245064780116081,
404
+ "val_nll": 0.05366950482130051,
405
+ "val_text_acc": 0.5049107142857143
406
+ },
407
+ {
408
+ "model": "no_spectral_transition",
409
+ "epoch": 2,
410
+ "train_loss": 0.14521276125950472,
411
+ "val_loss": 0.12309963681868144,
412
+ "val_mse": 0.03614606335759163,
413
+ "val_psnr": 14.41938994501424,
414
+ "val_ssim": 0.053956516087055206,
415
+ "val_nll": 0.053746674209833145,
416
+ "val_text_acc": 0.5526785714285715
417
+ },
418
+ {
419
+ "model": "no_spectral_transition",
420
+ "epoch": 3,
421
+ "train_loss": 0.11529357039502688,
422
+ "val_loss": 0.11065810599497386,
423
+ "val_mse": 0.0352352075278759,
424
+ "val_psnr": 14.530231662570795,
425
+ "val_ssim": 0.07634083926677704,
426
+ "val_nll": 0.02211970090866089,
427
+ "val_text_acc": 0.7464285714285714
428
+ }
429
+ ]
430
+ },
431
+ {
432
+ "model": "no_text_branch",
433
+ "params": 402350,
434
+ "epochs": 3,
435
+ "best_val_loss": 0.1184177217738969,
436
+ "val": {
437
+ "loss": 0.1184177217738969,
438
+ "mse": 0.034196775406599045,
439
+ "psnr": 14.66014843918864,
440
+ "ssim": 0.12382669746875763,
441
+ "nll": -0.013937046751379967,
442
+ "text_acc": 0.725
443
+ },
444
+ "test": {
445
+ "loss": 0.11902656512601036,
446
+ "mse": 0.033662281930446625,
447
+ "psnr": 14.728564469992364,
448
+ "ssim": 0.12929166853427887,
449
+ "nll": -0.032495759427547455,
450
+ "text_acc": 0.7026785714285714
451
+ },
452
+ "rollout": {
453
+ "rollout_mse": 0.03507991507649422,
454
+ "time_per_rollout_step_ms": 0.03016817812504513
455
+ },
456
+ "history": [
457
+ {
458
+ "model": "no_text_branch",
459
+ "epoch": 1,
460
+ "train_loss": 0.2242140466613429,
461
+ "val_loss": 0.12535723085914338,
462
+ "val_mse": 0.03669121488928795,
463
+ "val_psnr": 14.354379080047845,
464
+ "val_ssim": 0.045943256467580795,
465
+ "val_nll": 0.07267540693283081,
466
+ "val_text_acc": 0.5254464285714285
467
+ },
468
+ {
469
+ "model": "no_text_branch",
470
+ "epoch": 2,
471
+ "train_loss": 0.13053855379777296,
472
+ "val_loss": 0.12476341639246259,
473
+ "val_mse": 0.035839807242155075,
474
+ "val_psnr": 14.456343347770307,
475
+ "val_ssim": 0.05472106486558914,
476
+ "val_nll": 0.04311274737119675,
477
+ "val_text_acc": 0.6169642857142857
478
+ },
479
+ {
480
+ "model": "no_text_branch",
481
+ "epoch": 3,
482
+ "train_loss": 0.1171437967568636,
483
+ "val_loss": 0.1184177217738969,
484
+ "val_mse": 0.034196775406599045,
485
+ "val_psnr": 14.66014843918864,
486
+ "val_ssim": 0.12382669746875763,
487
+ "val_nll": -0.013937046751379967,
488
+ "val_text_acc": 0.725
489
+ }
490
+ ]
491
+ },
492
+ {
493
+ "model": "no_stability_penalty",
494
+ "params": 405422,
495
+ "epochs": 2,
496
+ "best_val_loss": 0.12874157088143484,
497
+ "val": {
498
+ "loss": 0.12874157088143484,
499
+ "mse": 0.036590300500392914,
500
+ "psnr": 14.36634023825047,
501
+ "ssim": 0.044199828058481216,
502
+ "nll": 0.06917144358158112,
503
+ "text_acc": 0.6120535714285714
504
+ },
505
+ "test": {
506
+ "loss": 0.13050702214241028,
507
+ "mse": 0.03603369742631912,
508
+ "psnr": 14.43291172530207,
509
+ "ssim": 0.04435477778315544,
510
+ "nll": 0.04984518140554428,
511
+ "text_acc": 0.584375
512
+ },
513
+ "rollout": {
514
+ "rollout_mse": 0.03608756139874458,
515
+ "time_per_rollout_step_ms": 0.029396649999924307
516
+ },
517
+ "history": [
518
+ {
519
+ "model": "no_stability_penalty",
520
+ "epoch": 1,
521
+ "train_loss": 0.22426620152379786,
522
+ "val_loss": 0.12874157088143484,
523
+ "val_mse": 0.036590300500392914,
524
+ "val_psnr": 14.36634023825047,
525
+ "val_ssim": 0.044199828058481216,
526
+ "val_nll": 0.06917144358158112,
527
+ "val_text_acc": 0.6120535714285714
528
+ },
529
+ {
530
+ "model": "no_stability_penalty",
531
+ "epoch": 2,
532
+ "train_loss": 0.13447609916329384,
533
+ "val_loss": 0.13604165826525008,
534
+ "val_mse": 0.035899341106414795,
535
+ "val_psnr": 14.449135223541106,
536
+ "val_ssim": 0.06068476289510727,
537
+ "val_nll": 0.04517996311187744,
538
+ "val_text_acc": 0.846875
539
+ }
540
+ ]
541
+ }
542
+ ]
543
+ }
results/neural_operator.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d2b7aea7c1936d2e3bcda86bf27e6148bd96889448259f009ba20daae42abeb7
3
+ size 1626542