X30 write-up (items 1, 3; item 2 pending) and SISO notes
Browse files- docs/icml_r3_x30.md +183 -0
- nonlinear/experiments/x30_siso_notes.py +56 -0
- results/icml_r3/X30/siso/notes.json +89 -0
- results/icml_r3/X30/siso/notes.txt +13 -0
docs/icml_r3_x30.md
ADDED
|
@@ -0,0 +1,183 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: C+phi next to C-only on the three deck results that were C-only (X30). In SISO [34] and full-state [53] C+phi certifies no more plants than C-only; it is cheaper on SISO; the per-plant SDP stays convex with fixed knots. Actuator [50]-[52] pending.
|
| 3 |
+
date: 2026-11-20
|
| 4 |
+
status: items 1 (SISO [34]) and 3 (full-state [53]) complete; item 2 (actuator [50]-[52], X29 step 3B) running, results expected overnight
|
| 5 |
+
claim: X30 (Matteo, relayed by dc_presentation on 2026-11-20, "Do the experiments"; to the move-HPC session, "You can take a GPU node if you want or CPU whatever you need"). No main-talk result in the advisor deck should stay C-only. Each setup stays identical to the existing C-only run, with only C+phi added.
|
| 6 |
+
maps_to: deck slide 17 (former [34]), [53], [50] to [52]. No paper edit until Matteo agrees the claim.
|
| 7 |
+
scripts: nonlinear/experiments/x28_eval.py (SISO sampling and scoring), nonlinear/experiments/x30_siso.py (SISO report), nonlinear/experiments/x30_siso_notes.py (SISO self-check and clip note), nonlinear/mimo_unstable/x30_fs.py (full state), nonlinear/mimo_unstable/x30_act.py (actuator)
|
| 8 |
+
artifacts: results/icml_r3/X30/{PREREG.md, PREREG_fs.md}; results/icml_r3/X30/siso/{report.txt, numbers.json, notes.txt, notes.json, eval_test/, eval_test_report.txt}; results/icml_r3/X30/fs/{report.txt, numbers.json, sdp.json, cand_*.npz, ds_info.json}; results/icml_r3/X30/act/selfcheck_identity_m{3,4,5}.json. Git 519a02e (SISO final), 663a462 (full state); HF 5f24446 (SISO), 8b6e813 (full state)
|
| 9 |
+
---
|
| 10 |
+
|
| 11 |
+
# C+phi next to C-only on the three deck results that were C-only (X30)
|
| 12 |
+
|
| 13 |
+
## TL;DR
|
| 14 |
+
- **Question:** when the model also generates the spline phi (C+phi), do the three deck results that were C-only change?
|
| 15 |
+
- **Answer:** not in certification.
|
| 16 |
+
- SISO [34]: at 16 candidates C+phi certifies 96.5% (poles) and 73.9% (coefficients), against 96.6% and 74.7% for C-only.
|
| 17 |
+
- Full state [53]: C+phi certifies fewer plants, 82.8% against 96.1% at 1 candidate (iid).
|
| 18 |
+
- C+phi is cheaper in SISO: 8.84% against 10.28% above J* on poles, and 26.50% against 32.04% on coefficients.
|
| 19 |
+
- With the knots fixed, the per-plant SDP stays convex and certifies 180 of 180 test plants in 15.4 ms (iid median).
|
| 20 |
+
- **So what:** the [34] message (poles certify about 22 points more than coefficients) holds for both variants at sampler clip 1. It depends on the clip, though: at its validation-chosen clip, the C+phi coefficient model certifies 95.0%, as poles do. Item 2 (actuator) is pending.
|
| 21 |
+
|
| 22 |
+
## 1. Problem / Goal
|
| 23 |
+
Three results in the advisor deck were shown for C-only only:
|
| 24 |
+
- [34], SISO closed-loop poles against controller coefficients;
|
| 25 |
+
- [50] to [52], the actuator setting against the 48-start solver;
|
| 26 |
+
- [53], the full-state 2x2 family.
|
| 27 |
+
|
| 28 |
+
Matteo asked for C+phi on each, with the setup otherwise unchanged.
|
| 29 |
+
|
| 30 |
+
**Falsification.** Under a sector certificate, a certified pair (K, psi) implies a certified linear gain inside the same sector (`PREREG.md` section 2, structural note). At the per-plant optimum, C+phi therefore cannot certify a plant that C-only cannot.
|
| 31 |
+
- A generated C+phi can still certify fewer plants, because any knot spread widens the composed sector.
|
| 32 |
+
- So the testable outcomes per slide are: does C+phi match C-only's certified share, and does it change the cost?
|
| 33 |
+
- For [34], the extra question is whether the poles-over-coefficients gap holds for C+phi too.
|
| 34 |
+
|
| 35 |
+
## 2. Method
|
| 36 |
+
*Common terms.*
|
| 37 |
+
- **C-only:** the model generates the linear part. phi is fixed: sat_1 in SISO, the identity in MIMO.
|
| 38 |
+
- **C+phi:** the model generates the linear part and the 10 nonzero knots of a piecewise-linear phi (SISO), or the so3 knots of psi (MIMO: odd, knots at |x| = 1, 3, 5).
|
| 39 |
+
- **Candidates, b:** the first b of the generated samples per plant.
|
| 40 |
+
- **Certified %:** the share of plants with at least one certified candidate among the first b.
|
| 41 |
+
- **Regret:** (J - J*) / J* for the cheapest certified candidate, as the median over plants. Uncertified plants count as 1e3 (X29's convention) unless the row says "median over certified plants" (X27 and T9).
|
| 42 |
+
|
| 43 |
+
### 2.1 Item 1: SISO coordinates (deck [34])
|
| 44 |
+
- **Plants:** the 199 X21 test plants (open-loop unstable, seed 8282).
|
| 45 |
+
- Loop: u = -phi(clip(F y, -5, 5)) with a generated dynamic filter F.
|
| 46 |
+
- **Certificate:** X21's regional circle criterion. A candidate is certified at s if its radius r* is at least s (`siso_x20_unstable.rstar`, line 201).
|
| 47 |
+
- **The F check:** all poles of F have real part below -0.01 (`siso_x20_unstable.f_ok`, line 351).
|
| 48 |
+
- **Arms:** 16 candidates, guidance 1, sampler clip 1, sampling seed 4242, all scored by `x28_eval`.
|
| 49 |
+
|
| 50 |
+
| variant | coordinates | models (seeds 0, 1, 2) | t-repair, primary block |
|
| 51 |
+
|---|---|---|---|
|
| 52 |
+
| C-only | poles | X21 clL | yes |
|
| 53 |
+
| C-only | coefficients | X21 base (`x21_fgen`) | no |
|
| 54 |
+
| C+phi | poles | X28 clS | yes |
|
| 55 |
+
| C+phi | coefficients | X28 coefS (seeds 1, 2 trained for X30 with seed 0's recipe) | no |
|
| 56 |
+
|
| 57 |
+
- **t-repair** (`x28_eval.py:86`): a candidate that fails the F check is moved along the null vector of the loop, linearized at gain k = phi'(0). The passing point closest to the original is kept. Candidates that pass the F check are unchanged.
|
| 58 |
+
- **Blocks:**
|
| 59 |
+
- primary: the [34] setup, with t-repair on the poles arms only;
|
| 60 |
+
- secondary: t-repair on every arm (both coefficient arms re-run with it).
|
| 61 |
+
- **Cost reference:**
|
| 62 |
+
- J* = min(J_Fonly, X28 test joint labels), as on the SISO baselines slides (X29);
|
| 63 |
+
- also J_Fonly, the reference of the original [34] bars.
|
| 64 |
+
- **Paired differences:** plant-paired, seed j against seed j, bootstrap 95% CIs. They are descriptive, with no decision rule.
|
| 65 |
+
- **Self-check, pre-registered:** `x28_eval` on X21 clL seed 0 must reproduce the stored X21 output. It failed: the sampled F differ, and 794 of 3,184 candidates differ in certification (`siso/notes.txt`). As pre-registered, every C-only arm was therefore re-run through `x28_eval`, and the stored X21 numbers are shown next to the re-runs.
|
| 66 |
+
- **How to run** (one model at a time, 4 workers, on move-hpc-07-gpu):
|
| 67 |
+
```bash
|
| 68 |
+
X28_EVAL_OUT=results/icml_r3/X30/siso X21_CLIP=1 X28_K=16 X21_TREPAIR=1 PYTHONPATH=. python -m nonlinear.experiments.x28_eval models/x21_fgen_clL/best.pth test
|
| 69 |
+
PYTHONPATH=. python -m nonlinear.experiments.x30_siso # report.txt, numbers.json
|
| 70 |
+
PYTHONPATH=. python -m nonlinear.experiments.x30_siso_notes # notes.txt: self-check, clip comparison
|
| 71 |
+
```
|
| 72 |
+
|
| 73 |
+
### 2.2 Item 3: full-state feedback (deck [53]; `PREREG_fs.md`, run by a fork session)
|
| 74 |
+
- **Family** (T9): n = 4 states, m = 2 inputs, u = -Phi(psi(K x)), Phi_i in [0.4, 2.2].
|
| 75 |
+
- **Plants:** a 6,000-plant bank, 120 iid test plants and 60 out-of-distribution (ood) plants.
|
| 76 |
+
- **Certificate:** the circle LMI on the composed sector [0.4 alpha_i, 2.2 beta_i], where alpha_i and beta_i are the min and max knot ratio of psi_i. At identity knots it agrees with `family.verify` on 200 of 200 gains.
|
| 77 |
+
- **Labels:** Adam from each bank plant's SDP gain, with so3 starts at c = 1, 2, 5 and 100 steps. The label is the cheapest certified snapshot.
|
| 78 |
+
- **Arms:**
|
| 79 |
+
- generator: T9 recipe, diffusion, 3 seeds;
|
| 80 |
+
- regression twin: 3 seeds;
|
| 81 |
+
- lookup: the 16 nearest bank labels.
|
| 82 |
+
- The C-only arms are T9's stored candidates, re-scored.
|
| 83 |
+
- **Fixed-knot SDP:** with psi's knots fixed at each test plant's so3 label, the synthesis stays a convex program. It combines a circle LMI at the composed design sector with an S-procedure guaranteed-cost LMI (`PREREG_fs.md` section 6).
|
| 84 |
+
|
| 85 |
+
### 2.3 Item 2: actuator setting (deck [50] to [52]; X29 step 3B; `PREREG.md` section 2)
|
| 86 |
+
- **Setting** (X27): output feedback u = -Phi(psi(K y)) with m = 3, 4, 5 inputs, Phi_i in [0.4, 2.2], psi in the so3 class.
|
| 87 |
+
- **Certificate:** the circle LMI on the composed sector [0.4 alpha_i, 2.2 beta_i].
|
| 88 |
+
- **Labels:** every certified row of X27's training banks: 18,733 / 18,451 / 33,961 rows at m = 3 / 4 / 5.
|
| 89 |
+
- Per row: Adam with so3 starts at c = 1, 2, 5, 100 steps; the label is the cheapest certified snapshot.
|
| 90 |
+
- **Generators:** X27's recipe (diffusion, 96k steps x batch 64), seeds 0, 1, 2 per m.
|
| 91 |
+
- **Pipeline:** X27's filter on the composed sector, in four stages:
|
| 92 |
+
- raw b = 1 / 4 / 16;
|
| 93 |
+
- filt: a 7-gain Hurwitz filter, then the LMI;
|
| 94 |
+
- rep b = 16: flatten log r toward log r(1);
|
| 95 |
+
- ref n = 3 / 10: `x7_solver.refine` with the knots fixed.
|
| 96 |
+
- **KPIs:** certified %, regret against X29's J*_A, CPU per plant, X27's YES rule, and the X28 S4 paired rule.
|
| 97 |
+
- **Self-check:** at identity knots the new pipeline reproduces X27's published certified shares in 54 of 54 cells (`act/selfcheck_identity_m{3,4,5}.json`).
|
| 98 |
+
|
| 99 |
+
## 3. Results
|
| 100 |
+
**C+phi matches C-only's certified share in SISO and certifies fewer full-state plants. Its only gain is cost, in SISO.**
|
| 101 |
+
|
| 102 |
+
### 3.1 Item 1: SISO coordinates
|
| 103 |
+
Per arm, 3-seed mean [range] (`siso/report.txt`):
|
| 104 |
+
|
| 105 |
+
| variant | coordinates | t-repair | certified, b = 1 | certified, b = 16 | regret vs J*, b = 16 | regret vs J_Fonly, b = 16 |
|
| 106 |
+
|---|---|---|---|---|---|---|
|
| 107 |
+
| C-only | poles | yes | 68.7% [67.8, 69.8] | 96.6% [96.0, 97.0] | 10.28% [9.63, 10.80] | 3.27% [3.10, 3.60] |
|
| 108 |
+
| C-only | coefficients | no | 50.4% [49.7, 51.3] | 74.7% [73.9, 75.4] | 32.04% [31.64, 32.30] | 23.21% [19.93, 26.61] |
|
| 109 |
+
| C-only | coefficients | yes | 50.4% [49.7, 51.3] | 74.7% [73.9, 75.4] | 32.04% [31.64, 32.30] | 23.21% [19.93, 26.61] |
|
| 110 |
+
| C+phi | poles | yes | 56.3% [55.3, 56.8] | 96.5% [95.0, 98.0] | 8.84% [7.86, 9.42] | 4.15% [3.71, 4.43] |
|
| 111 |
+
| C+phi | coefficients | no | 46.7% [44.2, 49.7] | 73.9% [72.9, 74.4] | 26.50% [25.81, 27.78] | 21.68% [21.09, 22.06] |
|
| 112 |
+
| C+phi | coefficients | yes | 48.7% [46.7, 51.8] | 73.9% [72.9, 74.4] | 25.91% [24.15, 27.78] | 21.58% [21.09, 22.06] |
|
| 113 |
+
|
| 114 |
+
The stored X21 C-only outputs, scored the same way, certify 97.5 / 97.5 / 96.5% (poles) and 75.9 / 74.4 / 75.9% (coefficients) at b = 16.
|
| 115 |
+
|
| 116 |
+
Paired differences at b = 16, seeds 0 / 1 / 2, primary block:
|
| 117 |
+
|
| 118 |
+
| effect | certified points | regret points on the plants both certify |
|
| 119 |
+
|---|---|---|
|
| 120 |
+
| coordinates (poles minus coefficients), C-only | +21.6 / +22.1 / +22.1 | +4.15 / +2.79 / +2.29 (all CIs exclude 0) |
|
| 121 |
+
| coordinates, C+phi | +20.6 / +23.6 / +23.6 | +3.38 / +4.83 / +2.55 (all CIs exclude 0) |
|
| 122 |
+
| variant (C+phi minus C-only), poles | -2.0 / +2.0 / -0.5 (all CIs include 0) | -0.29 / +0.88 / +0.27 (all CIs include 0) |
|
| 123 |
+
| variant, coefficients | -1.0 / +0.5 / -2.0 (all CIs include 0) | +1.23 / +0.27 / +1.60 (only seed 2's CI excludes 0) |
|
| 124 |
+
|
| 125 |
+
- The regret column uses the plants both arms certify. About a quarter of the plants are uncertified by both coefficient arms, and at 1e3 they tie at 0, so the all-plant median of the paired difference is exactly 0 for the variant rows.
|
| 126 |
+
- The secondary block gives the same coordinate effects: +21.6 / +22.1 / +22.1 (C-only) and +20.6 / +23.6 / +23.6 (C+phi) certified points.
|
| 127 |
+
- On the coefficient arms, t-repair acts on very few candidates. Of 3,184 candidates per seed, it gains 7 / 4 / 9 (C-only) and 29 / 32 / 30 (C+phi). It changes no plant's certification at b = 16, and the cheapest certified cost on 0 (C-only) and 1 / 3 / 1 plants (C+phi).
|
| 128 |
+
|
| 129 |
+
The sampler clip, same checkpoints and t-repair on every row (`siso/notes.txt`; X28's stored test runs at the validation-chosen clip of `results/icml_r3/X28/val_clip_choice.json`):
|
| 130 |
+
|
| 131 |
+
| arm | clip 1 (X30): certified, regret vs J* | validation-chosen clip | at that clip: certified, regret vs J* |
|
| 132 |
+
|---|---|---|---|
|
| 133 |
+
| C-only poles, seeds 0 / 1 / 2 | 97.0 / 96.0 / 97.0%; 10.42 / 9.63 / 10.80% | 1.5 | 98.5 / 98.0 / 97.5%; 6.79 / 6.62 / 6.81% |
|
| 134 |
+
| C+phi poles, seeds 0 / 1 / 2 | 95.0 / 98.0 / 96.5%; 9.25 / 7.86 / 9.42% | 1.5 | 95.0 / 96.5 / 95.5%; 7.14 / 6.33 / 6.30% |
|
| 135 |
+
| C+phi coefficients, seed 0 | 74.4%; 24.15% | 3 | 95.0%; 10.58% |
|
| 136 |
+
| C-only coefficients | see the table above | never validated | not run |
|
| 137 |
+
|
| 138 |
+
### 3.2 Item 3: full state
|
| 139 |
+
Certified % at b = 1 / 4 / 16, 3-seed mean (`fs/report.txt`):
|
| 140 |
+
|
| 141 |
+
| split | arm | C+phi | C-only |
|
| 142 |
+
|---|---|---|---|
|
| 143 |
+
| iid (120) | generator | 82.8 / 95.8 / 98.3 | 96.1 / 99.7 / 100.0 |
|
| 144 |
+
| iid | twin | 72.2 / 81.9 / 91.1 | 96.9 / 97.2 / 98.3 |
|
| 145 |
+
| iid | lookup | 42.5 / 70.0 / 83.3 | 43.3 / 70.0 / 83.3 |
|
| 146 |
+
| ood (60) | generator | 45.6 / 61.1 / 70.0 | 58.9 / 69.4 / 74.4 |
|
| 147 |
+
| ood | twin | 31.7 / 44.4 / 53.3 | 61.1 / 62.8 / 63.9 |
|
| 148 |
+
| ood | lookup | 33.3 / 46.7 / 55.0 | 35.0 / 48.3 / 55.0 |
|
| 149 |
+
|
| 150 |
+
- **Regret** at b = 16 against J*_FS, median over certified plants (iid): C+phi generator -0.25% against C-only -0.26%.
|
| 151 |
+
- **Fixed-knot SDP:**
|
| 152 |
+
- feasible and certified on the composed sector on 120 of 120 iid and 60 of 60 ood plants, including the 28 and 37 plants whose knots are not a constant ratio;
|
| 153 |
+
- CPU 15.38 ms per plant (iid median), against 15.17 ms for the C-only SDP re-timed in the same run;
|
| 154 |
+
- bound over simulated cost 1.0002.
|
| 155 |
+
- **The labels are mostly linear:** 4,858 of the 6,000 bank labels are the SDP gain with identity knots, and the median cost gain over the SDP gain is -0.00%.
|
| 156 |
+
|
| 157 |
+
### 3.3 Item 2: actuator
|
| 158 |
+
<!-- TODO: pending. Labels at step 50 (m = 3) and 25 (m = 4, 5) of 100 at 12:30 UTC on 2026-11-20; then certify, dataset, 3 generators per m, sampling, pipeline, latency, report (results/icml_r3/X30/act/report_m{3,4,5}.txt). -->
|
| 159 |
+
|
| 160 |
+
**Reading.**
|
| 161 |
+
- In SISO, C+phi changes no certified share by more than 2 points. Its cost is lower: 1.44 points on poles and 5.54 points on coefficients, as 3-seed means against J*.
|
| 162 |
+
- Against J_Fonly, C+phi poles are 0.88 points dearer (4.15% against 3.27%). So the two references rank the variants differently on poles. J* also contains the joint (C+phi) labels; which plants drive the flip was not checked.
|
| 163 |
+
- The poles-over-coefficients gap is about 22 points for both variants at clip 1. t-repair explains none of it.
|
| 164 |
+
- The gap depends on the sampler clip. At clip 3, which its validation chose, the C+phi coefficient model certifies 95.0%, the same as C+phi poles at their clip (seed 0).
|
| 165 |
+
- In the full-state family, C+phi certifies fewer plants than C-only on every learned arm, as the structural note predicts for generated knots. The per-plant optimum gains nothing: most labels are linear.
|
| 166 |
+
|
| 167 |
+
## 4. Conclusion / Interpretation
|
| 168 |
+
- **What it means:**
|
| 169 |
+
- The deck can draw C+phi next to C-only on [34] and [53] without changing either message's direction.
|
| 170 |
+
- Generating phi does not buy certification in these settings, and it costs some at small b.
|
| 171 |
+
- In SISO it buys a lower cost, and only against J*.
|
| 172 |
+
- **Scope / caveats:**
|
| 173 |
+
- The SISO clip-1 setup is the original [34] setup, not the validated protocol of the baselines slides. The C-only coefficient models were never clip-validated.
|
| 174 |
+
- The SISO C-only numbers are re-runs, because the stored X21 draws could not be reproduced on this cluster. The two agree within about 1 point.
|
| 175 |
+
- Full-state ood is 60 plants.
|
| 176 |
+
- The full-state self-checks and runs were done by a fork session, and its report was verified by this session.
|
| 177 |
+
- **Claim status change:** none for the paper. For the deck:
|
| 178 |
+
- slide 17 keeps its numbers, with a clip caveat;
|
| 179 |
+
- [53] shows C+phi below C-only on certified share;
|
| 180 |
+
- the fixed-knot SDP answers dc_presentation's convexity question.
|
| 181 |
+
- **Next:** Matteo decides whether to run the coefficient clip validation (about 8 to 10 CPU-hours, no training). Item 2 lands overnight.
|
| 182 |
+
|
| 183 |
+
<!-- Related: [[icml_r3_x29]] (docs/icml_r3_x29.md, the C+phi baselines); [[icml_r3_x28]] (docs/icml_r3_x28.md, the spline generators); [[icml_r3_x31]] (docs/icml_r3_x31.md, the pendulum screen of the same day) -->
|
nonlinear/experiments/x30_siso_notes.py
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""X30-S notes (written after the runs, descriptive): (1) the PREREG section 1 self-check, recomputed from the files: x28_eval at clip 1 on X21 clL
|
| 2 |
+
seed 0 with t-repair vs the stored X21 output; (2) the clip comparison asked by dc_presentation: the same poles checkpoints sampled at clip 1
|
| 3 |
+
(X30) and at their validation-chosen clip (X28's stored test runs, results/icml_r3/X28/val_clip_choice.json), and the C+phi coefficient model
|
| 4 |
+
seed 0 at clip 1 and at its chosen clip 3. Every arm scored the same way (b = 16, J* = min(J_Fonly, X28 test joint labels), uncertified = 1e3).
|
| 5 |
+
Run: PYTHONPATH=. python -m nonlinear.experiments.x30_siso_notes -> results/icml_r3/X30/siso/notes.txt"""
|
| 6 |
+
import json
|
| 7 |
+
import numpy as np
|
| 8 |
+
|
| 9 |
+
E30, E28, E21 = "results/icml_r3/X30/siso/eval_test", "results/icml_r3/X28/eval_test", "results/icml_r3/X21/test_eval"
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
def score(path, ids, Jst, b=16):
|
| 13 |
+
z = np.load(path)
|
| 14 |
+
assert (z["ref_i"] == ids).all()
|
| 15 |
+
Jb = z["J"][:, :b].min(1)
|
| 16 |
+
ok = np.isfinite(Jb)
|
| 17 |
+
return ok.mean() * 100, np.median(np.where(ok, (Jb - Jst) / Jst, 1e3)) * 100
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
def main():
|
| 21 |
+
z0 = np.load(f"{E30}/x21_fgen_clL_best_tr_K16_clip1.npz")
|
| 22 |
+
ids, Jst = z0["ref_i"], z0["ref_J_star"]
|
| 23 |
+
L = ["X30-S notes (descriptive, written after the runs). Scoring: b = 16, regret vs J* = min(J_Fonly, X28 test joint labels), uncertified = 1e3."]
|
| 24 |
+
s = np.load(f"{E21}/x21_fgen_clL_best_w1_tr.npz")
|
| 25 |
+
J30, J21 = z0["J"][:, :16], s["J"][:, :16]
|
| 26 |
+
c30, c21 = np.isfinite(J30), np.isfinite(J21)
|
| 27 |
+
both = c30 & c21
|
| 28 |
+
rel = np.abs(J30[both] - J21[both]) / np.abs(J21[both])
|
| 29 |
+
F30, F21 = z0["F"][:, :16], s["F"][:, :16] if "F" in s.files else None
|
| 30 |
+
L.append("\n== (1) PREREG self-check: x28_eval (clip 1, t-repair) on X21 clL seed 0 vs the stored X21 output (x21_fgen_clL_best_w1_tr.npz)")
|
| 31 |
+
L.append(f" certified candidates: x28_eval {c30.sum()}, stored {c21.sum()} of {c30.size}; same certified set: {bool((c30 == c21).all())} ({int((c30 != c21).sum())} differ)")
|
| 32 |
+
L.append(f" J on the candidates certified by both: max rel diff {rel.max():.2e}, median {np.median(rel):.2e}; within 1e-6 on {int((rel <= 1e-6).sum())} of {both.sum()}")
|
| 33 |
+
if F21 is not None and F21.shape == F30.shape:
|
| 34 |
+
L.append(f" sampled F identical: {bool(np.allclose(F30, F21, rtol=0, atol=0))}; max abs diff {float(np.nanmax(np.abs(F30 - F21))):.3e}")
|
| 35 |
+
L.append(" -> " + ("PASSED" if (c30 == c21).all() and (rel <= 1e-6).all() else "FAILED: the draws differ, so every C-only arm is re-run through x28_eval (PREREG section 1)"))
|
| 36 |
+
ch = json.load(open("results/icml_r3/X28/val_clip_choice.json"))
|
| 37 |
+
L.append("\n== (2) clip: the same checkpoints at clip 1 (X30 runs) and at the validation-chosen clip (X28 stored test runs); t-repair on every row")
|
| 38 |
+
rows = [("C-only poles", [("x21_fgen_clL", "x21_fgen_clL_best_tr"), ("x21_fgen_clL_s1", "x21_fgen_clL_s1_best_tr"), ("x21_fgen_clL_s2", "x21_fgen_clL_s2_best_tr")]),
|
| 39 |
+
("C+phi poles", [("x28_clS_s0", "x28_clS_s0_best_tr"), ("x28_clS_s1", "x28_clS_s1_best_tr"), ("x28_clS_s2", "x28_clS_s2_best_tr")]),
|
| 40 |
+
("C+phi coefficients", [("x28_coefS_s0", "x28_coefS_s0_best_tr")])]
|
| 41 |
+
out = {}
|
| 42 |
+
for name, tags in rows:
|
| 43 |
+
a = [score(f"{E30}/{t}_best_tr_K16_clip1.npz", ids, Jst) for t, _ in tags]
|
| 44 |
+
cl = [ch[k]["clip"] for _, k in tags]
|
| 45 |
+
b = [score(f"{E28}/{t}_best_tr_K16_clip{c}.npz", ids, Jst) for (t, _), c in zip(tags, cl)]
|
| 46 |
+
f = lambda r: " / ".join(f"{x:.1f}% cert, {y:.2f}%" for x, y in r)
|
| 47 |
+
L.append(f" {name:19s} seeds {len(tags)}: clip 1: {f(a)} | chosen clip {'/'.join(cl)}: {f(b)}")
|
| 48 |
+
out[name] = dict(clip1=a, chosen_clip=cl, chosen=b)
|
| 49 |
+
L.append(" C-only coefficient models (X21 base): never clip-validated (X21 validated the poles model only, results/icml_r3/X21/clip_val_report.txt)")
|
| 50 |
+
open("results/icml_r3/X30/siso/notes.txt", "w").write("\n".join(L) + "\n")
|
| 51 |
+
json.dump(out, open("results/icml_r3/X30/siso/notes.json", "w"), indent=1)
|
| 52 |
+
print("\n".join(L))
|
| 53 |
+
|
| 54 |
+
|
| 55 |
+
if __name__ == "__main__":
|
| 56 |
+
main()
|
results/icml_r3/X30/siso/notes.json
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"C-only poles": {
|
| 3 |
+
"clip1": [
|
| 4 |
+
[
|
| 5 |
+
96.98492462311557,
|
| 6 |
+
10.418918701688334
|
| 7 |
+
],
|
| 8 |
+
[
|
| 9 |
+
95.97989949748744,
|
| 10 |
+
9.634953894191463
|
| 11 |
+
],
|
| 12 |
+
[
|
| 13 |
+
96.98492462311557,
|
| 14 |
+
10.798670970868143
|
| 15 |
+
]
|
| 16 |
+
],
|
| 17 |
+
"chosen_clip": [
|
| 18 |
+
"1.5",
|
| 19 |
+
"1.5",
|
| 20 |
+
"1.5"
|
| 21 |
+
],
|
| 22 |
+
"chosen": [
|
| 23 |
+
[
|
| 24 |
+
98.49246231155779,
|
| 25 |
+
6.790642686562219
|
| 26 |
+
],
|
| 27 |
+
[
|
| 28 |
+
97.98994974874373,
|
| 29 |
+
6.622439531083497
|
| 30 |
+
],
|
| 31 |
+
[
|
| 32 |
+
97.48743718592965,
|
| 33 |
+
6.8092246907948875
|
| 34 |
+
]
|
| 35 |
+
]
|
| 36 |
+
},
|
| 37 |
+
"C+phi poles": {
|
| 38 |
+
"clip1": [
|
| 39 |
+
[
|
| 40 |
+
94.9748743718593,
|
| 41 |
+
9.247272821108044
|
| 42 |
+
],
|
| 43 |
+
[
|
| 44 |
+
97.98994974874373,
|
| 45 |
+
7.855646722910372
|
| 46 |
+
],
|
| 47 |
+
[
|
| 48 |
+
96.4824120603015,
|
| 49 |
+
9.418142258995463
|
| 50 |
+
]
|
| 51 |
+
],
|
| 52 |
+
"chosen_clip": [
|
| 53 |
+
"1.5",
|
| 54 |
+
"1.5",
|
| 55 |
+
"1.5"
|
| 56 |
+
],
|
| 57 |
+
"chosen": [
|
| 58 |
+
[
|
| 59 |
+
94.9748743718593,
|
| 60 |
+
7.143839228708125
|
| 61 |
+
],
|
| 62 |
+
[
|
| 63 |
+
96.4824120603015,
|
| 64 |
+
6.333795343609581
|
| 65 |
+
],
|
| 66 |
+
[
|
| 67 |
+
95.47738693467338,
|
| 68 |
+
6.29564027668883
|
| 69 |
+
]
|
| 70 |
+
]
|
| 71 |
+
},
|
| 72 |
+
"C+phi coefficients": {
|
| 73 |
+
"clip1": [
|
| 74 |
+
[
|
| 75 |
+
74.37185929648241,
|
| 76 |
+
24.15191124258877
|
| 77 |
+
]
|
| 78 |
+
],
|
| 79 |
+
"chosen_clip": [
|
| 80 |
+
"3"
|
| 81 |
+
],
|
| 82 |
+
"chosen": [
|
| 83 |
+
[
|
| 84 |
+
94.9748743718593,
|
| 85 |
+
10.576864412067446
|
| 86 |
+
]
|
| 87 |
+
]
|
| 88 |
+
}
|
| 89 |
+
}
|
results/icml_r3/X30/siso/notes.txt
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
X30-S notes (descriptive, written after the runs). Scoring: b = 16, regret vs J* = min(J_Fonly, X28 test joint labels), uncertified = 1e3.
|
| 2 |
+
|
| 3 |
+
== (1) PREREG self-check: x28_eval (clip 1, t-repair) on X21 clL seed 0 vs the stored X21 output (x21_fgen_clL_best_w1_tr.npz)
|
| 4 |
+
certified candidates: x28_eval 2307, stored 2261 of 3184; same certified set: False (794 differ)
|
| 5 |
+
J on the candidates certified by both: max rel diff 2.51e+01, median 1.61e-01; within 1e-6 on 0 of 1887
|
| 6 |
+
sampled F identical: False; max abs diff 6.998e+04
|
| 7 |
+
-> FAILED: the draws differ, so every C-only arm is re-run through x28_eval (PREREG section 1)
|
| 8 |
+
|
| 9 |
+
== (2) clip: the same checkpoints at clip 1 (X30 runs) and at the validation-chosen clip (X28 stored test runs); t-repair on every row
|
| 10 |
+
C-only poles seeds 3: clip 1: 97.0% cert, 10.42% / 96.0% cert, 9.63% / 97.0% cert, 10.80% | chosen clip 1.5/1.5/1.5: 98.5% cert, 6.79% / 98.0% cert, 6.62% / 97.5% cert, 6.81%
|
| 11 |
+
C+phi poles seeds 3: clip 1: 95.0% cert, 9.25% / 98.0% cert, 7.86% / 96.5% cert, 9.42% | chosen clip 1.5/1.5/1.5: 95.0% cert, 7.14% / 96.5% cert, 6.33% / 95.5% cert, 6.30%
|
| 12 |
+
C+phi coefficients seeds 1: clip 1: 74.4% cert, 24.15% | chosen clip 3: 95.0% cert, 10.58%
|
| 13 |
+
C-only coefficient models (X21 base): never clip-validated (X21 validated the poles model only, results/icml_r3/X21/clip_val_report.txt)
|