Fix file list to match repo contents
Browse files
README.md
CHANGED
|
@@ -9,8 +9,9 @@ A ~250-line 2D toy that proves the paper's core principle end to end. Not a full
|
|
| 9 |
## Files
|
| 10 |
- `repro.py` — the entire thing (training + all three checks + figure), runnable via `uv run repro.py` (PEP 723 deps) or plain `python repro.py`.
|
| 11 |
- `metrics.json` — raw numbers from the run.
|
| 12 |
-
- `
|
| 13 |
-
|
|
|
|
| 14 |
|
| 15 |
## Setup
|
| 16 |
- **g**: RealNVP-style invertible network (8 affine couplings, hidden 64, ActNorm, 2D data) — the small analog of the paper's invertible `g`.
|
|
@@ -20,9 +21,13 @@ A ~250-line 2D toy that proves the paper's core principle end to end. Not a full
|
|
| 20 |
- **Hardware/cost**: ran on throttled CPU in ~20 minutes, effectively free.
|
| 21 |
|
| 22 |
## Structure follows the official implementation
|
| 23 |
-
Loss, sampler, and collapse-matrix construction copied in structure from `one_step/train_one_step.py` (commit `adfca2c`)
|
| 24 |
|
| 25 |
## What the checks do and do not show
|
| 26 |
- The N-step ≡ 1-step collapse (check 2) is the paper's headline claim and holds **exactly** here, as it must: it follows algebraically once the sampler is a composition of (affine-in-g) maps. This repro confirms the implementation actually realizes that algebra, rather than the claim being an approximation in practice.
|
| 27 |
- Induced linearity (check 1) likewise holds exactly, but note that evaluating it in *data space* through `g⁻¹` amplifies float round-trip error because `g` is ill-conditioned at this scale — the identity is exact where the algebra happens.
|
| 28 |
-
- Sample quality (check 3) is the only "learned" result and is accordingly the weakest: it demonstrates the principle (all modes reached in one step) at toy scale, not image quality parity with the paper.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
## Files
|
| 10 |
- `repro.py` — the entire thing (training + all three checks + figure), runnable via `uv run repro.py` (PEP 723 deps) or plain `python repro.py`.
|
| 11 |
- `metrics.json` — raw numbers from the run.
|
| 12 |
+
- `linearizer_toy.png` — data vs 100-step vs one-step samples, plus the loss curve.
|
| 13 |
+
|
| 14 |
+
(The trained `checkpoint.pt` is not stored here — rerun `repro.py` to regenerate it; ~20 minutes on CPU.)
|
| 15 |
|
| 16 |
## Setup
|
| 17 |
- **g**: RealNVP-style invertible network (8 affine couplings, hidden 64, ActNorm, 2D data) — the small analog of the paper's invertible `g`.
|
|
|
|
| 21 |
- **Hardware/cost**: ran on throttled CPU in ~20 minutes, effectively free.
|
| 22 |
|
| 23 |
## Structure follows the official implementation
|
| 24 |
+
Loss, sampler, and collapse-matrix construction copied in structure from `one_step/train_one_step.py` (commit `adfca2c`) of the official repo ([assafshocher/Linearizer](https://github.com/assafshocher/Linearizer)); the 2D modules (`InvertibleG`, `LinearCore`) are the 2D analogs of the official `modules/linear_network.py` components.
|
| 25 |
|
| 26 |
## What the checks do and do not show
|
| 27 |
- The N-step ≡ 1-step collapse (check 2) is the paper's headline claim and holds **exactly** here, as it must: it follows algebraically once the sampler is a composition of (affine-in-g) maps. This repro confirms the implementation actually realizes that algebra, rather than the claim being an approximation in practice.
|
| 28 |
- Induced linearity (check 1) likewise holds exactly, but note that evaluating it in *data space* through `g⁻¹` amplifies float round-trip error because `g` is ill-conditioned at this scale — the identity is exact where the algebra happens.
|
| 29 |
+
- Sample quality (check 3) is the only "learned" result and is accordingly the weakest: it demonstrates the principle (all modes reached in one step) at toy scale, not image quality parity with the paper.
|
| 30 |
+
|
| 31 |
+
## Reference
|
| 32 |
+
- Paper: [arXiv:2510.08570](https://arxiv.org/abs/2510.08570) — Berman, Hallak, Shocher, "Who Said Neural Networks Aren't Linear?"
|
| 33 |
+
- Official code: [assafshocher/Linearizer](https://github.com/assafshocher/Linearizer)
|