Compare commits
6 Commits
protocol-v
...
8d5befb412
| Author | SHA1 | Date | |
|---|---|---|---|
| 8d5befb412 | |||
|
|
fc15bf6510 | ||
| bbdb82997c | |||
| 423a333ae9 | |||
| 2e4f618947 | |||
| 381b5ffb06 |
73
AGENTS.md
73
AGENTS.md
@@ -4,7 +4,7 @@ Seismic-to-porosity learning on F3 when the well tie is uncertain (RML: training
|
|||||||
|
|
||||||
Read first: `docs/plan.md` (plan, gates, decisions; §6 roadmap, §10 forbidden claims, §12 decision log), `README.md` (setup, scripts, logging), `docs/theory.md`. Progress page: `report.html`. These docs are in Vietnamese.
|
Read first: `docs/plan.md` (plan, gates, decisions; §6 roadmap, §10 forbidden claims, §12 decision log), `README.md` (setup, scripts, logging), `docs/theory.md`. Progress page: `report.html`. These docs are in Vietnamese.
|
||||||
|
|
||||||
## Status (29/10/2026)
|
## Status (02/11/2026)
|
||||||
|
|
||||||
- P0, P1 done. P2 closed: gate G-B failed on 26/10 and the P2 verdict stands.
|
- P0, P1 done. P2 closed: gate G-B failed on 26/10 and the P2 verdict stands.
|
||||||
- **P2r** (P2 rerun on new realizations 8–15 under the new pre-registration `configs/protocol_p2r.yaml`) is done and committed (5a6fb2f). Summary in `outputs/p2r/summary/` (`verdict.json`, `summary.md`); details in `docs/plan.md` §12 items 11–14.
|
- **P2r** (P2 rerun on new realizations 8–15 under the new pre-registration `configs/protocol_p2r.yaml`) is done and committed (5a6fb2f). Summary in `outputs/p2r/summary/` (`verdict.json`, `summary.md`); details in `docs/plan.md` §12 items 11–14.
|
||||||
@@ -81,8 +81,8 @@ Read first: `docs/plan.md` (plan, gates, decisions; §6 roadmap, §10 forbidden
|
|||||||
Propositions 3–6 (classical/Berkson tie error, calibrated bank with a
|
Propositions 3–6 (classical/Berkson tie error, calibrated bank with a
|
||||||
fourth-order population gain, coverage, misregistered reference),
|
fourth-order population gain, coverage, misregistered reference),
|
||||||
Corollaries 3–4, T4 (`scripts/30_t4_coverage.py`) and the post hoc H2b
|
Corollaries 3–4, T4 (`scripts/30_t4_coverage.py`) and the post hoc H2b
|
||||||
bound check (`scripts/31_p2r_posthoc.py`) in Sec. 6.3, T3 in Sec. 6.5,
|
bound check (`scripts/31_p2r_posthoc.py`) in Sec. 6.3, T3 in Sec. 6.5 (6.6 since 02/11),
|
||||||
field cases in Sec. 6.6 with F3/Volve details moved to Appendix B. Red
|
field cases in Sec. 6.6 (6.7 since 02/11) with F3/Volve details moved to Appendix B. Red
|
||||||
TODOs remain for S1–S8, T2 and the authors' declarations. **Self-correction
|
TODOs remain for S1–S8, T2 and the authors' declarations. **Self-correction
|
||||||
(29/10, A6):** two earlier agent claims were wrong. The first was "the two
|
(29/10, A6):** two earlier agent claims were wrong. The first was "the two
|
||||||
error structures give nearly the same bound (factor < 1.17)". In fact the
|
error structures give nearly the same bound (factor < 1.17)". In fact the
|
||||||
@@ -95,7 +95,7 @@ Read first: `docs/plan.md` (plan, gates, decisions; §6 roadmap, §10 forbidden
|
|||||||
computes both bounds and reads the Oracle npz files (about 6 min). The paper
|
computes both bounds and reads the Oracle npz files (about 6 min). The paper
|
||||||
(Sec. 4.3, 6.3 with a 1/B_b column in `tab:h2b`, 6.4, 7, abstract,
|
(Sec. 4.3, 6.3 with a 1/B_b column in `tab:h2b`, 6.4, 7, abstract,
|
||||||
introduction, conclusion) and the docs were corrected. **Length risk:**
|
introduction, conclusion) and the docs were corrected. **Length risk:**
|
||||||
the main text is about 14,750 words (crude count after A6) against a Computers & Geosciences limit
|
the main text was about 14,750 words (crude count after A6; about 18,100 after the 02/11 results pass) against a Computers & Geosciences limit
|
||||||
of about 5,500 (secondary source; not yet checked on the official page).
|
of about 5,500 (secondary source; not yet checked on the official page).
|
||||||
The user dropped the length pass for the venue on 29/10/2026 (`docs/plan.md`
|
The user dropped the length pass for the venue on 29/10/2026 (`docs/plan.md`
|
||||||
§12 item 25); the risk stays recorded as R9 with no mitigation.
|
§12 item 25); the risk stays recorded as R9 with no mitigation.
|
||||||
@@ -106,42 +106,45 @@ Read first: `docs/plan.md` (plan, gates, decisions; §6 roadmap, §10 forbidden
|
|||||||
`.gitignore`, and the 29/10 paper/docs edits. Run logs `logs/*.out` stay
|
`.gitignore`, and the 29/10 paper/docs edits. Run logs `logs/*.out` stay
|
||||||
untracked, as before (`docs/plan.md` §12 item 25).
|
untracked, as before (`docs/plan.md` §12 item 25).
|
||||||
|
|
||||||
|
- **P6 (level-B benchmark) started early on 29/10/2026; all main runs finished 02:16 UTC 30/10/2026** (`docs/plan.md` §12 item 26; code in commit 381b5ff). Subagents: Fable for reasoning-heavy work, Opus for routine work.
|
||||||
|
- p6-gen done: `misspec=` in `ml_porosity/data/synth_d2.py` (rock physics, wavelet, drift); `misspec=None` reproduces the P2r fingerprints bit for bit (`tests/test_d2_misspec.py`); presets in `configs/d2_synth_bench.yaml` are still PLACEHOLDER; QC in `scripts/33_bench_generator_qc.py`, notes in `docs/research/bench-generator.md`. The uniform rock-physics error is absorbed by the profiled-α likelihood (control only).
|
||||||
|
- T2 done (exploratory; declared and hashed before computing; results `docs/research/t2-results.md`, `outputs/t2/summary.md`). B3d-Sa's label error is Berkson at c = 1, so 1/B_b applies and the H2b gain does not exceed the population correction; a GP-noise bank with the posterior's mean and covariance gets most of the c = 1 gain (label augmentation); implicit re-registration is real (8/8 wide cells); no evidence for the multimodal mechanism; about a third of the PM–Oracle gap is training length. Never use T2 to reselect P2r budgets.
|
||||||
|
- Runner built (`ml_porosity/benchmark/`, `scripts/34_run_bench.py`, `35_bench_calibration.py`, `scripts/run_bench.sh`; design `docs/research/bench-protocol.md`); a P2r cell reproduces bit for bit through it. S2 levels chosen on dev 902–905. `configs/protocol_bench.yaml` is **locked** (29/10 14:39 UTC; sha256 aa763f0a…; TCN budgets 125 from dev; L1 levels above the declared band are disclosed). **Main runs started 29/10 14:43 UTC; all four drivers were SIGTERMed at 15:27 when the agent session ended** (setsid nohup is not enough). Relaunched in the user's tmux server (15:41 on cuda:0; resized at 16:07 UTC when the other project released both GPUs): `p6_s2` (S2, cuda:1, 6 workers), `p6_s1a` (S1 R10/Rm5/R0, cuda:0, 5 workers), `p6_s1b` (S1 R0h/R10tb, cuda:1, 2 workers), `p6_s348` (S3+S4+S8 train, cuda:0, 4 workers); logs `logs/bench_{s2_cuda1,s1a_cuda0,s1b_cuda1,s348_cuda0}.out`. Worker count is bounded by 40 CPUs (2 threads each). Since 16:22 UTC `operations/p6_supervisor.py` (tmux `p6_supervisor`, log `logs/p6_supervisor.out`, state `logs/p6_supervisor_state.json`) checks every 5 min: it relaunches dead unfinished drivers on the card with most free memory (keeping 2.5 GB free, at most 5 restarts each) and gives the workers of a finished driver to the one with most jobs left (21 workers total since 22:26 UTC, when S1 group B was boosted from 2 to 6 workers as the critical path). To change drivers by hand, stop the supervisor first and keep its state file consistent. The GPU co-tenant is the user's own `vinhnt` job (about 80 GB per card at 16:20 UTC); never touch it. Never run two drivers over the same study/regimes (the runner does not claim jobs). Drivers resume by fingerprint: restart a stopped driver with the same command; never edit locked code or inputs. New code files break the F3/Volve code-hash checks of the working tree; acceptable because P3/P4 are never rerun. **Final state (30/10):** S2 (224 posterior + 224 train) done 00:12 UTC, S3+S4+S8 train (384) done 00:58, S1 (560 train cells; posteriors done earlier) done 02:16 after a 01:02 split of group B into `p6_s1b_r0h` and `p6_s1b_r10tb` (36 workers, CPU-bound). The supervisor was stopped at 02:16; no P6 job is running and nothing needs resuming.
|
||||||
|
- **Summarize done (02/11/2026, 02:02 UTC; `docs/plan.md` §12 item 28).** Lock and the 8,799 synced `outputs/bench/` files checked first. Locked `scripts/34_run_bench.py summarize` → `outputs/bench/summary/` (`verdict.json`, `summary.md`, csv tables). Its verdict extraction differs from the locked statements in three places (S1-H1 needs exactly 2 rows but S1 has 4 N values → null; S2-H1 has no top-level `pass` → "not available"; S3-H1 adds the disclosed Ctl-GP to the stated competitor set). Locked code was not edited: `scripts/36_bench_verdicts.py` (outside the lock hash; checks the lock first) applies the statements as worded → `verdict_final.json`, `verdict_final.md`, `s3_h2a_stated.csv`. Report both readings; the paper's Methods must disclose this implementation deviation.
|
||||||
|
- **Verdicts (as worded): 9/11 pass.** S1-H1 pass (R10 c = 1.5: 0.853 / 0.796 at N = 4/16); S1-H2 pass (13/13 wide families, ρ = −0.47, p < 1e−4); **S2-H1 fails for rock physics (0.940 / 0.934) and wavelet (1.023 / 1.042; posterior overconfident, cov90 0.17 / 0.10), passes for drift (0.862 / 0.798)**; S2-H2 pass (14/14 ≤ 1.02); S3-H1 pass in R10, R0, Rm5 (as run with Ctl-GP: fail everywhere, because Ctl-GP nearly equals B3d-Sa); S4-H1, S4-H2, S8-H1, S8-H2 pass. S2 is complete, so the paper may say "benchmark"; never claim H2a is robust to misspecification in general (`docs/plan.md` §10).
|
||||||
|
- **S7 packaging done (02/11/2026; `docs/plan.md` §12 item 29), except the Zenodo deposit.** `scripts/37_bench_package.py` (outside the lock; `generate`/`tables` check it first): `generate` → 630 tasks (test 8–15, dev 900–905; 45 per realization: 5 nominal regimes × 5 c, 14 S2 settings, 6 S8 settings), hidden truth, inputs and `inputs/analyst.json` in `outputs/bench/package/` (845 MB, gitignored, the Zenodo payload); content hashes in `benchmark/MANIFEST.json` (git). A second `generate` reproduced all 1,260 content hashes, and `check` matches 1,265/1,265 files (with the 5 inputs). `tables` → 45,200 reference runs (21 methods), `benchmark/reference/{cells.csv,main_table.md}`. `score --pred DIR --name NAME` applies the locked H2a cell rule and `better` rule of `summary.py`. `selftest` passes (copies of saved B3d-Sa/BK2 predictions reproduce metrics to 5e-10 and the rule outputs, e.g. S1-H1 0.8529 / 0.7964). User docs: `benchmark/README.md` (English); `benchmark/zenodo_metadata.json` is a draft. **Do not upload to Zenodo without the user**: it needs their account, the author list, and a check of the licence (draft CC BY-SA 3.0, inherited from F3).
|
||||||
|
- **Results sections written (02/11/2026; `docs/plan.md` §12 item 30).** The paper now has Sec. 6.5 "Experiment 3: registration-aware benchmark": design and verdict tables, with both readings of D-13; S1 phase diagram; S2 table with the rock-physics and wavelet-phase failures; S3; S4; S8 table and figure; equal budgets. Sec. 6.4 (T2) replaces its todoblock. Sec. 3.2 gains the misspecification presets, Sec. 5 the TCN and the benchmark rows of `tab:methods`. The abstract, introduction, discussion and conclusion were updated, and the title todo was removed. F3 and Volve dataset citations (`dgb2023f3demo`, `equinor2018volve`) are in `paper/refs.bib`. Figures come from `scripts/38_bench_figures.py` (outside the lock); `--flipband` prints the post hoc S8 cos/cos² table. The locked S8-H2 statement calls BK2 "calibrated" only in the weak sense that the truth is a member. Under Corollary 3 (a), its λ → 0 transfer is cos²(πfΔ), while the measured value is 0.92–1.00 at N = 16. The paper says so; the verdict is unchanged. The paper compiles cleanly (66 pages); the main text is about 18,100 words (R9, no mitigation). Remaining todos: authors, author declarations, repository URL and DOI, Zenodo DOI and licence, Teapot licence, the Sec. 2 novelty todoblock.
|
||||||
|
- **Preliminary novelty scan for the Sec. 2 todoblock (02/11/2026; `docs/plan.md` §12 item 31).** Crossref, OpenAlex 2025–2026 and web search found no work that feeds tie uncertainty into the training of a property predictor, so "To our knowledge…" stands. Added, abstract only: Herrera & van der Baan 2014 (Geophysics; the 2012 preprint stays the version read), Autotie (da Costa Silva et al., Geophysics 2026; new row entry in `tab:positioning`) and Castagna, Kronberg & Gil (TLE 2026, tie and prediction quality metrics). Sukar et al. 2026 was rechecked in full (`refs/`): it trains on simulator-derived synthetic 4D maps, so "UQ→train = --" is fair, and Sec. 2 now says no tie places its labels. Still open for the submission-day rerun (13/11): the Palavicini Gurria et al. IMAGE 2026 abstract (no IMAGE 2026 expanded abstract indexed yet) and the Quesada 2024 DOI (otherwise keep the lab URL). The todoblock was shortened to these items. The paper compiles cleanly (66 pages).
|
||||||
|
- **Proof review and reproduction package (02/11/2026; `docs/plan.md` §12 item 32).** An independent subagent read Sec. 4, App. A and Lemma 5 and returned 15 findings; 14 were fixed and 1 partly (the registered names $B_a$/$B_b$ stay). No verdict or reported number changed. Main fixes: (A2) needs a bounded second moment; (B) is restricted to integer shifts up to β_max; Corollary 3's equal-weight two-member bank contains the true warp but is not calibrated, and cos²(πfΔ) is its λ → 0 transfer; Corollary 4's σ_r < σ/√2 is necessary at every frequency but not sufficient, and Sec. 6.6 now gives the simulated crossings 3.6/3.8/4.3 ms against σ/√2 = 3.0/4.1/5.1 ms; `docs/theory.md` synced. `scripts/39_repro_package.py` (outside every lock) builds five deterministic derived-data archives in `outputs/repro/` (gitignored; 11,112 files; F3 and synthetic CC BY-SA 3.0, Volve CC BY-NC-SA 4.0, Teapot CC0 unverified) with `repro/MANIFEST.json` (git), and `verify` reruns 12 stages in a clean room without raw data. The run of 02/11 (20 min, CPU) passes: 12/12 stages exit 0, no reads outside the clean room, 63 rewritten files identical in bytes (the 8 figures pixel-identical), 3 equal in value, none different; `tests/test_d2_misspec.py` passes 15/15 there (`repro/verify_report.md`). Reader docs: `repro/README.md`, `repro/requirements-linux.txt`; Sec. 8 has a derived-data sentence (DOI todo). **Not done, needs the user:** the deposit, the licence choice for the combined F3+Volve applicability tables, a code licence, and `39 code --rev` after a commit. The paper compiled cleanly then (67 pages).
|
||||||
|
- **Full texts of six abstract-only references (02/11/2026; `docs/plan.md` §12 item 33).** The user downloaded AWSM (`lim2025awsm`), BootNet (`lim2025bootnet`), P05 (`li2024bpinn`) and Guillon et al. 2020 (`guillon2020gtmetrics`) into `refs/`, renamed to their BibTeX keys; the two Rizzuti papers were obtained earlier that day. Every claim in Sec. 2 was checked against the full texts. The table classifications and "To our knowledge…" are unchanged. AWSM reports a time–depth posterior for 44 wells but keeps only the median- and minimum-misfit models, and no later step uses the posterior. Their ᵃ markers were removed, Sec. 2 now uses full-text wording, and the `refs.bib` annotes were updated. The paper compiles cleanly (68 pages). Still abstract-only: Autotie, Herrera 2014, Thiebaud, Cordoba, Mirza, Quesada, Huff, P04, P07, P09. **Closed by the user (02/11/2026):** no further full-text search; those entries keep their ᵃ marker. Castagna 2026 (CC BY) was then downloaded by the user (`refs/castagna2026quality.pdf`) and read in full. Its Discussion does address timing error: time–depth functions are never exact, time shifts mainly degrade the high frequencies, and their distribution-based measures are insensitive to small shifts. It does not model that error or use it in training. The earlier Sec. 2 sentence ("Their abstract does not consider error in the timing…") was therefore replaced; "To our knowledge…" stands.
|
||||||
|
- **Server move (30/10):** the repository folder is synced as a whole to a new server; `outputs/` stays out of git. About 600 MB of outputs force-added and pushed at 01:05–01:15 UTC were removed by a history rewrite and force-push at the user's request (`main` = 381b5ff). What is not in git, with sha256: `docs/research/server-migration.md`, `docs/research/unpushed_outputs.sha256`. tmux sessions do not move with the folder.
|
||||||
|
- Another project held about 125–142 GB on each H200 from about 13:00 to 16:00 UTC on 29/10 and released it by 16:06; if it returns, keep at least 2.5 GB free per card (about 1.56 GB per SMC worker, 0.7 GB per training worker).
|
||||||
|
|
||||||
|
- **Third machine (04/11/2026; `docs/plan.md` §12 item 34, `docs/research/server-migration.md` §4).** `outputs/` and `data/` come from the 30/10 snapshot (21,987/21,987 sha256 match). The 02/11 outputs outside git were regenerated and match byte for byte: `outputs/bench/summary/` (verdicts unchanged), `outputs/bench/package/` (1,260 hashes match `benchmark/MANIFEST.json`, selftest PASS), `outputs/repro/*.tar.gz` (`repro/MANIFEST.json` unchanged). `paper/main.pdf` was rebuilt (68 pages). `.venv` was aligned to the lock (numpy 2.5.4, tabulate 0.10.0, segyio 1.9.14). Still missing, the user must copy them: the 7 PDFs downloaded by hand on 02/11 in `refs/`, `outputs_thesis/`, and raw logs.
|
||||||
|
- **Technical overview restored (04/11/2026; `docs/plan.md` §12 item 35).** The 27/10 overview had been overwritten by the lecture in 0cfe202 (29/10). The lecture now lives in `docs/lecture.md`; `docs/technical_overview.md` was rebuilt from 9976abc and updated to 04/11 (Pivot 1 frame, SMC posterior, Propositions 3–6, P2r/P3/P4/P6 results, code map to script 39). No new results.
|
||||||
|
- **Hallucination audit and rewrite of the manuscript (04/11/2026; `docs/plan.md` §12 item 36, `docs/research/paper-audit.md`).** Done with the scientific-writing, literature-review, citation-management and academic-humanizer skills. Five subagents traced every number, citation and claim to `outputs/`, protocols, code and `refs/` texts and returned 87 findings; 4 were S1. (G1-01) Two TD models were conflated as "up to 36 ms". (G2-01) The warp prior was described as type-II ML, but the code uses MAP-II with σ_a = 7 and σ_b = 50 ms fixed, and σ_b = 19 ms is from a separate ML fit. (G3-01) The Exp. 1 protocol was described as tagged before its run; it was only hash-locked. (G5-01) PHIE_DT is linear in sonic at all four wells, not three. The main session verified the findings and applied 106 exact replacements in 10 sections and the highlights. A token guard confirms that only the approved numbers and citations changed: `tab:audit` follows `td_qc.csv`; prabowo/tao/DILATE are dropped from the intro; claims are scoped (σ_a arm one regime; extensions at R10; dr_L1 only; T3 exploratory); the 500-iteration arm is a trajectory record, not retraining; about 40 small number fixes. The academic-humanizer pass only split long sentences. No verdict, gate or threshold changed. `main.pdf` has 69 pages and builds cleanly. Open for the authors: G1-14 (Rizzuti/BootNet DL ✓), the 7 PDFs missing on this machine, the Volve licence wording (G2-10), the Rm5 "within the CI" null (G4-04), and the optional Kassis et al. 2026 citation.
|
||||||
|
- **Abstract rewritten (09/11/2026; `docs/plan.md` §12 item 37).** Shortened to 241 words for outside readers: no internal codes (R10 is now "10 dB"), no verdict counts. The synthetic result is one sentence with its assumptions stated up front (correct tie model, dense anchors of known uncertainty). At the user's request the abstract no longer mentions the failed first comparison, the drift-free gain or the misspecification failures; these remain disclosed in the body (C2, Secs. 6, 7, 8). The field failures stay. No new numbers; `main.pdf` builds cleanly (69 pages). Sec. 7 ("One simulator") now states that the nominal cells use the model the registration assumes, so their gains are not field estimates. The internal notation in Sec. 1 and Sec. 8 was removed in the rewrite below.
|
||||||
|
- **Manuscript rewritten for outside readers (09/11/2026; `docs/plan.md` §12 item 38, `docs/research/paper-style-survey.md`).** Descriptive names replace repository codes everywhere in the text, tables and captions (mapping in `paper/README.md`; configs, outputs and code keep the codes). Methods now precede Theory (`04_method.tex`, `05_theory.tex`), new Appendix C (`C_record.tex`) holds the protocol record and secondary results, `tab:lessons` gives each failure a cause and a lesson. Sec. 5 now states results in words, and the formal propositions, corollaries and proofs are in Appendix A (`docs/plan.md` §12 item 39); Sec. 6.6 has a worked example and Sec. 7 has "Practical advice". Two Fable referees: major revision in round 1, minor revision in round 2, accept after minor corrections and 5/5 criteria in round 3; those corrections were applied. No verdict, threshold or protocol changed. `main.pdf` has 69 pages and builds cleanly; the main text is about 15,400 words. **Still open:** regenerate the figures on a machine with `outputs/*/summary` (labels already changed in `scripts/22` and `scripts/38`), then delete the red `\figcodes` notes and rerun the clean-room check.
|
||||||
|
|
||||||
## Next
|
## Next
|
||||||
|
|
||||||
Schedule: `docs/plan.md` §6.1 (level B, 29/10 → 14/11/2026). Cut-scope order
|
Schedule: `docs/plan.md` §6.1 (level B, 29/10 → 14/11/2026). Cut-scope order
|
||||||
if late is given there; never cut thresholds.
|
if late is given there; never cut thresholds.
|
||||||
|
|
||||||
1. **Dataset citations (30–31/10).** Level A writing is done (plan §12 item 24).
|
1. **Dataset citations: done 02/11/2026** (plan §12 item 30). The length pass
|
||||||
Add the F3 and Volve dataset citations to `paper/refs.bib`. The length pass
|
|
||||||
for the venue was dropped by the user on 29/10/2026 (plan §12 item 25): do
|
for the venue was dropped by the user on 29/10/2026 (plan §12 item 25): do
|
||||||
not schedule it. The rest of these two days is buffer.
|
not schedule it.
|
||||||
2. **T2 mechanism study (1/11), exploratory:** declare
|
2. **T2 mechanism study: done on 29/10/2026; written into Sec. 6.4 on 02/11/2026** (plan §12 item 30).
|
||||||
`docs/research/t2-mechanism.md` before running. The question is now
|
3. **protocol_bench: done early (locked 29/10 14:39 UTC).** See Status.
|
||||||
whether any bank gain remains beyond the population correction of the
|
4. **Runs: done early (29/10 14:43 → 30/10 02:16 UTC). Summarize and the 11
|
||||||
Berkson structure. Five tests, as in the Sec. 6.4 todoblock: (i)
|
verdicts: done 02/11/2026** (see Status; `outputs/bench/summary/verdict_final.md`).
|
||||||
responsibility-weighted warp error vs. mean-warp error; (ii) random GP-noise
|
5. **S7 packaging: done 02/11/2026** except the Zenodo deposit (user's account; fill the TODOs of
|
||||||
bank control; (iii) multimodal-cell split; (iv) Berkson-vs-classical
|
`benchmark/zenodo_metadata.json` first, then put the DOI into `benchmark/README.md` and Sec. 8).
|
||||||
covariance test for the bulk offset of B3d-Sa and B3c-R, which decides which
|
**Results sections: done 02/11/2026** (plan §12 item 30). **Proof appendix review and reproduction
|
||||||
bound applies; (v) B3d-Sa retrained at the Oracle's 500 iterations. The
|
package: done 02/11/2026** (plan §12 item 32) except the deposit of `outputs/repro/*.tar.gz` (user's account and licence decisions).
|
||||||
declaration must disclose what was already inspected post hoc on 29/10
|
6. **Next: review and submission (11–14/11; can start early):** internal review (hallucination audit done 04/11, plan §12 item 36; open author items listed there), figures, final
|
||||||
(`outputs/p2r/posthoc/`): the Oracle/B3d-Sa and M2-Sa/B3d-Sa ratios and
|
proofread of the proof appendix (reviewed 02/11), final novelty scan (Sec. 2 todoblock; preliminary scan done 02/11, plan §12 item 31), quartile check, preprint, submit to
|
||||||
every bound, (a), (b), b60 and cross-spectral, at σ_post and at the warp
|
*Computers & Geosciences*. The authors must fill the author list and declarations.
|
||||||
error.
|
|
||||||
3. **protocol_bench (2–3/11):** add misspecification parameters to
|
|
||||||
`ml_porosity/data/synth_d2.py` without changing the default path (P2r must
|
|
||||||
still reproduce); dev on new realizations 902–905 only; lock
|
|
||||||
`configs/protocol_bench.yaml` + `.sha256` + `.lock.json` before the first
|
|
||||||
main run. Contents: S1 grid fill (c ∈ {0.5, 1.5}, N ∈ {2, 8}), S2 three
|
|
||||||
misspec axes (R10, Rm5; c = 1; N ∈ {4, 16}; Oracle, B3c-R, B3d-Sa, M2-Sa),
|
|
||||||
S3 (B4 under the SMC posterior), S4 (second backbone), S8 (controlled
|
|
||||||
cycle-skip regime). Realizations 8–15 for all main cells.
|
|
||||||
4. **Runs (4–7/11)** on both GPUs, detached with `setsid nohup`, via a
|
|
||||||
`scripts/run_bench.sh` driver with runlog. Report results as they come out.
|
|
||||||
5. **S7 packaging (8–10/11):** one command to generate, one to score, reference
|
|
||||||
tables, README, hashes, Zenodo deposit; then rewrite the results sections.
|
|
||||||
6. **Review and submission (11–14/11):** internal review, figures, proof
|
|
||||||
appendix, final novelty scan, quartile check, preprint, submit to
|
|
||||||
*Computers & Geosciences*.
|
|
||||||
|
|
||||||
## Conventions
|
## Conventions
|
||||||
|
|
||||||
@@ -153,7 +156,7 @@ if late is given there; never cut thresholds.
|
|||||||
- **Decisions:** decide from evidence and proceed. Do not block on supervisor (GVHD) sign-off.
|
- **Decisions:** decide from evidence and proceed. Do not block on supervisor (GVHD) sign-off.
|
||||||
- **Keep docs in sync (every task):** whenever you change anything (a run starts, finishes, fails or is stopped; a result, decision, deadline, protocol, script or file is added or changed), update in the same turn every file that states it: `report.html` (task status and notes, result cards, FINDS, DECISIONS, LOG), `docs/plan.md` (§0, §6 roadmap, §12 decision log), `AGENTS.md` (Status, Next), and where relevant `README.md` (scripts, run commands), `paper/README.md` (number sources), `docs/technical_overview.md` and `docs/research/*.md`. Before ending the turn, grep these files for older statements about the same item (for example "running", old counts or dates) and correct them, so no two files disagree. After editing `report.html`, check that its data block still parses (balanced brackets and quotes).
|
- **Keep docs in sync (every task):** whenever you change anything (a run starts, finishes, fails or is stopped; a result, decision, deadline, protocol, script or file is added or changed), update in the same turn every file that states it: `report.html` (task status and notes, result cards, FINDS, DECISIONS, LOG), `docs/plan.md` (§0, §6 roadmap, §12 decision log), `AGENTS.md` (Status, Next), and where relevant `README.md` (scripts, run commands), `paper/README.md` (number sources), `docs/technical_overview.md` and `docs/research/*.md`. Before ending the turn, grep these files for older statements about the same item (for example "running", old counts or dates) and correct them, so no two files disagree. After editing `report.html`, check that its data block still parses (balanced brackets and quotes).
|
||||||
- **GPU (shared server):** choose cuda:0 or cuda:1 by free memory and load. Never touch other users' jobs. Set `OMP_NUM_THREADS`, `MKL_NUM_THREADS` and `OPENBLAS_NUM_THREADS` explicitly when running by hand (the machine default is 40).
|
- **GPU (shared server):** choose cuda:0 or cuda:1 by free memory and load. Never touch other users' jobs. Set `OMP_NUM_THREADS`, `MKL_NUM_THREADS` and `OPENBLAS_NUM_THREADS` explicitly when running by hand (the machine default is 40).
|
||||||
- **Long runs:** detach multi-hour runs with `setsid nohup ... &` so they survive the agent session. Wrap runs with `scripts/runlog.sh` or the `run_p*.sh` drivers. Scripts 11/14/15 resume by skipping finished cells.
|
- **Long runs:** start multi-hour runs inside the user's tmux server (`tmux new-session -d -s <name> -c <repo> "<cmd> >> logs/<name>.out 2>&1"`) so they survive the agent session; on 29/10 `setsid nohup` runs were killed when the session ended. Wrap runs with `scripts/runlog.sh` or the `run_p*.sh` drivers. Scripts 11/14/15 resume by skipping finished cells.
|
||||||
- `code_thesis/` is the unchanged thesis-code archive (renamed from `test 2/`): do not modify its contents.
|
- `code_thesis/` is the unchanged thesis-code archive (renamed from `test 2/`): do not modify its contents.
|
||||||
- **User constraint:** do not rerun `04_wavelet_tie.py` or
|
- **User constraint:** do not rerun `04_wavelet_tie.py` or
|
||||||
`09_fit_warp_prior_f3.py`, or overwrite their historical artifacts. P3 uses
|
`09_fit_warp_prior_f3.py`, or overwrite their historical artifacts. P3 uses
|
||||||
|
|||||||
21
README.md
21
README.md
@@ -10,6 +10,8 @@ python -m venv .venv
|
|||||||
.venv/bin/pip install --no-deps -e .
|
.venv/bin/pip install --no-deps -e .
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Môi trường Linux của các lock `protocol_volve`/`protocol_bench` (Python 3.13.15, torch 2.14.0+cu130, numpy 2.5.4): `repro/requirements-linux.txt`; `requirements-lock.txt` là môi trường P0 cũ (numpy 2.5.3). Môi trường của P3 trên Windows: `requirements-windows-rtx3060.txt`.
|
||||||
|
|
||||||
Dữ liệu F3 Demo 2023 đặt ở `data/F3_Demo_2023/F3_Demo_2023/`, dữ liệu Volve ở `data/Volve/`, LAS và TD của NLOG ở `data/NLOG/` (hoặc trỏ `ML_POROSITY_F3_ROOT` tới thư mục chứa `.survey`). Kết quả ghi vào `outputs/` (đổi bằng `ML_POROSITY_OUTPUTS`).
|
Dữ liệu F3 Demo 2023 đặt ở `data/F3_Demo_2023/F3_Demo_2023/`, dữ liệu Volve ở `data/Volve/`, LAS và TD của NLOG ở `data/NLOG/` (hoặc trỏ `ML_POROSITY_F3_ROOT` tới thư mục chứa `.survey`). Kết quả ghi vào `outputs/` (đổi bằng `ML_POROSITY_OUTPUTS`).
|
||||||
|
|
||||||
Code luận văn được lưu ở [`code_thesis/`](code_thesis/), các output gốc ở [`outputs_thesis/`](outputs_thesis/). SHA-256 của 7 artifact nằm trong [`data_manifest/thesis_outputs.json`](data_manifest/thesis_outputs.json); kết quả kiểm tra ngày 27/10/2026 ở [thesis-output-audit.md](docs/research/thesis-output-audit.md). Pipeline nghiên cứu ghi kết quả mới vào `outputs/`.
|
Code luận văn được lưu ở [`code_thesis/`](code_thesis/), các output gốc ở [`outputs_thesis/`](outputs_thesis/). SHA-256 của 7 artifact nằm trong [`data_manifest/thesis_outputs.json`](data_manifest/thesis_outputs.json); kết quả kiểm tra ngày 27/10/2026 ở [thesis-output-audit.md](docs/research/thesis-output-audit.md). Pipeline nghiên cứu ghi kết quả mới vào `outputs/`.
|
||||||
@@ -63,6 +65,17 @@ scripts/run_p2r_dev.sh # chuẩn bị P2r (chạy lại P2) trên dev 900/9
|
|||||||
scripts/run_p2r_main.sh # lưới chính P2r trên realization 8–15
|
scripts/run_p2r_main.sh # lưới chính P2r trên realization 8–15
|
||||||
scripts/run_p4.sh # P4 Volve: register, train, summarize nhánh σ_a chính (DEVICE mặc định cuda:1)
|
scripts/run_p4.sh # P4 Volve: register, train, summarize nhánh σ_a chính (DEVICE mặc định cuda:1)
|
||||||
ARMS=sensitivity scripts/run_p4.sh register train # nhánh σ_a = 3,5 / 14 ms; sau đó ARMS=all scripts/run_p4.sh summarize
|
ARMS=sensitivity scripts/run_p4.sh register train # nhánh σ_a = 3,5 / 14 ms; sau đó ARMS=all scripts/run_p4.sh summarize
|
||||||
|
scripts/run_bench.sh lock # P6 protocol_bench: khoá lần đầu (sau khi duyệt bản nháp)
|
||||||
|
STUDIES="S1" DEVICE=cuda:0 WORKERS=4 scripts/run_bench.sh posterior train # S1 trên cuda:0; các study khác tương tự (STUDIES, REGIMES, PRESETS, RIDS, DEV=1)
|
||||||
|
scripts/run_bench.sh summarize | status | repro # tổng hợp theo luật đã khai báo; tiến độ; ô tái lập P2r
|
||||||
|
CUDA_VISIBLE_DEVICES= .venv/bin/python scripts/36_bench_verdicts.py # sau summarize: verdict cuối theo đúng lời phát biểu → outputs/bench/summary/verdict_final.{json,md}
|
||||||
|
CUDA_VISIBLE_DEVICES= .venv/bin/python scripts/37_bench_package.py generate # S7: gói benchmark; sau đó lần lượt tables, selftest → outputs/bench/package/ (hash: benchmark/MANIFEST.json)
|
||||||
|
CUDA_VISIBLE_DEVICES= .venv/bin/python scripts/37_bench_package.py score --pred DIR --name TÊN # chấm một phương pháp theo luật protocol_bench (hướng dẫn: benchmark/README.md)
|
||||||
|
CUDA_VISIBLE_DEVICES= .venv/bin/python scripts/38_bench_figures.py [--only bench_s1,bench_s8] [--flipband] # hình Thí nghiệm 3 của bài → paper/figures/; --flipband in bảng cos/cos² của S8
|
||||||
|
CUDA_VISIBLE_DEVICES= OMP_NUM_THREADS=2 .venv/bin/python scripts/39_repro_package.py build | verify # P5 gói tái lập: archive dữ liệu dẫn xuất → outputs/repro/, manifest repro/MANIFEST.json; phòng sạch → repro/verify_report.md (hướng dẫn: repro/README.md)
|
||||||
|
# Run dài: chạy trong tmux server của người dùng, ví dụ tmux new-session -d -s p6_s2 -c $PWD "env STUDIES=S2 DEVICE=cuda:0 WORKERS=2 MEM_GB=2 scripts/run_bench.sh posterior train >> logs/bench_s2_cuda0.out 2>&1"
|
||||||
|
# (setsid nohup bị dừng khi phiên agent kết thúc, 29/10). operations/p6_s1_watcher.sh khởi động S1 khi GPU có chỗ trống (đã dùng 15:43–16:06 UTC 29/10, rồi bỏ khi GPU trống).
|
||||||
|
# operations/p6_supervisor.py (tmux p6_supervisor): mỗi 5 phút chạy lại driver P6 chết và dồn worker khi một study xong; log logs/p6_supervisor.out. Đã dừng 02:16 UTC 30/10 khi P6 xong. Lỗi đã biết: khi dồn worker, nó khởi động lại driver kể cả lúc số worker không đổi, làm mất job đang dở.
|
||||||
```
|
```
|
||||||
|
|
||||||
Log và runtime: mỗi lần chạy `run_p*.sh` tạo `logs/runs/<YYYYmmdd-HHMMSS>_p*/`, mỗi bước là một thư mục con có `log.txt` (stdout + stderr, cả của worker, đầu dòng có thời gian đã trôi) và `meta.json` (lệnh, git commit + hash mã nguồn, biến luồng, thiết bị, wall/CPU time, RSS và VRAM đỉnh, mã thoát). Mỗi bước thêm một dòng vào `logs/index.csv`. Chạy lẻ một script thì bọc bằng `scripts/runlog.sh`:
|
Log và runtime: mỗi lần chạy `run_p*.sh` tạo `logs/runs/<YYYYmmdd-HHMMSS>_p*/`, mỗi bước là một thư mục con có `log.txt` (stdout + stderr, cả của worker, đầu dòng có thời gian đã trôi) và `meta.json` (lệnh, git commit + hash mã nguồn, biến luồng, thiết bị, wall/CPU time, RSS và VRAM đỉnh, mã thoát). Mỗi bước thêm một dòng vào `logs/index.csv`. Chạy lẻ một script thì bọc bằng `scripts/runlog.sh`:
|
||||||
@@ -113,5 +126,13 @@ Biến môi trường máy đặt sẵn `OMP_NUM_THREADS=40` (cả MKL, OpenBLAS
|
|||||||
| `python -P scripts/29_teapot_pilot.py` | Pilot P-a Teapot (Deviation 2): hình học, độ phủ horizon, σ̂_knot trên giếng dev (inline ≤ 200), không đọc porosity → `outputs/teapot/pilot_pa/` |
|
| `python -P scripts/29_teapot_pilot.py` | Pilot P-a Teapot (Deviation 2): hình học, độ phủ horizon, σ̂_knot trên giếng dev (inline ≤ 200), không đọc porosity → `outputs/teapot/pilot_pa/` |
|
||||||
| `scripts/30_t4_coverage.py` | T4 post hoc, mô tả: tỉ số phân tán ξ (cột `kappa`), coverage90 và phần do số vòng lặp của các ensemble 5 seed, từ `outputs/p2r/train/*/cells/*.npz` và dev P2 → `outputs/t4/` |
|
| `scripts/30_t4_coverage.py` | T4 post hoc, mô tả: tỉ số phân tán ξ (cột `kappa`), coverage90 và phần do số vòng lặp của các ensemble 5 seed, từ `outputs/p2r/train/*/cells/*.npz` và dev P2 → `outputs/t4/` |
|
||||||
| `scripts/31_p2r_posthoc.py` | Post hoc H2b, đọc `outputs/p2r/summary/` và dự đoán Oracle trong `outputs/p2r/train/<regime>/cells/*.npz` (khoảng 6 phút): tỉ số Oracle / B3d-Sa / M2-Sa, phần khoảng cách đã đóng; cận 1/B cho cấu trúc (a) classical (đã đăng ký) và (b) Berkson (thêm biến thể giữ hệ số ở 60 Hz và biến thể phổ chéo), tại σ_post và tại sai số warp; cờ vượt mép lưới B → `outputs/p2r/posthoc/{bound.csv, blur_ab.csv, meta.json}` |
|
| `scripts/31_p2r_posthoc.py` | Post hoc H2b, đọc `outputs/p2r/summary/` và dự đoán Oracle trong `outputs/p2r/train/<regime>/cells/*.npz` (khoảng 6 phút): tỉ số Oracle / B3d-Sa / M2-Sa, phần khoảng cách đã đóng; cận 1/B cho cấu trúc (a) classical (đã đăng ký) và (b) Berkson (thêm biến thể giữ hệ số ở 60 Hz và biến thể phổ chéo), tại σ_post và tại sai số warp; cờ vượt mép lưới B → `outputs/p2r/posthoc/{bound.csv, blur_ab.csv, meta.json}` |
|
||||||
|
| `scripts/32_t2_mechanism.py` | T2 (P6, exploratory, khai báo trước ở `docs/research/t2-mechanism.md`): năm phép kiểm cơ chế của lợi ích bank trên realization 8–15 của P2r; `--tests i ii v` huấn luyện lại (GPU), `--tests iii iv` đọc particle (CPU, khoảng 7 phút); tự kiểm tái lập so với `outputs/p2r/train/` → `outputs/t2/`. Kết quả: `docs/research/t2-results.md` |
|
||||||
|
| `scripts/33_bench_generator_qc.py` | QC bộ sinh cho S2 (P6, `p6-gen`; CPU, khoảng 1 phút): với realization dev 902 và từng preset misspec trong `configs/d2_synth_bench.yaml`, đo thay đổi AI thật, wavelet thật (pha hằng khớp nhất, tần số đỉnh, băng 90 %), warp thật (RMS, bước nhảy, jitter), sai số mô hình mà registration thấy tại warp thật (wavelet F3 danh nghĩa và thành viên tốt nhất trong họ wavelet thống kê + pha hằng, quy ra dB), tie chỉ anchor (Laplace, N = 4); `--sweep` quét từng núm đơn; `--smc --device cuda:1` (hoặc `cpu`) chạy registration + SMC tie posterior như P2r cho từng preset ở R10/Rm5, N = 4, nối tiếp ô đã xong → `outputs/bench/dev/{generator_qc.json, generator_qc.png, generator_sweep.json, smc_qc_rid902.json}`. Thiết kế: `docs/research/bench-generator.md` |
|
||||||
|
| `scripts/34_run_bench.py <stage…> [--studies S1 S2 S3 S4 S8] [--device] [--workers] [--gpu-mem-gb] [--dev --rids 902…]` | Runner của `configs/protocol_bench.yaml` (P6, mức B): `lock` (khoá: `.sha256` + `.lock.json` gồm code, môi trường, input, artifact P2r tham chiếu, fingerprint bộ sinh danh nghĩa), `posterior` (SMC như scripts/14, nhánh estR, P = 1024, lưu hạt γ = 1/κ), `train` (như scripts/15 + B4a–d, nhánh S8 hai mode, backbone TCN), `summarize` (luật đã khai báo trước → `outputs/bench/summary/`), `repro` (ô tái lập P2r → `outputs/bench/repro/comparison.json`), `dev-budgets` (ngân sách TCN trên dev). Realization 8–15 chỉ chạy sau khi khoá; `--dev` chỉ nhận 900–905 và ghi vào `outputs/bench/dev/`. Resume theo fingerprint + checksum. Mã: `ml_porosity/benchmark/` |
|
||||||
|
| `scripts/35_bench_calibration.py [--rids 902 903 904 905]` | Bảng hiệu chuẩn mức S2 (dev): gộp `outputs/bench/dev/smc_qc_rid*.json` (scripts/33 `--smc`) thành `calibration.{csv,md}`: sai số mô hình trong họ so với nhiễu regime, SMC warp RMSE / coverage90 / σ_post / overconfidence, phase_R, B3c, theo preset × regime |
|
||||||
|
| `scripts/36_bench_verdicts.py` | Verdict cuối của protocol_bench (02/11/2026): kiểm lock (`freeze(check=True)`), đọc `verdict.json` của summarize và áp đúng lời phát biểu ở ba chỗ code đã khoá khác (S1-H1 lọc N ∈ {4, 16}; S2-H1 theo từng trục; S3-H1 đối thủ {B3b, B3c, B3c-R, B4a–d}, không có Ctl-GP) bằng chính hàm của `ml_porosity/benchmark/summary.py` → `outputs/bench/summary/{verdict_final.json,verdict_final.md,s3_h2a_stated.csv}`. Ngoài tập hash của lock; không sửa output của summarize (`docs/plan.md` §12 ý 28) |
|
||||||
|
| `scripts/37_bench_package.py <lệnh> [--out DIR]` (generate, check, tables, score, selftest) | S7 đóng gói benchmark (02/11/2026; ngoài lock, generate và tables kiểm lock trước): `generate` ghi 630 task (test 8–15, dev 900–905; 5 regime danh nghĩa × 5 c, 14 setting S2, 6 setting S8), truth ẩn, input và `inputs/analyst.json` vào `outputs/bench/package/` (khoảng 845 MB), rồi so sha256 nội dung với `benchmark/MANIFEST.json` (lần đầu thì ghi); `check` kiểm một bản tải về; `tables` gộp 45.200 run tham chiếu → `reference/runs.csv.gz`, `benchmark/reference/{cells.csv,main_table.md}`; `score --pred DIR --name TÊN` chấm dự đoán `r<rid>_c<c>_n<N>_s<seed>.npz` (metric của scripts/11, luật ô H2a và luật better của `summary.py`) → `DIR/score/`; `selftest` chép dự đoán tham chiếu đã lưu thành bài nộp và kiểm metric, truth và luật khớp. Hướng dẫn cho người dùng: `benchmark/README.md` |
|
||||||
|
| `scripts/38_bench_figures.py [--only bench_s1,bench_s8] [--flipband]` | Hình Thí nghiệm 3 của bài (02/11/2026; ngoài lock, kiểm lock trước, không ghi vào `outputs/`): `bench_s1` (phase diagram S1 từ `outputs/bench/summary/s1_cells.csv`) và `bench_s8` (hàm truyền hai mode từ `s8_transfer_curves.json`; băng dùng được tính lại từ file dự đoán S8 như `summary.py`) → `paper/figures/{bench_s1,bench_s8}.pdf`, cùng style với scripts/22. `--flipband` chỉ in ra stdout bảng post hoc của Sec. 6.5: trung bình cos(πfΔ), cos²(πfΔ) (Hệ quả 3) và transfer đo được của PM2/BK2/HM2 trong băng 1/(2Δ) < f < 3/(2Δ) (D-14) |
|
||||||
|
| `scripts/39_repro_package.py <lệnh> [--out DIR]` (build, check, verify, code) | P5 gói tái lập (02/11/2026; ngoài mọi lock, không train, không ghi vào `outputs/` gốc): `build` chọn file của `outputs/` theo `RULES` và ghi 5 archive tar.gz tất định theo giấy phép dữ liệu (f3_results, f3_predictions, f3_volume: CC BY-SA 3.0; volve: CC BY-NC-SA 4.0; teapot: CC0, cần kiểm) vào `outputs/repro/`, cùng `repro/MANIFEST.json` (11.112 file, sha256 từng file, script sinh ra); `check --root DIR` kiểm một cây đã giải nén; `verify [--only …] [--keep]` dựng phòng sạch (code + archive, không SEG-Y/Volve/Teapot thô), chạy lại 12 bước tổng hợp, post hoc, bảng và hình, theo dõi file mở bằng audit hook rồi so với bản gốc → `repro/verify_report.md` (02/11: 12/12 bước khớp, 63 file trùng byte, 3 trùng giá trị, 0 khác); `code --rev REV` ghi `git archive` của một commit. Hướng dẫn cho người đọc (tiếng Anh): `repro/README.md` |
|
||||||
|
|
||||||
`code_thesis/` là bản lưu trữ code luận văn. Giữ nguyên nội dung để đối chiếu: các script này còn đường dẫn máy cũ và ghi vào `outputs/`, nên cần một bản sao đã điều chỉnh đường dẫn nếu muốn chạy lại. Kiểm tra bộ artifact hiện có bằng `python scripts/00_data_manifest.py --dataset thesis --check`.
|
`code_thesis/` là bản lưu trữ code luận văn. Giữ nguyên nội dung để đối chiếu: các script này còn đường dẫn máy cũ và ghi vào `outputs/`, nên cần một bản sao đã điều chỉnh đường dẫn nếu muốn chạy lại. Kiểm tra bộ artifact hiện có bằng `python scripts/00_data_manifest.py --dataset thesis --check`.
|
||||||
|
|||||||
1296
benchmark/MANIFEST.json
Normal file
1296
benchmark/MANIFEST.json
Normal file
File diff suppressed because it is too large
Load Diff
192
benchmark/README.md
Normal file
192
benchmark/README.md
Normal file
@@ -0,0 +1,192 @@
|
|||||||
|
# A registration-aware benchmark for sparse-well seismic porosity learning
|
||||||
|
|
||||||
|
Version 1 (protocol_bench, locked 29/10/2026 14:39 UTC, sha256 `aa763f0a…`). This directory documents the benchmark
|
||||||
|
package: synthetic seismic-to-porosity tasks in which the time–depth tie of every training well is uncertain and the
|
||||||
|
truth is known. The data package itself (about 630 tasks) is generated by one command and is deposited on Zenodo
|
||||||
|
(DOI: TODO).
|
||||||
|
|
||||||
|
## 1. The problem
|
||||||
|
|
||||||
|
A network learns porosity on seismic time from a few wells. Its labels come from logs recorded in depth (here: on
|
||||||
|
the sonic time τ of the log), so each label trace depends on a well tie t(τ) that is itself estimated from the
|
||||||
|
seismic and from a few marker picks. A tie error shifts the labels relative to the seismic. The benchmark asks how
|
||||||
|
much a learning method loses to this registration error, and whether a method that uses the uncertainty of the tie
|
||||||
|
does better than one that trains on a single point tie.
|
||||||
|
|
||||||
|
Each task is one synthetic realization of an earth model built on the geometry of seven interpreted horizons of the
|
||||||
|
F3 block (Dutch North Sea), with 16 training wells and 8 blind test wells. The true tie of each training well is a
|
||||||
|
drift b + ∫ exp(g) dτ drawn from a Matérn-3/2 prior fitted to the F3 wells, scaled by a drift factor c (c = 0: no
|
||||||
|
drift). A method receives what an analyst would have:
|
||||||
|
|
||||||
|
- for every well: a 3 × 3 patch of noisy post-stack traces around the well;
|
||||||
|
- for training wells only: the porosity log and the acoustic impedance log on τ, and unit-boundary anchors
|
||||||
|
(τ_k exact, t_k = true time + N(0, σ_a²), σ_a = 7 ms);
|
||||||
|
- the analyst's nominal knowledge (`inputs/analyst.json`): wavelet, warp prior, anchor noise, rock physics.
|
||||||
|
|
||||||
|
It must predict the porosity (and optionally its standard deviation) of the centre trace of each test well on
|
||||||
|
600–1100 ms (126 samples at 4 ms). The test labels are the true porosity on true time, so a perfect tie is not
|
||||||
|
required to score well, but a wrong tie corrupts the training labels.
|
||||||
|
|
||||||
|
## 2. Settings
|
||||||
|
|
||||||
|
| family | settings | drift factors c | registered N |
|
||||||
|
|---|---|---|---|
|
||||||
|
| nominal (S1) | R10 (SNR 10 dB, all anchors), R0 (0 dB), Rm5 (−5 dB), R0h (0 dB, every second anchor), R10tb (10 dB, top and bottom anchors only) | 0, 0.5, 1, 1.5, 2 | 2, 4, 8, 16 |
|
||||||
|
| misspecified (S2) | `{R10,Rm5}__{rp_L1, rp_L2}` rock physics (per-unit DT intercept error), `__{wv_L1, wv_L2}` wavelet (mixed/minimum phase), `__wv_Q` (constant Q 80), `__{dr_L1, dr_L2}` drift (hyperparameters ×, step + jitter) | 1 | 4, 16 |
|
||||||
|
| two-mode (S8) | `{R10,Rm5}__s8d{8,16,32}`: the analyst knows that each tie is one of two warps, t_true or t_true + s·Δ | 1 | 4, 16 |
|
||||||
|
|
||||||
|
In S2 the truth is generated with the stated error but `inputs/analyst.json` still describes the nominal model:
|
||||||
|
methods must not be told about the preset. S2 levels were chosen on the dev split (realizations 902–905). Preset
|
||||||
|
parameters: `inputs/d2_synth_bench.yaml` (`misspec_presets`). In S8 the task file carries both candidate warps
|
||||||
|
(`two_mode_t_of_tau_ms`); which one is true is hidden (`truth/…/two_mode_side`).
|
||||||
|
|
||||||
|
A task with N training wells uses the first N of the 16 training wells of the file (`train_*[:N]`, and the anchors
|
||||||
|
with `anchor_well < N`). c = 2 cells are flagged "unstable posterior" in the reference runs and are never primary
|
||||||
|
evidence.
|
||||||
|
|
||||||
|
## 3. Splits
|
||||||
|
|
||||||
|
- **test**: realizations 8–15 (5 network seeds 0–4 in the reference runs). Scores on this split are the benchmark
|
||||||
|
result. Test truth is in the package because the generator is public anyway; do not choose anything (shift,
|
||||||
|
checkpoint, hyperparameter, training length) from it.
|
||||||
|
- **dev**: realizations 900–905, same settings. Use them for every design choice. The reference methods chose their
|
||||||
|
training budgets on dev realizations; the S2 levels were chosen on 902–905.
|
||||||
|
|
||||||
|
## 4. Files
|
||||||
|
|
||||||
|
```
|
||||||
|
MANIFEST.json content hashes of every task, truth and input file
|
||||||
|
README.md this file
|
||||||
|
inputs/analyst.json units, windows, patch layout, nominal wavelet / rock physics / warp prior / σ_a, metric
|
||||||
|
inputs/{wavelets.npz, warp_prior_f3.json, horizon_grid.npz, d2_synth_bench.yaml, protocol_bench.yaml}
|
||||||
|
tasks/index.csv one row per task: split, setting, regime, preset, delta_ms, c, rid, SNR, anchors, paths
|
||||||
|
tasks/<split>/<setting>/r<rid>_c<c>.npz
|
||||||
|
truth/<split>/<setting>/r<rid>_c<c>.npz
|
||||||
|
reference/runs.csv.gz one row per reference run (setting, c, N, rid, seed, method) with every metric
|
||||||
|
reference/cells.csv, main_table.md cell means and σ_post (copies of benchmark/reference/ in the repository)
|
||||||
|
```
|
||||||
|
|
||||||
|
Task file (`np.load`), times in ms TWT, porosity logs as fractions, labels in porosity units (p.u. = 100 × fraction):
|
||||||
|
|
||||||
|
| key | shape | content |
|
||||||
|
|---|---|---|
|
||||||
|
| `rid`, `c`, `snr_db`, `anchor_density`, `sigma_a_ms` | scalars | realization, drift factor, regime |
|
||||||
|
| `t_seis_ms` | (226,) | seismic time axis, 400–1300 ms at 4 ms |
|
||||||
|
| `t_label_ms` | (126,) | label axis, 600–1100 ms |
|
||||||
|
| `tau_ms` | (3101,) | log axis τ, 100–1650 ms at 0.5 ms |
|
||||||
|
| `train_names`, `train_ilxl`, `train_xy` | (16,), (16, 2), (16, 2) | training wells |
|
||||||
|
| `train_seis` | (16, 9, 226) float32 | 3 × 3 patch: inline offset −1..1 (outer) × crossline −1..1 (inner); centre = index 4 |
|
||||||
|
| `train_phi_log`, `train_ai_log` | (16, 3101) | porosity (fraction) and AI on τ; `train_ai_log` = AI(`train_phi_log`) with the nominal rock physics |
|
||||||
|
| `anchor_well`, `anchor_tau_ms`, `anchor_t_ms` | (K,) | anchors of all training wells (well index, τ_k, noisy t_k) |
|
||||||
|
| `test_names`, `test_ilxl`, `test_xy` | (8,), (8, 2), (8, 2) | test wells, in scoring order |
|
||||||
|
| `test_seis` | (8, 9, 226) float32 | test patches (same SNR as the training wells) |
|
||||||
|
| `delta_ms`, `two_mode_t_of_tau_ms` | scalar, (16, 2, 3101) | S8 only: the two candidate warps t(τ) of each training well |
|
||||||
|
|
||||||
|
Truth file: `y_test` (8, 126) p.u.; `train_t_of_tau_ms` (16, 3101), `train_b_ms`, `train_g` (true ties, for
|
||||||
|
diagnostics of a registration step); S8: `two_mode_side`.
|
||||||
|
|
||||||
|
## 5. Commands
|
||||||
|
|
||||||
|
From the repository root, with the environment of `requirements*.txt` and the inputs listed in `MANIFEST.json`:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# generate the package (checks the protocol lock, then compares every content hash with benchmark/MANIFEST.json)
|
||||||
|
CUDA_VISIBLE_DEVICES= .venv/bin/python scripts/37_bench_package.py generate
|
||||||
|
# or verify a downloaded package
|
||||||
|
CUDA_VISIBLE_DEVICES= .venv/bin/python scripts/37_bench_package.py check --out /path/to/package
|
||||||
|
# reference tables from the saved reference runs (needs outputs/p2r and outputs/bench)
|
||||||
|
CUDA_VISIBLE_DEVICES= .venv/bin/python scripts/37_bench_package.py tables
|
||||||
|
# score a method
|
||||||
|
CUDA_VISIBLE_DEVICES= .venv/bin/python scripts/37_bench_package.py score --pred /path/to/predictions --name MyMethod
|
||||||
|
# end-to-end check of the scorer (copies of saved reference predictions must reproduce the reference rules)
|
||||||
|
CUDA_VISIBLE_DEVICES= .venv/bin/python scripts/37_bench_package.py selftest
|
||||||
|
```
|
||||||
|
|
||||||
|
All commands take `--out DIR` (default `outputs/bench/package`). `generate` takes `--split test dev`.
|
||||||
|
|
||||||
|
### Submission format
|
||||||
|
|
||||||
|
```
|
||||||
|
<pred>/<split>/<setting>/r<rid>_c<c>_n<N>_s<seed>.npz mu (8, 126) p.u., optional sigma (8, 126) > 0
|
||||||
|
```
|
||||||
|
|
||||||
|
`c` as in the task name (`1`, `1.5`, `0.5`), test wells in the order of `test_names`. Submit any subset; a cell
|
||||||
|
(setting, c, N) counts as complete with 8 realizations × 5 seeds. Without `sigma`, the Gaussian scores (NLL, CRPS,
|
||||||
|
coverage) are left empty.
|
||||||
|
|
||||||
|
### Scores
|
||||||
|
|
||||||
|
Per test well (scripts/11 `evaluate`): RMSE and PCC, the **band RMSE** and band PCC after a 4th-order zero-phase
|
||||||
|
Butterworth high-pass at 6 Hz (primary: the seismic band, where registration error acts), the low-band RMSE, NLL,
|
||||||
|
CRPS and coverage of the 50/80/90/95% intervals. A run is the mean over the 8 test wells; a cell averages runs over
|
||||||
|
realization × seed.
|
||||||
|
|
||||||
|
On the test split `score` applies the registered rules of protocol_bench (`ml_porosity/benchmark/summary.py`):
|
||||||
|
|
||||||
|
- **H2a cell rule** against the best point tie of the cell (lowest mean band RMSE among B3b, B3c, B3c-R):
|
||||||
|
a method *improves* if its band RMSE ≤ 0.90 × that of the best point tie, or its band PCC ≥ +0.05 higher; the
|
||||||
|
cell passes if it improves in ≥ 4/5 seeds (seed means over realizations) and in more than half of the
|
||||||
|
realizations (realization means over seeds).
|
||||||
|
- **better** against B3d-Sa, M2-Sa and Oracle (PM2, BK2 and Oracle in S8): lower band RMSE in ≥ 4/5 seeds and in
|
||||||
|
more than half of the realizations, with the ratio of means and a 95% bootstrap CI over realizations.
|
||||||
|
|
||||||
|
Reference rows are restricted to the realizations and seeds submitted. Output: `<pred>/score/` (`score.md`,
|
||||||
|
`rule_point_ties.csv`, `pairs.csv`, `cells.csv`, `runs.csv`, `per_well.csv`).
|
||||||
|
|
||||||
|
## 6. Reference methods
|
||||||
|
|
||||||
|
All reference methods use the CNN–GRU heteroscedastic network of the repository (d 64, Adam 5e-3, full batch,
|
||||||
|
64-sample windows, per-well z-score) at budgets chosen on dev; S4 repeats the main cells with a TCN (suffix `-TCN`).
|
||||||
|
|
||||||
|
| method | labels |
|
||||||
|
|---|---|
|
||||||
|
| Oracle | true tie (ceiling) |
|
||||||
|
| B3b | marker-calibrated sonic through the anchors |
|
||||||
|
| B3c | B3b + local NCC shifts against a synthetic |
|
||||||
|
| B3c-R | B3c with the wavelet at the re-estimated phase |
|
||||||
|
| B3d | weighted mean warp of an anchor-conditioned bank |
|
||||||
|
| B3d-Sa | labels at the posterior-mean warp of 1024 SMC particles (registration posterior) |
|
||||||
|
| M2-Sa | regression with misregistered labels (RML): soft-min loss over a bank of 64 SMC particles |
|
||||||
|
| B4a–d | anchor-free alignment baselines on B3b labels: hard-min / RML over ±8-sample shifts, soft-DTW, DILATE |
|
||||||
|
| Ctl-GP | control bank: 64 Gaussian warps with the posterior's mean and covariance |
|
||||||
|
| PM2, BK2, HM2 | S8: label at the two-mode mean warp; RML over the two-member bank; hard-min over it |
|
||||||
|
|
||||||
|
`reference/main_table.md` gives the nominal band RMSE at c = 1. `reference/cells.csv` gives every cell, with
|
||||||
|
σ_post (the SMC posterior width over the training wells; "wide" at σ_post ≥ 1.5 ms).
|
||||||
|
|
||||||
|
Registered results of protocol_bench (11 verdicts, 9 pass): posterior-mean labels (B3d-Sa) beat the best point tie
|
||||||
|
by ≥ 10% in band RMSE at R10 c = 1.5 (0.853 / 0.796 at N = 4 / 16); the bank gain over B3d-Sa grows with N in
|
||||||
|
13/13 wide families; under misspecification the gain survives the drift axis (0.862 / 0.798) but not the rock
|
||||||
|
physics axis (0.940 / 0.934) or the wavelet phase axis (1.023 / 1.042, where the posterior is overconfident); M2-Sa
|
||||||
|
never hurts (14/14 ≤ 1.02); B4a–d are never the best competitor at c ≤ 1; the TCN backbone keeps the gain; the
|
||||||
|
two-mode bank beats the two-mode mean at Δ = 16 and 32 ms (BK2/PM2 0.28–0.71). Full statements and both readings of the three verdicts
|
||||||
|
whose locked extraction differs from the wording: `outputs/bench/summary/verdict_final.md` in the repository.
|
||||||
|
|
||||||
|
## 7. What this benchmark is not
|
||||||
|
|
||||||
|
- It is synthetic. It says nothing about field skill: on F3 and Volve no method had enough blind-well skill in the
|
||||||
|
seismic band to test a registration effect.
|
||||||
|
- It measures registration effects on labels. It makes no calibration claim (in the P2r study every 5-seed
|
||||||
|
ensemble under-covered).
|
||||||
|
- One earth-model family (F3 horizon geometry, φ–DT rock physics, a stationary 128 ms wavelet). The S2 settings
|
||||||
|
probe three axes of misspecification at two levels each (plus one bandwidth setting); they do not cover
|
||||||
|
misspecification in general.
|
||||||
|
|
||||||
|
## 8. Licence and citation
|
||||||
|
|
||||||
|
Derived from the F3 Netherlands dataset (dGB Earth Sciences, CC BY-SA 3.0): the horizon grid, the statistical
|
||||||
|
wavelet and the warp prior are F3 derivatives, so the data package is released under CC BY-SA 3.0 (TODO: verify
|
||||||
|
the F3 licence wording on the provider's page before deposit). Code: TODO (licence of the repository).
|
||||||
|
|
||||||
|
Citation: TODO (paper and Zenodo DOI).
|
||||||
|
|
||||||
|
## 9. Deposit (maintainers)
|
||||||
|
|
||||||
|
1. `generate` on a clean checkout of the tagged commit; it must report "content hashes equal to
|
||||||
|
benchmark/MANIFEST.json (1260 files)". The input hashes in `MANIFEST.json` equal the sha256 registered in
|
||||||
|
`configs/protocol_bench.yaml`.
|
||||||
|
2. `tables`, then `selftest` (must print `selftest PASS`).
|
||||||
|
3. `tar -C outputs/bench -cf bench_package_v1.tar package` (about 0.85 GB; the npz files are already compressed),
|
||||||
|
and record its sha256.
|
||||||
|
4. Upload with the metadata of `benchmark/zenodo_metadata.json` once the TODO fields (authors, licence check,
|
||||||
|
related identifiers) are filled; put the DOI in this README and in the paper.
|
||||||
1131
benchmark/reference/cells.csv
Normal file
1131
benchmark/reference/cells.csv
Normal file
File diff suppressed because it is too large
Load Diff
19
benchmark/reference/main_table.md
Normal file
19
benchmark/reference/main_table.md
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
# Reference band RMSE (p.u.), nominal settings, c = 1
|
||||||
|
|
||||||
|
Mean over 8 test realizations × 5 network seeds at the registered budgets (CNN–GRU). σ_post (ms) is the SMC posterior width over the training wells; 'wide' means σ_post ≥ 1.5 ms. Full table: cells.csv.
|
||||||
|
|
||||||
|
| method | R10 N=4 | R10 N=16 | R0 N=4 | R0 N=16 | Rm5 N=4 | Rm5 N=16 | R0h N=4 | R0h N=16 | R10tb N=4 | R10tb N=16 |
|
||||||
|
|---|---|---|---|---|---|---|---|---|---|---|
|
||||||
|
| Oracle | 0.614 | 0.453 | 0.856 | 0.753 | 1.101 | 1.040 | 0.858 | 0.756 | 0.613 | 0.453 |
|
||||||
|
| B3b | 0.941 | 0.828 | 1.115 | 1.048 | 1.270 | 1.253 | 1.123 | 1.063 | 1.293 | 1.180 |
|
||||||
|
| B3c | 0.717 | 0.627 | 1.024 | 0.951 | 1.280 | 1.230 | 1.024 | 0.897 | 0.873 | 0.801 |
|
||||||
|
| B3c-R | 0.724 | 0.582 | 1.021 | 0.914 | 1.276 | 1.207 | 0.992 | 0.860 | 0.826 | 0.744 |
|
||||||
|
| B3d | 0.762 | 0.675 | 0.980 | 0.916 | 1.185 | 1.154 | 1.049 | 0.959 | 1.197 | 1.156 |
|
||||||
|
| B4a | 1.355 | 1.205 | 1.445 | 1.339 | 1.511 | 1.487 | 1.442 | 1.321 | 1.305 | 1.016 |
|
||||||
|
| B4b | 1.314 | 1.143 | 1.423 | 1.236 | 1.527 | 1.445 | 1.444 | 1.260 | 1.322 | 0.956 |
|
||||||
|
| B4c | 0.973 | 0.815 | 1.186 | 1.052 | 1.344 | 1.285 | 1.190 | 1.058 | 1.160 | 1.036 |
|
||||||
|
| B4d | 0.977 | 0.785 | 1.184 | 1.077 | 1.343 | 1.295 | 1.182 | 1.076 | 1.162 | 1.023 |
|
||||||
|
| B3d-Sa | 0.614 | 0.455 | 0.907 | 0.812 | 1.162 | 1.114 | 0.917 | 0.823 | 0.813 | 0.598 |
|
||||||
|
| M2-Sa | 0.611 | 0.457 | 0.885 | 0.786 | 1.155 | 1.094 | 0.904 | 0.798 | 0.756 | 0.532 |
|
||||||
|
| Ctl-GP | 0.610 | 0.458 | 0.895 | 0.802 | 1.162 | 1.096 | 0.913 | 0.799 | 0.775 | 0.541 |
|
||||||
|
| σ_post | 0.67 | 0.59 | 1.75 | 1.53 | 2.72 | 2.56 | 1.89 | 1.72 | 1.90 | 1.92 |
|
||||||
20
benchmark/zenodo_metadata.json
Normal file
20
benchmark/zenodo_metadata.json
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
"_status": "DRAFT, not deposited. Fill the TODO fields, verify the licence, then upload the archive of outputs/bench/package (see benchmark/README.md section 9). Deposit needs the authors' Zenodo account.",
|
||||||
|
"metadata": {
|
||||||
|
"upload_type": "dataset",
|
||||||
|
"title": "A registration-aware synthetic benchmark for sparse-well seismic porosity learning (protocol_bench v1)",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"creators": [
|
||||||
|
{"name": "TODO, Family name, Given names", "affiliation": "TODO", "orcid": "TODO"}
|
||||||
|
],
|
||||||
|
"description": "<p>Synthetic seismic-to-porosity tasks in which the time-depth tie of every training well is uncertain and the truth is known. Each task is one realization of an earth model on the geometry of seven interpreted horizons of the F3 block (Dutch North Sea) with 16 training wells (3 x 3 trace patch, porosity and impedance logs on sonic time, noisy unit-boundary anchors) and 8 blind test wells. Settings: five noise and anchor regimes x five drift factors (nominal), seven misspecification presets (rock physics, wavelet, drift), and six two-mode registration settings. Test split: realizations 8-15; dev split: 900-905; 630 tasks. Includes the hidden truth, the analyst's nominal inputs, reference results of 21 method variants (45,200 runs) and content hashes. Generation and scoring code, and the locked protocol, are in the companion repository.</p>",
|
||||||
|
"access_right": "open",
|
||||||
|
"license": "cc-by-sa-3.0",
|
||||||
|
"keywords": ["seismic inversion", "well tie", "porosity", "label noise", "registration uncertainty", "benchmark", "synthetic data", "F3 Netherlands"],
|
||||||
|
"related_identifiers": [
|
||||||
|
{"identifier": "TODO repository URL", "relation": "isSupplementTo", "resource_type": "software"},
|
||||||
|
{"identifier": "TODO paper DOI or preprint", "relation": "isSupplementTo", "resource_type": "publication-article"}
|
||||||
|
],
|
||||||
|
"notes": "Derived from the F3 Netherlands dataset (dGB Earth Sciences; CC BY-SA 3.0): horizon grid, statistical wavelet and warp prior. Content hashes: MANIFEST.json (sha256 of array content). Protocol sha256 aa763f0a4f81125ea8441fdfba4361f68246c7a0be1c36d4bf8de2650a91a4c5 (configs/protocol_bench.yaml, locked 2026-10-29 14:39 UTC)."
|
||||||
|
}
|
||||||
|
}
|
||||||
107
configs/d2_synth_bench.yaml
Normal file
107
configs/d2_synth_bench.yaml
Normal file
@@ -0,0 +1,107 @@
|
|||||||
|
# D2 for protocol_bench (phase P6, S1/S2/S3/S4/S8): GENERATOR IDENTICAL to configs/d2_synth_p2r.yaml and therefore to
|
||||||
|
# configs/d2_synth.yaml (protocol_p2). This file differs only in comments, the `regimes` block (copied from p2r) and
|
||||||
|
# the `misspec_presets` block at the end; every key read by ml_porosity/data/synth_d2.py keeps its value, so the same
|
||||||
|
# realization yields the same data when no preset is applied (tests/test_d2_misspec.py). Do not edit the locked
|
||||||
|
# configs/d2_synth.yaml or configs/d2_synth_p2r.yaml.
|
||||||
|
horizons: [Shallow, FS8, FS7, Truncation, MFS4] # 5 horizons covering ≥ 95% of the survey (Top-Foresets 74%, FS6 49%)
|
||||||
|
horizon_cache: outputs/d2/horizon_grid.npz
|
||||||
|
min_gap_ms: 8 # drop bins where two consecutive horizons are < 8 ms apart or out of order
|
||||||
|
sub_unit_ms: 60 # nominal sub-unit thickness (unit boundaries = markers/anchors)
|
||||||
|
model_t_ms: [-300, 2400] # earth-model domain in true time; wide enough that t(τ) of the 100–1650 ms log stays inside at drift ×2
|
||||||
|
log_tau_ms: [100, 1650] # log domain in sonic time τ
|
||||||
|
fine_dt_ms: 0.5
|
||||||
|
warp_dtau_ms: 4.0 # grid of g
|
||||||
|
dt_ms: 4
|
||||||
|
ext_window_ms: [400, 1300] # seismic + anchors (as in F3)
|
||||||
|
main_window_ms: [600, 1100] # input/labels/scoring (as in F3)
|
||||||
|
patch_radius: 1
|
||||||
|
|
||||||
|
wells:
|
||||||
|
n_test: 8
|
||||||
|
n_train_pool: 16 # N_train ∈ {2, 4, 8, 16}, nested draws from the pool
|
||||||
|
min_dist_test_m: 1000 # test wells ≥ 1 km from every other well (spatial block split)
|
||||||
|
min_dist_train_m: 500
|
||||||
|
|
||||||
|
property:
|
||||||
|
phi0: 0.32
|
||||||
|
phi0_sd: 0.01
|
||||||
|
slope_per_100ms: -0.008
|
||||||
|
unit_offset_sd: 0.02
|
||||||
|
unit_lateral_sd: 0.01
|
||||||
|
grf: # sum of OU processes in stratigraphic coordinates
|
||||||
|
- {sd: 0.010, ell_ms: 10.0}
|
||||||
|
- {sd: 0.006, ell_ms: 2.0}
|
||||||
|
clip: [0.05, 0.45]
|
||||||
|
|
||||||
|
wavelet: statistical # outputs/wavelets.npz (zero phase, 128 ms) from scripts/04
|
||||||
|
snr_db: 10 # generator default; the protocol takes SNR from the regimes below
|
||||||
|
|
||||||
|
drift:
|
||||||
|
prior_json: outputs/p2/warp_prior_f3.json # Matérn-3/2 fit on F3 anchors (scripts/09)
|
||||||
|
factors: [0, 0.5, 1, 2]
|
||||||
|
|
||||||
|
anchors:
|
||||||
|
density: full
|
||||||
|
sigma_a_ms: 7.0 # robust σ (MAD) of marker–horizon differences at the 4 F3 wells (18 pairs): 6.9 ms
|
||||||
|
|
||||||
|
regimes: # identical to configs/d2_synth_p2r.yaml
|
||||||
|
R10: {snr_db: 10, anchor_density: full} # P2 default; narrow posterior (dev σ_post ≈ 0.85 ms at c = 1)
|
||||||
|
R0: {snr_db: 0, anchor_density: full} # dev σ_post ≈ 1.9 ms at c = 1
|
||||||
|
Rm5: {snr_db: -5, anchor_density: full} # close to F3 under the protocol prior (dev σ_post ≈ 3.0 ms, F3 2.5–3.4 ms)
|
||||||
|
R0h: {snr_db: 0, anchor_density: half} # sparse anchors: dev σ_post ≈ 1.8 / 4.5 ms at c = 1 / 2
|
||||||
|
R10tb: {snr_db: 10, anchor_density: topbottom} # top–bottom anchors only: dev σ_post ≈ 2.6 / 11 ms (multimodal, overconfident posterior)
|
||||||
|
|
||||||
|
# S2 misspecification presets (plan §12 item 22, decision 2; docs/research/bench-generator.md; levels fixed on dev
|
||||||
|
# realizations 902–905 on 29/10/2026, docs/research/bench-protocol.md §3). Each preset is a `misspec` argument of
|
||||||
|
# D2Realization (keys and defaults: synth_d2.MISSPEC_DEFAULTS; a `note` key is ignored). Main cells of protocol_bench
|
||||||
|
# S2: rp_L1, rp_L2, wv_L1, wv_L2, wv_Q, dr_L1, dr_L2. The control presets (*_C) document what the registration's model
|
||||||
|
# family absorbs; they are never main cells. The cand_* presets below are the calibration candidates (dev evidence
|
||||||
|
# only; kept so that the calibration is reproducible). Realizations 8–15 were not used to choose any level.
|
||||||
|
misspec_presets:
|
||||||
|
rp_C: # control: uniform coefficient error only. The profiled amplitude α of the tie likelihood
|
||||||
|
note: "control: uniform φ–DT / density coefficient error (plan §5.5 literal axis); absorbed by the profiled amplitude (QC: in-family error 0.073 = nominal)"
|
||||||
|
rock_physics: {dt_slope_factor: 1.15, dt_intercept_factor: 1.15, rho_slope_factor: 1.2}
|
||||||
|
rp_L1: # per-unit intercept scatter (lithology-dependent matrix slowness); uniform factors dropped (invisible)
|
||||||
|
note: "L1: unit_dt_intercept_sd 0.10 (DT_matrix ±18 µs/m per unit; in-family model error 0.39 = 1.2 × R10 noise, 0.22 × Rm5 noise); dev SMC at R10 (rids 903–905, N = 4): warp RMSE ×1.27, cov90 0.85"
|
||||||
|
rock_physics: {unit_dt_intercept_sd: 0.10}
|
||||||
|
rp_L2:
|
||||||
|
note: "L2: unit_dt_intercept_sd 0.15 (±27 µs/m; model error 0.53 = 1.7 × R10 noise, 0.30 × Rm5); dev SMC at R10 (rids 902–905): warp RMSE ×1.66, cov90 0.81. Expected null at Rm5 (model error far below the noise)"
|
||||||
|
rock_physics: {unit_dt_intercept_sd: 0.15}
|
||||||
|
wv_C: # control: constant phase + peak-frequency factor, both inside the registration's family
|
||||||
|
note: "control: constant 45° phase and peak frequency ×1.2: absorbed by the statistical wavelet + constant-phase fit (15° grid)"
|
||||||
|
wavelet: {phase_deg: 45.0, peak_freq_factor: 1.2}
|
||||||
|
wv_L1: # frequency-dependent phase (phase sub-axis), nominal amplitude spectrum
|
||||||
|
note: "L1: minphase_frac 0.5 (half of the minimum-phase spectrum; model error 0.34 = 1.08 × R10 noise); dev SMC at R10 (rids 902–905): warp RMSE ×3.2, cov90 0.11 (overconfident) but still ahead of the point ties (2.1 vs 4.3 ms)"
|
||||||
|
wavelet: {minphase_frac: 0.5}
|
||||||
|
wv_L2:
|
||||||
|
note: "L2: minphase_frac 1.0 (minimum-phase version of the nominal wavelet; model error 0.61 = 1.9 × R10 noise); dev SMC at R10 (rids 902–905): warp RMSE ×5.9, cov90 0.03, ahead of B3c in 3/4 rids only"
|
||||||
|
wavelet: {minphase_frac: 1.0}
|
||||||
|
wv_Q: # bandwidth sub-axis: time-variant constant-Q attenuation (stationary statistical wavelet is wrong at both ends of the window)
|
||||||
|
note: "bandwidth cell (single level): Q 80 from t_ref = 400 ms with Futterman dispersion (peak 59 → 32 Hz over 600–1100 ms; model error 0.45 = 1.4 × R10 noise); dev SMC at R10 (rids 902–905): warp RMSE ×1.57, cov90 0.84, σ_post ×1.8 (the posterior widens rather than collapses)"
|
||||||
|
wavelet: {Q: 80.0, Q_t_ref_ms: 400.0, Q_dispersion: true}
|
||||||
|
dr_L1: # mechanism 1: the truth is drawn from scaled hyperparameters (σ_b 58 ms > the registration's fixed 50 ms; rougher g); partly absorbed by MAP-II
|
||||||
|
note: "L1 (hyperparameter mechanism): sigma_b ×3, sigma_g ×1.5, ell ×0.5 (same z_g, z_b); dev SMC at R10 (rids 902–905): warp RMSE ×2.2 (1.1–2.1 ms), cov90 0.75"
|
||||||
|
drift: {sigma_b_factor: 3.0, sigma_g_factor: 1.5, ell_factor: 0.5}
|
||||||
|
dr_L2: # mechanism 2: components outside the GP family (step at Truncation, short-correlation jitter); the step does not scale with c
|
||||||
|
note: "L2 (structural mechanism): step 8 ms just below Truncation (12 ms anomaly) plus Matérn-3/2 jitter sd 1 ms, ell 8 ms; dev SMC at R10 (rids 902–905): warp RMSE ×3.3 (1.3–4.1 ms), cov90 0.61"
|
||||||
|
drift: {step_ms: 8.0, step_width_ms: 12.0, step_horizon: Truncation, jitter_sd_ms: 1.0, jitter_ell_ms: 8.0}
|
||||||
|
# --- dev calibration candidates (29/10/2026, phase 2 of P6): single-knob and combined settings whose SMC-stage
|
||||||
|
# diagnostics on dev realizations 902–905 (scripts/33 --smc, N = 4, c = 1, R10 and Rm5) choose the L1/L2 levels
|
||||||
|
# above. They are never main cells. Rock physics: per-unit intercept scatter only (the uniform factors are
|
||||||
|
# invariant under the profiled-amplitude likelihood, docs/research/bench-generator.md §2, and stay in rp_C).
|
||||||
|
cand_rp_a: {note: "candidate: unit_dt_intercept_sd 0.05 (in-family model error 0.217, 13.3 dB)", rock_physics: {unit_dt_intercept_sd: 0.05}}
|
||||||
|
cand_rp_b: {note: "candidate: unit_dt_intercept_sd 0.10 (0.391, 8.2 dB)", rock_physics: {unit_dt_intercept_sd: 0.10}}
|
||||||
|
cand_rp_c: {note: "candidate: unit_dt_intercept_sd 0.15 (0.531, 5.5 dB)", rock_physics: {unit_dt_intercept_sd: 0.15}}
|
||||||
|
cand_wv_a: {note: "candidate: minphase_frac 0.5 (0.342, 9.3 dB)", wavelet: {minphase_frac: 0.5}}
|
||||||
|
cand_wv_b: {note: "candidate: Q 160 from 400 ms with dispersion (0.259, 11.7 dB)", wavelet: {Q: 160.0, Q_t_ref_ms: 400.0, Q_dispersion: true}}
|
||||||
|
cand_wv_c: {note: "candidate: minphase_frac 1.0 (0.609, 4.3 dB) = wv_L1 placeholder", wavelet: {minphase_frac: 1.0}}
|
||||||
|
cand_wv_d: {note: "candidate: Q 80 (0.445, 7.0 dB)", wavelet: {Q: 80.0, Q_t_ref_ms: 400.0, Q_dispersion: true}}
|
||||||
|
cand_wv_e: {note: "candidate: minphase_frac 0.5 + Q 160", wavelet: {minphase_frac: 0.5, Q: 160.0, Q_t_ref_ms: 400.0, Q_dispersion: true}}
|
||||||
|
cand_dr_h: {note: "candidate: hyperparameter misspecification only = dr_L1 placeholder", drift: {sigma_b_factor: 3.0, sigma_g_factor: 1.5, ell_factor: 0.5}}
|
||||||
|
cand_dr_s: {note: "candidate: structural components only (step 8 ms, jitter 1 ms) = dr_L2 placeholder", drift: {step_ms: 8.0, step_width_ms: 12.0, step_horizon: Truncation, jitter_sd_ms: 1.0, jitter_ell_ms: 8.0}}
|
||||||
|
cand_dr_hs: {note: "candidate: hyperparameters + structural components", drift: {sigma_b_factor: 3.0, sigma_g_factor: 1.5, ell_factor: 0.5, step_ms: 8.0, step_width_ms: 12.0, step_horizon: Truncation, jitter_sd_ms: 1.0, jitter_ell_ms: 8.0}}
|
||||||
|
cand_dr_s2: {note: "candidate: stronger structural components (step 16 ms, jitter 2 ms)", drift: {step_ms: 16.0, step_width_ms: 12.0, step_horizon: Truncation, jitter_sd_ms: 2.0, jitter_ell_ms: 8.0}}
|
||||||
|
cand_rp_d: {note: "candidate: unit_dt_intercept_sd 0.075 (in-family model error ≈ 0.30, ≈ 0.95 × R10 noise)", rock_physics: {unit_dt_intercept_sd: 0.075}}
|
||||||
|
cand_wv_f: {note: "candidate: minphase_frac 0.25 (0.197, 14.1 dB)", wavelet: {minphase_frac: 0.25}}
|
||||||
|
cand_wv_g: {note: "candidate: Q 40 (0.652, 3.7 dB)", wavelet: {Q: 40.0, Q_t_ref_ms: 400.0, Q_dispersion: true}}
|
||||||
|
cand_wv_h: {note: "candidate: minphase_frac 0.5 + Q 80 (phase and bandwidth)", wavelet: {minphase_frac: 0.5, Q: 80.0, Q_t_ref_ms: 400.0, Q_dispersion: true}}
|
||||||
166
configs/protocol_bench.lock.json
Normal file
166
configs/protocol_bench.lock.json
Normal file
@@ -0,0 +1,166 @@
|
|||||||
|
{
|
||||||
|
"protocol_sha256": "aa763f0a4f81125ea8441fdfba4361f68246c7a0be1c36d4bf8de2650a91a4c5",
|
||||||
|
"code_sha256": "5ea2eb17681459ed973217c9d61706a269f1913314fec0848bb2d5c99eb6bbb8",
|
||||||
|
"environment": {
|
||||||
|
"python": "3.13.15",
|
||||||
|
"platform": "Linux",
|
||||||
|
"packages": {
|
||||||
|
"torch": "2.14.0+cu130",
|
||||||
|
"numpy": "2.5.4",
|
||||||
|
"scipy": "1.18.1",
|
||||||
|
"pandas": "3.0.6",
|
||||||
|
"matplotlib": "3.11.2",
|
||||||
|
"segyio": "1.9.14",
|
||||||
|
"lasio": "0.32",
|
||||||
|
"pylops": "2.5.0",
|
||||||
|
"numba": "0.67.0",
|
||||||
|
"scikit-learn": "1.9.1",
|
||||||
|
"PyYAML": "6.0.3",
|
||||||
|
"tabulate": "0.10.0",
|
||||||
|
"psutil": "7.2.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"inputs": {
|
||||||
|
"repo:configs/d2_synth_bench.yaml": "2bfd01c94f169116fb92e7c1ac92db8bbe003973a610c32b2740e864b4c761b2",
|
||||||
|
"repo:configs/protocol_p2.yaml": "0733620042c4ec1b7dce447eef3ec64f915db05acbebbe5b6c977ac42e71a470",
|
||||||
|
"repo:configs/protocol_p2r.yaml": "eb887311f26a7c1c3dc69d9623d0086cfb5ccc79eea9e5ef59c723078f49c8aa",
|
||||||
|
"outputs:p2/warp_prior_f3.json": "55cda573c06b3a7275bdb4ac5f169fb4e5af329e1d199acc3d4daffe15624d27",
|
||||||
|
"outputs:wavelets.npz": "b689ea12578e580d8c2305c8f7219be05ff6e339884fa30b694111e968c0fc64",
|
||||||
|
"outputs:d2/horizon_grid.npz": "70e3321fa9f8fe2a1301877fb34386a64bf29eaa4f6948007e18874678e92b1e",
|
||||||
|
"outputs:p2/diag/train/budgets.json": "815c6f7abc3d961255feb79bbed57a3e326cbc24cec11bbd97f455f0356e28c5",
|
||||||
|
"repo:tests/data/d2_fingerprints.json": "86cbd6dd49044c1288ec6b649a2d688bf4121280d5cc3dca9b45109523bd6fc1"
|
||||||
|
},
|
||||||
|
"p2r_reference": {
|
||||||
|
"outputs:p2r/summary/sigma_post.csv": "81993c37d434bdb4474df6ee1980234e705157b4564b9db3eea8a4353d93eeaa",
|
||||||
|
"outputs:p2r/train/R10/runs.csv": "68a9b790b0697c7122ced975b210e41d0f1437a15b4f1924e74bc5717ae0f728",
|
||||||
|
"outputs:p2r/train/R0/runs.csv": "0e5545450c25befe71684592b51dcf42d988b049f422542893493e72bd25fbd5",
|
||||||
|
"outputs:p2r/train/Rm5/runs.csv": "3f34805b565effe8430d06ba25db4b8cea53d21df1edc5187b41c6d04dc5d8cc",
|
||||||
|
"outputs:p2r/train/R0h/runs.csv": "2fb21ddae78066c81ba530632dfd21c237d505b317b0da2322242360b85ebc5e",
|
||||||
|
"outputs:p2r/train/R10tb/runs.csv": "155394bacfa60ef7c8adc93f690fd1fcfa7580e6c230add1712bc1cbf4a18d47",
|
||||||
|
"outputs:p2r/posterior/R10/r8_c1_n4_s0_particles.npz": "2221b21a178bef237dcd7fac9134a892dd49c5229e07f61279dff40d9dd35498",
|
||||||
|
"outputs:p2r/posterior/R10/r8_c1_n4_s0_phase.json": "af449f4626f26c27410d953d7ac25b99dfddc6247b58ec756479728779b937ed",
|
||||||
|
"outputs:p2r/posterior/R10/r9_c1_n4_s0_particles.npz": "8319ae0973d6939991f59298373a1021ecde9ff36bae4e0c9e94182be2c49edd",
|
||||||
|
"outputs:p2r/posterior/R10/r9_c1_n4_s0_phase.json": "109a2edf27f883f1ed49b375eb6bb88910f9d688d0acf1d6c8557692fbb494bb",
|
||||||
|
"outputs:p2r/posterior/R10/r10_c1_n4_s0_particles.npz": "f75919b16fecfae9571621205ca46abaefcd89faad41181cfa8dfaf86eee104c",
|
||||||
|
"outputs:p2r/posterior/R10/r10_c1_n4_s0_phase.json": "dd308be9dbbbb0dab231f1568331c95d135fe9ed1cfe791981ae7f27521e1cfa",
|
||||||
|
"outputs:p2r/posterior/R10/r11_c1_n4_s0_particles.npz": "82746d118a3ae765c2f6ca2c598c554427a210098e15bbe6112ab669fac078ea",
|
||||||
|
"outputs:p2r/posterior/R10/r11_c1_n4_s0_phase.json": "589b6a9a0759f78c0deec2570cfcf1d9e999d606496f63d274a299406639a2a1",
|
||||||
|
"outputs:p2r/posterior/R10/r12_c1_n4_s0_particles.npz": "18b5704ef49a6be85718be3afd36adbb1b3b05ac001a4d042825f82e7390b8b3",
|
||||||
|
"outputs:p2r/posterior/R10/r12_c1_n4_s0_phase.json": "edcb9c55168fd4148ca140b8152114c5ed6518de2408a4b5b766d7afe700618a",
|
||||||
|
"outputs:p2r/posterior/R10/r13_c1_n4_s0_particles.npz": "c1ffbe821f0f592362bbd07e8395a1573ba6984c9fb2130a8ddd8fedb0439f38",
|
||||||
|
"outputs:p2r/posterior/R10/r13_c1_n4_s0_phase.json": "9d270dcac190498b135849424e933586789fab5e54f569d1f6c5d60ceca6ccd5",
|
||||||
|
"outputs:p2r/posterior/R10/r14_c1_n4_s0_particles.npz": "566d13c7f2fc5db635012b954adf4c07a2f826b40bbc52de6d237e8cd717870c",
|
||||||
|
"outputs:p2r/posterior/R10/r14_c1_n4_s0_phase.json": "17fa46ad5f285dc058fcb2cec4dc771fc9b808b356ba1778dcee6db92dbf3540",
|
||||||
|
"outputs:p2r/posterior/R10/r15_c1_n4_s0_particles.npz": "16cd72a0541e6a739548cdb2762b4a31c17732785aa976faf36e895b93de5335",
|
||||||
|
"outputs:p2r/posterior/R10/r15_c1_n4_s0_phase.json": "2cb76771811b2b44f1d8a45798bae3d6f15b4e4e0345212147afda5859d41705",
|
||||||
|
"outputs:p2r/posterior/R10/r8_c1_n16_s0_particles.npz": "6d117e2cafe77f1e40250465dfabd28caefef97ef547e648877ef5d4dc0fc621",
|
||||||
|
"outputs:p2r/posterior/R10/r8_c1_n16_s0_phase.json": "473edfa3d0d196a70aef8bd21b30c8781e3200d5e98b6d5f4805446f61e604cf",
|
||||||
|
"outputs:p2r/posterior/R10/r9_c1_n16_s0_particles.npz": "0b124530110ace9bf02c81a94bb1a90a1205ee99817dcbf30689e7bbb98b7fc9",
|
||||||
|
"outputs:p2r/posterior/R10/r9_c1_n16_s0_phase.json": "b3bac0cbf6c7fc360b3bcc4e9594a7896f5fdf2d9deda17df3d799223b7af0fd",
|
||||||
|
"outputs:p2r/posterior/R10/r10_c1_n16_s0_particles.npz": "37352c3c778105c98554d0aba982f91f02876b5b6efa5572745aa71d54194776",
|
||||||
|
"outputs:p2r/posterior/R10/r10_c1_n16_s0_phase.json": "93bcd2dfc6b050f9ef3195ca4747eb7c33b3629916f0629e44b6c93288fbe7c8",
|
||||||
|
"outputs:p2r/posterior/R10/r11_c1_n16_s0_particles.npz": "8cfd481f0d264c4d522e23b3ac1a3583a447167b87418734ea7733cc3c0063c9",
|
||||||
|
"outputs:p2r/posterior/R10/r11_c1_n16_s0_phase.json": "9fd2c2cf41c7c067c28ba66b1a6669069c74d5db179acc4d9714dbc8261c0518",
|
||||||
|
"outputs:p2r/posterior/R10/r12_c1_n16_s0_particles.npz": "4300b1107779f1a88a79fca6c10a845daddd2661575efd74b24ac73bbc8ade9a",
|
||||||
|
"outputs:p2r/posterior/R10/r12_c1_n16_s0_phase.json": "3036584163a098446cc5eb93b1f514248c07a467e0d0b554a39f2b8a98ec778b",
|
||||||
|
"outputs:p2r/posterior/R10/r13_c1_n16_s0_particles.npz": "b537f59b93b49081901cd9eccb623a2ae6f9743ead46bdd87145218f1a33cf80",
|
||||||
|
"outputs:p2r/posterior/R10/r13_c1_n16_s0_phase.json": "d951a6ac2d2a9b35eb157a086c930a2c0f7be9cde179269a61c2641a6078b4d6",
|
||||||
|
"outputs:p2r/posterior/R10/r14_c1_n16_s0_particles.npz": "244cc82ce07bdb01c3f197f62c92c6cc34509aa5d9e477178d678618841eed57",
|
||||||
|
"outputs:p2r/posterior/R10/r14_c1_n16_s0_phase.json": "230a42baf6e4865eac18d4851f3f3ad47c0200a73d6706a3191e6dc2a7491224",
|
||||||
|
"outputs:p2r/posterior/R10/r15_c1_n16_s0_particles.npz": "3bdb8ed21d9c3cbd4b9e05bd9b391c2da8b3c8a27fd4f1dac9e89967b1f3300a",
|
||||||
|
"outputs:p2r/posterior/R10/r15_c1_n16_s0_phase.json": "36b79c5cc8d6f36557cfbfc682f7f87fd94df592594f8e95d71d663098358959",
|
||||||
|
"outputs:p2r/posterior/Rm5/r8_c1_n4_s0_particles.npz": "330f656862017097733b1abb4e774a927f396e9f984bab44c9b53719b125fc93",
|
||||||
|
"outputs:p2r/posterior/Rm5/r8_c1_n4_s0_phase.json": "8f1a5279db5042add8efb12cd5a425b8dc2af195a66f530044232f947ccae63c",
|
||||||
|
"outputs:p2r/posterior/Rm5/r9_c1_n4_s0_particles.npz": "2689b63440065bbf7820f6d3a77d9d6469494cdfc9346b19939c231a264a2d8a",
|
||||||
|
"outputs:p2r/posterior/Rm5/r9_c1_n4_s0_phase.json": "c4ad961246b42c30e1cdb4051bf75808726c40b584a7b83c4c936ece20c6c78b",
|
||||||
|
"outputs:p2r/posterior/Rm5/r10_c1_n4_s0_particles.npz": "226c494a7ac1b236bdd6ecd23940f809087501a42e626be77f7891136f0ba0b8",
|
||||||
|
"outputs:p2r/posterior/Rm5/r10_c1_n4_s0_phase.json": "72e053d1a113f95d417582fba0bd4fca11fafe102f35df46e35a2731cbb5a1c6",
|
||||||
|
"outputs:p2r/posterior/Rm5/r11_c1_n4_s0_particles.npz": "9155fd1537d5b01ffa02baf7d48f5d7d2f36afc739ffe10c08062514d857b470",
|
||||||
|
"outputs:p2r/posterior/Rm5/r11_c1_n4_s0_phase.json": "a171d8f099c31a0ef9ff7c04ba50ce0d8015b3165c5cb3f0b63b678a2c75557b",
|
||||||
|
"outputs:p2r/posterior/Rm5/r12_c1_n4_s0_particles.npz": "46756fc65b51232644bffbe7e990549db9c26b5c995865c394d01ecfa448611c",
|
||||||
|
"outputs:p2r/posterior/Rm5/r12_c1_n4_s0_phase.json": "c67ce4c8dace40a1cb1ebf49c84f8dd7815603397ccb69cd21ea4ac8764fd446",
|
||||||
|
"outputs:p2r/posterior/Rm5/r13_c1_n4_s0_particles.npz": "5bb923440ac215439b360cebc2a004c575db69b36a548037b3be63a8992f1c91",
|
||||||
|
"outputs:p2r/posterior/Rm5/r13_c1_n4_s0_phase.json": "c9715ff84285491c9dfd7b1f698f39571d5b2253584ec68014f83abd971c3f5f",
|
||||||
|
"outputs:p2r/posterior/Rm5/r14_c1_n4_s0_particles.npz": "4016b3c2057790c3e40038c0f08c6e9893c144ba7270c493039046a5bbf4de87",
|
||||||
|
"outputs:p2r/posterior/Rm5/r14_c1_n4_s0_phase.json": "c19eaa7ca8215602a325381b85abdaf715eae693072702f085674858f2457eba",
|
||||||
|
"outputs:p2r/posterior/Rm5/r15_c1_n4_s0_particles.npz": "dfb5a06a345b8ffb4ee9998647c5d53e7e151b894048d4ff0a0dfd553ae36dd0",
|
||||||
|
"outputs:p2r/posterior/Rm5/r15_c1_n4_s0_phase.json": "96401dc3d10f6f187380fdebca6a22e763fe23e742ea0fdc5f53fca1484c798e",
|
||||||
|
"outputs:p2r/posterior/Rm5/r8_c1_n16_s0_particles.npz": "2c0480f2c14111663c5fbbddc6a84f65ba809e818be1247400c054680e6ec509",
|
||||||
|
"outputs:p2r/posterior/Rm5/r8_c1_n16_s0_phase.json": "cc11f96033ba8748fe72eb858bd679e5a067e1a7709843fad9298d9d5efd46f0",
|
||||||
|
"outputs:p2r/posterior/Rm5/r9_c1_n16_s0_particles.npz": "33bfe288e207f0b409885b486df05b182a99ea23c15a134a85515451434f99f8",
|
||||||
|
"outputs:p2r/posterior/Rm5/r9_c1_n16_s0_phase.json": "f7d03ffd0d3d15a021c40e0b643981b304c33d72ca3c608c7e31f41b733c1451",
|
||||||
|
"outputs:p2r/posterior/Rm5/r10_c1_n16_s0_particles.npz": "dd3c1634e2e2c72633e22992c5a993825d501821f1ed8f701178add03e4836fb",
|
||||||
|
"outputs:p2r/posterior/Rm5/r10_c1_n16_s0_phase.json": "81d651de74dfdac67e9942f46bd89dd1473a2aee3d24900ec35c848f5d86bd93",
|
||||||
|
"outputs:p2r/posterior/Rm5/r11_c1_n16_s0_particles.npz": "56c3aeed9e9b3fcf9b67131ec5300a9f75b2fc06578e04a955ba290ed29b5a14",
|
||||||
|
"outputs:p2r/posterior/Rm5/r11_c1_n16_s0_phase.json": "43b421054e5d4e563fcb1237bac5ac57c7487ad4f91499f9cd81a8048ec973a4",
|
||||||
|
"outputs:p2r/posterior/Rm5/r12_c1_n16_s0_particles.npz": "413187f2c4ffa087a494cde19acef2ebdf44b0bf6f3d7b2cfbbfe94dcb948406",
|
||||||
|
"outputs:p2r/posterior/Rm5/r12_c1_n16_s0_phase.json": "7113f91f5d7ecd6e0b03f1fd2be328be4ba3ff9814d9fbd42a7252fb730ce6f7",
|
||||||
|
"outputs:p2r/posterior/Rm5/r13_c1_n16_s0_particles.npz": "c89c55818d71b90b4afa1e92a447a72e333d365675a6c3142f4a63bf07dd20a0",
|
||||||
|
"outputs:p2r/posterior/Rm5/r13_c1_n16_s0_phase.json": "1d5297b1dc819908fb66a4de4fe5d7749a0fbf82ee4b198b8641d3e24ffbb505",
|
||||||
|
"outputs:p2r/posterior/Rm5/r14_c1_n16_s0_particles.npz": "4b2e17b34e0a34aab2d664349f4a942b7729bc59b4ccdcab06b6aadd73677770",
|
||||||
|
"outputs:p2r/posterior/Rm5/r14_c1_n16_s0_phase.json": "6a96189e555b9c86528eb2a89f4b3ef9250540224a6a7f3bff6f7989fe67041a",
|
||||||
|
"outputs:p2r/posterior/Rm5/r15_c1_n16_s0_particles.npz": "acc9499057c1607afd22d16da9ce4d5fb61bc17c84bdb4384e5d7650a566aa9c",
|
||||||
|
"outputs:p2r/posterior/Rm5/r15_c1_n16_s0_phase.json": "58c3370e34f5555f24270eef395499616eb66ae5369d651291120e27111c0cd3",
|
||||||
|
"outputs:p2r/posterior/R0h/r8_c1_n4_s0_particles.npz": "363b747704ed7af158264d20137522e4d8d5a86cfe570cd3563d63d7d509124c",
|
||||||
|
"outputs:p2r/posterior/R0h/r8_c1_n4_s0_phase.json": "3519c7ceeba60bac013c760f78dd96a4638b403d4980b9111f3e226e130147c0",
|
||||||
|
"outputs:p2r/posterior/R0h/r9_c1_n4_s0_particles.npz": "e0411696908e91b56475ee6d28a8314425941f08eab7d318f92a2127d412476f",
|
||||||
|
"outputs:p2r/posterior/R0h/r9_c1_n4_s0_phase.json": "6ce7632e2f4e0e7ef3694704df61bd60f50f2a919c509d180d4a5b364a521d07",
|
||||||
|
"outputs:p2r/posterior/R0h/r10_c1_n4_s0_particles.npz": "ccf6ff42e18e5caf1424cf99a76717b44cf859908205ef91841b819b745f392f",
|
||||||
|
"outputs:p2r/posterior/R0h/r10_c1_n4_s0_phase.json": "9333225fa963bbef09dd39664b2e80a33fbb8170e88a5ce52d1996ba0e37c15f",
|
||||||
|
"outputs:p2r/posterior/R0h/r11_c1_n4_s0_particles.npz": "3b80796b3944413562742bc0843106571298e44aeb5f734eb0f15c5c0cd2da03",
|
||||||
|
"outputs:p2r/posterior/R0h/r11_c1_n4_s0_phase.json": "4fb5a297b5845dfdf5f3fe7a3457865afb7954185bf3b6e3757ee80779c67b99",
|
||||||
|
"outputs:p2r/posterior/R0h/r12_c1_n4_s0_particles.npz": "bc05e164683b73d94dbdd1559f6c0e53a8c2e9847f414088a3570590e703aca6",
|
||||||
|
"outputs:p2r/posterior/R0h/r12_c1_n4_s0_phase.json": "1549857aca3c4d412aa5246fd6e4846e0ae44307ffd96fdb0131c10e9682a339",
|
||||||
|
"outputs:p2r/posterior/R0h/r13_c1_n4_s0_particles.npz": "0600bd71479316eb53e29a940af46726917a555a5489afbcac95939acef76663",
|
||||||
|
"outputs:p2r/posterior/R0h/r13_c1_n4_s0_phase.json": "c671c7bbd0caae492e232dca66854e3ec72c1c4116aef3d6eab337503a142d05",
|
||||||
|
"outputs:p2r/posterior/R0h/r14_c1_n4_s0_particles.npz": "761bdf503cf84d2aee01fd249f9a6cf6f33ecefd3e996e175ff37a7d231527aa",
|
||||||
|
"outputs:p2r/posterior/R0h/r14_c1_n4_s0_phase.json": "e5464d5304b22ada70ae8b69b31afd08cf3c637a8c6d3f01f89ee044e7c9a808",
|
||||||
|
"outputs:p2r/posterior/R0h/r15_c1_n4_s0_particles.npz": "9a998f657239175883556d9acb749eafc885f01fc8b5e301d3945b3daaffdf9a",
|
||||||
|
"outputs:p2r/posterior/R0h/r15_c1_n4_s0_phase.json": "0659850be0f8b937c0f140bb83e8559684f0f8d47f5c23a179d558a1b2068486",
|
||||||
|
"outputs:p2r/posterior/R0h/r8_c1_n16_s0_particles.npz": "dc261c29af42887806406c14ff5a98ee9e0b4438a1002d360688091400649266",
|
||||||
|
"outputs:p2r/posterior/R0h/r8_c1_n16_s0_phase.json": "40979d874d3e20af80c2f26afd0a091f509abdc6100543c3e864b89e969bbb6a",
|
||||||
|
"outputs:p2r/posterior/R0h/r9_c1_n16_s0_particles.npz": "76abcd6d9da0184904473cf51ac62c9bc1c2c7ef768016be0876c3d60e5943f1",
|
||||||
|
"outputs:p2r/posterior/R0h/r9_c1_n16_s0_phase.json": "5999b1fe877cc21c4e712d6dccc221ed558a4a642345311074ea7b905f3e3745",
|
||||||
|
"outputs:p2r/posterior/R0h/r10_c1_n16_s0_particles.npz": "050fd0db044f68389136ce04b1a2c747e6959de28d22d41442b9a0b4668f28df",
|
||||||
|
"outputs:p2r/posterior/R0h/r10_c1_n16_s0_phase.json": "9d66d40af704e2d6170d89b4a8d0ad689a0083c379744eb532cd2504fc8b4686",
|
||||||
|
"outputs:p2r/posterior/R0h/r11_c1_n16_s0_particles.npz": "630d576b74725a0376ca2ddee568ad7372f017ca158071b5360ce3a24b20b656",
|
||||||
|
"outputs:p2r/posterior/R0h/r11_c1_n16_s0_phase.json": "456d8a69ab4b9049510e06b29b12dde9252f7eb3fa97b2e5867634de16b8d7b3",
|
||||||
|
"outputs:p2r/posterior/R0h/r12_c1_n16_s0_particles.npz": "100247cd4db887911212d17e752107ad848b5448481542e2493ca686aa2c3bd4",
|
||||||
|
"outputs:p2r/posterior/R0h/r12_c1_n16_s0_phase.json": "a1953bffa9f0b15d0e8616d1ee26859738a2fac32ebc2d7c678133a7f9f52124",
|
||||||
|
"outputs:p2r/posterior/R0h/r13_c1_n16_s0_particles.npz": "06c6e84cf1d4ac270c677a3ea43143f250a2834c51533e628f23c6634f783169",
|
||||||
|
"outputs:p2r/posterior/R0h/r13_c1_n16_s0_phase.json": "2eada76427f27f3e853674c76394f6e3d97126c9ebb2ca7cfb4110b8e963c31b",
|
||||||
|
"outputs:p2r/posterior/R0h/r14_c1_n16_s0_particles.npz": "ca5521c1aabe3fa9ae86e7db6bc2b0f9bd2b71d7eaa900ef3232e3fa01c293f0",
|
||||||
|
"outputs:p2r/posterior/R0h/r14_c1_n16_s0_phase.json": "00fb832008590ee27c07b72666c2402ca2793e50212dfc4819ac17587daa61db",
|
||||||
|
"outputs:p2r/posterior/R0h/r15_c1_n16_s0_particles.npz": "41cc06637eed575d698f3edccbd8b8b5f265463c061a69d51ccaa7725e901165",
|
||||||
|
"outputs:p2r/posterior/R0h/r15_c1_n16_s0_phase.json": "d0df0a3f9cb55a16d893de229d7880db4dc047aee038b87f4e9430242499b6b5"
|
||||||
|
},
|
||||||
|
"nominal_fingerprints": {
|
||||||
|
"8": {
|
||||||
|
"match": true,
|
||||||
|
"sha256_of_fingerprint": "09ab86e2d27583a42e66f4468c3cd7b67d90d5538e305c34fa406ad8711014a8"
|
||||||
|
},
|
||||||
|
"902": {
|
||||||
|
"match": true,
|
||||||
|
"sha256_of_fingerprint": "a9e084ba63afa05706887dde80a9c5fbef33727fedbbd665bd2d1207cd6f8e8a"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"locked_utc": "2026-10-29T14:39:20.607386+00:00",
|
||||||
|
"canonical_text": "UTF-8, CRLF normalized to LF for code, protocol and text inputs; binary inputs exact",
|
||||||
|
"studies": [
|
||||||
|
"S1",
|
||||||
|
"S2",
|
||||||
|
"S3",
|
||||||
|
"S4",
|
||||||
|
"S8"
|
||||||
|
],
|
||||||
|
"realizations": [
|
||||||
|
8,
|
||||||
|
9,
|
||||||
|
10,
|
||||||
|
11,
|
||||||
|
12,
|
||||||
|
13,
|
||||||
|
14,
|
||||||
|
15
|
||||||
|
]
|
||||||
|
}
|
||||||
1
configs/protocol_bench.sha256
Normal file
1
configs/protocol_bench.sha256
Normal file
@@ -0,0 +1 @@
|
|||||||
|
aa763f0a4f81125ea8441fdfba4361f68246c7a0be1c36d4bf8de2650a91a4c5 configs/protocol_bench.yaml
|
||||||
427
configs/protocol_bench.yaml
Normal file
427
configs/protocol_bench.yaml
Normal file
@@ -0,0 +1,427 @@
|
|||||||
|
# Protocol bench (phase P6, level B of Pivot 1; plan §12 items 22 and 26; docs/research/pivot-theory-benchmark.md §6).
|
||||||
|
# Registration-aware synthetic benchmark on D2: S1 grid fill, S2 misspecification axes, S3 anchor-free baselines
|
||||||
|
# under the P2r cells, S4 second backbone, S8 controlled cycle-skip regime. Locked by SHA-256 (configs/protocol_bench.sha256)
|
||||||
|
# and configs/protocol_bench.lock.json (code, environment, inputs, P2r reference artifacts, nominal generator
|
||||||
|
# fingerprints) BEFORE the first run on realizations 8–15: `scripts/run_bench.sh lock`. After the lock this file is
|
||||||
|
# never edited; a change needs protocol_bench v2 with a recorded deviation. Dev realizations 902–905 (and 900/901)
|
||||||
|
# are the only realizations used for design; their outputs (outputs/bench/dev) are never results.
|
||||||
|
status: "LOCKED 2026-10-29 — reviewed by the coordinator (7 fixes applied), locked by scripts/run_bench.sh lock after the dev TCN budget selection; no main-grid run before the lock"
|
||||||
|
version: 1
|
||||||
|
date: 2026-10-29
|
||||||
|
designed_after: >
|
||||||
|
Designed on 29/10/2026 after the complete protocol_p2r results (H2a pass at R10/R0/Rm5, H2b pass, σ_a arm fail,
|
||||||
|
H3 descriptive), after the field phases P3 (G-C fail) and P4 (G-D fail), and after the post hoc inspection of
|
||||||
|
29/10/2026 (outputs/p2r/posthoc: Oracle/B3d-Sa and M2-Sa/B3d-Sa ratios, the classical and Berkson bounds (a), (b),
|
||||||
|
b60 and cross-spectral, at σ_post and at the warp error; plan §12 item 24). The T2 mechanism study
|
||||||
|
(docs/research/t2-mechanism.md) was declared and started before this file was written; its results
|
||||||
|
(docs/research/t2-results.md, 29/10/2026, exploratory, on realizations 8–15) arrived while this draft was being
|
||||||
|
written and motivated two DISCLOSED additions (training.equal_budget_arm and the method Ctl-GP); they changed no
|
||||||
|
rule or threshold of the hypotheses below.
|
||||||
|
deviation: >
|
||||||
|
protocol_bench is not a pre-registration in the sense of protocol_p2: every study was designed knowing the P2r
|
||||||
|
outcome, and S1/S3/S4 reuse the P2r realizations 8–15 and, for S4 and the S2 nominal reference, the P2r SMC
|
||||||
|
particles and results. The paper's Methods state this. Hypotheses marked `claim` below are confirmatory ONLY in
|
||||||
|
the sense that their rule and threshold were fixed here before any run on realizations 8–15; everything marked
|
||||||
|
`descriptive` is reported without a pass/fail; `disclosed` marks an analysis whose motivation came from T2, which
|
||||||
|
looked at test realizations 8–15 (T2 test (v): B3d-Sa and M2-Sa gain from 500 iterations in 7/8 wide cells; test
|
||||||
|
(ii): a GP-noise bank with the posterior's first two moments obtains most of the c = 1 gain). Nothing from T2 is
|
||||||
|
used to reselect a budget or a method: the registered P2r budgets remain the budgets of every rule. The S2
|
||||||
|
misspecification levels were chosen on dev realizations 902–905 (calibration block) before the lock; realizations
|
||||||
|
8–15 were not used for that choice.
|
||||||
|
|
||||||
|
inputs: # hash-checked at load and recorded in the lock (text files CRLF-normalised)
|
||||||
|
d2_config: {path: configs/d2_synth_bench.yaml, sha256: 2bfd01c94f169116fb92e7c1ac92db8bbe003973a610c32b2740e864b4c761b2} # generator = d2_synth_p2r + regimes + misspec presets (final 29/10)
|
||||||
|
protocol_p2: {path: configs/protocol_p2.yaml, sha256: 0733620042c4ec1b7dce447eef3ec64f915db05acbebbe5b6c977ac42e71a470}
|
||||||
|
protocol_p2r: {path: configs/protocol_p2r.yaml, sha256: eb887311f26a7c1c3dc69d9623d0086cfb5ccc79eea9e5ef59c723078f49c8aa}
|
||||||
|
warp_prior: {path: outputs/p2/warp_prior_f3.json, sha256: 55cda573c06b3a7275bdb4ac5f169fb4e5af329e1d199acc3d4daffe15624d27, fit: matern32}
|
||||||
|
wavelet: {path: outputs/wavelets.npz, key: statistical, sha256: b689ea12578e580d8c2305c8f7219be05ff6e339884fa30b694111e968c0fc64}
|
||||||
|
horizon_cache: {path: outputs/d2/horizon_grid.npz, sha256: 70e3321fa9f8fe2a1301877fb34386a64bf29eaa4f6948007e18874678e92b1e}
|
||||||
|
budgets: {path: outputs/p2/diag/train/budgets.json, sha256: 815c6f7abc3d961255feb79bbed57a3e326cbc24cec11bbd97f455f0356e28c5}
|
||||||
|
fingerprints: {path: tests/data/d2_fingerprints.json, sha256: 86cbd6dd49044c1288ec6b649a2d688bf4121280d5cc3dca9b45109523bd6fc1}
|
||||||
|
|
||||||
|
reference:
|
||||||
|
p2r: # read-only; hashed in the lock (ml_porosity/benchmark/protocol.py p2r_reference_files)
|
||||||
|
root: outputs/p2r
|
||||||
|
regimes: [R10, R0, Rm5, R0h, R10tb]
|
||||||
|
use: >
|
||||||
|
S1: the (c ∈ {0, 1, 2}) × (N ∈ {4, 16}) cells of the phase diagram come from outputs/p2r/train/<regime>/runs.csv
|
||||||
|
and outputs/p2r/summary/sigma_post.csv; they are not recomputed. S2: the nominal cells (R10, Rm5; c = 1; N 4/16)
|
||||||
|
are the P2r cells (descriptive reference only; no S2 rule uses them). S3: the P2r runs of Oracle, B3b, B3c,
|
||||||
|
B3c-R, B3d, B3d-Sa, M2-Sa are joined with the new B4a–d runs cell by cell. S4: the P2r SMC particles and
|
||||||
|
phase_R of the S4 cells are the posterior of the TCN methods (same labels, different backbone).
|
||||||
|
fingerprint_rids: [8, 902] # nominal generator fingerprints recomputed at lock time against inputs.fingerprints
|
||||||
|
reproduction_check: >
|
||||||
|
Before the lock, the cell reproduction: (R10, rid 8, c = 1, N = 4) is rerun through this runner (SMC posterior
|
||||||
|
and training) and compared with outputs/p2r/posterior/R10/r8_c1_n4_s0* and outputs/p2r/train/R10/cells/r8_c1_n4.*
|
||||||
|
(scripts/34_run_bench.py repro). The agreement is recorded in docs/research/bench-protocol.md §2 and in
|
||||||
|
outputs/bench/repro/comparison.json. The P2r guard hashes no code, so this check is the evidence that the
|
||||||
|
default generator path and the training path of this runner are those of protocol_p2r.
|
||||||
|
|
||||||
|
grid:
|
||||||
|
realizations: [8, 9, 10, 11, 12, 13, 14, 15] # the P2r realizations; 0–7 (P2) are never used
|
||||||
|
dev_realizations: [900, 901, 902, 903, 904, 905] # design only; 902–905 new for P6
|
||||||
|
seeds: [0, 1, 2, 3, 4] # network seeds; registration seed and SMC stream below
|
||||||
|
test_wells: 8 # observed at the regime SNR with full anchors (anchors unused)
|
||||||
|
regimes: {R10: {snr_db: 10, anchor_density: full}, R0: {snr_db: 0, anchor_density: full},
|
||||||
|
Rm5: {snr_db: -5, anchor_density: full}, R0h: {snr_db: 0, anchor_density: half},
|
||||||
|
R10tb: {snr_db: 10, anchor_density: topbottom}} # = configs/d2_synth_bench.yaml regimes (= p2r)
|
||||||
|
|
||||||
|
registration: # identical to protocol_p2r (scripts/14 with --wavelets estR, P = 1024, K = 1)
|
||||||
|
base: "protocol_p2 registration block (MAP-II, σ_a 7 ms, σ_b 50 ms, 128 ms statistical wavelet, 15° constant phase)"
|
||||||
|
reg_seed: 0
|
||||||
|
smc:
|
||||||
|
code: ml_porosity/benchmark/registration.py (= scripts/14 run_job, estR arm)
|
||||||
|
particles: 1024
|
||||||
|
smc_seed: 0 # random streams [0, i, 13] anchor samples, [0, 19] phase fit, [0, i, 17] SMC
|
||||||
|
arm: estR # statistical wavelet with the phase re-estimated from the SMC log Z (phase_R)
|
||||||
|
checkpoints: [g_old, g_acf, g_one] # same tempering milestones as P2r (checkpoints change the schedule); g_acf used
|
||||||
|
saved: [estR/g_acf] # particles at γ = 1/κ; P2r also stored g_one (unused by any method)
|
||||||
|
phase_step: 15.0
|
||||||
|
phase_half_width: 3
|
||||||
|
phase_max_extra: 6
|
||||||
|
sigma_a_reg_ms: 7.0 # correct σ_a everywhere (the σ_a arm of P2r is not repeated; its failure stands)
|
||||||
|
note_misspec: >
|
||||||
|
Under the S2 presets the registration still assumes the nominal rock physics (obs["ai_log"]), a stationary
|
||||||
|
wavelet with a constant phase and the F3 Matérn-3/2 prior with σ_b = 50 ms: nothing in the registration is told
|
||||||
|
about the preset. The "true wavelet" arm of scripts/14 is not run (under constant Q no single true wavelet
|
||||||
|
exists). Diagnostics from [b, g] are not used (invalid with jitter); warp errors use obs["t_of_tau_true"].
|
||||||
|
|
||||||
|
training: # identical to protocol_p2r for the CNN-GRU methods
|
||||||
|
backbone: "CNNGRUHetero (protocol_p2 training block: d 64, dropout 0.05, Adam 5e-3, grad clip 5, full batch, 64-sample windows, per-well z-score)"
|
||||||
|
code: ml_porosity/models/bank_train.py train_predict (CNN-GRU, unchanged) | ml_porosity/benchmark/training.py train_predict_tcn (S4)
|
||||||
|
lambda: "λ = 1/τ_c as in protocol_p2 (pooled ACF of the high-passed B3b labels)"
|
||||||
|
bank_S: 64
|
||||||
|
budgets: # iterations; P2r values for the P2r methods, protocol_p2 values for B4a–d
|
||||||
|
Oracle: 500
|
||||||
|
B3b: 125
|
||||||
|
B3c: 250
|
||||||
|
B3c-R: 500
|
||||||
|
B3d: 250
|
||||||
|
B3d-Sa: 250
|
||||||
|
M2-Sa: 250
|
||||||
|
B4a: 125
|
||||||
|
B4b: 125
|
||||||
|
B4c: 500
|
||||||
|
B4d: 250
|
||||||
|
PM2: 250 # S8 point label at the posterior-mean warp: budget of B3d-Sa (same label type)
|
||||||
|
BK2: 250 # S8 two-member bank with RML: budget of M2-Sa
|
||||||
|
HM2: 125 # S8 two-member bank with hard-min: budget of B4a (same loss)
|
||||||
|
Ctl-GP: 250 # control bank with RML: budget of M2-Sa (same loss, same bank size)
|
||||||
|
equal_budget_arm: 500 # DISCLOSED (T2 test v, seen on realizations 8–15): every method's trajectory also records
|
||||||
|
# its prediction at 500 iterations (one trajectory per seed, as bank_train evaluates
|
||||||
|
# every budget in the list). No rule uses this arm; it is reported as a separate
|
||||||
|
# descriptive table (equal budget for all methods). It does not replace the budgets above.
|
||||||
|
budgets_tcn: # S4; filled 29/10/2026 from outputs/bench/dev/budgets_tcn.json (stage dev-budgets, runlog
|
||||||
|
# 20261029-133330_bench_dev_budgets_tcn): protocol_p2 budget_selection rule applied to the TCN
|
||||||
|
# on dev 902–905, R10, c = 1, N ∈ {4, 16}, seeds 0–1, candidates [125, 250, 500, 1000, 2000].
|
||||||
|
# Every method selects 125, the smallest candidate (mean total RMSE rises monotonically with
|
||||||
|
# iterations for the TCN on ≤ 16 wells: e.g. B3d-Sa-TCN 1.406/1.428/1.482/1.537/1.592,
|
||||||
|
# M2-Sa-TCN 1.389/1.429/1.469/1.521/1.616); the minimum lies on the boundary of the candidate
|
||||||
|
# list, which is kept as in protocol_p2 (no smaller candidate is added after seeing dev).
|
||||||
|
Oracle: 125
|
||||||
|
B3b: 125
|
||||||
|
B3c: 125
|
||||||
|
B3c-R: 125
|
||||||
|
B3d-Sa: 125
|
||||||
|
M2-Sa: 125
|
||||||
|
budget_candidates: [125, 250, 500, 1000, 2000]
|
||||||
|
budget_rule_new_methods: >
|
||||||
|
No budget is selected on realizations 8–15. PM2/BK2/HM2 inherit the budget of the P2r/P2 method with the same
|
||||||
|
label type and loss. TCN budgets follow training.budgets_tcn.
|
||||||
|
|
||||||
|
methods:
|
||||||
|
Oracle: {labels: true warp, note: "reference ceiling under the generator of the cell (under S2 presets the seismic changed too)"}
|
||||||
|
B3b: as protocol_p2 (marker-calibrated sonic through the anchors)
|
||||||
|
B3c: as protocol_p2 (B3b + local NCC shifts, protocol_p2 phase)
|
||||||
|
B3c-R: as protocol_p2r (B3c with the wavelet at phase_R)
|
||||||
|
B3d: as protocol_p2 (weighted mean warp of the anchor-conditioned M2 of P2)
|
||||||
|
B3d-Sa: as protocol_p2r (labels at the mean warp of the SMC particles, γ = 1/κ)
|
||||||
|
M2-Sa: as protocol_p2r (RML, soft-min with λ, bank of 64 SMC particles, uniform π)
|
||||||
|
B4a: as protocol_p2 (B3b labels shifted ±8 samples, uniform π, hard-min)
|
||||||
|
B4b: as protocol_p2 (same bank, RML with λ)
|
||||||
|
B4c: as protocol_p2 (soft-DTW γ = 0.1, band ±8, on B3b labels)
|
||||||
|
B4d: as protocol_p2 (DILATE α = 0.5, γ = 0.1, band ±8, on B3b labels)
|
||||||
|
PM2: "S8: point labels at t_true + s·Δ/2 (the posterior-mean warp of the two-mode posterior {t_true, t_true + s·Δ}); s = ±1 per training well from rng [rid, 20261030, 8, i]"
|
||||||
|
BK2: "S8: two-member bank {t_true, t_true + s·Δ}, π = (½, ½), RML with the cell's λ (a calibrated bank: the truth is a member)"
|
||||||
|
HM2: "S8: the BK2 bank with the hard-min loss (λ = ∞)"
|
||||||
|
Ctl-GP: >
|
||||||
|
DISCLOSED (T2 test ii): control bank of 64 warps T̄ + η_s with η_s Gaussian with the empirical mean and covariance
|
||||||
|
of the 1024 SMC particles on the warp grid (rng [reg_seed, i, 2029]; monotone draws, ≤ 1280 attempts, u-space
|
||||||
|
fallback flagged), uniform π, RML with the cell's λ. It carries the posterior's first two moments and no link
|
||||||
|
between a member and the seismic: the natural null for "the information in the SMC bank matters".
|
||||||
|
Implementation ml_porosity/benchmark/training.py control_gp_bank (= scripts/32 control_bank).
|
||||||
|
suffix_TCN: "S4: the same labels trained with TCNHetero (ml_porosity/f3/training.py; 4 dilated Conv1d, k = 5, dilations 1–8, softplus σ); names carry the suffix -TCN"
|
||||||
|
ensembles: "5-seed ensembles (μ = mean μ_s, σ² = mean σ_s² + var μ_s) reported descriptively (coverage, NLL, CRPS); no calibration claim"
|
||||||
|
|
||||||
|
studies:
|
||||||
|
S1: # grid fill of the phase diagram (pivot §2.2 S1, theory gap T5)
|
||||||
|
regimes: [R10, Rm5, R0, R0h, R10tb] # run order = priority; see cut_order
|
||||||
|
drift_factors: [0, 0.5, 1, 1.5, 2]
|
||||||
|
n_train: [2, 4, 8, 16]
|
||||||
|
existing: "P2r cells (c ∈ {0, 1, 2}) × (N ∈ {4, 16}) are read from outputs/p2r; 14 new (c, N) combinations per regime"
|
||||||
|
methods: [Oracle, B3b, B3c, B3c-R, B3d, B3d-Sa, M2-Sa]
|
||||||
|
cells_new: "5 regimes × 14 (c, N) × 8 realizations = 560 SMC jobs and 560 training cells"
|
||||||
|
S2: # misspecification axes (plan §12 item 22 decision 2); MANDATORY for the word "benchmark"
|
||||||
|
regimes: [R10, Rm5]
|
||||||
|
drift_factors: [1]
|
||||||
|
n_train: [4, 16]
|
||||||
|
presets: # names in configs/d2_synth_bench.yaml misspec_presets; levels fixed on dev 902–905 (calibration)
|
||||||
|
rock_physics: [rp_L1, rp_L2] # per-unit φ–DT intercept scatter sd 0.10 / 0.15
|
||||||
|
wavelet: [wv_L1, wv_L2, wv_Q] # phase sub-axis minphase 0.5 / 1.0; bandwidth sub-axis Q 80 (single level, third entry, no L1 role)
|
||||||
|
drift: [dr_L1, dr_L2] # two mechanisms: hyperparameters (σ_b ×3, σ_g ×1.5, ℓ ×0.5) / structural (step 8 ms + jitter 1 ms)
|
||||||
|
controls: # optional, run last and cut first within S2: in-family controls of two axes
|
||||||
|
presets: [rp_C, wv_C]
|
||||||
|
n_train: [4]
|
||||||
|
methods: [Oracle, B3b, B3c, B3c-R, B3d-Sa, M2-Sa, Ctl-GP] # decision 2's set plus the two cheap point ties B3b, B3c so that
|
||||||
|
# the H2a competitor set {B3b, B3c, B3c-R} is the P2r one, plus the
|
||||||
|
# disclosed control bank Ctl-GP (training only)
|
||||||
|
cells: "2 regimes × 7 presets × 2 N × 8 realizations = 224 SMC jobs and 224 training cells (+ 32 control jobs)"
|
||||||
|
nominal_reference: "the P2r cells of the same (regime, c = 1, N): descriptive comparison only"
|
||||||
|
S3: # anchor-free / shift-bank baselines under the P2r cells
|
||||||
|
regimes: [R10, R0, Rm5, R0h, R10tb]
|
||||||
|
drift_factors: [0, 1, 2]
|
||||||
|
n_train: [4, 16]
|
||||||
|
methods: [B4a, B4b, B4c, B4d, Ctl-GP]
|
||||||
|
posterior: p2r # B4 uses the protocol_p2 B3b labels (register(); registration seed 0, as P2r); Ctl-GP reads the
|
||||||
|
# P2r particles of the cell (no new SMC)
|
||||||
|
cells: "5 × 3 × 2 × 8 = 240 training cells; joined with the P2r runs of the same cells"
|
||||||
|
S4: # second backbone on representative cells
|
||||||
|
backbone: tcn
|
||||||
|
posterior: p2r # SMC particles and phase_R of outputs/p2r/posterior/<regime>
|
||||||
|
cells: [{regime: R10, c: 1}, {regime: Rm5, c: 1}, {regime: R0h, c: 1}]
|
||||||
|
n_train: [4, 16]
|
||||||
|
methods: [Oracle, B3b, B3c, B3c-R, B3d-Sa, M2-Sa]
|
||||||
|
cells_count: "3 × 2 × 8 = 48 training cells"
|
||||||
|
S8: # controlled cycle-skip (two-mode) regime; theory Corollary 3 and Proposition 4
|
||||||
|
regimes: [R10, Rm5]
|
||||||
|
drift_factors: [1]
|
||||||
|
n_train: [4, 16]
|
||||||
|
delta_ms: [8, 16, 32] # mode separation; sign-flip band of cos(πfΔ): (62.5, 187), (31.3, 93.8), (15.6, 46.9) Hz
|
||||||
|
methods: [Oracle, PM2, BK2, HM2]
|
||||||
|
posterior: none # the two-mode posterior is constructed from the true warp (no SMC); inputs as the regime
|
||||||
|
cells: "2 × 3 × 2 × 8 = 96 training cells"
|
||||||
|
note: >
|
||||||
|
This is the "set Δ explicitly" reading of pivot §2.2 S8. The run-to-run instability of the real SMC posterior at
|
||||||
|
c = 2 (P2r flag) is not re-measured here; the realistic multimodal cells remain flagged as in P2r.
|
||||||
|
|
||||||
|
rules: # all from protocol_p2 / protocol_p2r; thresholds never change
|
||||||
|
metric: "band RMSE (6 Hz Butterworth high-pass, p.u.) macro over the 8 test wells; band PCC secondary"
|
||||||
|
run: "(realization, c, N, method, seed) at the method's budget; cell statistics average over realization × seed"
|
||||||
|
improves: "band_rmse(cand) ≤ 0.90 · band_rmse(best) OR band_pcc(cand) ≥ band_pcc(best) + 0.05"
|
||||||
|
cell_pass: "improves in ≥ 4/5 seeds (per seed: mean over realizations) AND in > 1/2 of the realizations (per realization: mean over seeds)"
|
||||||
|
better: "cand < ref in ≥ 4/5 seeds AND > 1/2 of realizations (direction rule for ratios without a margin)"
|
||||||
|
no_harm: 1.02
|
||||||
|
wide: "σ_post ≥ 1.5 ms (σ_post = mean 90% width of τ(t) of the SMC particles over the train wells / 3.29; no labels)"
|
||||||
|
ci: "95% bootstrap over realizations (2000 resamples, rng 0) for every ratio; reported regardless of direction"
|
||||||
|
permutation: "10000 permutations, rng 0, one-sided p; a declared test passes at p < 0.05"
|
||||||
|
flags: "c = 2 cells keep the P2r flag 'unstable posterior'; they are reported, never primary evidence"
|
||||||
|
multiplicity: >
|
||||||
|
Every `claim` below is a separate pre-declared test with its own rule and threshold; there is no family-wise
|
||||||
|
correction. Number of claims: 9 (S1-H1, S1-H2, S2-H1, S2-H2, S3-H1, S4-H1, S4-H2, S8-H1, S8-H2), giving 11
|
||||||
|
verdicts because S2-H1 is judged once per axis (rock physics, wavelet, drift). The paper reports every verdict,
|
||||||
|
including failures, and never selects among them.
|
||||||
|
bounds: >
|
||||||
|
No rule here is bound-based. Where a population bound is quoted next to a B3d-Sa ratio at c = 1 it is the Berkson
|
||||||
|
bound 1/B_b (T2 test iv found the Berkson structure for B3d-Sa at c = 1, informed by T2, disclosed); at c = 2 no
|
||||||
|
structure holds and no bound is quoted.
|
||||||
|
|
||||||
|
hypotheses:
|
||||||
|
S1-H1:
|
||||||
|
kind: claim
|
||||||
|
statement: "H2a extends to c = 1.5 in R10: B3d-Sa beats the best point tie {B3b, B3c, B3c-R} (cell_pass) for both N ∈ {4, 16}"
|
||||||
|
prediction: pass
|
||||||
|
S1-H2:
|
||||||
|
kind: claim
|
||||||
|
statement: >
|
||||||
|
The bank gain grows with the number of wells at fixed posterior width (finite-sample heuristic of the paper,
|
||||||
|
Sec. 4.3): in every family (regime, c) whose N = 16 cell is wide, the ratio r(N) = band_rmse(M2-Sa)/band_rmse(B3d-Sa)
|
||||||
|
is lower at N = 16 than at N = 2 in ≥ 2/3 of the families, AND the pooled Spearman ρ(log2 N, r) over all
|
||||||
|
(family, N) points is negative with one-sided permutation p < 0.05 (permutations within family).
|
||||||
|
families: "(regime, c) with σ_post(N = 16) ≥ 1.5 ms, from the P2r and S1 posteriors"
|
||||||
|
prediction: pass
|
||||||
|
S1-D:
|
||||||
|
kind: descriptive
|
||||||
|
items: ["phase diagram c × N of band RMSE per method and of the ratios B3d-Sa/best point tie and M2-Sa/B3d-Sa with CI",
|
||||||
|
"σ_post(c, N) and SMC warp RMSE / coverage90 per regime",
|
||||||
|
"additivity fit per regime: band_rmse²(B3d-Sa; c, N) = band_rmse²(Oracle; c, N) + β σ_post²(c, N), β and R² reported",
|
||||||
|
"H2a cell rule at every new (c, N) with the P2r competitors (no verdict beyond S1-H1)"]
|
||||||
|
S2-H1:
|
||||||
|
kind: claim
|
||||||
|
statement: >
|
||||||
|
Posterior-mean labels survive moderate misspecification: for each axis at level L1, in R10, B3d-Sa beats the best
|
||||||
|
point tie {B3b, B3c, B3c-R} (cell_pass, c = 1) for both N ∈ {4, 16}. One verdict per axis; the claim is scoped to
|
||||||
|
the axes that pass. Rm5, L2 and the bandwidth cell wv_Q are reported with the same rule, without a claim.
|
||||||
|
prediction: >
|
||||||
|
pass for rock physics (dev R10, N = 4: SMC warp RMSE ×1.27 nominal at rp_L1, cov90 0.85) and for the wavelet
|
||||||
|
phase sub-axis at L1 (dev: wv_L1 posterior overconfident, cov90 0.11, yet its warp RMSE 2.14 ms stays below the
|
||||||
|
point tie B3c's 4.30 ms in 4/4 rids); fail expected at wv_L2 (dev: 3.93 ms, cov90 0.03, below B3c 4.57 ms in
|
||||||
|
only 3/4 rids); drift uncertain (dr_L1 1.55 ms / dr_L2 2.27 ms against B3c 3.48 / 4.52 ms, 4/4 rids ahead).
|
||||||
|
expected_null: >
|
||||||
|
At Rm5 (noise RMS 1.78 × signal) every preset's model error (≤ 0.61 × signal) is buried in the noise: on dev
|
||||||
|
(902, 903) all presets left the Rm5 SMC diagnostics within ±10% of nominal, including wv_L2. Pre-declared null:
|
||||||
|
at Rm5 the registration diagnostics (warp RMSE, cov90, σ_post, phase_R) of every preset are expected to equal
|
||||||
|
their nominal values within the CI; S2 at Rm5 therefore tests only the label-side and input-side consequences
|
||||||
|
of misspecification (Oracle and the point ties change with the seismic), not the registration. The sharpest
|
||||||
|
version is the rock-physics axis (model error 0.22–0.30 of the noise).
|
||||||
|
S2-H2:
|
||||||
|
kind: claim
|
||||||
|
statement: >
|
||||||
|
No harm of the posterior bank under misspecification: for every S2 preset (rp_L1, rp_L2, wv_L1, wv_L2, wv_Q,
|
||||||
|
dr_L1, dr_L2) and regime (R10, Rm5), the mean ratio band_rmse(M2-Sa)/band_rmse(B3d-Sa) over its cells
|
||||||
|
(N ∈ {4, 16}) is ≤ 1.02. Passes only if all 14 (preset, regime) pairs satisfy it (summary.py: len(regimes) ×
|
||||||
|
number of presets = 14).
|
||||||
|
prediction: pass
|
||||||
|
S2-D:
|
||||||
|
kind: descriptive
|
||||||
|
items: ["SMC diagnostics per preset, regime, N: warp RMSE, coverage90, σ_post, overconfidence = warp RMSE/σ_post, phase_R, κ_post, r_post",
|
||||||
|
"degradation of every method vs its P2r nominal cell (ratio with CI); Oracle degradation isolates the covariate change",
|
||||||
|
"M2-Sa vs B3d-Sa at wide cells (σ_post ≥ 1.5 ms) with the 'better' rule, and the ratio vs coverage90 (does the gain track coverage rather than σ_post?)",
|
||||||
|
"B3d-Sa no-harm flag: band_rmse(B3d-Sa) ≤ 1.02 · best point tie per (preset, regime, N)",
|
||||||
|
"controls rp_C, wv_C (if run): in-family misspecification should leave every diagnostic at its nominal value",
|
||||||
|
"DISCLOSED (T2 ii): Ctl-GP vs B3d-Sa and M2-Sa vs Ctl-GP ('better' rule) per cell: under misspecification, does the SMC bank's information matter beyond its two moments?",
|
||||||
|
"DISCLOSED (T2 v): the equal-budget table at 500 iterations for every method, next to the registered-budget table"]
|
||||||
|
S3-H1:
|
||||||
|
kind: claim
|
||||||
|
statement: >
|
||||||
|
The H2a verdict is unchanged when the competitor set is extended by the anchor-free / shift-bank baselines:
|
||||||
|
per regime (R10, R0, Rm5), B3d-Sa vs best of {B3b, B3c, B3c-R, B4a, B4b, B4c, B4d} with the P2r regime rule
|
||||||
|
(cell_pass at c = 1 for both N AND the c = 0 guard ≤ 1.02 macro and per N). Passes if R10 passes; scoped to the
|
||||||
|
regimes that pass.
|
||||||
|
prediction: pass
|
||||||
|
S3-D:
|
||||||
|
kind: descriptive
|
||||||
|
items: ["complete benchmark table (all methods × 5 regimes × c × N) with CI", "B4 variants vs B3b (do shift banks help without the posterior?)"]
|
||||||
|
T2-1:
|
||||||
|
kind: disclosed
|
||||||
|
statement: >
|
||||||
|
Control bank across the P2r grid (S3 cells, 5 regimes × c ∈ {0, 1, 2} × N ∈ {4, 16}): per cell, Ctl-GP vs B3d-Sa
|
||||||
|
and M2-Sa vs Ctl-GP with the 'better' rule and CI. Reading fixed before the run: the SMC bank's information
|
||||||
|
matters in a cell if M2-Sa is better than Ctl-GP; T2 (ii) found this at c = 2 (3/4 wide cells) and not at c = 1
|
||||||
|
(3/4 cells consistent with label augmentation). No pass/fail; the N = 16, c ∈ {1, 2} wide cells duplicate T2 (ii).
|
||||||
|
S4-H1:
|
||||||
|
kind: claim
|
||||||
|
statement: "Backbone independence of H2a at R10, c = 1: B3d-Sa-TCN beats the best TCN point tie {B3b-TCN, B3c-TCN, B3c-R-TCN} (cell_pass) for both N"
|
||||||
|
prediction: pass
|
||||||
|
S4-H2:
|
||||||
|
kind: claim
|
||||||
|
statement: "Backbone independence of the wide-cell bank gain: M2-Sa-TCN is better than B3d-Sa-TCN ('better' rule) in both wide cells (Rm5 c = 1 N = 16; R0h c = 1 N = 16)"
|
||||||
|
prediction: "pass; uncertain (the TCN has no recurrent context)"
|
||||||
|
S4-D:
|
||||||
|
kind: descriptive
|
||||||
|
items: ["TCN vs CNN-GRU per method and cell (ratio with CI)", "coverage of TCN ensembles"]
|
||||||
|
S8-H1:
|
||||||
|
kind: claim
|
||||||
|
statement: >
|
||||||
|
Corollary 3 (sign flip): at Δ = 32 ms in R10, for both N, the measured transfer of PM2 relative to Oracle,
|
||||||
|
Ĥ(f) = Σ Re[Y* P_PM2] / Σ Re[Y* P_Oracle] (Hann, NFFT 256, pooled over test wells, realizations and seeds, as
|
||||||
|
H1), averaged over the usable frequencies in (1/(2Δ), 3/(2Δ)) = (15.6, 46.9) Hz, is negative. Usable: f ≥ 6 Hz
|
||||||
|
and Re S_Oracle(f) ≥ 10% of its in-band maximum.
|
||||||
|
prediction: pass
|
||||||
|
S8-H2:
|
||||||
|
kind: claim
|
||||||
|
statement: >
|
||||||
|
The calibrated two-member bank repairs the point label where the modes are resolvable: BK2 is better than PM2
|
||||||
|
('better' rule) at Δ ∈ {16, 32} ms, N = 16, in both regimes (4 cells, all must pass).
|
||||||
|
prediction: pass
|
||||||
|
dev_note: >
|
||||||
|
A first draft also required "no harm at Δ = 8 ms". The dev smoke (rid 902, R10, N = 4, seed 0, 29/10) gave band
|
||||||
|
RMSE PM2 0.96, BK2 1.34, HM2 1.30, Oracle 0.62 at Δ = 8 ms, and PM2 1.45 / BK2 0.62 at 16 ms, PM2 1.76 / BK2 0.56
|
||||||
|
at 32 ms: two members 8 ms apart (half the dominant period) are not separated by the window loss and the bank
|
||||||
|
then behaves like an averaged label. The Δ = 8 ms clause was therefore moved to S8-D before the lock (design on
|
||||||
|
dev, recorded here).
|
||||||
|
S8-D:
|
||||||
|
kind: descriptive
|
||||||
|
items: ["Ĥ(f) of PM2, BK2 and HM2 against cos(πfΔ) for every Δ", "ratios PM2/Oracle, BK2/Oracle, HM2/PM2 with CI per cell",
|
||||||
|
"first zero crossing of Ĥ_PM2 vs 1/(2Δ)",
|
||||||
|
"Δ = 8 ms: BK2/PM2 and HM2/PM2 with CI (resolution limit of the bank; dev showed harm at N = 4, see S8-H2.dev_note)"]
|
||||||
|
|
||||||
|
cells: "cell = (study, regime, preset, c, N); all cell statistics average over realization × seed as in protocol_p2r"
|
||||||
|
|
||||||
|
calibration: # S2 levels: chosen on dev 902–905 before the lock; evidence in docs/research/bench-protocol.md §3
|
||||||
|
status: "CHOSEN 29/10/2026 on rids 902 and 903 (all candidates), confirmed on 904 and 905 (chosen presets): bench-protocol.md §3"
|
||||||
|
procedure: >
|
||||||
|
For each axis, candidate levels (configs/d2_synth_bench.yaml cand_*) were registered as in P2r (SMC, P = 1024,
|
||||||
|
estR, γ = 1/κ) on dev realizations at N = 4, c = 1, R10 and Rm5 (scripts/33 --smc). Targets declared before the
|
||||||
|
results: L1 = the registration's in-family model error comparable to the R10 noise (0.5–1.0 ×) and the SMC
|
||||||
|
posterior still ahead of the point ties (SMC warp RMSE < B3c warp RMSE at R10); L2 = model error 1.5–2 × the R10
|
||||||
|
noise, with a visible loss of posterior calibration (coverage90 < 0.5 at R10 or warp RMSE ≥ 2 × nominal).
|
||||||
|
Rock physics uses the per-unit intercept scatter only (the uniform coefficient error is invariant under the
|
||||||
|
profiled-amplitude likelihood, docs/research/bench-generator.md §2; rp_C stays as a control). The drift axis has
|
||||||
|
no generator-side model-error measure and its two presets are two separate MECHANISMS, not two strengths of one
|
||||||
|
setting: dr_L1 = the truth drawn from misspecified hyperparameters (σ_b ×3, σ_g ×1.5, ℓ ×0.5; inside the GP
|
||||||
|
family, partly absorbed by MAP-II), dr_L2 = components outside the GP family (step 8 ms at Truncation + jitter 1 ms,
|
||||||
|
no hyperparameter change). Each is attributed on its own cell; nothing is attributed by difference. On dev dr_L2
|
||||||
|
degrades the SMC more than dr_L1 (×3.3 vs ×2.2), which is why they carry the labels L2 and L1.
|
||||||
|
levels_vs_declared_band: >
|
||||||
|
Two chosen levels sit outside the declared L1 band of 0.5–1.0 × the R10 noise, by design and stated here:
|
||||||
|
rp_L1 (unit sd 0.10) has a model error of 1.24 × the R10 noise (+24%), wv_L1 (minphase 0.5) 1.08 × (+8%).
|
||||||
|
Reasons. (i) Rock physics: the registration is nearly blind to this axis (sd 0.05 → ×1.3, 0.10 → ×1.27,
|
||||||
|
0.15 → ×1.66 SMC warp RMSE; cov90 0.59–0.85), so the level cannot be set by the SMC criterion; 0.10 keeps L1 and
|
||||||
|
L2 distinguishable in model error (1.24 vs 1.68) and in SMC effect, whereas sd 0.075 (0.95 ×, one dev rid:
|
||||||
|
×1.09, cov90 0.76) would be indistinguishable from nominal; the QC author recommended 0.10/0.15. (ii) Wavelet
|
||||||
|
phase: no in-band setting is moderate for the SMC (minphase 0.25 at 0.62 × already gives cov90 0.25), so the
|
||||||
|
band cannot be met together with the "still ahead of the point ties" criterion; 0.5 is the mildest phase level
|
||||||
|
confirmed on 4 rids that keeps the SMC ahead of B3c (2.14 vs 4.30 ms). The L2 levels (1.68 ×, 1.93 ×) and wv_Q
|
||||||
|
(1.41 ×, bandwidth cell) are inside their declared bands. Option (a) of the review (sd 0.075 with two more dev
|
||||||
|
rids) was considered and rejected for reason (i).
|
||||||
|
evidence: >
|
||||||
|
outputs/bench/dev/smc_qc_rid{902,903,904,905}.json (scripts/33 --smc), tabulated by scripts/35_bench_calibration.py
|
||||||
|
→ outputs/bench/dev/calibration.{csv,md}; docs/research/bench-protocol.md §3. Dev SMC at R10, N = 4, c = 1, means over
|
||||||
|
rids (warp RMSE ratio to nominal 0.69 ms / coverage90; nominal 0.83): unit sd 0.05 ×1.3/0.59 (1 rid), 0.10 ×1.27/0.85
|
||||||
|
(3), 0.15 ×1.66/0.81 (4); minphase 0.25 ×1.9/0.25 (1), 0.5 ×3.2/0.11 (4), 1.0 ×5.9/0.03 (4, ahead of B3c in 3/4),
|
||||||
|
Q 160 ×1.1/0.79 (2), Q 80 ×1.57/0.84 (4), Q 40 ×1.6/0.86 (1); hyperparameter drift ×2.2/0.75 (4), structural drift
|
||||||
|
×3.3/0.61 (4), both ×3.5/0.61 (2), step 16 ms ×5.3/0.60 (2). At Rm5 every preset stays within ×0.97–1.23 of the
|
||||||
|
nominal 3.68 ms. Rock physics is nearly invisible to the registration (chosen by model error);
|
||||||
|
the wavelet phase sub-axis is the one that breaks the constant-phase family (overconfident posterior), while the
|
||||||
|
bandwidth sub-axis widens the posterior without breaking it (kept as a single separate cell wv_Q); the drift levels
|
||||||
|
are two mechanisms rather than two strengths (kept separate for attribution).
|
||||||
|
note_single_checkpoint: >
|
||||||
|
scripts/33 runs the SMC with the single checkpoint γ = 1/κ, whereas P2r and this runner use the milestones
|
||||||
|
(g_old, g_acf, g_one); the dev diagnostics therefore differ slightly from what the main run will produce for the
|
||||||
|
same cell (rid 902, R10 nominal: 0.74 vs 0.70 ms warp RMSE at P00). Levels were chosen on ratios to nominal under
|
||||||
|
the same schedule.
|
||||||
|
chosen: # verbatim misspec dicts (configs/d2_synth_bench.yaml); checked against the file at load
|
||||||
|
rp_L1: {rock_physics: {unit_dt_intercept_sd: 0.10}}
|
||||||
|
rp_L2: {rock_physics: {unit_dt_intercept_sd: 0.15}}
|
||||||
|
wv_L1: {wavelet: {minphase_frac: 0.5}}
|
||||||
|
wv_L2: {wavelet: {minphase_frac: 1.0}}
|
||||||
|
wv_Q: {wavelet: {Q: 80.0, Q_t_ref_ms: 400.0, Q_dispersion: true}}
|
||||||
|
dr_L1: {drift: {sigma_b_factor: 3.0, sigma_g_factor: 1.5, ell_factor: 0.5}}
|
||||||
|
dr_L2: {drift: {step_ms: 8.0, step_width_ms: 12.0, step_horizon: Truncation, jitter_sd_ms: 1.0, jitter_ell_ms: 8.0}}
|
||||||
|
|
||||||
|
reproduction: # see reference.reproduction_check
|
||||||
|
rid: 8
|
||||||
|
regime: R10
|
||||||
|
c: 1
|
||||||
|
n_train: 4
|
||||||
|
methods: [Oracle, B3b, B3c, B3c-R, B3d, B3d-Sa, M2-Sa]
|
||||||
|
tolerance_note: >
|
||||||
|
The SMC on the GPU matches the CPU algorithm up to rounding and bank_train sets no cudnn deterministic flags;
|
||||||
|
bitwise agreement is reported if it occurs, otherwise the maximum deviations of phase_R, particles, warp RMSE
|
||||||
|
and band RMSE are reported as the reproducibility floor of this environment.
|
||||||
|
result: >
|
||||||
|
bitwise exact (29/10/2026, cuda:1, torch 2.14.0+cu130, H200): phase0 and phase_R identical (−0.990696378084408),
|
||||||
|
log Z max |diff| 0, all four g_acf particle sets (1024 × 390) bitwise equal, every warp diagnostic 0, stage counts
|
||||||
|
17/17/17/18 identical; 280 training rows (7 methods × 5 seeds × 8 test wells) max |diff| 0 on band RMSE, RMSE,
|
||||||
|
band PCC, NLL and coverage90, all 35 μ arrays and y_true bitwise equal, _diag.csv 0.
|
||||||
|
Evidence: outputs/bench/repro/comparison.json (runlog 20261029-133329_bench_repro_r8); docs/research/bench-protocol.md §2.
|
||||||
|
|
||||||
|
cut_order: # if late (never cut thresholds); plan §6.1
|
||||||
|
- "S4 (second backbone)"
|
||||||
|
- "S8 (cycle-skip regime)"
|
||||||
|
- "S2 reduced to the rock-physics axis (then the paper says 'controlled synthetic study', not 'benchmark')"
|
||||||
|
- "S1 reduced to c ∈ {0.5, 1.5} × N ∈ {4, 16} on R10, Rm5, R0 (within S1 the regimes R0h, R10tb are cut first)"
|
||||||
|
- "S2 controls rp_C, wv_C are optional at all times; within S2 the bandwidth cell wv_Q is cut before the phase levels"
|
||||||
|
- "the equal-budget arm and Ctl-GP are disclosed extras: dropping them needs no new protocol version only if no cell has been trained yet"
|
||||||
|
|
||||||
|
compute: # estimate; see docs/research/bench-protocol.md §5
|
||||||
|
posterior_jobs: {S1: 560, S2: 224, S2_controls: 32}
|
||||||
|
training_cells: {S1: 560, S2: 224, S3: 240, S4: 48, S8: 96}
|
||||||
|
split: "cuda:0 — S1 R10/Rm5/R0h then S2 R10; cuda:1 — S1 R0/R10tb then S2 Rm5, S3, S4, S8; 4 workers per GPU at 6 GiB each when free"
|
||||||
|
resume: "scripts/run_bench.sh is restartable: completed jobs are skipped by fingerprint and checksum"
|
||||||
|
|
||||||
|
wording:
|
||||||
|
forbidden: ["first", "novel", "the word benchmark if S2 is incomplete", "calibrated uncertainty", "generalizing to the field",
|
||||||
|
"mechanism proven", "tuning on test labels", "claims about λ"]
|
||||||
|
required: ["designed after P2r (deviation above)", "S2 levels chosen on dev 902–905", "P2r guard hashes no code; reproduction check reported",
|
||||||
|
"F3 and Volve are scope-bounding cases"]
|
||||||
806
docs/lecture.md
Normal file
806
docs/lecture.md
Normal file
@@ -0,0 +1,806 @@
|
|||||||
|
# Bài giảng: học porosity từ seismic khi không chắc nhãn nằm ở đâu
|
||||||
|
|
||||||
|
Cập nhật 02/11/2026. Phản ánh trạng thái dự án: P0–P4 đã xong (G-C và G-D đều không đạt tiêu chí claim), đang viết bài (P5). Từ 29/10 bài theo Pivot 1: lý thuyết + benchmark synthetic, hạn thứ 7, 14/11/2026; phần viết mức A đã xong sớm; benchmark P6 đã chạy và tổng hợp ngày 02/11 (9/11 verdict đạt; mục 11.7); các mục kết quả đã viết vào bài cùng ngày.
|
||||||
|
|
||||||
|
**Bài giảng này dành cho ai.** Người chưa biết gì về địa vật lý, học máy hay thống kê Bayes. Chỉ cần toán phổ thông: hàm số, trung bình, phương sai, hàm mũ. Mỗi khái niệm được giải thích bằng ví dụ đời thường trước, rồi mới đến công thức. Công thức nào khó thì có câu "đọc bằng lời" ngay bên dưới.
|
||||||
|
|
||||||
|
**Học xong, bạn sẽ hiểu:**
|
||||||
|
1. Dự án muốn làm gì, và vì sao việc đó khó.
|
||||||
|
2. Ý tưởng chính (RML) hoạt động ra sao, từng bước.
|
||||||
|
3. Làm sao biết phương pháp có tốt thật hay không, và vì sao dự án tự trói tay mình bằng các "luật khoá trước".
|
||||||
|
4. Kết quả đến hôm nay, gồm cả các lần thất bại, và những điều được phép hay không được phép viết trong bài báo.
|
||||||
|
5. Mỗi phần nằm ở file nào trong code.
|
||||||
|
|
||||||
|
**Cách đọc.** Đọc theo thứ tự từ Bài 1. Mỗi bài kết thúc bằng một khung **Ý chính**. Gặp từ lạ thì tra [Phụ lục A](#phụ-lục-a-thuật-ngữ). Muốn tự kiểm tra thì làm [Phụ lục B](#phụ-lục-b-câu-hỏi-tự-kiểm-tra). Chứng minh đầy đủ ở [theory.md](theory.md); kế hoạch, số liệu và nhật ký quyết định ở [plan.md](plan.md).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Bài 0. Toàn bộ câu chuyện trong năm câu
|
||||||
|
|
||||||
|
1. Ta muốn vẽ bản đồ **porosity** (độ rỗng của đá) cho cả một khối đất đá dưới biển, dựa vào ảnh **seismic** phủ toàn vùng và vài **giếng khoan** đo porosity trực tiếp.
|
||||||
|
2. Seismic đo theo **thời gian** (mili giây), giếng đo theo **độ sâu** (mét). Phép đổi giữa hai trục, gọi là **well tie**, có sai số lớn hơn cả một chu kỳ sóng seismic.
|
||||||
|
3. Khi huấn luyện mạng nơ-ron trên các cặp (seismic, porosity) bị lệch thời gian như vậy, mạng học ra một phiên bản **bị làm mờ** của sự thật. Dự án chứng minh điều này bằng toán và kiểm chứng bằng thí nghiệm.
|
||||||
|
4. Ý tưởng sửa lỗi: thay vì tin một phép đổi duy nhất, ta mô tả **mọi phép đổi hợp lý kèm độ tin cậy** (một phân phối xác suất), rồi huấn luyện mạng trên tất cả các phương án đó. Phương pháp này tên là **RML**.
|
||||||
|
5. Trên dữ liệu mô phỏng, ý tưởng này giúp rõ rệt. Trên 4 giếng thật của F3, nó **không** thắng được đối thủ tốt nhất. Trên mỏ thứ hai (Volve) không phương pháp nào dự đoán được giếng giấu, nên phép so sánh không phân định được gì. Vì vậy bằng chứng của bài là lý thuyết và synthetic; hai mỏ thật chỉ giới hạn phạm vi những gì được nói.
|
||||||
|
|
||||||
|
Các bài sau giải thích từng câu.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Bài 1. Ta muốn biết gì: porosity
|
||||||
|
|
||||||
|
**Porosity** (độ rỗng, ký hiệu φ) là tỉ lệ thể tích lỗ rỗng trong đá. Hãy hình dung một miếng bọt biển: phần rỗng có thể chứa nước, dầu hoặc khí.
|
||||||
|
- φ = 0.25 nghĩa là 25% thể tích là lỗ rỗng.
|
||||||
|
- Trong bài, porosity được ghi bằng **p.u.** (porosity unit), tức φ × 100. Vậy 0.25 = 25 p.u.
|
||||||
|
|
||||||
|
**Vì sao quan tâm.** Porosity cho biết đá chứa được bao nhiêu chất lưu. Đây là một trong những thông tin quan trọng nhất khi đánh giá một mỏ dầu khí, hay một nơi để chôn CO₂ hoặc trữ nhiệt.
|
||||||
|
|
||||||
|
**Khó ở đâu.** Porosity chỉ đo trực tiếp được ở giếng khoan, mà giếng thì rất đắt và rất thưa. Khối F3 dùng trong bài rộng hàng trăm km² nhưng chỉ có **4 giếng** công khai. Ta cần một cách "nội suy thông minh" từ 4 điểm ra cả khối.
|
||||||
|
|
||||||
|
> **Ý chính.** Ta cần porosity ở mọi nơi, nhưng chỉ đo được ở vài giếng.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Bài 2. Hai cách nhìn xuống lòng đất
|
||||||
|
|
||||||
|
### 2.1 Seismic: "ảnh siêu âm" của lòng đất
|
||||||
|
|
||||||
|
**Cách thu.** Một tàu kéo súng hơi phát ra tiếng nổ. Sóng âm đi xuống, gặp ranh giới giữa hai lớp đá khác nhau thì một phần dội ngược lên. Các máy thu ghi lại tiếng vọng. Giống hệt cách siêu âm thai: phát âm thanh vào, nghe tiếng vọng để đoán bên trong có gì.
|
||||||
|
|
||||||
|
**Dữ liệu trông như thế nào.**
|
||||||
|
- Tại mỗi vị trí trên mặt, ta có một **trace**: một chuỗi số, mỗi số là biên độ tiếng vọng tại một thời điểm.
|
||||||
|
- Trục dọc của trace là **TWT** (two-way time): thời gian sóng đi xuống rồi quay lên, tính bằng mili giây (ms). Đây là **thời gian, không phải độ sâu**. Điểm này là gốc của mọi rắc rối trong bài.
|
||||||
|
- F3 ghi một mẫu mỗi 4 ms.
|
||||||
|
- Các trace xếp thành lưới hai chiều (**inline × crossline**). Mỗi ô lưới là một **bin**. Cả khối 3D gọi là **cube**.
|
||||||
|
|
||||||
|
**Tiếng vọng sinh ra thế nào (mô hình tích chập).** Mỗi lớp đá có một **trở kháng âm** (AI = mật độ × vận tốc sóng). Tại ranh giới giữa hai lớp, phần sóng dội lại tỉ lệ với chênh lệch trở kháng:
|
||||||
|
|
||||||
|
$$
|
||||||
|
r = \frac{AI_2 - AI_1}{AI_2 + AI_1}.
|
||||||
|
$$
|
||||||
|
|
||||||
|
Chuỗi các hệ số r theo thời gian gọi là **reflectivity**. Nhưng sóng phát ra không phải một "tách" sắc gọn, mà là một xung ngắn có hình dạng riêng, gọi là **wavelet**. Trace ta ghi được là reflectivity "nhoè" theo hình dạng wavelet, cộng thêm nhiễu:
|
||||||
|
|
||||||
|
$$
|
||||||
|
s(t) = (w * r)(t) + \text{nhiễu}.
|
||||||
|
$$
|
||||||
|
|
||||||
|
*Đọc bằng lời:* tại mỗi ranh giới đá, đặt một bản sao của wavelet, cao thấp theo r, rồi cộng tất cả lại. Dấu `*` (tích chập) chính là phép "đặt bản sao và cộng" đó.
|
||||||
|
|
||||||
|
**Seismic chỉ nghe được một dải tần.** Wavelet của F3 chứa năng lượng chủ yếu từ khoảng 4 đến 83 Hz, mạnh nhất quanh 50–60 Hz. Một chu kỳ sóng ở tần số trội dài khoảng **17–20 ms**. Hệ quả:
|
||||||
|
- **Seismic gần như điếc với tần số rất thấp** (dưới khoảng 6 Hz). Những biến đổi chậm, như porosity giảm dần theo độ sâu do đá bị nén, seismic không "nghe" được. Phần đó phải lấy từ giếng.
|
||||||
|
- Vì vậy bài tách mọi phép đo thành hai **băng tần**: **băng thấp** (< 6 Hz, chủ yếu là xu hướng) và **băng seismic** (≥ 6 Hz, phần mà seismic thực sự đóng góp). Băng seismic là phần ta quan tâm nhất.
|
||||||
|
|
||||||
|
**Horizon** là một mặt phản xạ liên tục được người giải đoán dò (pick) xuyên qua cube, ví dụ mặt nóc của một tầng đá. F3 có 7 horizon.
|
||||||
|
|
||||||
|
### 2.2 Giếng khoan: "mẫu sinh thiết"
|
||||||
|
|
||||||
|
Khi khoan, người ta thả thiết bị đo xuống lỗ khoan và ghi các **log**, tức các đường cong theo **độ sâu** (mét):
|
||||||
|
|
||||||
|
| Log | Đo gì | Ghi chú |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| DT (sonic) | Thời gian sóng âm đi qua 1 m đá (µs/m). DT lớn nghĩa là đá "chậm" | Dùng để đổi độ sâu sang thời gian (Bài 4) |
|
||||||
|
| RHOB | Mật độ đá (kg/m³) | |
|
||||||
|
| GR | Phóng xạ tự nhiên, cho biết đá nhiều sét hay không | |
|
||||||
|
| PHIE | Porosity hiệu dụng, tính từ các log khác | Đây là **nhãn** ta muốn dự đoán |
|
||||||
|
|
||||||
|
**Độ sâu cũng có vài loại.** MD là chiều dài dọc theo lỗ khoan. TVD là độ sâu thẳng đứng. Giếng thẳng thì hai thứ gần như trùng nhau. Giếng nghiêng (như ở Volve, Bài 11.6) thì khác nhau đáng kể.
|
||||||
|
|
||||||
|
**Một sự thật quan trọng về nhãn của F3.** Kiểm tra cho thấy ở 3/4 giếng F3, PHIE là một **hàm tuyến tính chính xác của DT**: PHIE = −0.2018 + 0.0011·DT, với R² = 1.00000. Lý do: mật độ trong bản demo F3 không phải số đo thật mà được suy ra từ sonic. Dự án chấp nhận điều này, dùng nhãn PHIE_DT = −0.2018 + 0.0011·DT cho cả 4 giếng, và **phải nói thẳng trong bài** rằng "porosity" của F3 thực chất là sonic đổi đơn vị. Đây là lý do cần thêm mỏ Volve, nơi porosity được tính độc lập với sonic.
|
||||||
|
|
||||||
|
### 2.3 Mỗi nguồn mạnh và yếu ở đâu
|
||||||
|
|
||||||
|
| | Seismic | Giếng khoan |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| Phủ không gian | Toàn khối | Vài điểm |
|
||||||
|
| Độ phân giải dọc | Thô (cỡ chục mét) | Rất mịn (15 cm) |
|
||||||
|
| Trục dọc | **Thời gian** (ms) | **Độ sâu** (m) |
|
||||||
|
| Đo porosity? | Không, chỉ gián tiếp qua trở kháng | Có (gần như trực tiếp) |
|
||||||
|
|
||||||
|
Ý tưởng tự nhiên: dạy một mô hình đọc seismic quanh giếng rồi đoán porosity của giếng. Học xong thì đem mô hình áp cho mọi trace của cube.
|
||||||
|
|
||||||
|
> **Ý chính.** Seismic phủ rộng nhưng mờ và đo theo thời gian. Giếng chính xác nhưng thưa và đo theo độ sâu. Muốn ghép hai thứ, phải biết mỗi độ sâu ứng với thời gian nào.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Bài 3. Học máy trong mười phút
|
||||||
|
|
||||||
|
Phần này dành cho ai chưa từng huấn luyện một mô hình.
|
||||||
|
|
||||||
|
**Học có giám sát.** Ta có nhiều cặp (input X, nhãn y). Mô hình là một hàm f có nhiều tham số chỉnh được. **Huấn luyện** là chỉnh tham số sao cho f(X) gần y nhất.
|
||||||
|
|
||||||
|
**Đo "gần" bằng hàm loss.** Phổ biến nhất là **MSE** (mean squared error): trung bình bình phương sai số, (f(X) − y)². Huấn luyện là tìm tham số làm loss nhỏ nhất.
|
||||||
|
|
||||||
|
**Một tính chất của MSE cần nhớ cho Bài 5.** Nếu cùng một input X mà nhãn y lúc thì thế này, lúc thì thế khác (do nhiễu), thì dự đoán tốt nhất theo MSE là **trung bình** của các nhãn đó. MSE không chọn một phương án mà "chia đều".
|
||||||
|
|
||||||
|
**Trong bài này.**
|
||||||
|
- **Input X:** 9 trace seismic trong ô 3×3 bin quanh giếng, mỗi trace dài 126 mẫu (cửa sổ 600–1100 ms).
|
||||||
|
- **Nhãn y:** đường porosity tại đúng 126 thời điểm đó.
|
||||||
|
- **Mô hình:** mạng **CNN–GRU**, giữ nguyên kiến trúc từ luận văn gốc. Phần CNN (tích chập) nhận ra các mẫu hình cục bộ trên trace. Phần GRU (mạng hồi quy hai chiều) cho mỗi điểm "nhìn" được ngữ cảnh phía trên lẫn phía dưới.
|
||||||
|
- **Mạng không chỉ đoán một con số.** Tại mỗi thời điểm, nó xuất ra **μ** (giá trị dự đoán) và **σ** (độ không chắc chắn). Loss tương ứng là **Gaussian NLL**: phạt khi sai, nhưng phạt nhẹ hơn ở chỗ mạng đã khai σ lớn. Để mạng không khai σ lớn ở mọi chỗ, loss có thêm một khoản phạt cho σ lớn.
|
||||||
|
- **Ensemble:** huấn luyện 5 bản của cùng mạng với khởi tạo ngẫu nhiên (seed) khác nhau rồi gộp lại. Các bản càng bất đồng thì bất định càng lớn.
|
||||||
|
|
||||||
|
**Vì sao ít giếng là khó.** Với 4 giếng, mỗi lần chỉ có 2–3 giếng để học, tức 2–3 đường cong. Mạng rất dễ **học thuộc** nhãn train (overfitting) thay vì học quy luật chung.
|
||||||
|
|
||||||
|
**Kiểm tra trung thực bằng LOWO.** *Leave-one-well-out:* lần lượt giấu một giếng, học trên các giếng còn lại, rồi chấm trên giếng bị giấu. Giếng bị giấu gọi là **blind well**. Nó không được góp bất cứ thông tin gì vào việc học.
|
||||||
|
|
||||||
|
> **Ý chính.** Mạng học từ các cặp (seismic, porosity). Nếu nhãn của cùng một input không nhất quán, mạng theo MSE sẽ học trung bình của chúng.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Bài 4. Vấn đề cốt lõi: hai chiếc đồng hồ chạy lệch nhau
|
||||||
|
|
||||||
|
### 4.1 Đổi độ sâu sang thời gian
|
||||||
|
|
||||||
|
Để ghép porosity (theo mét) với seismic (theo ms), ta cần biết **mỗi độ sâu z ứng với thời gian t nào**. Quan hệ đó gọi là **TDR** (time–depth relationship).
|
||||||
|
|
||||||
|
**Cách cơ bản: cộng dồn sonic.** DT cho biết sóng mất bao lâu để đi qua mỗi mét đá. Cộng dồn (tích phân) từ trên xuống, rồi nhân 2 vì sóng đi cả xuống lẫn lên, ta được thời gian tại mỗi độ sâu:
|
||||||
|
|
||||||
|
$$
|
||||||
|
t(z) = t_{\text{ref}} + 2\int_{z_{\text{ref}}}^{z} \mathrm{DT}(u)\,du.
|
||||||
|
$$
|
||||||
|
|
||||||
|
Ta gọi thời gian tính theo cách này là **thời gian sonic**, ký hiệu **τ**. Thời gian thật trên seismic ký hiệu **t**.
|
||||||
|
|
||||||
|
### 4.2 Đồng hồ sonic chạy sai: drift
|
||||||
|
|
||||||
|
Nếu sonic hoàn hảo thì τ = t. Thực tế không phải vậy. Hãy hình dung **hai chiếc đồng hồ**: đồng hồ sonic và đồng hồ seismic. Chúng chạy gần cùng tốc độ nhưng không hẳn, nên càng xuống sâu càng lệch nhau. Độ lệch tích luỹ này gọi là **drift**. Nguyên nhân:
|
||||||
|
- Sonic đo bằng sóng tần số kHz, seismic dùng sóng vài chục Hz. Đá truyền sóng tần số cao nhanh hơn một chút (hiện tượng tán sắc).
|
||||||
|
- Sonic chỉ đo lớp đá sát thành lỗ khoan, nơi có thể đã bị khoan làm hỏng.
|
||||||
|
- Log có đoạn thiếu, và không ai biết chắc thời điểm bắt đầu.
|
||||||
|
|
||||||
|
Trên F3, ngay bên trong một giếng (F06-1), drift thay đổi tới **45 ms** trong cửa sổ 600–1100 ms. Vậy không thể sửa bằng cách dịch cả đường đi một hằng số.
|
||||||
|
|
||||||
|
### 4.3 Các điểm neo: anchor
|
||||||
|
|
||||||
|
May là có vài điểm mà ta biết cả độ sâu lẫn thời gian một cách độc lập với sonic:
|
||||||
|
- Trên log giếng, nhà địa chất xác định nóc một tầng đá (**marker**), nên biết **độ sâu** của nó.
|
||||||
|
- Trên seismic, cùng tầng đá đó hiện ra thành một horizon, nên biết **thời gian** của nó.
|
||||||
|
|
||||||
|
Ghép hai thứ, ta được một cặp (độ sâu, thời gian) gọi là **anchor** (điểm neo). Mỗi giếng F3 có 9–11 anchor trong cửa sổ chính. Anchor cũng không hoàn hảo: người pick có thể lệch vài ms. Độ lệch này được mô tả bằng một độ lệch chuẩn **σ_a** (dự án dùng σ_a = 7 ms). Lưu ý: file tên "Checkshot" của F3 thực ra là các cặp marker–horizon như trên, không phải phép đo thời gian độc lập.
|
||||||
|
|
||||||
|
### 4.4 Well tie
|
||||||
|
|
||||||
|
**Well tie** là quá trình chỉnh TDR cho khớp nhất. Cách làm:
|
||||||
|
1. Dùng TDR hiện tại đưa log trở kháng sang thời gian.
|
||||||
|
2. Tính reflectivity, tích chập với wavelet, được một trace "nhân tạo" gọi là **synthetic seismogram**.
|
||||||
|
3. So synthetic với trace seismic thật tại giếng, rồi kéo giãn hoặc dịch TDR để hai đường giống nhau hơn.
|
||||||
|
|
||||||
|
Tie khó vì nhiều đáp án đều trông "khá khớp":
|
||||||
|
- **Cycle skipping:** dịch lệch đúng một chu kỳ sóng, hai đường vẫn trông giống nhau.
|
||||||
|
- **Pha của wavelet** không biết trước, và một chút đổi pha có thể bù cho một chút dịch thời gian.
|
||||||
|
- Nhiễu có thể tạo ra độ khớp cao do ngẫu nhiên.
|
||||||
|
|
||||||
|
### 4.5 Các con số trên F3
|
||||||
|
|
||||||
|
- Thời gian sonic chưa hiệu chỉnh lệch so với anchor từ **14 đến 66 ms**, tuỳ giếng.
|
||||||
|
- Bốn cách dựng TDR khác nhau (sonic thô, sonic hiệu chỉnh theo anchor, mô hình của OpendTect, ...) chênh nhau **9–36 ms**.
|
||||||
|
- Một chu kỳ sóng seismic chỉ dài **17–20 ms**.
|
||||||
|
|
||||||
|
Nghĩa là nhãn porosity có thể bị đặt lệch **một đến vài chu kỳ** so với seismic, và lệch khác nhau ở các độ sâu khác nhau. Bất định này là **bản chất của bài toán**, không phải lỗi lập trình.
|
||||||
|
|
||||||
|
**Cách làm phổ biến trong ngành và trong các bài báo:** chọn TDR tốt nhất, coi là đúng tuyệt đối, rồi huấn luyện. Bài này hỏi: làm vậy thì mất gì?
|
||||||
|
|
||||||
|
> **Ý chính.** Đổi độ sâu sang thời gian cần một TDR, và TDR trên F3 sai nhiều hơn một chu kỳ sóng. Anchor giúp ghim TDR tại một số điểm, nhưng giữa các anchor vẫn còn bất định.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Bài 5. Lệch một chút thì hỏng đến đâu?
|
||||||
|
|
||||||
|
### 5.1 Ví dụ đồ chơi
|
||||||
|
|
||||||
|
Giả sử porosity dao động như một hình sin chu kỳ 20 ms (tần số 50 Hz):
|
||||||
|
- Nhãn lệch **5 ms** (một phần tư chu kỳ): nhãn và porosity thật có **tương quan bằng 0**. Nhãn chẳng nói gì cả.
|
||||||
|
- Nhãn lệch **10 ms** (nửa chu kỳ): tương quan bằng **−1**. Nhãn nói "cao" đúng ở chỗ thật ra là "thấp".
|
||||||
|
|
||||||
|
Vậy một độ lệch còn nhỏ hơn một chu kỳ đã đủ phá hỏng nhãn ở những tần số mà seismic mang thông tin.
|
||||||
|
|
||||||
|
### 5.2 Học trên nhãn lệch ngẫu nhiên thì học được gì: hiện tượng làm mờ
|
||||||
|
|
||||||
|
Giả sử mỗi giếng, mỗi đoạn có một độ lệch δ khác nhau mà ta không biết. Với cùng một kiểu seismic, nhãn lúc thì bị dịch lên, lúc bị dịch xuống. Nhớ lại Bài 3: **MSE học trung bình của các nhãn**. Ở đây đó là trung bình của nhiều bản sao bị dịch của cùng một đường porosity.
|
||||||
|
|
||||||
|
**Hình dung:** chụp ảnh khi tay run. Ảnh nhận được là trung bình của nhiều ảnh bị dịch đi một chút, tức một **ảnh mờ**. Chi tiết nhỏ (tần số cao) triệt tiêu nhau; chỉ hình dạng lớn (tần số thấp) còn lại.
|
||||||
|
|
||||||
|
Dự án phát biểu điều này thành **Mệnh đề 1**: nếu δ độc lập với dữ liệu và có phân phối chuẩn với độ lệch chuẩn σ, thì thành phần tần số f của dự đoán tối ưu bị nhân với
|
||||||
|
|
||||||
|
$$
|
||||||
|
e^{-2\pi^2\sigma^2 f^2}.
|
||||||
|
$$
|
||||||
|
|
||||||
|
*Đọc bằng lời:* hệ số này bằng 1 ở tần số 0 (xu hướng giữ nguyên), rồi giảm rất nhanh khi tần số tăng hoặc khi độ lệch σ tăng.
|
||||||
|
|
||||||
|
Với phổ seismic thật của F3:
|
||||||
|
|
||||||
|
| σ (độ lệch chuẩn của δ) | Hệ số ở 40 Hz | Hệ số ở 50 Hz | Phần phương sai băng seismic còn lại |
|
||||||
|
| --- | --- | --- | --- |
|
||||||
|
| 4 ms | 0.60 | 0.45 | 28% |
|
||||||
|
| 8 ms | 0.13 | 0.04 | 6% |
|
||||||
|
| 16 ms | ≈ 0 | ≈ 0 | 2% |
|
||||||
|
|
||||||
|
Chỉ cần σ = 8 ms là gần như mọi chi tiết seismic có thể cung cấp đã bị xoá khỏi mục tiêu học. Sai số thật trên F3 còn lớn hơn.
|
||||||
|
|
||||||
|
**Kiểm chứng (giả thuyết H1).** Dự án cố ý dịch nhãn những lượng ngẫu nhiên đã biết, huấn luyện bằng MSE, rồi đo mức mờ thực tế. Tỉ số "đo / lý thuyết" là 1.009, 1.009, 1.007 ở σ = 4, 8, 16 ms. Lý thuyết khớp trong khoảng 1%. Hai giới hạn: chỉ đo được dải 7–23 Hz; và trên F3 thật, giả thiết "δ độc lập với dữ liệu" không đúng hoàn toàn, vì cùng một log DT sinh ra cả nhãn lẫn trục thời gian (Bài 2.2).
|
||||||
|
|
||||||
|
### 5.3 Giải thích được "triệu chứng" của luận văn gốc
|
||||||
|
|
||||||
|
Mô hình trong luận văn gốc (code ở `code_thesis/`) có ba đặc điểm:
|
||||||
|
- dự đoán bị trơn;
|
||||||
|
- phải thêm một loss ép phương sai dự đoán to lên (L_Var), vì dự đoán bị co biên độ;
|
||||||
|
- phải thêm bước thử dịch ±64 ms để tìm vị trí khớp nhất.
|
||||||
|
|
||||||
|
Mệnh đề 1 cho thấy cả ba là triệu chứng của cùng một bệnh: nhãn bị lệch. Loss L_Var chỉ làm ảnh mờ "to ra", không làm nó nét lại, vì thông tin về pha đã mất.
|
||||||
|
|
||||||
|
> **Ý chính.** Huấn luyện trên nhãn bị lệch ngẫu nhiên giống chụp ảnh khi tay run: mạng học ra một phiên bản bị làm mờ. Mức mờ tính được bằng công thức, và thí nghiệm khớp công thức.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Bài 6. Ý tưởng chính: đừng chọn một đáp án, hãy giữ mọi đáp án hợp lý
|
||||||
|
|
||||||
|
### 6.1 Ví dụ đời thường
|
||||||
|
|
||||||
|
Một giáo viên chấm bài, nhưng tờ đáp án bị in lệch dòng và không ai chắc lệch mấy dòng.
|
||||||
|
- **Cách 1 (cách phổ biến):** đoán một độ lệch, coi là đúng, chấm theo. Đoán sai thì chấm sai hết.
|
||||||
|
- **Cách 2 (ý tưởng của bài):** liệt kê mọi độ lệch hợp lý, kèm mức độ tin cậy của từng cái, dựa vào những manh mối chắc chắn (vài câu mà ta biết chắc vị trí, tương ứng với anchor) và dựa vào việc đáp án nào "trông hợp lý" nhất (tương ứng với vật lý). Rồi chấm sao cho học sinh được ghi nhận nếu trả lời khớp với **một trong các** cách căn hợp lý, có ưu tiên theo độ tin cậy.
|
||||||
|
|
||||||
|
### 6.2 Ba bước của RML
|
||||||
|
|
||||||
|
**RML** (*Registration-Marginalized Learning*: học có lấy tổng trên mọi phép căn chỉnh) gồm ba bước:
|
||||||
|
|
||||||
|
1. **Mô tả độ lệch bằng xác suất.** Coi phép đổi thời gian (gọi là **warp**) là một đại lượng chưa biết. Dùng anchor và vật lý truyền sóng để tính **phân phối posterior** của nó: một tập hợp nhiều warp hợp lý, mỗi cái có trọng số (Bài 7).
|
||||||
|
2. **Dựng ngân hàng nhãn.** Mỗi warp cho ra một phiên bản nhãn porosity theo thời gian. Có 64 warp thì có 64 phiên bản nhãn (Bài 8).
|
||||||
|
3. **Huấn luyện trên cả ngân hàng.** Loss RML không bắt mạng khớp một nhãn cố định. Nó chấm mạng theo "trung bình mềm" trên mọi phiên bản (Bài 9).
|
||||||
|
|
||||||
|
Sau khi huấn luyện xong, việc dự đoán **không cần warp nữa**: đưa seismic vào, nhận μ ± σ ra. Warp chỉ ảnh hưởng lúc học và lúc chấm điểm.
|
||||||
|
|
||||||
|
### 6.3 Hai cách dùng posterior, và vì sao phân biệt chúng quan trọng
|
||||||
|
|
||||||
|
Khi đã có posterior của warp, có hai cách đưa nó vào huấn luyện:
|
||||||
|
- **Cách "trung bình":** lấy warp trung bình của posterior, tạo **một** bộ nhãn duy nhất, rồi huấn luyện bình thường. Tên trong code: **B3d-Sa**.
|
||||||
|
- **Cách "ngân hàng" (RML thật sự):** giữ cả 64 phiên bản và dùng loss RML. Tên trong code: **M2-Sa**.
|
||||||
|
|
||||||
|
Kết quả (Bài 11) cho thấy phần lớn lợi ích đến từ **việc có một posterior tốt**, tức cách "trung bình" đã thắng các phương pháp tie truyền thống. Cách "ngân hàng" chỉ giúp thêm khi posterior **rộng** (bất định lớn). Phân biệt hai cách này giúp bài báo nói đúng thứ gì tạo ra cải thiện.
|
||||||
|
|
||||||
|
> **Ý chính.** Coi phép căn chỉnh là chưa biết, mô tả nó bằng một phân phối, rồi huấn luyện trên mọi phương án hợp lý. Cần tách bạch lợi ích từ "có posterior tốt" với lợi ích từ "học trên cả ngân hàng".
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Bài 7. Mô tả độ lệch bằng xác suất
|
||||||
|
|
||||||
|
Đây là bài dài nhất. Nếu chỉ cần ý chính, hãy đọc 7.1 và 7.6.
|
||||||
|
|
||||||
|
### 7.1 Bayes trong một ví dụ
|
||||||
|
|
||||||
|
Bạn đánh rơi chìa khoá đâu đó trên đường từ cổng vào nhà.
|
||||||
|
- **Prior** (tin gì trước khi có manh mối): chìa khoá có thể ở bất cứ đâu trên đường, nhưng hay rơi gần cửa hơn.
|
||||||
|
- **Likelihood** (manh mối giải thích được bao nhiêu): hàng xóm nói nghe tiếng leng keng ở gần gốc cây.
|
||||||
|
- **Posterior** (niềm tin sau khi kết hợp): chìa khoá nhiều khả năng ở gần gốc cây, nhưng vẫn có thể ở chỗ khác.
|
||||||
|
|
||||||
|
Công thức: posterior ∝ likelihood × prior. Trong bài, đại lượng chưa biết là **warp** của từng giếng. Hai nguồn manh mối là **anchor** và **độ khớp synthetic–seismic**.
|
||||||
|
|
||||||
|
### 7.2 Warp: viết độ lệch thành một hàm
|
||||||
|
|
||||||
|
Warp là hàm biến thời gian sonic τ thành thời gian seismic thật t. Dự án viết nó thông qua tốc độ chạy tương đối của hai đồng hồ:
|
||||||
|
|
||||||
|
$$
|
||||||
|
\frac{dt}{d\tau} = e^{g(\tau)}, \qquad t(\tau_0) = \tau_0 + b.
|
||||||
|
$$
|
||||||
|
|
||||||
|
- **b**: độ dịch chung của cả giếng (đồng hồ seismic bắt đầu sớm hay muộn hơn).
|
||||||
|
- **g(τ)**: đồng hồ seismic chạy nhanh hay chậm hơn đồng hồ sonic tại từng thời điểm. g = 0.05 nghĩa là nhanh hơn khoảng 5%. Drift 66 ms trên khoảng 1000 ms ứng với g cỡ 5–6%, một mức hợp lý về vật lý.
|
||||||
|
- Vì e^g luôn dương, t luôn tăng khi τ tăng. Nghĩa là warp **không bao giờ đảo thứ tự các lớp đá**: lớp dưới không bị đẩy lên trên lớp trên. Đây là ràng buộc vật lý cài sẵn vào công thức.
|
||||||
|
|
||||||
|
Code: [warp_prior.py](../ml_porosity/registration/warp_prior.py).
|
||||||
|
|
||||||
|
### 7.3 Prior: những đường cong ngẫu nhiên "trông hợp lý"
|
||||||
|
|
||||||
|
Ta cần nói trước, khi chưa thấy dữ liệu, g(τ) thường trông như thế nào. Công cụ là **Gaussian process (GP)**: một "máy sinh đường cong ngẫu nhiên". Mỗi lần rút, nó cho ra một đường cong. Hai núm điều chỉnh chính:
|
||||||
|
- **σ_g (biên độ):** đường cong dao động mạnh cỡ nào.
|
||||||
|
- **ℓ (độ dài tương quan):** hai điểm cách nhau bao xa thì coi như không liên quan. ℓ lớn cho đường cong uốn lượn chậm; ℓ nhỏ cho đường cong lắc nhanh.
|
||||||
|
|
||||||
|
Các núm này không chọn tay mà **học từ anchor của các giếng train** (phương pháp type-II maximum likelihood: chọn giá trị làm cho các anchor quan sát được có xác suất cao nhất). Fit trên F3 cho ℓ ≈ 71 ms, σ_g ≈ 0.10. Kiểm tra bằng cách lần lượt bỏ từng anchor rồi dự đoán lại nó từ các anchor còn lại: prior không quá tự tin.
|
||||||
|
|
||||||
|
### 7.4 Hai nguồn manh mối
|
||||||
|
|
||||||
|
**Manh mối 1: anchor.** Mỗi anchor nói "warp phải đi qua điểm này, sai số khoảng σ_a":
|
||||||
|
|
||||||
|
$$
|
||||||
|
t_k = t(\tau_k) + \varepsilon_k,\qquad \varepsilon_k\sim\mathcal N(0,\sigma_a^2).
|
||||||
|
$$
|
||||||
|
|
||||||
|
**Manh mối 2: vật lý (likelihood tie).** Với mỗi warp ứng viên, dựng synthetic seismogram (Bài 4.4) rồi so với trace thật tại giếng. Warp nào cho synthetic khớp hơn thì được tin hơn. Ở F3 phép so sánh này không phải xấp xỉ, vì nhãn, sonic, mật độ và trở kháng đều suy ra chính xác từ nhau (Bài 2.2). Code: [tie_likelihood.py](../ml_porosity/registration/tie_likelihood.py).
|
||||||
|
|
||||||
|
### 7.5 Lấy mẫu: biến posterior thành một đám warp cụ thể
|
||||||
|
|
||||||
|
Posterior ở đây không có công thức đóng. Cách thực tế là **lấy mẫu**: tạo ra nhiều warp cụ thể sao cho tỉ lệ xuất hiện của chúng đúng theo posterior.
|
||||||
|
|
||||||
|
**Cách đầu tiên (P2) thất bại.** Ban đầu dự án làm hai bước: rút 64 warp chỉ dựa trên anchor, rồi gán trọng số theo độ khớp vật lý. Vấn đề: độ khớp vật lý quá "nhọn". Một warp chiếm gần hết trọng số, 63 warp kia gần như bằng 0. Hiện tượng này gọi là **suy biến trọng số**. Để tránh nó, quy tắc của P2 phải làm yếu likelihood vật lý đến mức gần như bỏ đi. Kết quả là posterior gần như chỉ dựa vào anchor.
|
||||||
|
|
||||||
|
**Cách thứ hai (từ P2r): SMC tempering.** Hình dung một đàn **1024 "hạt"**, mỗi hạt là một warp:
|
||||||
|
1. Bắt đầu: rút các hạt từ prior + anchor, chưa xét vật lý.
|
||||||
|
2. Tăng dần "liều" vật lý một chút (luỹ thừa γ đi từ 0 lên 1).
|
||||||
|
3. Ở mỗi bậc: hạt khớp tốt được nhân bản, hạt khớp kém bị bỏ, rồi mọi hạt được xê dịch ngẫu nhiên một chút để đàn không bị trùng lặp.
|
||||||
|
4. Lặp lại cho tới khi dùng đủ liều vật lý.
|
||||||
|
|
||||||
|
Giống tăng dần độ khó cho một đàn thí sinh thay vì ra ngay đề khó nhất. Mức γ cuối cùng được chỉnh theo độ tự tương quan của phần dư, vì các mẫu liền kề trên trace không độc lập, nên coi chúng độc lập sẽ làm posterior quá tự tin. Code: [smc.py](../ml_porosity/registration/smc.py), bản GPU [smc_torch.py](../ml_porosity/registration/smc_torch.py).
|
||||||
|
|
||||||
|
Hậu tố **"-Sa"** trong tên phương pháp (B3d-Sa, M2-Sa) nghĩa là dùng posterior SMC này.
|
||||||
|
|
||||||
|
Trên dữ liệu mô phỏng, đổi sang SMC làm sai số warp giảm từ khoảng **3.3 ms xuống 0.57 ms**, trong khi phương pháp tie truyền thống tốt nhất vẫn sai khoảng 3.8–4.2 ms.
|
||||||
|
|
||||||
|
### 7.6 Độ rộng của posterior: σ_post
|
||||||
|
|
||||||
|
**σ_post** đo posterior còn bất định bao nhiêu (tính bằng ms). Đây là con số quan trọng nhất để hiểu kết quả:
|
||||||
|
- σ_post **nhỏ** (posterior hẹp): mọi hạt gần như trùng nhau. Ngân hàng nhãn chẳng khác gì một nhãn duy nhất, nên RML không có gì để thêm.
|
||||||
|
- σ_post **lớn** (posterior rộng): các hạt khác nhau đáng kể. Đây là nơi RML có cơ hội phát huy.
|
||||||
|
|
||||||
|
Trên F3, với σ_a = 7 ms, σ_post khoảng 2.5–3.4 ms. Nhưng σ_a thật trên F3 không biết. Nếu coi marker là gần như chính xác (σ_a ≈ 0.4 ms) thì σ_post chỉ còn 0.56–0.64 ms. Vậy F3 nằm ở đâu đó giữa "hẹp" và "vừa".
|
||||||
|
|
||||||
|
> **Ý chính.** Posterior của warp được dựng từ prior GP, anchor và độ khớp vật lý, rồi biểu diễn bằng một đàn hạt (SMC). Độ rộng σ_post quyết định RML có đất dụng võ hay không.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Bài 8. Từ mỗi warp đến một phiên bản nhãn
|
||||||
|
|
||||||
|
Code: [labels.py](../ml_porosity/registration/labels.py). Với mỗi warp s:
|
||||||
|
1. **Đảo ngược warp** để biết mỗi thời điểm seismic t ứng với thời gian sonic nào, và do đó ứng với độ sâu nào. Phép đảo luôn làm được vì warp đơn điệu (Bài 7.2).
|
||||||
|
2. **Đọc porosity** của log tại độ sâu đó.
|
||||||
|
3. **Lọc chống alias** trước khi lấy mẫu mỗi 4 ms. Log gốc có một mẫu mỗi 15 cm. Lấy mẫu thưa đi mà không lọc trước thì các dao động rất nhanh "giả dạng" thành dao động chậm (alias). Luận văn gốc bỏ qua bước này, nên nhãn của nó bị alias.
|
||||||
|
|
||||||
|
Kết quả cho mỗi giếng là một bảng S × 126: **S phiên bản hợp lý của nhãn** (S = 64), mỗi phiên bản có trọng số π_s. Đó là **ngân hàng nhãn** (label bank).
|
||||||
|
|
||||||
|
> **Ý chính.** Mỗi warp hợp lý cho một phiên bản nhãn. Gom lại thành ngân hàng nhãn.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Bài 9. Huấn luyện mạng bằng loss RML
|
||||||
|
|
||||||
|
### 9.1 Loss trong một câu
|
||||||
|
|
||||||
|
Mạng xuất ra (μ, σ). Với mỗi phiên bản nhãn s, ta đo xem dự đoán khớp phiên bản đó đến đâu (ký hiệu ℓ_s, càng lớn càng khớp). Loss RML gộp các ℓ_s lại bằng một phép **"lấy tổng mềm"**:
|
||||||
|
|
||||||
|
$$
|
||||||
|
\mathrm{RML}_\lambda = -\frac{1}{\lambda n}\log\sum_{s=1}^{S}\pi_{s}\,e^{\lambda\,\ell_{s}} .
|
||||||
|
$$
|
||||||
|
|
||||||
|
*Đọc bằng lời:* phiên bản nào khớp tốt (ℓ_s lớn) và đáng tin (π_s lớn) thì chiếm phần lớn tổng. Mạng được thưởng nếu dự đoán khớp **tốt với ít nhất vài phiên bản hợp lý**. Nó không bị buộc phải khớp một phiên bản cố định. Loss được tính trên từng cửa sổ con 64 mẫu, nên mỗi đoạn của giếng được "chọn" phiên bản riêng. Code: [rml.py](../ml_porosity/losses/rml.py), hàm `bank_loss`.
|
||||||
|
|
||||||
|
### 9.2 Núm λ: từ "trung bình" đến "chọn cái khớp nhất"
|
||||||
|
|
||||||
|
- **λ → 0:** loss trở thành trung bình đều trên mọi phiên bản. Mạng học nhãn trung bình, đúng là ảnh mờ của Bài 5. Không tốt.
|
||||||
|
- **λ → ∞:** loss chỉ nhìn phiên bản khớp nhất. Mạng có thể "chọn" căn chỉnh để khớp cả nhiễu. Cũng không tốt.
|
||||||
|
- **Mặc định λ = 1/τ_c**, trong đó τ_c là độ dài tương quan của nhãn trong băng seismic, đo bằng số mẫu (trên dữ liệu mô phỏng, τ_c ≈ 2.7 nên λ ≈ 0.37). Lý do: 64 mẫu liền kề không mang thông tin bằng 64 quan sát độc lập, nên phải "giảm liều". Đây là một **quy tắc kinh nghiệm (heuristic)**, không phải định lý.
|
||||||
|
|
||||||
|
**Gradient** của loss có một cách hiểu đẹp: nó bằng loss Gaussian thường, nhưng mỗi phiên bản nhãn được nhân với trọng số softmax(log π_s + λℓ_s). Mạng tự nghiêng về những căn chỉnh khớp với điều nó đang học từ các giếng khác, nhưng bị kìm bởi trọng số π và bởi λ. Giống một bước của thuật toán EM.
|
||||||
|
|
||||||
|
### 9.3 Các phương pháp cũ là trường hợp đặc biệt
|
||||||
|
|
||||||
|
Một điểm mạnh về lý thuyết: nhiều phương pháp có sẵn là RML với một lựa chọn cụ thể cho "ngân hàng" và λ (chứng minh ở [theory.md](theory.md) §4, kiểm bằng test trong [test_losses.py](../tests/test_losses.py)):
|
||||||
|
|
||||||
|
| Phương pháp | Tương ứng trong RML |
|
||||||
|
| --- | --- |
|
||||||
|
| Tie một lần rồi huấn luyện (B3) | Ngân hàng chỉ có 1 phiên bản |
|
||||||
|
| Thử dịch ±64 ms rồi lấy cái khớp nhất (luận văn, B4a) | Ngân hàng = các bản dịch, trọng số đều, λ = ∞ |
|
||||||
|
| Soft-DTW (B4c) | Ngân hàng = mọi đường căn chỉnh co giãn trong một dải, trọng số đều, λ hữu hạn |
|
||||||
|
| **RML (M2-Sa)** | Ngân hàng = các hạt posterior có anchor và vật lý |
|
||||||
|
|
||||||
|
Vậy RML khác các loss căn chỉnh khác **không phải ở công thức "min" hay "soft-min"**, mà ở chỗ **ngân hàng đến từ đâu**: một posterior có anchor và vật lý, hay "mọi kiểu dịch đều được phép như nhau".
|
||||||
|
|
||||||
|
### 9.4 Vì sao bắt buộc phải có anchor (Mệnh đề 2)
|
||||||
|
|
||||||
|
Thử nghĩ: nếu dịch **cả** dự đoán của mạng **lẫn** mọi warp đi cùng một lượng β, loss gần như không đổi. Mạng dùng chung cho mọi giếng, mà mạng tích chập gần như không phân biệt "sớm hơn 5 ms" hay "muộn hơn 5 ms". Giống hai người khiêng một cái thang: cùng bước sang trái một bước thì thang vẫn nằm ngang, không ai biết họ đã dịch.
|
||||||
|
|
||||||
|
Khi đó loss có một "sống núi phẳng" theo β, và lời giải trôi dạt tuỳ ý. Chỉ có thứ gì đó cố định thời gian tuyệt đối mới chặn được trôi dạt này. **Anchor làm đúng việc đó.** Với 4 giếng × 16 anchor và σ_a = 7 ms, độ bất định còn lại của β chỉ khoảng 0.9 ms.
|
||||||
|
|
||||||
|
Hệ quả: soft-DTW, DILATE và loss "thử dịch rồi lấy cái khớp nhất" đều **không có anchor**, nên chúng rơi đúng vào trường hợp sống núi phẳng.
|
||||||
|
|
||||||
|
**Kiểm chứng (giả thuyết H4).** Bỏ anchor đi làm sai số warp tăng từ khoảng 3 ms lên 31–33 ms, và sai số dự đoán trong băng seismic tăng gần gấp đôi. Giả thuyết "anchor là cần thiết" không bị bác bỏ.
|
||||||
|
|
||||||
|
> **Ý chính.** RML chấm mạng theo "tổng mềm" trên ngân hàng nhãn, có núm λ. Nhiều phương pháp cũ là trường hợp đặc biệt của nó. Anchor là bắt buộc, vì không có anchor thì mạng và căn chỉnh có thể cùng trôi mà loss không phát hiện.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Bài 10. Làm sao biết phương pháp có tốt thật?
|
||||||
|
|
||||||
|
### 10.1 Ba bộ dữ liệu, ba vai trò
|
||||||
|
|
||||||
|
| Bộ | Là gì | Vì sao cần |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| **D1: F3** | Khối seismic thật ở phần Hà Lan của Biển Bắc, 4 giếng thẳng | Dữ liệu thật chính. Nhưng không bao giờ biết warp đúng, và nhãn là sonic đổi đơn vị |
|
||||||
|
| **D2: synthetic** | Dữ liệu mô phỏng dựng theo F3 (địa tầng, rock physics, wavelet, thống kê drift) | "Phòng thí nghiệm": biết warp thật, nên đo được chính xác sai số warp, và có nhiều giếng |
|
||||||
|
| **D3: Volve** | Mỏ thứ hai ở phần Na Uy của Biển Bắc, 6 giếng nghiêng | Porosity tính từ mật độ–neutron, độc lập với sonic. Kiểm tra xem kết quả có phụ thuộc vào đặc thù của F3 không |
|
||||||
|
|
||||||
|
**Các núm của D2:**
|
||||||
|
- **c**: hệ số nhân độ lớn drift. c = 0 là không lệch; **c = 1 là lệch giống F3**; c = 2 là lệch gấp đôi.
|
||||||
|
- **N**: số giếng train (4 hoặc 16).
|
||||||
|
- **Regime**: chất lượng dữ liệu, gồm tỉ số tín hiệu/nhiễu (SNR) của seismic và mật độ anchor. Ví dụ **R10** = SNR 10 dB, đủ anchor (posterior hẹp); **Rm5** = SNR −5 dB, đủ anchor (gần F3 nhất); **R10tb** = chỉ có anchor ở đỉnh và đáy (posterior rộng).
|
||||||
|
- **Realization**: một lần sinh ngẫu nhiên một "trái đất" mô phỏng. Realization 900 và 901 chỉ dùng để thiết kế (dev), không bao giờ dùng làm kết quả.
|
||||||
|
- **Oracle**: mô hình học trên nhãn với warp **thật**. Chỉ có trên D2. Đây là trần tham chiếu, không phải đối thủ.
|
||||||
|
|
||||||
|
### 10.2 Các đối thủ
|
||||||
|
|
||||||
|
Mọi phương pháp mạng dùng **cùng mạng, cùng input, cùng cách tối ưu**. Chúng chỉ khác nhau ở nhãn và loss. Cách so như vậy đảm bảo khác biệt đến từ cách xử lý căn chỉnh, không phải từ mạng to hay nhỏ.
|
||||||
|
|
||||||
|
| Tên | Dễ hiểu là | Trả lời câu hỏi |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| B0a | Đường xu hướng theo thời gian, không dùng seismic | Seismic có thêm được gì ngoài xu hướng? |
|
||||||
|
| B0b | Hồi quy/rừng ngẫu nhiên trên các thuộc tính seismic | Baseline học máy nông |
|
||||||
|
| B1 | Nghịch đảo trở kháng cổ điển rồi đổi sang porosity | Baseline địa vật lý chuẩn |
|
||||||
|
| B2 | Mạng của luận văn với 6 loss gốc, pipeline đã sửa lỗi | Nối tiếp luận văn |
|
||||||
|
| B3a, B3b, B3c, B3c-R | Tie một lần theo các cách khác nhau, từ thô (B3a) đến tốt nhất có dùng seismic (B3c, B3c-R) | Đối thủ "tie điểm" |
|
||||||
|
| B3d | Một nhãn từ warp trung bình của posterior cũ (P2) | |
|
||||||
|
| **B3d-Sa** | Một nhãn từ warp trung bình của **posterior SMC** | Chỉ cần posterior tốt là đủ? |
|
||||||
|
| B4a–d | Nhãn B3b + loss chịu lệch: thử dịch, soft-min, soft-DTW, DILATE | Loss chịu lệch không cần anchor có đủ không? |
|
||||||
|
| B5 | Ensemble 5 seed của B3b | Bất định tốt hơn có phải chỉ nhờ ensemble? |
|
||||||
|
| M1, M2 | RML trên posterior cũ (P2) | |
|
||||||
|
| **M2-Sa** | RML trên ngân hàng 64 hạt SMC | **Phương pháp chính** |
|
||||||
|
|
||||||
|
### 10.3 Luật chơi chống "gian lận vô tình"
|
||||||
|
|
||||||
|
Với ít giếng và nhiều lựa chọn, rất dễ vô tình chọn đúng cấu hình làm kết quả đẹp. Dự án dùng bốn hàng rào:
|
||||||
|
|
||||||
|
1. **Giếng mù là mù thật.** Giếng test chỉ dùng để chấm điểm. Không dùng log, marker hay bất cứ thông tin nào của nó cho tie, cho huấn luyện, cho việc chọn số bước huấn luyện, hay để dịch dự đoán cho khớp.
|
||||||
|
2. **Thước đo cố định.** Đáp án dùng để chấm là nhãn theo TDR "sonic hiệu chỉnh bằng marker", chốt trước khi huấn luyện bất kỳ mô hình nào. Không bao giờ đổi sang thước đo khác vì nó cho điểm đẹp hơn.
|
||||||
|
3. **Đăng ký trước (pre-registration).** Trước mỗi đợt chạy chính, giả thuyết, cách đo và **ngưỡng đạt/trượt** được ghi vào một file protocol (`configs/protocol*.yaml`), rồi khoá bằng mã băm SHA-256. Script từ chối chạy nếu file bị sửa. Giống niêm phong luật chấm thi trước khi mở đề. Muốn đổi luật thì phải tạo protocol mới và ghi rõ là đã đổi (gọi là **deviation**).
|
||||||
|
4. **Thống kê trung thực.** Báo cáo từng giếng trước rồi mới lấy trung bình. Không tính p-value trên từng mẫu thời gian như thể chúng độc lập.
|
||||||
|
|
||||||
|
### 10.4 Đo bằng gì
|
||||||
|
|
||||||
|
| Nhóm | Thước đo | Ý nghĩa |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| Độ chính xác | RMSE (p.u.), PCC (tương quan) | Sai bao nhiêu, đúng hình dạng không |
|
||||||
|
| Theo băng | **RMSE băng seismic** (≥ 6 Hz) | Thước đo quyết định: đúng phần mà lệch thời gian phá hỏng |
|
||||||
|
| Biên độ | std ratio = độ lệch chuẩn dự đoán / của nhãn | Nhỏ hơn 1 nghĩa là dự đoán bị co, dấu hiệu bị mờ |
|
||||||
|
| Bất định | **Coverage** 80/90%, CRPS, NLL | Khoảng tin cậy 90% có chứa giá trị thật khoảng 90% số lần không |
|
||||||
|
|
||||||
|
### 10.5 Cổng go/no-go
|
||||||
|
|
||||||
|
Dự án chia thành các pha. Cuối mỗi pha có một **cổng** với ngưỡng chốt trước. Ngưỡng **không bao giờ đổi**; chỉ ngày có thể đổi.
|
||||||
|
|
||||||
|
| Cổng | Câu hỏi |
|
||||||
|
| --- | --- |
|
||||||
|
| G-A | Baseline có tái lập được không? |
|
||||||
|
| G-B | Trên D2 ở drift giống F3, M2 có hơn đối thủ tốt nhất ít nhất 10% RMSE băng (hoặc +0.05 PCC băng) không, và không thua quá 2% khi không có drift? |
|
||||||
|
| G-C | Trên F3: M2-Sa có hơn đối thủ ở ít nhất 3/4 giếng, **và** coverage 80/90% có nằm trong ±5% của mức danh nghĩa không? |
|
||||||
|
| G-D | Trên Volve: báo cáo kết quả theo chiều nào cũng được, và giới hạn claim theo kết quả |
|
||||||
|
|
||||||
|
> **Ý chính.** Synthetic cho biết phương pháp có hoạt động khi biết đáp án không; field cho biết nó có dùng được trong thực tế không. Mọi luật chấm được niêm phong trước khi chạy.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Bài 11. Câu chuyện kết quả, theo thứ tự thời gian
|
||||||
|
|
||||||
|
### 11.1 P0–P1 (26/10): dọn nhà và dựng lại baseline
|
||||||
|
|
||||||
|
Kiểm tra code và dữ liệu của luận văn gốc phát hiện nhiều lỗi khiến kết quả cũ **không dùng làm mốc được**:
|
||||||
|
- Toạ độ giếng sai 5–11 km: trace "tại giếng" thực ra không nằm ở giếng.
|
||||||
|
- Không hiệu chỉnh drift, nên lệch 14–66 ms.
|
||||||
|
- Giếng validation cũng là giếng train.
|
||||||
|
- Nhãn bị alias.
|
||||||
|
- MSE 0.015 được báo cáo thực ra ứng với R² ≈ −9.8, tức tệ hơn đoán một hằng số.
|
||||||
|
|
||||||
|
Mọi baseline được dựng lại. Kết quả LOWO trên F3 (trung bình 4 giếng):
|
||||||
|
|
||||||
|
| | B0a (xu hướng) | B0b-ridge | B1 | B2 (luận văn) | B3a | B3b |
|
||||||
|
| --- | --- | --- | --- | --- | --- | --- |
|
||||||
|
| RMSE (p.u.) | **2.48** | 2.58 | 3.60 | 3.07 | 2.93 | 2.82 |
|
||||||
|
| PCC băng seismic | −0.13 | **0.24** | −0.02 | 0.15 | −0.02 | 0.15 |
|
||||||
|
|
||||||
|
**Điều rút ra:** với 3 giếng train, **không mô hình nào thắng đường xu hướng đơn giản** về RMSE tổng. Tương quan trong băng seismic yếu ở mọi phương pháp. Tie tốt hơn (B3b so với B3a) có giúp.
|
||||||
|
|
||||||
|
### 11.2 P2 (26/10): lần thử đầu trên synthetic, trượt cổng G-B
|
||||||
|
|
||||||
|
- Ở c = 1, M2 chỉ ngang ngửa đối thủ tốt nhất (tỉ số RMSE băng 0.985–1.045; cần ≤ 0.90). 0/4 ô đạt.
|
||||||
|
- Ở c = 0, M2 thua 3.9% (giới hạn 2%).
|
||||||
|
- Điểm đáng chú ý: so với tie chuẩn B3b, M2 vẫn giảm RMSE băng 12–28%. Các loss chịu lệch (B4) không giúp, đúng như Mệnh đề 2 dự đoán.
|
||||||
|
- **H3 bị bác:** bất định của M2 không tốt hơn ensemble thường. Với ít giếng, mọi mạng tự học σ đều làm σ quá nhỏ vì học thuộc nhãn train.
|
||||||
|
|
||||||
|
**Chẩn đoán** (chỉ trên realization dev): nút thắt không nằm ở loss mà ở **posterior**. Trọng số vật lý suy biến (Bài 7.5), nên posterior gần như chỉ dựa vào anchor. Thay bằng SMC thì sai số warp giảm từ 3.3 xuống 0.57 ms.
|
||||||
|
|
||||||
|
### 11.3 P2r (27/10): chạy lại với posterior SMC, có ghi rõ deviation
|
||||||
|
|
||||||
|
Vì P2 đã trượt, kết luận G-B **giữ nguyên**. P2r là một **protocol mới** ([protocol_p2r.yaml](../configs/protocol_p2r.yaml)), thiết kế sau khi thấy P2 trượt và chỉ dựa trên dữ liệu dev. Nó chạy trên realization mới (8–15). Bài báo phải ghi rõ điều này trong phần Methods.
|
||||||
|
|
||||||
|
P2r tách câu hỏi chính làm hai:
|
||||||
|
|
||||||
|
**H2a: chỉ cần posterior tốt có đủ không?** So B3d-Sa (một nhãn từ warp trung bình SMC) với tie điểm tốt nhất. **Đạt** ở cả ba regime đủ anchor (R10, R0, Rm5). Ví dụ R10 ở c = 1: RMSE băng bằng 0.857 lần (N = 4) và 0.782 lần (N = 16) của đối thủ, tức giảm khoảng 14–22%.
|
||||||
|
|
||||||
|
Cần đọc kỹ: B3d-Sa đã thắng tie điểm ngay cả khi **không có drift** (c = 0, tỉ số khoảng 0.81). Vậy phần lớn lợi ích **không đến từ việc xử lý drift**. Phần gắn với drift là: khi c tăng, B3d-Sa giữ gần Oracle, còn đối thủ xấu đi.
|
||||||
|
|
||||||
|
**H2b: học trên cả ngân hàng có thêm được gì không?** So M2-Sa với B3d-Sa. **Đạt** với N = 16: ở 8/8 ô có posterior rộng, M2-Sa tốt hơn, và lợi ích càng lớn khi posterior càng rộng (tương quan hạng ρ = −0.85). Ở các ô posterior hẹp, hai phương pháp ngang nhau (tỉ số 0.996), đúng như Bài 7.6 dự đoán.
|
||||||
|
|
||||||
|
**Nhánh σ_a: trượt.** Khi cố ý đặt sai σ_a (một nửa hoặc gấp đôi giá trị thật), không ô nào đạt. Nghĩa là lợi ích của H2a **cần σ_a được đặt đúng**. Đây là rủi ro lớn nhất cho F3, vì σ_a thật của F3 không biết.
|
||||||
|
|
||||||
|
**H3 (chỉ mô tả):** mọi ensemble, kể cả Oracle, đều cho khoảng tin cậy quá hẹp. Coverage 90% chỉ từ 0.31 đến 0.79, trung vị 0.47. **Không claim gì về calibration.**
|
||||||
|
|
||||||
|
### 11.4 P3 (28/10): F3 thật, trượt cổng G-C
|
||||||
|
|
||||||
|
**Thiết kế: nested LOWO.**
|
||||||
|
- Vòng ngoài: giấu 1 trong 4 giếng làm test.
|
||||||
|
- Vòng trong: trong 3 giếng còn lại, lần lượt giấu 1 giếng làm validation, học trên 2 giếng. Validation dùng để chọn số bước huấn luyện và chọn đối thủ tie điểm, không bao giờ dùng giếng test ngoài.
|
||||||
|
- Tổng cộng 1,320 lần huấn luyện; 12 ablation; hai nhánh σ_a; dự đoán cả khối 649 inline bằng 20 mô hình.
|
||||||
|
- Protocol: [protocol_f3.yaml](../configs/protocol_f3.yaml), khoá lúc 00:14 ngày 28/10, trước khi chạy.
|
||||||
|
|
||||||
|
**Kết quả: G-C trượt cả hai điều kiện.**
|
||||||
|
- M2-Sa chỉ hơn đối thủ (B3c-R, được validation chọn ở cả 4 giếng) tại **1/4 giếng** (F03-4, tỉ số 0.981). Cần 3/4. Ba giếng còn lại: F02-1 1.008, F03-2 1.000, F06-1 1.070.
|
||||||
|
- Coverage 80% là 52.4% (cần 75–85%); coverage 90% là 60.9% (cần 85–95%).
|
||||||
|
- Đổi σ_a, đổi thước đo hay đổi nhãn đều không làm kết quả đạt.
|
||||||
|
|
||||||
|
**Đọc kết quả thế nào.**
|
||||||
|
- Mỗi mô hình chỉ học từ 2 giếng. Ở mức này, mạng dự đoán được rất ít nội dung băng seismic. Sai khác giữa các phương pháp **nhỏ hơn sai khác giữa các seed**.
|
||||||
|
- Một mốc tham chiếu làm sau (chỉ mô tả): nếu dự đoán hoàn toàn không có nội dung băng seismic thì RMSE băng là 1.224 p.u. M2-Sa đạt 1.272, B3c-R 1.256. Chỉ B4b (1.211) thấp hơn mốc này một chút.
|
||||||
|
- Đường xu hướng B0a vẫn có RMSE tổng tốt nhất (2.48 p.u.).
|
||||||
|
|
||||||
|
**Quyết định:** đóng P3, không chạy lại. Mọi thay đổi thiết kế lúc này đều là lựa chọn sau khi đã thấy nhãn test. Kết luận P2/P2r trên synthetic giữ nguyên, nhưng **không được claim chúng khái quát ra field**.
|
||||||
|
|
||||||
|
### 11.5 Tổng kết đến lúc này
|
||||||
|
|
||||||
|
| Câu hỏi | Trả lời |
|
||||||
|
| --- | --- |
|
||||||
|
| Nhãn lệch có làm mạng học ra ảnh mờ không? | Có. Lý thuyết khớp thí nghiệm trong 1% (H1) |
|
||||||
|
| Có cần anchor không? | Có (H4, Mệnh đề 2) |
|
||||||
|
| Posterior tie tốt (SMC) có giúp trên synthetic không? | Có, giảm RMSE băng khoảng 8–22% so với tie điểm tốt nhất (H2a), với điều kiện σ_a đúng |
|
||||||
|
| Học trên cả ngân hàng có thêm gì không? | Có, nhưng chỉ khi posterior rộng (H2b) |
|
||||||
|
| Khoảng bất định có đáng tin không? | Không, mọi phương pháp đều quá tự tin |
|
||||||
|
| Trên F3 thật thì sao? | Không thắng; khác biệt nhỏ hơn nhiễu do seed (G-C trượt) |
|
||||||
|
| Trên Volve thì sao? | Không phân định được: không phương pháp nào thắng một hằng số; G-D không đạt tiêu chí claim (mục 11.6) |
|
||||||
|
| Nhãn đặt tại tie trung bình posterior thì mạng học ra gì? | Ảnh sắc hơn thật, không mờ: sai số kiểu Berkson (Mệnh đề 3, mục 11.7) |
|
||||||
|
| Một field test cần gì để thấy được lợi ích? | Reference ở giếng blind chính xác cỡ 1 ms và khoảng 5–18 giếng blind; F3, Volve và Teapot đều không có (mục 11.7) |
|
||||||
|
|
||||||
|
### 11.6 P4 Volve (29/10): G-D không đạt, và phép thử không có lực
|
||||||
|
|
||||||
|
**Vì sao Volve.** Porosity ở Volve (PHIF) tính từ mật độ và neutron, **độc lập với sonic**. Điều này phá vỡ cấu trúc "nhãn = hàm của DT" của F3.
|
||||||
|
|
||||||
|
**Cái khó mới.** Cả 6 giếng đều **nghiêng** (có giếng nghiêng tới 82°). Phải dựng quỹ đạo giếng trong không gian, đổi độ sâu đo dọc lỗ khoan sang độ sâu thẳng đứng, rồi lấy seismic dọc theo đường giếng thay vì một cột thẳng đứng. Nhãn cũng ngắn: chỉ 16–37 mẫu mỗi giếng, tổng 150 mẫu. Code: [deviated.py](../ml_porosity/data/deviated.py), [volve_wells.py](../ml_porosity/data/volve_wells.py), [ml_porosity/volve/](../ml_porosity/volve/).
|
||||||
|
|
||||||
|
**Thiết kế.** Hai cách chia fold: LOWO, và "slot" (giấu cả nhóm giếng khoan chung một lỗ). Vị trí giếng test được đặt bằng mô hình thời gian–độ sâu trung bình của các giếng train, không dùng thông tin của giếng test. Cổng G-D chỉ mô tả: được nói "cải thiện nhất quán" chỉ khi ít nhất 5/6 giếng cải thiện ở cả hai cách chia. Protocol: `configs/protocol_volve.yaml`.
|
||||||
|
|
||||||
|
**Kết quả** (xong 02:21 UTC ngày 29/10 trên server Linux; [plan.md](plan.md) §12 ý 20–21):
|
||||||
|
|
||||||
|
| Tiêu chí đã khóa | lowo | slot |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| RML tốt hơn tie điểm được chọn, cần ≥ 5/6 giếng | 2/6 | 3/6 |
|
||||||
|
| Coverage 80% (cần 75–85%) | 39% | 35% |
|
||||||
|
| Coverage 90% (cần 85–95%) | 48% | 47% |
|
||||||
|
|
||||||
|
Đổi σ_a sang 3,5 hay 14 ms gần như không đổi gì (RMSE macro lệch ≤ 0,06 p.u.).
|
||||||
|
|
||||||
|
**Vì sao không đọc được kết quả này theo chiều nào.** Mọi phương pháp đều có R² âm: dự đoán giếng giấu còn kém hơn chính trung bình của giếng đó. Sau khi chạy, ta thử một đối chứng "ngây thơ": đoán mọi mẫu bằng một hằng số, là trung bình porosity của các giếng train, không dùng seismic. Hằng số này có RMSE 6,03 (lowo) và 6,59 p.u. (slot), **thấp hơn mọi mạng**. Lý do là porosity trung bình khác nhau nhiều giữa các giếng (8,5–17,0 p.u.); mạng mang theo độ lệch đó, còn dao động của dự đoán dọc giếng không bám nhãn. Các phương pháp tie chỉ khác nhau ở chỗ đặt nhãn theo thời gian, và chênh nhau tối đa 0,25 p.u. trên tổng sai số 6–7 p.u.
|
||||||
|
|
||||||
|
Hình dung: thi chạy giữa hai đôi giày khác nhau một chút, nhưng cả hai vận động viên đều bị chấn thương và đi bộ về đích. Kết quả không cho biết đôi giày nào tốt hơn. Volve vì vậy **không chống và cũng không ủng hộ** RML.
|
||||||
|
|
||||||
|
Một điểm đáng chú ý: registration trên Volve "khỏe" hơn F3. Pha wavelet xác định tốt (các tập train nằm trong cung 43°, F3 là 214°), và độ rộng posterior (trung vị khoảng 4 ms) gần như không theo σ_a. Nút thắt ở Volve không nằm ở tie.
|
||||||
|
|
||||||
|
**Thử thêm (exploratory, không claim).** Sau G-D có chạy thêm vài biến thể mô hình trên Volve: trừ trend vận tốc rồi học phần dư, thêm kênh đầu vào, hay dùng mô hình tuyến tính rất nhỏ. Kế hoạch ghi trước ở [p4-exploratory.md](research/p4-exploratory.md). Vì mọi biến thể được nghĩ ra *sau khi* thấy nhãn test của P4, kết quả chỉ được mô tả, không được dùng để đổi kết luận. Ngày 29/10 hướng này bị bỏ hẳn (Pivot 1, `plan.md` §12 ý 22): job bị dừng giữa chừng, output chỉ giữ làm hồ sơ, không tổng hợp và không đưa vào bài.
|
||||||
|
|
||||||
|
### 11.7 Pivot 1 (29/10): bài thành lý thuyết + benchmark, và một field test cần gì
|
||||||
|
|
||||||
|
**Vì sao đổi hướng.** G-C và G-D đều trượt, nên bài không thể claim cải thiện trên field. Ngày 29/10 dự án chọn Pivot 1 mức B: bài nói về sai số đăng ký của nhãn, gồm lý thuyết và một benchmark synthetic có warp thật; F3 và Volve chỉ là các trường hợp giới hạn phạm vi. Tên làm việc: *Label registration error in sparse-well seismic property learning: theory, a registration-aware benchmark, and the limits of field validation*. Hạn nộp dời sang thứ 7, 14/11/2026 ([plan.md](plan.md) §12 ý 22, 24).
|
||||||
|
|
||||||
|
**Lý thuyết mở rộng** (bài mục 4.3–4.5, chứng minh ở Phụ lục A; bản tiếng Việt ở [theory.md](theory.md) mục 6):
|
||||||
|
- *Hai kiểu sai số của tie (Mệnh đề 3).* Nếu sai số tie độc lập với nhãn thật (kiểu *classical*), mạng học ra ảnh mờ như Mệnh đề 1. Nếu sai số độc lập với những gì ta đã biết (kiểu *Berkson*), như khi lấy tie là trung bình posterior, thì ngược lại: mạng học ra ảnh *sắc hơn* thật. Cận 1/B(σ_post) dùng cho H2b là cận của kiểu classical. Kiểu Berkson cho cận thấp hơn. Hệ số giữa hai tích phân, e^{4π²σ²f²}, nhỏ ở tần số thấp, nhưng phần méo (trọng số f⁴) nằm quanh 70 Hz, nơi hệ số lớn: ở σ = 2 ms, tích phân Berkson gấp 2,1–2,6 lần. Bản trước ghi "hệ số dưới 1,17". Con số đó sai vì chỉ xét tới 25 Hz (sửa 29/10).
|
||||||
|
- *Bank hiệu chỉnh (Mệnh đề 4).* Nếu bank là mẫu đúng của posterior, học trên cả bank cho cùng nghiệm quần thể với học trên nhãn thật. Nhưng lợi ích quần thể so với nhãn điểm chỉ ở *bậc bốn* theo σ, nên rất nhỏ khi posterior hẹp.
|
||||||
|
- *Coverage (Mệnh đề 5)* và *reference lệch (Mệnh đề 6, Hệ quả 4).* Nếu reference dùng để chấm cũng lệch, phép so sánh hai phương pháp chỉ có thể cho đúng chiều khi sai số của reference nhỏ hơn σ/√2 (điều kiện cần ở mọi tần số, không đủ; sửa 02/11/2026).
|
||||||
|
|
||||||
|
**Kiểm tra post hoc trên P2r** ([31_p2r_posthoc.py](../scripts/31_p2r_posthoc.py), [30_t4_coverage.py](../scripts/30_t4_coverage.py); bài mục 6.3). Theo cận classical đã đăng ký, lợi ích của bank vượt cận quần thể ở 7/8 ô rộng khi tính tại σ_post và 6/8 ô khi tính tại sai số warp. Cận Berkson, tính post hoc, là cấu trúc tự nhiên cho nhãn tại warp trung bình. Theo cận này chỉ 3/8 ô vượt tại σ_post, cả ba ở c = 1 và hai ô sát cận. Tại sai số warp thì nhiều nhất 1/8 ô vượt. Vì vậy không nói được rằng lợi ích "vượt cận". M2-Sa vẫn kém Oracle ở mọi ô rộng (4–63%). T2 (exploratory, khai báo trước; [t2-results.md](research/t2-results.md)) cho thấy sai số nhãn của B3d-Sa đúng là kiểu Berkson ở c = 1, nên cận Berkson là cận áp dụng và lợi ích H2b không vượt hiệu chỉnh quần thể. Một bank nhiễu GP cùng trung bình và hiệp phương sai posterior lấy được phần lớn lợi ích ở c = 1 (tăng cường nhãn). Tái đăng ký ngầm có thật (8/8 ô rộng). Không có bằng chứng cho cơ chế đa mode. Khoảng một phần ba khoảng cách giữa nhãn trung bình posterior và Oracle là do độ dài huấn luyện. Mọi ensemble quá hẹp, và độ dài huấn luyện lẫn với nguồn nhãn nên chưa tách được nguyên nhân.
|
||||||
|
|
||||||
|
**Một field test cần gì** (T3, [27_t3_power.py](../scripts/27_t3_power.py); bài mục 6.6). Lấy dự đoán đã lưu của P2r rồi chấm lại bằng một reference cố ý lệch σ_ref. Với reference chính xác, sign test cần 5–18 giếng blind để đạt lực 0,8 ở phần lớn các ô; với σ_ref từ 3 ms trở lên thì 40 giếng cũng không đủ. Luật "≥ k/n giếng cải thiện" của G-C, G-D thực ra không phải phép kiểm: nó đạt ngẫu nhiên với xác suất 0,31 khi có 4 giếng và 0,11 khi có 6 giếng.
|
||||||
|
|
||||||
|
**Điều kiện áp dụng và Teapot Dome** (exploratory; [applicability-teapot.md](research/applicability-teapot.md), [applicability-results.md](research/applicability-results.md); bài mục 6.7). Bốn điều kiện để một field test có ý nghĩa với kết quả synthetic: mạng có kỹ năng ở giếng blind trong băng seismic (C1), posterior tie đủ rộng (C2, chỉ cho so sánh với nhãn trung bình posterior), σ_a xác định được bằng dữ liệu thời gian–độ sâu độc lập ở ít nhất 3 giếng ngoài tập test (C3), và đủ giếng cho phép kiểm có lực (C4). F3 và Volve trượt C1, đạt C2 ([26_applicability.py](../scripts/26_applicability.py)). Thử Teapot Dome: chỉ tối đa 2 giếng có bảng thời gian–độ sâu độc lập (T0 trượt), và pilot dùng cặp horizon–top làm reference thay thế cho sai số 6,75 ms so với dung sai 1,5 ms (P-a trượt) ([28_teapot_inventory.py](../scripts/28_teapot_inventory.py), [29_teapot_pilot.py](../scripts/29_teapot_pilot.py)). Teapot dừng; bài không có field test mới.
|
||||||
|
|
||||||
|
**Benchmark P6** (`configs/protocol_bench.yaml`, khoá 29/10; chạy 29/10 → 30/10; tổng hợp 02/11; [bench-protocol.md](research/bench-protocol.md) mục 8, [plan.md](plan.md) §12 ý 28). 9 claim, 11 verdict, 9 đạt. H2a (nhãn trung bình posterior hơn tie điểm tốt nhất) còn giữ khi drift lớn hơn (c = 1,5; S1-H1), khi thêm các baseline không anchor B4a–d (S3-H1, ở R10, R0, Rm5), và với backbone thứ hai TCN (S4-H1). Lợi ích của bank tăng theo số giếng (S1-H2). Ở chế độ cycle-skip có điều khiển, hàm truyền đảo dấu như Hệ quả 3 dự đoán và bank hai mode hơn nhãn trung bình rõ rệt (S8). **Hai verdict trượt**, cả hai đều được dự đoán đạt: dưới sai mô hình rock physics, lợi ích H2a co xuống dưới ngưỡng (0,94 / 0,93). Dưới sai pha wavelet, posterior SMC quá tự tin (cov90 0,17 / 0,10) và lợi ích H2a mất hẳn (1,02 / 1,04). Chỉ trục drift đạt. Vì vậy không được nói H2a bền với sai mô hình nói chung. Code tổng hợp đã khoá khác lời phát biểu ở ba chỗ; verdict cuối theo đúng phát biểu do [36_bench_verdicts.py](../scripts/36_bench_verdicts.py) ghi, và cả hai cách đọc đều được báo cáo. Gói benchmark S7 (02/11; [37_bench_package.py](../scripts/37_bench_package.py), [benchmark/README.md](../benchmark/README.md)) có 630 task kèm truth ẩn và hash nội dung, cùng một lệnh chấm theo đúng luật đã khoá; selftest đạt. Chưa deposit Zenodo. Bank hai mode BK2 chứa warp thật nhưng không phải bank hiệu chỉnh theo Mệnh đề 4. Khi λ → 0, Hệ quả 3 cho transfer của nó là cos²(πfΔ), nhưng đo được gần 1 (0,92–1,00 ở N = 16): responsibility đã tái đăng ký nhãn. Kết quả và cách đọc này đã viết vào bài ngày 02/11 (mục 6.5, Thí nghiệm 3; mục cơ chế T2 là 6.4; [plan.md](plan.md) §12 ý 30).
|
||||||
|
|
||||||
|
Hình dung: muốn biết đôi giày mới giúp chạy nhanh hơn 1% hay không, cần một đồng hồ bấm giờ sai ít hơn 1% và nhiều lượt chạy. F3, Volve và Teapot đều chưa có đồng hồ đủ chính xác.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Bài 12. Được nói gì, không được nói gì
|
||||||
|
|
||||||
|
Đây là phần quan trọng khi viết bài. Danh sách đầy đủ ở [plan.md](plan.md) §10.
|
||||||
|
|
||||||
|
**Được nói (có bằng chứng):**
|
||||||
|
- Huấn luyện trên nhãn lệch tương đương học một mục tiêu bị làm mờ, và mức mờ tính được (Mệnh đề 1, H1).
|
||||||
|
- Không có anchor thì thời gian tuyệt đối không xác định được; các loss căn chỉnh chung không tự sửa được điều này (Mệnh đề 2, H4).
|
||||||
|
- Trên synthetic dựng theo F3, nhãn từ posterior SMC hơn tie điểm tốt nhất; RML hơn thêm khi posterior rộng. Cả hai cần σ_a đúng.
|
||||||
|
- Trên F3, phép thử đăng ký trước đã trượt.
|
||||||
|
- Trên Volve, phép thử khóa trước cũng trượt; ở đó không phương pháp nào thắng một hằng số, nên phép thử không có lực.
|
||||||
|
- Tie trung bình posterior có sai số kiểu Berkson, làm sắc chứ không làm mờ predictor; lợi ích quần thể của một bank hiệu chỉnh là bậc bốn theo σ (Mệnh đề 3–4).
|
||||||
|
- Một phép so sánh tie ở giếng blind cần reference chính xác cỡ 1 ms và đủ giếng (T3, Hệ quả 4); đây là kết quả exploratory.
|
||||||
|
|
||||||
|
**Không được nói:**
|
||||||
|
- "First" hay "novel" khi chưa kiểm tra novelty xong.
|
||||||
|
- "Porosity" của F3 mà không nói rằng nó là biến đổi tuyến tính của sonic.
|
||||||
|
- Bất kỳ con số nào của luận văn gốc dùng làm baseline.
|
||||||
|
- "Calibrated uncertainty": mọi phương pháp đều under-cover.
|
||||||
|
- Gọi kết quả chỉ có trên synthetic là "khái quát ra field". Kết quả F3 và Volve không ủng hộ điều đó.
|
||||||
|
- Dùng Volve làm bằng chứng rằng RML "không hoạt động", hoặc dùng kết quả exploratory P4x làm bằng chứng nó "có hoạt động".
|
||||||
|
- Nói rằng lợi ích thêm của bank vượt cận quần thể hoặc đã được giải thích. Nó chỉ vượt cận classical. Với cận Berkson, lợi ích nằm trong cận. T2 (exploratory) gợi ý phần lớn lợi ích ở c = 1 là tăng cường nhãn, nhưng đó không phải claim xác nhận.
|
||||||
|
- Nói rằng nhãn trung bình posterior (H2a) bền với sai mô hình nói chung. S2-H1 chỉ đạt ở trục drift, trượt ở rock physics và pha wavelet.
|
||||||
|
- Dùng C1–C4 như một tiêu chí đã đăng ký trước: chúng được nêu sau khi cả hai field gate trượt.
|
||||||
|
- Gọi marker của F3 là checkshot độc lập.
|
||||||
|
- Bất kỳ kết quả nào có dính lựa chọn (dịch, checkpoint, hyperparameter) dựa trên nhãn test.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Bài 13. Đi vào code
|
||||||
|
|
||||||
|
### 13.1 Luồng xử lý
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
*Hình 1. Luồng xử lý chi tiết. Khung nét đứt là các giai đoạn. Nhãn trong hình bằng tiếng Anh để dùng thẳng cho bài báo. Bản vector: [workflow.svg](figures/workflow.svg); nguồn TikZ: [workflow.tex](figures/workflow.tex). Dựng lại: chạy `xelatex workflow.tex` trong `docs/figures/`, rồi xuất PDF sang PNG (200 dpi) và SVG.*
|
||||||
|
|
||||||
|
| Giai đoạn | Bài | Làm gì | Code |
|
||||||
|
| --- | --- | --- | --- |
|
||||||
|
| 1. Tiền xử lý | 2, 4 | Đặt giếng đúng toạ độ, lấy patch 3×3, tích phân DT, ghép marker với horizon thành anchor | [geometry.py](../ml_porosity/data/geometry.py), [tdr.py](../ml_porosity/data/tdr.py), [horizons.py](../ml_porosity/data/horizons.py) |
|
||||||
|
| 2. Posterior warp | 7 | Prior GP, anchor, likelihood vật lý, SMC | [warp_prior.py](../ml_porosity/registration/warp_prior.py), [tie_likelihood.py](../ml_porosity/registration/tie_likelihood.py), [smc.py](../ml_porosity/registration/smc.py) |
|
||||||
|
| 3. Ngân hàng nhãn | 8 | Mỗi warp cho một phiên bản nhãn | [labels.py](../ml_porosity/registration/labels.py) |
|
||||||
|
| 4. Huấn luyện | 9 | CNN–GRU, loss RML, ensemble 5 seed | [bank_train.py](../ml_porosity/models/bank_train.py), [rml.py](../ml_porosity/losses/rml.py) |
|
||||||
|
| 5. Dự đoán | 6 | Chỉ cần seismic, ra μ ± σ | [cnn_gru.py](../ml_porosity/models/cnn_gru.py) |
|
||||||
|
| 6. Đánh giá | 10 | Chấm trên giếng mù theo protocol đã khoá | [metrics.py](../ml_porosity/eval/metrics.py) |
|
||||||
|
|
||||||
|
### 13.2 Bản đồ module ([ml_porosity/](../ml_porosity/))
|
||||||
|
|
||||||
|
| Khái niệm | File |
|
||||||
|
| --- | --- |
|
||||||
|
| Đọc LAS, SEG-Y, horizon, Volve | [data/las_io.py](../ml_porosity/data/las_io.py), [data/seismic_io.py](../ml_porosity/data/seismic_io.py), [data/horizons.py](../ml_porosity/data/horizons.py), [data/volve_io.py](../ml_porosity/data/volve_io.py) |
|
||||||
|
| Toạ độ bin ↔ XY | [data/geometry.py](../ml_porosity/data/geometry.py) |
|
||||||
|
| TDR (legacy, sonic, calibrated) | [data/tdr.py](../ml_porosity/data/tdr.py) |
|
||||||
|
| Đổi log sang thời gian có chống alias | [data/resample.py](../ml_porosity/data/resample.py) |
|
||||||
|
| Wavelet, synthetic seismogram | [data/wavelet.py](../ml_porosity/data/wavelet.py), [data/synthetic.py](../ml_porosity/data/synthetic.py) |
|
||||||
|
| Bộ sinh D2 | [data/synth_d2.py](../ml_porosity/data/synth_d2.py) |
|
||||||
|
| Giếng nghiêng (Volve) | [data/deviated.py](../ml_porosity/data/deviated.py), [data/volve_wells.py](../ml_porosity/data/volve_wells.py) |
|
||||||
|
| Prior GP của warp, posterior tuyến tính hoá | [registration/warp_prior.py](../ml_porosity/registration/warp_prior.py) |
|
||||||
|
| Lấy mẫu kiểu P2 (elliptical slice sampling) | [registration/sampler.py](../ml_porosity/registration/sampler.py) |
|
||||||
|
| SMC tempering (CPU / GPU) | [registration/smc.py](../ml_porosity/registration/smc.py), [registration/smc_torch.py](../ml_porosity/registration/smc_torch.py) |
|
||||||
|
| Likelihood vật lý, chọn pha wavelet | [registration/tie_likelihood.py](../ml_porosity/registration/tie_likelihood.py) |
|
||||||
|
| Tie điểm B3a–d | [registration/ties.py](../ml_porosity/registration/ties.py) |
|
||||||
|
| Ngân hàng nhãn | [registration/labels.py](../ml_porosity/registration/labels.py) |
|
||||||
|
| Loss RML, soft-DTW, DILATE, loss luận văn | [losses/rml.py](../ml_porosity/losses/rml.py), [losses/softdtw.py](../ml_porosity/losses/softdtw.py), [losses/legacy_v2.py](../ml_porosity/losses/legacy_v2.py) |
|
||||||
|
| Mạng CNN–GRU và huấn luyện | [models/cnn_gru.py](../ml_porosity/models/cnn_gru.py), [models/train.py](../ml_porosity/models/train.py), [models/bank_train.py](../ml_porosity/models/bank_train.py) |
|
||||||
|
| Baseline B0b, B1 | [baselines/attributes.py](../ml_porosity/baselines/attributes.py), [baselines/inversion.py](../ml_porosity/baselines/inversion.py) |
|
||||||
|
| Thước đo | [eval/metrics.py](../ml_porosity/eval/metrics.py) |
|
||||||
|
| Pipeline P3 (F3) | [f3/](../ml_porosity/f3/): protocol, registration, training, evaluation, volume |
|
||||||
|
| Pipeline P4 (Volve) | [volve/](../ml_porosity/volve/): folds, loss có mask, registration, training, evaluation |
|
||||||
|
|
||||||
|
### 13.3 Chạy theo pha
|
||||||
|
|
||||||
|
Cài đặt và bảng mô tả từng script ở [README.md](../README.md).
|
||||||
|
|
||||||
|
| Pha | Driver | Script chính |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| P0 | `scripts/run_p0.sh` | test, manifest dữ liệu |
|
||||||
|
| P1 | `scripts/run_p1.sh` | 01–08 |
|
||||||
|
| P2 | `scripts/run_p2.sh` | 09–13 |
|
||||||
|
| P2r | `scripts/run_p2r_main.sh` | 14, 15, 18 |
|
||||||
|
| P3 | `scripts/run_p3.ps1` (Windows) | 19–21 |
|
||||||
|
| P4 | `scripts/run_p4.sh`, `scripts/run_p4.ps1` | 23, 24; 25 (post hoc, ngoài khóa) |
|
||||||
|
| Điều kiện áp dụng, T3, Teapot (exploratory) | | 26, 27; 28, 29 (đọc data/Teapot, chạy bằng `python -P`) |
|
||||||
|
| T4 và kiểm cận H2b (post hoc trên P2r) | | 30, 31 |
|
||||||
|
| Hình cho bài báo | | 22 |
|
||||||
|
|
||||||
|
Không chạy lại `04_wavelet_tie.py` và `09_fit_warp_prior_f3.py`, và không ghi đè artifact cũ của chúng (yêu cầu của người dùng; xem [AGENTS.md](../AGENTS.md)). Test nằm trong [tests/](../tests/). Hai file quan trọng nhất cho lý thuyết là [test_losses.py](../tests/test_losses.py) (các trường hợp đặc biệt của RML) và [test_registration.py](../tests/test_registration.py).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Phụ lục A. Thuật ngữ
|
||||||
|
|
||||||
|
| Thuật ngữ | Nghĩa |
|
||||||
|
| --- | --- |
|
||||||
|
| Acoustic impedance (AI) | Mật độ × vận tốc sóng. Ranh giới có AI thay đổi tạo ra tiếng vọng |
|
||||||
|
| Alias | Dao động nhanh "giả dạng" thành dao động chậm khi lấy mẫu thưa mà không lọc trước |
|
||||||
|
| Anchor | Cặp (độ sâu, thời gian) độc lập với sonic: marker trên log khớp với horizon trên seismic. Có sai số pick σ_a |
|
||||||
|
| Băng seismic / băng thấp | Phần tín hiệu ≥ 6 Hz (seismic mang thông tin) / < 6 Hz (chủ yếu là xu hướng) |
|
||||||
|
| Blind well | Giếng test, không góp thông tin gì vào việc học |
|
||||||
|
| c | Hệ số nhân drift trong D2. c = 1 giống F3 |
|
||||||
|
| Calibration, coverage | Khoảng tin cậy x% có chứa giá trị thật khoảng x% số lần không |
|
||||||
|
| Cổng (gate) G-A…G-D | Điểm quyết định cuối mỗi pha, ngưỡng chốt trước |
|
||||||
|
| CRPS | Điểm chấm cả độ chính xác lẫn độ sắc của dự đoán dạng phân phối (càng nhỏ càng tốt) |
|
||||||
|
| Cycle skipping | Tie khớp nhầm, lệch đúng một chu kỳ sóng |
|
||||||
|
| Deviation | Thay đổi so với protocol đã khoá, phải ghi rõ và báo cáo |
|
||||||
|
| Drift | Độ lệch tích luỹ theo độ sâu giữa thời gian sonic và thời gian seismic |
|
||||||
|
| DT (sonic) | Thời gian sóng đi qua 1 m đá, µs/m |
|
||||||
|
| Ensemble | Gộp nhiều bản mạng huấn luyện với seed khác nhau |
|
||||||
|
| Gaussian NLL | Loss cho mạng dự đoán cả μ và σ |
|
||||||
|
| Gaussian process (GP) | "Máy sinh đường cong ngẫu nhiên", điều khiển bởi biên độ và độ dài tương quan |
|
||||||
|
| Horizon | Mặt phản xạ dò liên tục trong cube seismic |
|
||||||
|
| LOWO, nested LOWO | Lần lượt giấu một giếng làm test; bản "nested" giấu thêm một giếng trong tập train làm validation |
|
||||||
|
| λ (lambda) | Núm của RML: λ → 0 là trung bình đều, λ → ∞ là chỉ lấy phiên bản khớp nhất |
|
||||||
|
| Marker | Nóc tầng đá xác định trên log giếng |
|
||||||
|
| MD / TVD | Độ sâu đo dọc lỗ khoan / độ sâu thẳng đứng |
|
||||||
|
| Ngân hàng nhãn (bank) | S phiên bản nhãn từ S warp, kèm trọng số π |
|
||||||
|
| N | Số giếng train trong D2 |
|
||||||
|
| Oracle | Mô hình học với warp thật, chỉ có trên synthetic |
|
||||||
|
| p.u. | Porosity × 100 |
|
||||||
|
| PCC | Hệ số tương quan Pearson |
|
||||||
|
| PHIE / PHIE_DT / PHIF | Porosity trong file LAS của F3 / nhãn chính của F3 (= −0.2018 + 0.0011·DT) / porosity của Volve |
|
||||||
|
| Posterior, prior, likelihood | Niềm tin sau / trước khi có dữ liệu / mức dữ liệu ủng hộ một giả thiết |
|
||||||
|
| Pre-registration | Ghi và khoá giả thuyết, cách đo, ngưỡng trước khi chạy |
|
||||||
|
| Realization | Một lần sinh ngẫu nhiên "trái đất" mô phỏng |
|
||||||
|
| Reflectivity | Chuỗi hệ số phản xạ theo thời gian |
|
||||||
|
| Regime (R10, R0, Rm5, R0h, R10tb) | Mức SNR seismic và mật độ anchor trong D2 |
|
||||||
|
| RML | Registration-Marginalized Learning, phương pháp của bài |
|
||||||
|
| -Sa (hậu tố) | Dùng posterior SMC (B3d-Sa: nhãn từ warp trung bình; M2-Sa: RML trên 64 hạt) |
|
||||||
|
| σ_a | Sai số pick của anchor (ms) |
|
||||||
|
| σ_post | Độ rộng posterior của warp (ms) |
|
||||||
|
| SMC tempering | Lấy mẫu bằng một đàn hạt, tăng dần "liều" likelihood từ 0 tới 1 |
|
||||||
|
| Soft-DTW / DILATE | Loss căn chỉnh chuỗi có co giãn, không có anchor |
|
||||||
|
| Std ratio | Độ lệch chuẩn dự đoán / của nhãn; < 1 nghĩa là dự đoán bị co |
|
||||||
|
| Synthetic seismogram | Trace nhân tạo dựng từ log giếng và wavelet |
|
||||||
|
| τ (tau) / t | Thời gian sonic (tích phân DT) / thời gian seismic thật |
|
||||||
|
| TDR | Quan hệ độ sâu ↔ thời gian |
|
||||||
|
| Trace, TWT, bin, cube | Chuỗi biên độ tại một vị trí / thời gian đi–về / ô lưới / cả khối 3D |
|
||||||
|
| Warp | Hàm đơn điệu biến τ thành t, gồm độ dịch b và tốc độ tương đối g |
|
||||||
|
| Wavelet | Xung seismic có băng tần hữu hạn |
|
||||||
|
| Well tie | Chỉnh TDR để synthetic khớp seismic tại giếng |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Phụ lục B. Câu hỏi tự kiểm tra
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>1. Vì sao không thể ghép thẳng log giếng với trace seismic?</summary>
|
||||||
|
|
||||||
|
Log đo theo độ sâu (m), seismic đo theo thời gian (ms). Phải có TDR để đổi, và TDR trên F3 sai 14–66 ms, lớn hơn một chu kỳ sóng (17–20 ms).
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>2. Nhãn lệch ngẫu nhiên làm dự đoán của mạng ra sao, và vì sao?</summary>
|
||||||
|
|
||||||
|
Dự đoán bị làm mờ. MSE học trung bình của các nhãn, ở đây là trung bình của nhiều bản dịch, giống ảnh chụp khi tay run. Các thành phần tần số cao bị nhân với e^{−2π²σ²f²}.
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>3. Thêm một loss ép phương sai dự đoán to lên (L_Var) có sửa được việc bị mờ không?</summary>
|
||||||
|
|
||||||
|
Không. Nó làm biên độ to ra nhưng không khôi phục được thông tin về pha đã mất. Ảnh vẫn mờ, chỉ đậm hơn.
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>4. Khác biệt cốt lõi giữa RML và soft-DTW là gì?</summary>
|
||||||
|
|
||||||
|
Không phải ở công thức "soft-min". Khác ở chỗ ngân hàng căn chỉnh đến từ đâu: RML dùng posterior có anchor và vật lý; soft-DTW cho phép mọi đường căn chỉnh trong một dải với trọng số như nhau, không có anchor.
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>5. Vì sao bỏ anchor thì hỏng?</summary>
|
||||||
|
|
||||||
|
Mệnh đề 2: dịch cả dự đoán lẫn mọi warp cùng một lượng thì loss gần như không đổi, nên không có gì ghim thời gian tuyệt đối. Thí nghiệm: bỏ anchor làm sai số warp tăng từ khoảng 3 ms lên 31–33 ms.
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>6. Khi nào học trên cả ngân hàng (M2-Sa) có lợi hơn dùng một nhãn trung bình (B3d-Sa)?</summary>
|
||||||
|
|
||||||
|
Khi posterior rộng (σ_post lớn). Posterior hẹp thì mọi phiên bản gần như trùng nhau, nên ngân hàng không thêm gì.
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>7. Vì sao P2r phải ghi là "deviation"?</summary>
|
||||||
|
|
||||||
|
Protocol P2 nói nếu G-B trượt thì chẩn đoán rồi pivot. Phương án chạy lại trên realization mới chỉ được thiết kế sau khi đã thấy P2 trượt. Kết luận G-B của P2 vẫn giữ nguyên; P2r là một đăng ký trước mới.
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>8. Kết quả F3 có nghĩa là phương pháp sai không?</summary>
|
||||||
|
|
||||||
|
Không hẳn. Nó nghĩa là trên 4 giếng F3, với 2 giếng train mỗi mô hình, phương pháp không thắng được đối thủ, và khác biệt giữa các phương pháp nhỏ hơn khác biệt giữa các seed. Không được claim ưu thế trên field. Kết luận trên synthetic vẫn đứng, nhưng chỉ trong phạm vi synthetic và với σ_a đúng.
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>9. Vì sao cần mỏ Volve?</summary>
|
||||||
|
|
||||||
|
Nhãn F3 là sonic đổi đơn vị, và cùng log sonic sinh ra cả nhãn lẫn trục thời gian. Porosity ở Volve tính độc lập với sonic, nên kiểm tra được xem kết quả có phụ thuộc vào đặc thù đó không. Thực tế trên Volve không phương pháp nào có kỹ năng ở giếng giấu, nên câu hỏi này vẫn chưa được trả lời (mục 11.6).
|
||||||
|
</details>
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Đọc tiếp
|
||||||
|
|
||||||
|
- [plan.md](plan.md): kế hoạch đầy đủ, số liệu audit, thiết kế thí nghiệm, rủi ro, nhật ký quyết định (§12).
|
||||||
|
- [theory.md](theory.md): chứng minh Mệnh đề 1–2, heuristic λ, Bổ đề 1–5; mục 6 là bản tiếng Việt của Mệnh đề 3–6 và Hệ quả 3–4.
|
||||||
|
- [research/pivot-theory-benchmark.md](research/pivot-theory-benchmark.md): phân tích và lịch Pivot 1.
|
||||||
|
- [research/applicability-teapot.md](research/applicability-teapot.md), [research/applicability-results.md](research/applicability-results.md): điều kiện C1–C4, T3 và thử Teapot Dome.
|
||||||
|
- [research/porosity-research-gap-survey.md](research/porosity-research-gap-survey.md): khảo sát tài liệu.
|
||||||
|
- [research/p3-code-review.md](research/p3-code-review.md): rà soát code P3.
|
||||||
|
- [`report.html`](../report.html): báo cáo tiến độ có hình.
|
||||||
|
- `paper/main.tex`: bản thảo bài báo.
|
||||||
|
- Tài liệu gốc nên đọc trước: Cuturi & Blondel (2017) về soft-DTW; Buland & Omre (2003) về tie Bayes; Lakshminarayanan et al. (2017) về deep ensemble; Gneiting & Raftery (2007) về CRPS.
|
||||||
181
docs/plan.md
181
docs/plan.md
File diff suppressed because one or more lines are too long
@@ -31,7 +31,7 @@ N* (power ≥ 0.8, sign test, n ≤ 40) theo sai số đăng ký của reference
|
|||||||
|
|
||||||
(— : không đạt 0.8 với n ≤ 40.) Tỉ số band RMSE trung vị M2-Sa / đối thủ: 0.80–0.92 ở σ_ref = 0, về ≈ 1 ở 4 ms, > 1 ở 8 ms.
|
(— : không đạt 0.8 với n ≤ 40.) Tỉ số band RMSE trung vị M2-Sa / đối thủ: 0.80–0.92 ở σ_ref = 0, về ≈ 1 ở 4 ms, > 1 ở 8 ms.
|
||||||
|
|
||||||
Hệ quả cho T0 Teapot (C4, giả định mức Rm5 như §4): cần khoảng 11–18 giếng test có reference TD độc lập với sai số ≲ 0.5 ms, cộng ≥ 3 giếng TD ngoài test cho C3. Với σ_ref ≥ 1.5 ms thì không còn ô Rm5 nào khả thi; với σ_ref ≥ 3 ms thì không ô nào khả thi. Sai số bulk shift datum/statics giữa checkshot và seismic cũng tính vào σ_ref.
|
Hệ quả cho T0 Teapot (C4, giả định mức Rm5 như §4): cần khoảng 11–18 giếng test có reference TD độc lập với sai số ≲ 0.5 ms, cộng ≥ 3 giếng TD ngoài test cho C3. Với σ_ref ≥ 1.5 ms thì không còn ô Rm5 nào khả thi trong lưới n ≤ 40; với σ_ref ≥ 3 ms thì không ô nào khả thi trong lưới đó. (Sửa 04/11/2026: ngoài lưới, công thức của `scripts/27_t3_power.py` cho ô Rm5, N_train = 16 ở 1,5 ms N* = 58 giếng, nên với 115 giếng test của Teapot thì σ_tol = 1,5 ms như cổng P-a khai báo; bài báo Sec. 6.6 nay nêu rõ điều này.) Sai số bulk shift datum/statics giữa checkshot và seismic cũng tính vào σ_ref.
|
||||||
|
|
||||||
## T0 Teapot Dome (29/10/2026) — trượt, dừng Teapot
|
## T0 Teapot Dome (29/10/2026) — trượt, dừng Teapot
|
||||||
|
|
||||||
@@ -59,7 +59,7 @@ Khai báo: Deviation 2 trong `applicability-teapot.md` (băm v2 07:11:29 UTC, tr
|
|||||||
|
|
||||||
## Dùng trong bài (29/10/2026)
|
## Dùng trong bài (29/10/2026)
|
||||||
|
|
||||||
- **T3** → bài mục 6.5 (*Detectability of a gain at blind wells*, exploratory), bảng `tab:t3`. Hệ quả 4 (bài mục 4.5: dấu của lợi ích đo được đúng với dấu thật chỉ khi σ_r < σ/√2) dự báo điểm cắt σ/√2 = 3,0/4,1/5,1 ms; tỉ số band RMSE trung vị cắt 1 ở 3,6–4,3 ms (ba ô N = 16). Bài ghi rõ phép phân tích được khai báo trước khi chạy nhưng sau khi cả hai field gate trượt, và nêu Deviation 1.
|
- **T3** → bài mục 6.6 (từ 02/11/2026; trước đó 6.5) (*Detectability of a gain at blind wells*, exploratory), bảng `tab:t3`. Hệ quả 4 (bài mục 4.5: dấu của lợi ích đo được có thể đúng với dấu thật chỉ khi σ_r < σ/√2; từ 02/11/2026 bài ghi đây là điều kiện cần ở mọi tần số nhưng không đủ, `docs/plan.md` §12 ý 32) đặt điểm cắt dưới σ/√2 = 3,0/4,1/5,1 ms khi không có shrinkage, và bằng σ/√2 ở bậc đầu; tỉ số band RMSE trung vị cắt 1 ở 3,6/3,8/4,3 ms (ba ô N = 16, nội suy tuyến tính), thấp hơn σ/√2 ở R0 và Rm5, cao hơn 0,6 ms ở R10, điều shrinkage cho phép. Bài ghi rõ phép phân tích được khai báo trước khi chạy nhưng sau khi cả hai field gate trượt, và nêu Deviation 1.
|
||||||
- **C1–C4 và phép kiểm hồi cứu F3, Volve** → bài mục 6.6, đoạn *Neither test could have detected the effect*: ghi là post hoc, với ngưỡng C1, C2 lấy cơ học từ Thí nghiệm 2 (P2r).
|
- **C1–C4 và phép kiểm hồi cứu F3, Volve** → bài mục 6.7 (trước 02/11/2026 là 6.6), đoạn *Neither test could have detected the effect*: ghi là post hoc, với ngưỡng C1, C2 lấy cơ học từ Thí nghiệm 2 (P2r).
|
||||||
- **Teapot T0 và pilot P-a** → bài mục 6.6, đoạn *Limits of field validation*: ghi là post hoc, exploratory; dùng 152 giếng, 4 bảng TD, tối đa 2 giếng có reference độc lập, σ̂_knot 6,75 ms (CI 90% 4,1–9,4) so với 1,5 ms.
|
- **Teapot T0 và pilot P-a** → bài mục 6.7, đoạn *Limits of field validation*: ghi là post hoc, exploratory; dùng 152 giếng, 4 bảng TD, tối đa 2 giếng có reference độc lập, σ̂_knot 6,75 ms (CI 90% 4,1–9,4) so với 1,5 ms.
|
||||||
- Nguồn số liệu từng câu: `paper/README.md`. Quyết định dừng Teapot: `docs/plan.md` §12 ý 23; `report.html` D-11.
|
- Nguồn số liệu từng câu: `paper/README.md`. Quyết định dừng Teapot: `docs/plan.md` §12 ý 23; `report.html` D-11.
|
||||||
|
|||||||
118
docs/research/bench-generator.md
Normal file
118
docs/research/bench-generator.md
Normal file
@@ -0,0 +1,118 @@
|
|||||||
|
# Bộ sinh D2 với tham số sai mô hình (misspecification) cho S2
|
||||||
|
|
||||||
|
Ngày 29/10/2026. Hạng mục `p6-gen` của phase P6 (plan §12 ý 22, quyết định 2: ba trục sai mô hình "rock physics sai hệ số; wavelet sai pha và băng thông; σ_b / prior drift sai"). Tài liệu này mô tả ngữ nghĩa của từng trục và từng khóa, cái gì **là** và cái gì **không là** sai mô hình so với giả định của registration, bảo đảm common random numbers (CRN), số QC trên realization dev 902, và các quyết định còn mở cho giai đoạn dev (902–905) trước khi khóa `configs/protocol_bench.yaml`.
|
||||||
|
|
||||||
|
Phạm vi: chỉ bộ sinh và test. Runner, protocol và việc chọn mức cuối cùng thuộc bước sau. **Đường mặc định không đổi:** `tests/data/d2_fingerprints.json` ghi SHA-256 của mọi trường `D2Well` và mọi output của `observe()` (rid 900, 8, 902; c ∈ {0, 1, 2}; SNR 10 dB; σ_a 7 ms; 8 giếng test + 4 giếng pool đầu) lấy **trước** khi sửa code; `tests/test_d2_misspec.py` tính lại và so khớp từng bit. Kết quả P2/P2r vì vậy vẫn tái lập.
|
||||||
|
|
||||||
|
## 1. Giao diện
|
||||||
|
|
||||||
|
```python
|
||||||
|
D2Realization(cfg, rid, hg, drift, wavelet, misspec: dict | None = None)
|
||||||
|
```
|
||||||
|
|
||||||
|
`misspec` là `None` (danh nghĩa) hoặc dict với tối đa ba khối con `rock_physics`, `wavelet`, `drift`; khóa và giá trị mặc định ở `synth_d2.MISSPEC_DEFAULTS`. Khóa hoặc khối lạ → `ValueError` (một lỗi chính tả trong protocol đã khóa không được âm thầm có nghĩa "danh nghĩa"). `observe()` giữ nguyên chữ ký và nguyên khóa output. Tiện ích: `preset_misspec(cfg, name)` đọc `cfg["misspec_presets"][name]` (bỏ khóa `note`; `None`/`"nominal"` → `None`); `normalize_misspec`, `active_axes`.
|
||||||
|
|
||||||
|
| Khối | Khóa | Mặc định | Ý nghĩa |
|
||||||
|
|---|---|---|---|
|
||||||
|
| `rock_physics` | `dt_slope_factor` | 1.0 | φ = A + B·DT: B → B·f (B danh nghĩa 0.0011 /(µs/m)) |
|
||||||
|
| | `dt_intercept_factor` | 1.0 | A → A·f (A danh nghĩa −0.2018; DT_matrix = −A/B = 183 µs/m) |
|
||||||
|
| | `rho_slope_factor` | 1.0 | RHOB = ρ0 − ρ1·φ: ρ1 → ρ1·f (1600) |
|
||||||
|
| | `rho_intercept_factor` | 1.0 | ρ0 → ρ0·f (2650) |
|
||||||
|
| | `unit_dt_intercept_sd` | 0.0 | A → A·(1 + sd·ζ_u) theo **từng đơn vị địa tầng** (46 sub-unit của khung S_ref), ζ_u ~ N(0, 1) cấp realization, stream riêng `[rid, 20261029, 1]` |
|
||||||
|
| | `region` | `all` | giếng chịu tác động: `all` \| `test` \| `pool` |
|
||||||
|
| `wavelet` | `phase_deg` | 0.0 | xoay pha hằng (trong họ của registration) |
|
||||||
|
| | `minphase_frac` | 0.0 | s ∈ [0, 1]: phổ pha s·θ_min(f) của phổ biên độ danh nghĩa (cepstral); giữ phổ biên độ; đã bỏ trễ khối bằng cách căn lại tại lag cực đại tương quan chéo với wavelet danh nghĩa |
|
||||||
|
| | `peak_freq_factor` | 1.0 | w(t) → w(p·t): phổ kéo giãn p lần |
|
||||||
|
| | `delay_ms` | 0.0 | trễ khối của wavelet (làm bộ 0,5 ms): sự kiện địa chấn lệch so với anchor |
|
||||||
|
| | `Q` | `null` | suy giảm constant-Q biến thiên theo thời gian so với `Q_t_ref_ms` (áp trong forward, không phải trong wavelet dừng) |
|
||||||
|
| | `Q_t_ref_ms` | 400.0 | thời gian tham chiếu (đỉnh cửa sổ mở rộng); gain exp(−π f Δt/Q), Δt = t′ − t_ref |
|
||||||
|
| | `Q_dispersion` | true | pha Kolsky–Futterman (2 f Δt/Q)·ln(f/f_ref), f_ref = tần số đỉnh của wavelet dừng thật |
|
||||||
|
| `drift` | `sigma_b_factor`, `sigma_g_factor`, `ell_factor` | 1.0 | sự thật rút từ (m_g, σ_g·f, ℓ·f, σ_b·f); cùng z_g, z_b |
|
||||||
|
| | `step_ms` | 0.0 | bước nhảy J của t(τ) ngay dưới `step_horizon`, **không nhân với c** |
|
||||||
|
| | `step_width_ms` | 12.0 | độ rộng (theo τ) của dị thường log-slowness tạo ra bước nhảy |
|
||||||
|
| | `step_horizon` | `Truncation` | tên horizon trong `cfg["horizons"]` |
|
||||||
|
| | `jitter_sd_ms` | 0.0 | jitter Matérn-3/2 của t(τ) trên lưới warp 4 ms, stream riêng `[rid, 20261029, 2, k]` theo giếng |
|
||||||
|
| | `jitter_ell_ms` | 8.0 | độ dài tương quan của jitter |
|
||||||
|
|
||||||
|
Thuộc tính và phương thức mới của realization:
|
||||||
|
|
||||||
|
- `R.misspec` (đã điền mặc định), `R.misspec_active` (chỉ các khóa cường độ khác danh nghĩa; `{}` = danh nghĩa), `R.misspec_info["monotone_repairs"]`.
|
||||||
|
- `R.wavelet`, `R.w_fine`: **wavelet dừng thật** (4 ms / lưới mịn); khi trục wavelet danh nghĩa thì chính là object đầu vào. `R.wavelet_nominal`, `R.w_fine_nominal`: tham chiếu của nhà phân tích. Với Q, `R.w_fine` là wavelet tại t_ref; `R.true_wavelet_at(t_ms)` cho kernel hiệu dụng tại thời gian t. Lưu ý cho runner: scripts/14 dùng `R.w_fine` làm nhánh wavelet "true"; dưới Q không có một wavelet thật duy nhất.
|
||||||
|
- `R.drift_true`, `R.Lg_true`: siêu tham số và Cholesky mà sự thật rút ra (bằng `R.drift`, `R.Lg` khi danh nghĩa).
|
||||||
|
- `R.phi_to_ai_true(phi, unit=None)`: ánh xạ φ → AI thật (bằng `phi_to_ai` khi danh nghĩa); `R.ai_log_true(w, obs)`: AI thật trên trục τ của log (chỉ số đơn vị lấy dọc warp thật); `R.rp_applies(name)`. `obs["ai_log"]` **luôn danh nghĩa**.
|
||||||
|
- `R.true_warp(w, c)` → (b, g) gồm phần GP nhân c và dị thường bước (gộp vào g); `R.true_warp_grid(w, c)` → t(τ) trên lưới gồm cả jitter. `obs["t_of_tau_true"]` luôn là sự thật đầy đủ; `obs["g"]` không chứa jitter (chẩn đoán kiểu `ll_true` từ `[b, g]` sẽ sai khi có jitter).
|
||||||
|
|
||||||
|
## 2. Cái gì là sai mô hình so với giả định của registration
|
||||||
|
|
||||||
|
Registration (`pipeline.register`, SMC ở scripts/14) giả định: (i) `obs["ai_log"]` theo quan hệ F3 danh nghĩa; (ii) wavelet **dừng**, phổ biên độ ước lượng thống kê (128 ms, Hann) từ trace giữa của giếng train, pha **hằng** trên lưới 15° (fit_phase, rồi phase_R qua log Z của SMC), biên độ α ≥ 0 và σ_n profile theo từng mẫu warp; (iii) warp prior Matérn-3/2 với MAP-II cho (m_g, σ_g, ℓ) dưới hyperprior log-normal, σ_a = 7 ms và σ_b = 50 ms cố định, |g| ≤ g_max = 1.
|
||||||
|
|
||||||
|
**Rock physics.** Sai hệ số đồng đều (bốn factor) làm ln AI thay đổi gần **affine** theo φ trên dải φ của D2 (0,20–0,43): với sai 15–20 % hệ số, ln AI đổi 3,9 % mà phần phi affine chỉ 0,56 % của dải ln AI (test `test_rock_physics_uniform_error_is_near_affine`). Vì r ≈ ½ Δln AI và α được profile, synthetic chỉ đổi một hệ số nhân: registration **không thấy** (QC: sai số trong họ 0,072 = danh nghĩa với dt_slope_factor 0,85 hoặc 1,3). SNR cũng không đổi vì nhiễu được chuẩn theo công suất tín hiệu sạch đã sai mô hình. Đây là trục "rock physics sai hệ số" theo nghĩa đen của plan §5.5, và nó là trục rỗng đối với registration; nó được giữ trong preset như một phần của L1/L2 để mô tả đúng plan, còn phần **không** hấp thụ được là `unit_dt_intercept_sd`: matrix slowness khác nhau giữa các đơn vị địa tầng (thạch học) tạo **phản xạ tại biên đơn vị không do φ**, không có trong synthetic danh nghĩa. Với sd = 0,05 (DT_matrix ±9 µs/m, tức vận tốc matrix 5450 → ~5200–5700 m/s) sai số mô hình 0,22; sd = 0,10 → 0,41 (hình (a): bậc thang ln AI_true/AI_nom theo đơn vị). `region: test` chỉ làm sai mô hình ở giếng test: đây là covariate shift cho mạng (câu hỏi của plan §5.5 "φ–DT ở vùng test khác vùng train"), **không** phải câu hỏi của S2 về registration; để sẵn vì rẻ, không khuyến nghị dùng trong S2.
|
||||||
|
|
||||||
|
**Wavelet.** `phase_deg` và `peak_freq_factor` nằm **trong họ**: QC wv_C (45°, ×1,2) cho pha khớp đúng 45° và sai số trong họ 0,050 (26 dB), thậm chí nhỏ hơn danh nghĩa 0,072 vì wavelet ngắn hơn được ước lượng tốt hơn trong 128 ms. Chúng là núm phụ (sanity/kiểm tra họ), không phải trục chính. Ngoài họ: (a) `minphase_frac` — pha phụ thuộc tần số với **cùng** phổ biên độ, nên ước lượng thống kê vẫn đúng biên độ nhưng không pha hằng nào khớp (tương quan tốt nhất 0,82 ở s = 1); (b) `Q` — wavelet biến thiên theo thời gian: một wavelet thống kê là trung bình trên 400–1300 ms nên sai ở cả hai đầu (hình (c): Q = 80 làm tần số đỉnh 59 → 32 Hz từ 600 đến 1100 ms). (c) `delay_ms` — xung đột **hệ thống** giữa địa chấn và anchor (anchor gắn với warp thật; σ_a = 7 ms chỉ mô hình sai số ngẫu nhiên); pha hằng bắt chước một phần (chọn −30°/−75° cho 2/4 ms), phần còn lại 0,24/0,40. Nhiễu `noise_unit` luôn được tạo dạng bằng wavelet danh nghĩa: nhiễu không suy giảm cùng tín hiệu (thực tế) và CRN sạch hơn (chỉ tín hiệu đổi).
|
||||||
|
|
||||||
|
**Drift.** Ba factor rút sự thật từ prior khác: MAP-II hấp thụ một phần (dr_L1: σ_g thật 0,156 → fit 0,133; ℓ thật 36 → fit 91 ms vì hyperprior trung vị 150 ms); σ_b thật 58 ms vượt σ_b = 50 ms cố định của registration ở ×3. Ngoài họ GP: `step_ms` là dị thường log-slowness cục bộ a = ln(1 + J/(Δτ Σ e^{g_i})) trên n_w = round(w/Δτ) nút ngay sau τ_h = t⁻¹(t_h) (bước nhảy **đúng bằng J** dưới dị thường nhờ quy tắc hình thang; ramp trải (n_w + 1) ô lưới bắt đầu từ ô chứa τ_h; t(τ_h) = t_h không đổi; a ≈ 0,50 cho J = 8, w = 12 và 0,85 cho J = 16, đều dưới g_max = 1). Monotone với mọi J > −Δτ Σ e^{g_i} (≈ −12 ms). `jitter` được cộng vào t(τ) chứ không vào g: tích phân của nhiễu ngắn trong g là drift kiểu Brown (tần thấp), không phải jitter; đổi lại jitter không biểu diễn được bằng g. Bảo vệ đơn điệu: nếu Δt giữa hai nút < 0,1·Δτ thì nâng lên (đếm trong `misspec_info`; 0 lần ở mọi mức đã thử). Anchor luôn nhất quán với warp thật: τ_k = t_true⁻¹(t_b), t_k = t_b + σ_a ε_k (kiểm 1e-13 ms trong test).
|
||||||
|
|
||||||
|
## 3. Bảo đảm CRN
|
||||||
|
|
||||||
|
Realization sai mô hình dùng **đúng** stream ngẫu nhiên của realization danh nghĩa, tiêu thụ theo đúng thứ tự: vị trí giếng, φ0, offset đơn vị, GRF từng giếng, nhiễu trắng, z_g, z_b, ε_a — test `_assert_crn` so khớp từng bit `phi_t, noise_unit, z_g, z_b, boundaries_t, eps_a` và tên/vị trí giếng. Hai nguồn ngẫu nhiên **mới** lấy từ stream riêng, gieo bằng rid (và chỉ số giếng cho jitter), chỉ được rút khi núm tương ứng bật, nên không chạm stream danh nghĩa. Hệ quả: trong một ô bench, hiệu số giữa ô sai mô hình và ô danh nghĩa chỉ đến từ phép biến đổi (seismic với rock physics/wavelet; warp với drift), không từ mẫu ngẫu nhiên khác. Sửa test ở `tests/test_d2.py` không cần vì đường danh nghĩa không đổi; test mới ở `tests/test_d2_misspec.py` (15 test, trong đó 3 test fingerprint theo rid, bỏ qua nếu thiếu input hoặc numpy/scipy khác bản ghi 2.5.4/1.18.1).
|
||||||
|
|
||||||
|
## 4. QC trên realization dev 902 (`scripts/33_bench_generator_qc.py`, c = 1, σ_a = 7 ms, địa chấn sạch, 16 giếng pool)
|
||||||
|
|
||||||
|
"Sai số mô hình" = RMS(địa chấn sạch − α·synthetic từ `ai_log` danh nghĩa tại warp thật)/RMS(địa chấn), α profile; "trong họ" = wavelet thống kê từ trace giếng train + pha hằng tốt nhất trên lưới 15°. Quy ra dB tương đương SNR (−20 log10); nhiễu của regime: R10 = 10 dB (tỉ số 0,32), Rm5 = −5 dB (1,78). Mức danh nghĩa: 0,010 với wavelet F3 thật, **0,072 (22,8 dB) trong họ** (sàn của ước lượng thống kê 128 ms).
|
||||||
|
|
||||||
|
| Preset | Khối | Đổi địa chấn (RMS tương đối, cửa sổ chính) | Sai số mô hình, wavelet danh nghĩa | Sai số mô hình **trong họ** (dB) | Ghi chú |
|
||||||
|
|---|---|---|---|---|---|
|
||||||
|
| nominal | — | 0 | 0,010 | 0,072 (22,8) | pha 0° |
|
||||||
|
| rp_C | 4 factor 1,15/1,15/1,2 | 0,037 | 0,012 | 0,073 (22,8) | hấp thụ hoàn toàn; ln AI đổi 0,033 RMS |
|
||||||
|
| rp_L1 | rp_C + unit sd 0,05 | 0,186 | 0,215 | 0,226 (12,9) | ζ_u tới ±1,8 → DT_matrix ±16 µs/m |
|
||||||
|
| rp_L2 | rp_C + unit sd 0,10 | 0,371 | 0,400 | 0,406 (7,8) | |
|
||||||
|
| wv_C | pha 45°, đỉnh ×1,2 | 0,839 | 0,767 | 0,050 (26,0) | pha khớp 45°; trong họ |
|
||||||
|
| wv_L1 | minphase 1,0 | 0,797 | 0,609 | 0,609 (4,3) | tương quan pha hằng tốt nhất 0,82 (13°); SMC chọn 15° |
|
||||||
|
| wv_L2 | wv_L1 + Q 80 | 0,609 | 0,667 | 0,595 (4,5) | đỉnh 59/34/32 Hz tại 600/850/1100 ms; wavelet thống kê đỉnh 36 Hz |
|
||||||
|
| dr_L1 | σ_b ×3, σ_g ×1,5, ℓ ×0,5 | 0 | 0,015 | 0,073 (22,7) | Δwarp RMS 31,9 ms (max 92) chủ yếu do b; Laplace N = 4: RMSE 4,54 ms (danh nghĩa 4,28), z RMS 0,98 |
|
||||||
|
| dr_L2 | bước 8 ms (w 12) + jitter 1 ms (ℓ 8) | 0 | 0,019 | 0,075 (22,5) | bước đạt 8,2 ms trung bình (6,3–10,7 vì đo qua ramp ±σ jitter), τ_h 573–1112 ms, a = 0,50; jitter RMS 0,93; Laplace RMSE 4,57, z RMS 1,26 |
|
||||||
|
|
||||||
|
Quét từng núm (`--sweep`, `outputs/bench/dev/generator_sweep.json`), sai số trong họ: unit sd 0,025/0,05/0,10/0,15 → 0,127/0,217/0,391/0,531 (17,9/13,3/8,2/5,5 dB); dt_slope 0,85 hay 1,3 → 0,072 (= danh nghĩa); minphase 0,25/0,5/0,75/1 → 0,197/0,342/0,486/0,609 (14,1/9,3/6,3/4,3 dB); Q 160/80/40 → 0,259/0,445/0,652 (11,7/7,0/3,7 dB); peak ×0,8/×1,2 → 0,096/0,050; delay 2/4 ms → 0,237/0,399. Drift: bước 4/8/16 ms → Δwarp 3,1/6,1/12,3 ms, Laplace RMSE 4,40/4,62/5,23 ms, z 1,17/1,26/1,47; jitter 0,5/1/2 ms → 0,48/0,97/2,04 ms, RMSE 4,26/4,27/4,46; σ_b ×2/×3/×5 → RMSE 4,08/3,91/3,67 (z 1,06/1,00/0,85); σ_g ×1,5/×2 → 4,65/5,07 (z 0,98/0,83); ℓ ×0,5/×0,25 → 4,03/3,77 (z 1,10/1,13). Kết luận: tie **chỉ anchor** gần như không nhạy với mọi núm drift ở σ_a = 7 ms (sai số anchor che bước nhảy ≤ 16 ms); sai mô hình drift chỉ bộc lộ ở posterior có địa chấn (σ_post ≈ 0,85 ms ở R10, 3 ms ở Rm5), nơi prior trơn (ℓ fit 90–120 ms) không biểu diễn được bước 8 ms trong 12 ms hay jitter ℓ = 8 ms. QC này không chạy SMC; mức drift phải chọn bằng chẩn đoán SMC trên dev (bước tiếp theo).
|
||||||
|
|
||||||
|
Hình `outputs/bench/dev/generator_qc.png`: (a) ln(AI_true/AI_nom) dọc log P00, (b)–(c) wavelet và phổ, (d) đổi warp dọc τ, (e) sai số trong họ theo preset so với mức nhiễu R10/Rm5, (f) tie chỉ anchor.
|
||||||
|
|
||||||
|
### 4b. Registration + SMC trên các preset (`--smc`, cuda:1, một worker; `outputs/bench/dev/smc_qc_rid902.json`)
|
||||||
|
|
||||||
|
Chạy đúng cấu hình P2r cho từng preset và nominal: `pipeline.register` (MAP-II, wavelet thống kê, pha anchor-based phase0, tie B3c/B3d) rồi SMC tie posterior với wavelet phase_R, γ = 1/κ, 1024 hạt, 4 giếng train đầu, c = 1, rid 902 (log `logs/runs/20261029-130144_bench_gen_smc_rid902/`, 18 ô, 32,5 phút; ô R10 khoảng 3 phút vì bước khớp phase_R, ô Rm5 khoảng 45 s). Giá trị là trung bình 4 giếng; warp RMSE/cov90/width90 của trung bình posterior SMC trên cửa sổ chính; r_post = tương quan synthetic tại trung bình posterior với địa chấn.
|
||||||
|
|
||||||
|
| Preset | R10: phase_R | SMC RMSE (ms) | cov90 | width90 (ms) | r_post | B3c / B3d (ms) | Rm5: phase_R | SMC RMSE | cov90 | width90 | r_post | B3c / B3d |
|
||||||
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
||||||
|
| nominal | −1° | 0,99 | 0,74 | 2,0 | 0,93 | 4,49 / 3,65 | 6° | 2,95 | 0,79 | 8,1 | 0,46 | 6,49 / 3,59 |
|
||||||
|
| rp_C | 4° | 1,02 | 0,69 | 2,1 | 0,92 | 4,49 / 3,65 | −1° | 2,87 | 0,79 | 7,6 | 0,47 | 6,49 / 3,59 |
|
||||||
|
| rp_L1 | 2° | 1,01 | 0,75 | 2,2 | 0,91 | 4,17 / 3,19 | 4° | 3,00 | 0,78 | 7,6 | 0,45 | 6,96 / 3,77 |
|
||||||
|
| rp_L2 | 6° | 1,24 | 0,76 | 3,0 | 0,85 | 5,60 / 3,26 | 1° | 3,07 | 0,81 | 8,2 | 0,41 | 8,26 / 3,60 |
|
||||||
|
| wv_C (thật 45°) | 54° | 0,92 | 0,70 | 1,8 | 0,89 | 3,84 / 3,28 | 48° | 3,62 | 0,85 | 8,6 | 0,38 | 6,81 / 3,47 |
|
||||||
|
| wv_L1 | 78° | **4,22** | **0,04** | 3,0 | 0,81 | 4,18 / 3,13 | 49° | 3,61 | 0,79 | 9,7 | 0,33 | 7,65 / 3,37 |
|
||||||
|
| wv_L2 | 56° | 3,06 | 0,26 | 3,5 | 0,85 | 3,68 / 3,11 | 27° | 3,04 | 0,91 | 10,1 | 0,32 | 7,49 / 3,31 |
|
||||||
|
| dr_L1 | 3° | 2,09 | 0,69 | 4,2 | 0,76 | 4,17 / 3,97 | 2° | 3,07 | 0,90 | 12,5 | 0,23 | 7,88 / 4,28 |
|
||||||
|
| dr_L2 | 0° | 2,22 | 0,64 | 3,7 | 0,79 | 4,15 / 3,81 | −2° | 3,25 | 0,68 | 7,2 | 0,49 | 8,21 / 3,66 |
|
||||||
|
|
||||||
|
Đọc kết quả:
|
||||||
|
|
||||||
|
- **Đối chứng đúng như dự đoán.** rp_C trùng nominal ở cả hai regime (trục "sai hệ số đồng đều" rỗng với registration). wv_C khôi phục pha thật trong một bước lưới (54°/48° so với 45°) và tie tốt như nominal.
|
||||||
|
- **Rock physics có bậc ở R10, không thấy ở Rm5.** sd 0,05 không đổi gì; sd 0,10 tăng RMSE 25 % và width 50 % mà vẫn hiệu chuẩn (cov90 0,76). Ở Rm5 nhiễu che hoàn toàn sai số mô hình (chỉ B3c xấu đi 6,5 → 8,3 ms). Trục này chỉ có lực ở SNR cao.
|
||||||
|
- **Pha phụ thuộc tần số là chế độ thất bại mạnh nhất, và là thất bại kiểu quá tự tin.** wv_L1 ở R10: RMSE 4,22 ms với width90 chỉ 3,0 ms → cov90 0,04, tệ hơn cả tie chỉ anchor B3d (3,13 ms); phase_R trôi tới 78°. Thêm Q (wv_L2) làm giảm thiệt hại (3,06 ms, cov90 0,26) vì suy giảm tần cao bớt phần tán sắc. Ở Rm5 posterior đủ rộng nên vẫn hiệu chuẩn (0,79–0,91) và RMSE chỉ tăng nhẹ (2,95 → 3,6). Hệ quả cho T4/Mệnh đề 5: đây là cơ chế tạo posterior lệch nhưng hẹp, khác hẳn trục drift.
|
||||||
|
- **Drift làm tăng sai số và độ rộng mà vẫn hiệu chuẩn.** dr_L1 và dr_L2 ở R10: RMSE gấp đôi (2,1–2,2 ms), width gấp đôi, cov90 0,64–0,69. Ở Rm5 dr_L1 làm posterior quá rộng (width 12,5 ms, cov90 0,90), dr_L2 hơi quá hẹp (0,68). Khác với tie chỉ anchor (mục 4), SMC thấy rõ hai mức này.
|
||||||
|
- phase0 (pha từ anchor) dao động −45°…75° dù pha thật 0°, nhắc lại vì sao P2 thất bại; chỉ phase_R có nghĩa.
|
||||||
|
|
||||||
|
## 5. Quyết định còn mở cho giai đoạn dev (902–905), trước khi khóa protocol
|
||||||
|
|
||||||
|
1. **Mức (sau 4b).** Rock physics: rp_L1 hiện tại (sd 0,05) là ô rỗng với SMC ở cả hai regime; đề nghị L1 = sd 0,10 (mức đầu tiên SMC thấy ở R10), L2 = sd 0,15 (sai số mô hình 0,53), và ghi trước rằng trục này được kỳ vọng rỗng ở Rm5. Wavelet: minphase 1,0 là mức "gãy" (posterior lệch 4 ms, cov90 0,04 ở R10); đề nghị L1 = minphase 0,5 (sai số mô hình 0,34 ≈ nhiễu R10) để có đáp ứng có bậc, L2 = minphase 1,0; Q nên là một ô riêng (cơ chế biến thiên theo thời gian) thay vì gộp vào L2, vì gộp làm giảm thiệt hại của tán sắc. Drift: dr_L1 và dr_L2 đã có bậc vừa phải (RMSE ×2, vẫn hiệu chuẩn) và có thể giữ; nếu cần một mức mạnh hơn thì bước 16 ms (a = 0,85). Mọi mức chốt trên 902–905 (lặp `--smc` trên 903–905, mỗi rid khoảng 30 phút một worker) rồi ghi vào protocol_bench cùng luật đạt; sau khi khóa không đổi.
|
||||||
|
2. **Trục rock physics.** Không dùng ô "chỉ sai hệ số đồng đều" làm ô chính (trục rỗng với registration; giữ rp_C làm bằng chứng trong bài). Giữ các factor đồng đều bên trong L1/L2 để bám câu chữ của plan hay bỏ hẳn cho sạch: cần một quyết định ghi vào protocol.
|
||||||
|
3. **Trục drift.** Hai mức hiện là hai cơ chế (siêu tham số sai; thành phần ngoài GP). Cần chọn: giữ như vậy (dễ quy kết) hay làm hai cường độ của cùng tổ hợp. Bước nhảy không nhân với c, nên ở c = 0 ô drift sẽ không còn là "không drift"; S2 chỉ chạy c = 1 nên không ảnh hưởng, nhưng protocol phải nói rõ.
|
||||||
|
4. **Núm phụ.** `phase_deg`, `peak_freq_factor` (trong họ) và `delay_ms`, `region` để làm kiểm tra bổ sung hoặc bỏ; nếu dùng `delay_ms` thì phải nói rõ đó là xung đột anchor–địa chấn, không phải "sai pha". `Q_dispersion` ảnh hưởng ít (Q 80: 0,517 có tán sắc so với 0,487 không, với wavelet danh nghĩa).
|
||||||
|
5. **Runner.** Nhánh wavelet "true" phải dùng `R.w_fine` (wavelet dừng thật) và ghi chú rằng dưới Q không có wavelet thật duy nhất; chẩn đoán từ `[b, g]` không hợp lệ khi có jitter; protocol phải ghi nguyên văn dict preset đã chuẩn hóa, SHA-256 của `configs/d2_synth_bench.yaml`, và đối chiếu fingerprint danh nghĩa.
|
||||||
|
6. **Dev.** Mọi thiết kế chỉ trên 902–905; QC từ chối rid ngoài tập này; realization 8–15 không được chạy trước khi khóa.
|
||||||
|
7. **Bài.** Khi viết, nói rõ trục rock physics của plan §5.5 theo nghĩa đen là bất biến với likelihood có α profile (một kết quả nhỏ nhưng đáng ghi), và rằng các mức được chọn sau khi xem dev 902–905 (thiết kế sau P2r, không phải confirmatory trừ khi luật đạt được ghi trước trong protocol_bench).
|
||||||
|
|
||||||
|
## 6. Tệp
|
||||||
|
|
||||||
|
- `ml_porosity/data/synth_d2.py`: `MISSPEC_DEFAULTS`, `normalize_misspec`, `active_axes`, `preset_misspec`, `phi_to_ai_coef`, `fractional_minimum_phase`, `true_stationary_wavelet`, `q_kernel`, `forward_fine_q`, các phương thức mới của `D2Realization`.
|
||||||
|
- `configs/d2_synth_bench.yaml`: bộ sinh = p2r + `regimes` (sao chép) + `misspec_presets` (placeholder).
|
||||||
|
- `tests/data/d2_fingerprints.json`, `tests/test_d2_misspec.py`.
|
||||||
|
- `scripts/33_bench_generator_qc.py` → `outputs/bench/dev/{generator_qc.json, generator_qc.png, generator_sweep.json, smc_qc_rid902.json}` (không theo dõi trong git); `--smc` chạy registration + SMC trên GPU (`--device cuda:1`, một worker, cap 2 GiB) hoặc `--device cpu` khi GPU đầy; nối tiếp theo ô đã xong.
|
||||||
286
docs/research/bench-protocol.md
Normal file
286
docs/research/bench-protocol.md
Normal file
@@ -0,0 +1,286 @@
|
|||||||
|
# protocol_bench: runner, hiệu chuẩn mức sai mô hình, tái lập P2r và bản nháp giao thức
|
||||||
|
|
||||||
|
Ngày viết: **29/10/2026** (phase P6, mức B; plan §12 ý 22 và 26; lịch §6.1 dự kiến 2–3/11, làm sớm). Trạng thái: **ĐÃ KHOÁ 14:39:20 UTC 29/10/2026** sau khi điều phối duyệt bản nháp và yêu cầu 7 sửa đổi (mục 1.4); `configs/protocol_bench.sha256` = `aa763f0a4f81125ea8441fdfba4361f68246c7a0be1c36d4bf8de2650a91a4c5`, `configs/protocol_bench.lock.json` (code `5ea2eb17…`, torch 2.14.0+cu130, 8 input, 102 artifact P2r, fingerprint rid 8/902 khớp). Chạy chính 29/10 14:43 → 30/10 02:16 UTC, đã xong toàn bộ (S1 560 ô train, S2 224 posterior + 224 train, S3+S4+S8 384 train; chi tiết `docs/plan.md` §12 ý 26). Summarize xong 02/11/2026 02:02 UTC; verdict cuối theo đúng lời phát biểu do `scripts/36_bench_verdicts.py` ghi (9/11 đạt; mục 8, `docs/plan.md` §12 ý 28). S7 đóng gói xong cùng ngày (`scripts/37_bench_package.py`, `benchmark/`; mục 9, §12 ý 29). Code commit 381b5ff. Tài liệu này ghi (1) thiết kế runner `ml_porosity/benchmark/` và CLI, (2) kết quả kiểm tra tái lập P2r qua runner mới, (3) hiệu chuẩn mức L1/L2 của ba trục sai mô hình trên realization dev, (4) tóm tắt giao thức `configs/protocol_bench.yaml` (ô, giả thuyết, luật), (5) ước tính chi phí và phân bổ GPU, (6) tác dụng phụ lên hash code của lock F3/Volve, (7) rủi ro còn mở, (8) kết quả và verdict, (9) gói benchmark S7. Mục 2 và 3 được điền khi có số; mọi số dev đều ghi rõ rid, N, regime.
|
||||||
|
|
||||||
|
Liên quan: `docs/research/pivot-theory-benchmark.md` §2.2 (S1–S8) và §6; `docs/research/bench-generator.md` (bộ sinh misspec, QC rid 902); `configs/protocol_p2r.yaml` (khoá; nguồn của regime, phương pháp, ngân sách, luật); `configs/protocol_p2.yaml` (khoá; registration, training, metric); bản đồ code của phase 1 (scratchpad `bench-code-map.md`, không theo dõi trong git).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 1. Runner `ml_porosity/benchmark/` và CLI
|
||||||
|
|
||||||
|
### 1.1 Mô-đun
|
||||||
|
|
||||||
|
| Mô-đun | Vai trò | Mẫu theo |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| `protocol.py` | `load_protocol` (kiểm hash input), `current_stamp` (protocol, code `ml_porosity/**/*.py` + `scripts/34_run_bench.py` + `scripts/run_bench.sh` + `pyproject.toml`, môi trường, input, artifact P2r tham chiếu, fingerprint bộ sinh danh nghĩa của rid 8 và 902), `freeze(check)` (khoá `.lock.json` + `.sha256`; từ chối khoá lần đầu nếu `outputs/bench/{s1,s2,s3,s4,s8,summary}` đã tồn tại, nếu còn `sha256: TBD` hoặc `status: DRAFT`), `check_rids` (rid 8–15 chỉ khi lock khớp; 900–905 chỉ với `--dev`; 0–7 luôn từ chối; không trộn), `dev_stamp` (khoá resume dev: chỉ protocol + bộ sinh), `fingerprint` | `ml_porosity/volve/protocol.py`, `scripts/11 check_rids` |
|
||||||
|
| `data.py` | `Inputs` (cfg bộ sinh, horizon grid, prior warp, wavelet, khối registration/training/metric của protocol_p2 qua `scripts/11 reg_settings`), `Inputs.realization(rid, preset)` (`D2Realization(..., misspec=preset_misspec(cfg, preset))`), `Inputs.observe` (giếng train = `pool[:N]` với anchor theo regime, 8 giếng test cùng SNR), `fingerprint_realization` (đúng hàm của `tests/test_d2_misspec.py`) | scripts 14/15 |
|
||||||
|
| `cells.py` | `Cell(study, regime, preset, c, N, rid, methods, backbone, posterior, delta_ms)`; liệt kê ô của S1/S2/S3/S4/S8 từ khối `studies:`; đường dẫn phẳng: posterior dùng chung theo setting `outputs/bench/posterior/<regime[__preset]>/r{rid}_c{c}_n{N}_s0{.csv,_particles.npz,_phase.json,.json}` (cùng layout P2r), train `outputs/bench/<study>/train/<setting>/cells/r{rid}_c{c}_n{N}[_d{Δ}][__tcn]{.csv,.npz,_diag.csv,.json}`; `--dev` → gốc `outputs/bench/dev/`, `repro` → `outputs/bench/repro/` | `volve/runner.py` reg_path/job_path |
|
||||||
|
| `registration.py` | `posterior_cell`: đúng `scripts/14 run_job` thu hẹp về nhánh estR mà P2r dùng; cùng stream ngẫu nhiên (`[k, i, 13]` mẫu anchor, `[k, 19]` fit pha, `[k, i, 17]` SMC), cùng ba mốc γ (g_old, g_acf, g_one; mốc đổi lịch tôi luyện nên giữ nguyên), chỉ lưu hạt g_acf (P2r còn lưu g_one, không phương pháp nào dùng) | scripts/14 |
|
||||||
|
| `training.py` | `train_cell`: đúng `scripts/15 run_cell` biến thể "a" (B3c-R, B3d-Sa, M2-Sa từ hạt; `run_d2.method_specs` cho Oracle/B3*/B4*/M*); thêm bank hai mode S8 (`two_mode_banks`), backbone TCN (`train_predict_tcn`, vòng lặp của `bank_train.train_predict` với `TCNHetero` và cờ cudnn deterministic như `f3.make_model`); nhánh CNN-GRU uỷ quyền nguyên vẹn cho `bank_train.train_predict` (không sửa `bank_train.py`/`rml.py` của T2) | scripts/15, `f3/training.py` |
|
||||||
|
| `runner.py` | job theo ô, pool `spawn`, `wait(FIRST_COMPLETED)` với ETA, fail-fast; sidecar `.json` mang fingerprint + SHA-256 artifact; `reusable` bỏ qua job khớp, **raise** nếu lệch (gốc output mới); `progress.json`; sắp xếp N lớn trước | `volve/runner.py` |
|
||||||
|
| `summary.py` | mọi phân tích đã khai báo (mục 4) dùng `scripts/13 gate_gb/boot` và luật cặp của `scripts/18`; đọc P2r cho ô có sẵn | scripts 13/18 |
|
||||||
|
| `repro.py` | so sánh ô tái lập với `outputs/p2r` (pha, hạt, chẩn đoán warp, metric train, dự đoán) → `outputs/bench/repro/comparison.json` | — |
|
||||||
|
| `devbudgets.py` | ngân sách TCN trên dev theo đúng luật `budget_selection` của protocol_p2 | scripts/11 `select_budgets` |
|
||||||
|
|
||||||
|
### 1.2 CLI và driver
|
||||||
|
|
||||||
|
```
|
||||||
|
scripts/34_run_bench.py <stage…> [--studies S1 S2 S3 S4 S8] [--device cuda:0] [--workers 4] [--gpu-mem-gb 6] [--threads 2]
|
||||||
|
[--regimes …] [--presets …] [--controls] [--rids …] [--dev] [--drift …] [--n-train …] [--seeds …]
|
||||||
|
stages: status | lock | posterior | train | summarize | repro | dev-budgets | all
|
||||||
|
scripts/run_bench.sh <stage…> # bọc runlog; env DEVICE WORKERS THREADS MEM_GB STUDIES REGIMES PRESETS RIDS DEV CONTROLS EXTRA
|
||||||
|
```
|
||||||
|
|
||||||
|
- `--dev`, `--drift`, `--n-train`, `--seeds` chỉ dành cho dev (900–905); với `--drift/--n-train` S1 bỏ loại trừ ô P2r (để chạy posterior danh nghĩa c = 1, N = 4/16 trên dev).
|
||||||
|
- `repro` chạy đúng một ô (`reproduction:` của protocol) trước khi khoá, ghi vào `outputs/bench/repro/`, không phải kết quả.
|
||||||
|
- Mọi lần chạy dài: `setsid nohup scripts/run_bench.sh … > logs/bench_<x>.out 2>&1 &`.
|
||||||
|
- Luồng: `OMP/MKL/OPENBLAS/NUMEXPR/NUMBA_NUM_THREADS` đặt tường minh (mặc định 2/worker), `PYTHONHASHSEED=0`, `CUBLAS_WORKSPACE_CONFIG=:4096:8` như `scripts/24`.
|
||||||
|
- Test: `tests/test_bench.py` (11 test: nhất quán protocol, đếm ô, đường dẫn, guard, fingerprint, TCN trên CPU, bank hai mode S8, bank đối chứng Ctl-GP, danh sách ngân sách với nhánh 500, fingerprint danh nghĩa, luật tổng hợp trên dữ liệu giả). Toàn bộ `tests/`: 216 pass, 1 skip (CUDA ẩn) sau khi sửa `tests/test_d2_misspec.py` cho tên preset `cand_*`.
|
||||||
|
- `scripts/35_bench_calibration.py`: bảng hiệu chuẩn từ `outputs/bench/dev/smc_qc_rid*.json` → `outputs/bench/dev/calibration.{csv,md}`.
|
||||||
|
|
||||||
|
### 1.3 Lệnh khoá (đã chạy 14:39 UTC, runlog `20261029-143914_bench_lock`) và lệnh chạy chính (điều phối khởi động 14:43 UTC bằng setsid nohup với ít worker hơn; bị SIGTERM 15:27 khi phiên agent kết thúc; chạy lại 15:41 UTC trong tmux, xem plan §12 ý 26. Lệnh dưới đây là mẫu: hãy bọc bằng `tmux new-session -d` thay cho `setsid nohup`)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 0. (sau khi duyệt) trong configs/protocol_bench.yaml: (a) đổi status thành "LOCKED 2026-11-0x"; (b) điền training.budgets_tcn
|
||||||
|
# từ outputs/bench/dev/budgets_tcn.json (stage dev-budgets, đang chạy lúc bàn giao) hoặc để null = budget-matched (phải nói trong bài);
|
||||||
|
# (c) nếu có sửa configs/d2_synth_bench.yaml sau bàn giao thì cập nhật inputs.d2_config.sha256:
|
||||||
|
.venv/bin/python -c "from ml_porosity.f3.protocol import digest; from pathlib import Path; print(digest(Path('configs/d2_synth_bench.yaml'), True))"
|
||||||
|
CUDA_VISIBLE_DEVICES= .venv/bin/python -m pytest -q -p no:cacheprovider tests/test_bench.py tests/test_d2_misspec.py tests/test_protocol.py
|
||||||
|
# 1. khoá (từ chối nếu còn DRAFT/TBD, nếu outputs/bench/{s1,s2,s3,s4,s8,summary} đã tồn tại, nếu fingerprint danh nghĩa rid 8/902 lệch)
|
||||||
|
scripts/run_bench.sh lock # = .venv/bin/python -m ml_porosity.runlog -n bench_lock -- .venv/bin/python scripts/34_run_bench.py lock
|
||||||
|
# 2. chạy chính (hai GPU, tách phiên); bộ nhớ đo được: worker SMC 1 556 MiB ở N = 16 (cap không chạm), worker train ≈ 710 MiB
|
||||||
|
setsid nohup env STUDIES="S1" REGIMES="R10 Rm5 R0h" DEVICE=cuda:0 WORKERS=4 MEM_GB=6 scripts/run_bench.sh posterior train > logs/bench_s1_cuda0.out 2>&1 &
|
||||||
|
setsid nohup env STUDIES="S1" REGIMES="R0 R10tb" DEVICE=cuda:1 WORKERS=4 MEM_GB=6 scripts/run_bench.sh posterior train > logs/bench_s1_cuda1.out 2>&1 &
|
||||||
|
setsid nohup env STUDIES="S2" REGIMES="R10" DEVICE=cuda:0 WORKERS=4 MEM_GB=6 scripts/run_bench.sh posterior train > logs/bench_s2_cuda0.out 2>&1 &
|
||||||
|
setsid nohup env STUDIES="S2" REGIMES="Rm5" DEVICE=cuda:1 WORKERS=4 MEM_GB=6 scripts/run_bench.sh posterior train > logs/bench_s2_cuda1.out 2>&1 &
|
||||||
|
setsid nohup env STUDIES="S3 S4 S8" DEVICE=cuda:1 WORKERS=4 scripts/run_bench.sh train > logs/bench_s348_cuda1.out 2>&1 &
|
||||||
|
scripts/run_bench.sh summarize
|
||||||
|
```
|
||||||
|
|
||||||
|
### 1.4 Sửa theo review của điều phối trước khi khoá (29/10, 14:15–14:39 UTC)
|
||||||
|
|
||||||
|
1. S2-H2: "12 cặp" → **14 cặp** (7 preset × 2 regime; `summary.py` đếm `len(regimes) × Σ preset` = 14).
|
||||||
|
2. S2-H1 `prediction`: số lấy đúng từ `calibration.md` (wv_L1: ×3.2 = 2.14 ms, cov90 0.11, B3c 4.30 ms, 4/4 rid; wv_L2: 3.93 ms, cov90 0.03, 3/4 rid; dr_L1/L2 1.55/2.27 ms so với B3c 3.48/4.52).
|
||||||
|
3. `calibration.procedure`: trục drift viết lại thành **hai cơ chế riêng** (dr_L1 siêu tham số trong họ GP; dr_L2 thành phần ngoài họ GP), bỏ câu "quy kết bằng hiệu".
|
||||||
|
4. `calibration.levels_vs_declared_band`: nêu rõ rp_L1 vượt dải L1 (0.5–1.0 × nhiễu R10) **+24 %** (1.24 ×) và wv_L1 **+8 %** (1.08 ×), lý do (registration mù với trục rock physics nên 0.075 ≈ danh nghĩa; không có mức pha "ôn hoà"); chọn phương án (b) giữ 0.10 và 0.5; phương án (a) đã cân nhắc và bác.
|
||||||
|
5. `reproduction.result`: ghi "bitwise exact" kèm con trỏ `outputs/bench/repro/comparison.json`.
|
||||||
|
6. `rules.multiplicity`: 9 claim, 11 verdict (S2-H1 theo trục), không hiệu chỉnh family-wise, báo mọi verdict kể cả trượt.
|
||||||
|
7. `training.budgets_tcn` điền từ `outputs/bench/dev/budgets_tcn.json` (stage `dev-budgets`, wall 1:03:53, 4 rid × 2 N × 2 seed): luật budget_selection của protocol_p2 chọn **125 cho mọi phương pháp TCN** — RMSE tổng tăng đơn điệu theo số vòng lặp (B3d-Sa-TCN 1.406/1.428/1.482/1.537/1.592; M2-Sa-TCN 1.389/1.429/1.469/1.521/1.616; Oracle-TCN 1.393/…/1.604); cực tiểu nằm ở biên danh sách ứng viên, danh sách giữ nguyên như protocol_p2 (không thêm ứng viên nhỏ hơn sau khi xem dev); ghi rõ trong protocol.
|
||||||
|
|
||||||
|
Sau sửa: `pytest tests/test_bench.py tests/test_d2_misspec.py tests/test_protocol.py` 31 pass; toàn bộ `tests/` 216 pass, 1 skip; `scripts/run_bench.sh lock` thành công; `freeze(check=True)` khớp lock; `check_rids([8..15])` chấp nhận realization chính, vẫn từ chối rid dev không có `--dev`.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 2. Kiểm tra tái lập P2r qua runner mới
|
||||||
|
|
||||||
|
Ô `reproduction:` của protocol: R10, rid 8, c = 1, N = 4 — chạy **lại từ đầu** qua `scripts/34_run_bench.py repro` (posterior SMC với P = 1024, mốc γ (g_old, g_acf, g_one), rồi huấn luyện 7 phương pháp × 5 seed ở ngân sách P2r) trên cuda:1 (1 worker, `--gpu-mem-gb 3`; runlog `20261029-133329_bench_repro_r8`, wall 3:48: posterior 142 s, train 73 s), so với `outputs/p2r/posterior/R10/r8_c1_n4_s0*` và `outputs/p2r/train/R10/cells/r8_c1_n4.*`. Kết quả (`outputs/bench/repro/comparison.json`):
|
||||||
|
|
||||||
|
| Đại lượng | Sai lệch tuyệt đối lớn nhất | Ghi chú |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| phase0 (đăng ký anchor) | 0 (0.0° = 0.0°) | `register()` CPU |
|
||||||
|
| phase_R (fit pha qua log Z của SMC) | 0 (-0.990696378084 = P2r) | lưới 7 nút, GPU |
|
||||||
|
| log Z theo pha × giếng | 0.0 | |
|
||||||
|
| hạt SMC tại γ = 1/κ, 4 giếng × (1024 × 390) | 0 — **trùng từng bit** | `particles_bitwise = true` |
|
||||||
|
| warp RMSE / cov90 / width90 / κ_post / r_post của mọi dòng CSV | 0 | số stage 17/17/17/18 trùng |
|
||||||
|
| metric train theo (phương pháp, seed, giếng test), 280 dòng: band RMSE, RMSE, band PCC, NLL, coverage90 | 0 | |
|
||||||
|
| dự đoán μ (35 mảng 8 × 126) và y_true | trùng từng bit | `pred_bitwise = true` |
|
||||||
|
| `_diag.csv`: B3c-R / B3d-Sa warp RMSE, λ, phase_R, M2-Sa n_valid | 0 | |
|
||||||
|
|
||||||
|
Band RMSE trung bình ô (mới = P2r): B3b 0.9667, B3c 0.5755, B3c-R 0.6022, B3d 0.7475, B3d-Sa 0.5380, M2-Sa 0.5289, Oracle 0.5577 p.u.
|
||||||
|
|
||||||
|
**Kết luận.** Đường mặc định của runner (bộ sinh với `misspec=None`, `register`, SMC GPU, bank nhãn, huấn luyện CNN-GRU qua `bank_train.train_predict`) tái lập P2r **chính xác từng bit** trên H200 với torch 2.14.0+cu130 (khớp self-check của T2: 10.560 dòng, sai lệch 0). Vì guard của P2r không băm code, đây là bằng chứng rằng các sửa code của P6 (misspec trong `synth_d2.py`, `on_budget`/`responsibilities` của T2, gói `benchmark/`) không đổi đường chạy đã đăng ký. Giới hạn: một ô, một GPU, một môi trường; bit-equality của SMC trên GPU không được bảo đảm nói chung (smc_torch khớp CPU đến sai số làm tròn; chọn/loại ở ties có thể lệch) — ở đây không xảy ra.
|
||||||
|
|
||||||
|
Kiểm tra phụ (dev rid 902, R10, c = 1, N = 4): runner và `scripts/33 --smc` cho **cùng** phase_R (−0.5323048335…) nhưng hạt khác nhau (warp RMSE P00 0.704 so với 0.744 ms; 17 so với 12 stage) vì scripts/33 chạy SMC với một mốc γ duy nhất (g_acf) còn runner/P2r dùng ba mốc; mốc đổi lịch tôi luyện. Các số hiệu chuẩn ở mục 3 vì vậy ở "lịch một mốc"; mức được chọn theo tỉ số so với danh nghĩa dưới cùng lịch.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 3. Hiệu chuẩn mức L1/L2 của S2 trên dev
|
||||||
|
|
||||||
|
**Cách làm.** Với mỗi ứng viên (khối `misspec_presets` của `configs/d2_synth_bench.yaml`, kể cả `cand_*`), chạy đúng registration của P2r trên dev: `pipeline.register` (MAP-II, wavelet thống kê, pha hằng) rồi SMC GPU (P = 1024, nhánh estR, γ = 1/κ; `scripts/33_bench_generator_qc.py --smc`, lịch **một mốc** γ — xem lưu ý ở mục 2) ở N = 4, c = 1, hai regime R10 và Rm5, trên realization dev 902 (mọi preset), 903 (các ứng viên), 904 và 905 (xác nhận 7 preset đã chọn). Bảng gộp: `scripts/35_bench_calibration.py` → `outputs/bench/dev/calibration.{csv,md}` (hàng nhận diện theo núm đang bật, vì tên preset đã được định nghĩa lại trong ngày). "Sai số mô hình trong họ" = RMS(địa chấn sạch − α·synthetic danh nghĩa tại warp thật)/RMS(địa chấn) với thành viên tốt nhất của họ wavelet thống kê + pha hằng (QC rid 902, `bench-generator.md` §4); nhiễu regime: R10 0.316, Rm5 1.778. Các log: `logs/bench_cal_smc_rid90{2,2b,3,4,5}.out`, runlog `bench_cal_smc_rid*`.
|
||||||
|
|
||||||
|
**Mục tiêu khai báo trước khi xem số** (`calibration.procedure` của protocol): L1 — sai số mô hình trong họ ≈ 0.5–1.0 × nhiễu R10 và SMC vẫn trước point tie ở R10; L2 — ≈ 1.5–2 × nhiễu R10, kèm mất hiệu chỉnh thấy được (cov90 < 0.5 ở R10 hoặc warp RMSE ≥ 2 × danh nghĩa). Trục rock physics chỉ dùng độ phân tán intercept theo đơn vị (các hệ số đồng đều bất biến với likelihood có α profile; `rp_C` giữ làm control). Thầy QC bộ sinh (chuyển qua điều phối) đề nghị: rp 0.10/0.15, wv minphase 0.5/1.0 với Q thành ô riêng, dr giữ hai preset; quyết định cuối ở dưới.
|
||||||
|
|
||||||
|
### 3.1 Bảy preset đã chọn — R10 (N = 4, c = 1; trung bình trên rid × 4 giếng train)
|
||||||
|
|
||||||
|
| Preset | Núm | n_rid | Sai số mô hình trong họ (÷ nhiễu regime) | SMC warp RMSE (ms) | ÷ danh nghĩa | cov90 | σ_post (ms) | overconf. | B3c warp RMSE | SMC < B3c (tỉ lệ rid) | r_post |
|
||||||
|
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
|
||||||
|
| nominal | `{}` | 4 | 0.072 (0.23) | 0.69 | 1.00 | 0.83 | 0.56 | 1.25 | 3.97 | 1.00 | 0.89 |
|
||||||
|
| rp_L1 | `{"rock_physics": {"unit_dt_intercept_sd": 0.1}}` | 3 | 0.391 (1.24) | 0.76 | 1.27 | 0.85 | 0.69 | 1.14 | 4.34 | 1.00 | 0.84 |
|
||||||
|
| rp_L2 | `{"rock_physics": {"unit_dt_intercept_sd": 0.15}}` | 4 | 0.531 (1.68) | 1.17 | 1.66 | 0.81 | 0.91 | 1.31 | 4.83 | 1.00 | 0.79 |
|
||||||
|
| wv_L1 | `{"wavelet": {"minphase_frac": 0.5}}` | 4 | 0.342 (1.08) | 2.14 | 3.24 | 0.11 | 0.63 | 3.49 | 4.30 | 1.00 | 0.85 |
|
||||||
|
| wv_L2 | `{"wavelet": {"minphase_frac": 1.0}}` | 4 | 0.609 (1.93) | 3.93 | 5.92 | 0.03 | 0.82 | 4.94 | 4.57 | 0.75 | 0.76 |
|
||||||
|
| wv_Q | `{"wavelet": {"Q": 80.0}}` | 4 | 0.445 (1.41) | 1.06 | 1.57 | 0.84 | 0.98 | 1.08 | 3.42 | 1.00 | 0.86 |
|
||||||
|
| dr_L1 | `{"drift": {"ell_factor": 0.5, "sigma_b_factor": 3.0, "sigma_g_factor": 1.5}}` | 4 | 0.073 (0.23) | 1.55 | 2.22 | 0.75 | 1.08 | 1.43 | 3.48 | 1.00 | 0.66 |
|
||||||
|
| dr_L2 | `{"drift": {"jitter_sd_ms": 1.0, "step_ms": 8.0}}` | 4 | 0.075 (0.24) | 2.27 | 3.29 | 0.61 | 0.85 | 2.74 | 4.52 | 1.00 | 0.80 |
|
||||||
|
|
||||||
|
### 3.2 Bảy preset đã chọn — Rm5
|
||||||
|
|
||||||
|
| Preset | Núm | n_rid | Sai số mô hình trong họ (÷ nhiễu regime) | SMC warp RMSE (ms) | ÷ danh nghĩa | cov90 | σ_post (ms) | overconf. | B3c warp RMSE | SMC < B3c (tỉ lệ rid) | r_post |
|
||||||
|
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
|
||||||
|
| nominal | `{}` | 4 | 0.072 (0.04) | 3.68 | 1.00 | 0.76 | 2.43 | 1.54 | 6.77 | 1.00 | 0.42 |
|
||||||
|
| rp_L1 | `{"rock_physics": {"unit_dt_intercept_sd": 0.1}}` | 3 | 0.391 (0.22) | 4.03 | 1.04 | 0.73 | 2.44 | 1.70 | 6.52 | 1.00 | 0.39 |
|
||||||
|
| rp_L2 | `{"rock_physics": {"unit_dt_intercept_sd": 0.15}}` | 4 | 0.531 (0.30) | 3.91 | 1.08 | 0.75 | 2.58 | 1.57 | 7.09 | 1.00 | 0.37 |
|
||||||
|
| wv_L1 | `{"wavelet": {"minphase_frac": 0.5}}` | 4 | 0.342 (0.19) | 3.87 | 1.06 | 0.76 | 2.59 | 1.50 | 7.27 | 1.00 | 0.36 |
|
||||||
|
| wv_L2 | `{"wavelet": {"minphase_frac": 1.0}}` | 4 | 0.609 (0.34) | 4.30 | 1.23 | 0.71 | 2.85 | 1.51 | 7.28 | 1.00 | 0.30 |
|
||||||
|
| wv_Q | `{"wavelet": {"Q": 80.0}}` | 4 | 0.445 (0.25) | 4.08 | 1.12 | 0.71 | 2.43 | 1.68 | 6.05 | 1.00 | 0.41 |
|
||||||
|
| dr_L1 | `{"drift": {"ell_factor": 0.5, "sigma_b_factor": 3.0, "sigma_g_factor": 1.5}}` | 4 | 0.073 (0.04) | 3.90 | 1.10 | 0.83 | 3.27 | 1.24 | 7.16 | 1.00 | 0.15 |
|
||||||
|
| dr_L2 | `{"drift": {"jitter_sd_ms": 1.0, "step_ms": 8.0}}` | 4 | 0.075 (0.04) | 4.21 | 1.18 | 0.66 | 2.37 | 1.79 | 7.29 | 1.00 | 0.41 |
|
||||||
|
|
||||||
|
### 3.3 Ứng viên đã xét và không chọn (R10)
|
||||||
|
|
||||||
|
| Ứng viên | Núm | n_rid | Sai số trong họ (÷ nhiễu) | SMC warp RMSE | ÷ danh nghĩa | cov90 | σ_post | overconf. |
|
||||||
|
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
|
||||||
|
| cand_dr_hs | `{"drift": {"ell_factor": 0.5, "jitter_sd_ms": 1.0, "sigma_b_factor": 3.0, "sigma_g_factor": 1.5, "step_ms": 8.0}}` | 2 | — | 2.86 | 3.52 | 0.61 | 1.33 | 2.16 |
|
||||||
|
| cand_dr_s2 | `{"drift": {"jitter_sd_ms": 2.0, "step_ms": 16.0}}` | 2 | — | 4.25 | 5.26 | 0.60 | 2.07 | 2.09 |
|
||||||
|
| cand_rp_a | `{"rock_physics": {"unit_dt_intercept_sd": 0.05}}` | 1 | 0.217 (0.69) | 0.93 | 1.34 | 0.59 | 0.50 | 1.84 |
|
||||||
|
| cand_rp_d | `{"rock_physics": {"unit_dt_intercept_sd": 0.075}}` | 1 | — | 1.08 | 1.09 | 0.76 | 0.76 | 1.41 |
|
||||||
|
| cand_wv_b | `{"wavelet": {"Q": 160.0}}` | 2 | 0.259 (0.82) | 0.92 | 1.08 | 0.79 | 0.64 | 1.41 |
|
||||||
|
| cand_wv_e | `{"wavelet": {"Q": 160.0, "minphase_frac": 0.5}}` | 2 | — | 1.72 | 2.06 | 0.32 | 0.67 | 2.58 |
|
||||||
|
| cand_wv_f | `{"wavelet": {"minphase_frac": 0.25}}` | 1 | 0.197 (0.62) | 1.92 | 1.95 | 0.25 | 0.64 | 3.01 |
|
||||||
|
| cand_wv_g | `{"wavelet": {"Q": 40.0}}` | 1 | 0.652 (2.06) | 1.60 | 1.63 | 0.86 | 1.59 | 1.01 |
|
||||||
|
| cand_wv_h | `{"wavelet": {"Q": 80.0, "minphase_frac": 0.5}}` | 1 | — | 1.67 | 1.69 | 0.63 | 0.98 | 1.71 |
|
||||||
|
| rp_C | `{"rock_physics": {"dt_intercept_factor": 1.15, "dt_slope_factor": 1.15, "rho_slope_factor": 1.2}}` | 1 | 0.073 (0.23) | 1.02 | 1.04 | 0.69 | 0.63 | 1.62 |
|
||||||
|
| rp_L1 (old definition) | `{"rock_physics": {"dt_intercept_factor": 1.15, "dt_slope_factor": 1.15, "rho_slope_factor": 1.2, "unit_dt_intercept_sd": 0.05}}` | 1 | 0.226 (0.71) | 1.01 | 1.02 | 0.75 | 0.67 | 1.49 |
|
||||||
|
| rp_L2 (old definition) | `{"rock_physics": {"dt_intercept_factor": 1.15, "dt_slope_factor": 1.15, "rho_slope_factor": 1.2, "unit_dt_intercept_sd": 0.1}}` | 1 | 0.406 (1.28) | 1.24 | 1.26 | 0.76 | 0.91 | 1.37 |
|
||||||
|
| wv_C | `{"wavelet": {"peak_freq_factor": 1.2, "phase_deg": 45.0}}` | 1 | 0.050 (0.16) | 0.92 | 0.93 | 0.70 | 0.53 | 1.72 |
|
||||||
|
| wv_L2 (old definition) | `{"wavelet": {"Q": 80.0, "minphase_frac": 1.0}}` | 1 | 0.595 (1.88) | 3.06 | 3.11 | 0.26 | 1.08 | 2.84 |
|
||||||
|
|
||||||
|
(Ở Rm5 mọi ứng viên nằm trong 0.97–1.33 × danh nghĩa; bảng đầy đủ trong `calibration.md`.)
|
||||||
|
|
||||||
|
### 3.4 Quyết định và lý do
|
||||||
|
|
||||||
|
1. **Rock physics: rp_L1 = unit sd 0.10, rp_L2 = 0.15.** Sai số mô hình 1.24× và 1.68× nhiễu R10. Trục này **gần như vô hình với registration**: SMC warp RMSE chỉ ×1.27 / ×1.66 danh nghĩa, cov90 giữ 0.85 / 0.81 (4 rid), nên mục tiêu "mất hiệu chỉnh" của L2 không đạt được trong dải vật lý hợp lý (sd 0.15 = DT_matrix ±27 µs/m, tức matrix 4 500–6 400 m/s); các mức 0.05/0.075 không khác biệt đủ. Mức được chọn theo sai số mô hình (như đề nghị); phát hiện "registration bền với rock physics sai hệ số ở R10" tự nó là một kết quả của S2. **Null khai báo trước ở Rm5** (sai số 0.22–0.30 × nhiễu).
|
||||||
|
2. **Wavelet: wv_L1 = minphase 0.5, wv_L2 = minphase 1.0, cộng ô băng thông wv_Q = Q 80.** Hai cơ chế rất khác nhau: pha phụ thuộc tần số phá họ pha-hằng → posterior **tự tin quá mức** (minphase 0.5: warp ×3.2, cov90 0.11, overconfidence 3.5; minphase 1.0: ×5.9, cov90 0.03, SMC không còn chắc hơn B3c: 3/4 rid), trong khi suy giảm Q làm posterior **nới rộng chứ không gãy** (Q 80: ×1.57, cov90 0.84, σ_post ×1.8; Q 160 ≈ danh nghĩa; Q 40: ×1.6, cov90 0.86). Minphase 0.25 (0.62× nhiễu, ứng viên L1 theo dải sai số) đã cho cov90 0.25 trên rid 903 — không có mức "ôn hoà" cho pha. Vì vậy L1/L2 là hai cường độ của **pha** (1.08× và 1.93× nhiễu, khớp dải khai báo), và băng thông thành ô riêng một mức (1.41× nhiễu) để trục wavelet phủ đúng câu chữ "sai pha và băng thông"; tổ hợp minphase 0.5 + Q 80 (`cand_wv_h`, 1 rid: ×1.7, cov 0.63) không chọn vì trộn hai cơ chế. Dự đoán ghi trong S2-H1: wv_L1 còn thắng point tie ở R10 (2.1 so với 4.3 ms) nhưng **wv_L2 trượt**.
|
||||||
|
3. **Drift: dr_L1 = siêu tham số (σ_b ×3, σ_g ×1.5, ℓ ×0.5), dr_L2 = cấu trúc (bước 8 ms tại Truncation + jitter 1 ms, ℓ 8 ms).** Hai **cơ chế** chứ không phải hai cường độ; giữ tách để quy kết được. Trên 4 rid: ×2.2 (cov90 0.75) và ×3.3 (cov90 0.61), tức L2 nặng hơn L1 về SMC; biến thiên giữa rid lớn (dr_L2: 1.3–4.1 ms vì vị trí bước so với cửa sổ). Tổ hợp (`cand_dr_hs`: ×3.5 nhưng SMC thua B3c ở 1/2 rid) và bước 16 ms (`cand_dr_s2`: ×5.3, σ_post 2.1) không chọn. Bước không nhân với c (S2 chỉ chạy c = 1).
|
||||||
|
4. **Rm5:** mọi preset cho chẩn đoán SMC trong ±23 % danh nghĩa (3.7 ms, cov 0.76) — nhiễu 1.78 × tín hiệu nuốt sai số mô hình ≤ 0.61. Protocol khai báo null này cho **mọi** trục ở Rm5 (S2-H1 `expected_null`): S2 ở Rm5 kiểm tra hệ quả phía nhãn/đầu vào (Oracle và point tie đổi theo địa chấn), không kiểm tra registration.
|
||||||
|
5. **Chi phí:** N = 4 một ô 50–240 s tuỳ tải GPU (Rm5 nhanh hơn R10 vì ít stage); không thấy ô nào vượt số stage bất thường dưới misspec ở N = 4.
|
||||||
|
|
||||||
|
**Giới hạn.** Hiệu chuẩn ở N = 4 (chưa ở N = 16), lịch SMC một mốc (khác lịch ba mốc của bench ≈ 5 %), 1–4 rid mỗi ứng viên, không có huấn luyện (mức chọn theo chẩn đoán registration + sai số mô hình, không theo band RMSE).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 4. Tóm tắt giao thức (bản nháp `configs/protocol_bench.yaml`, chưa khoá)
|
||||||
|
|
||||||
|
**Chung.** Realization chính 8–15 (của P2r); dev 900–905; seed mạng 0–4; registration seed 0, SMC stream 0, P = 1024, nhánh estR, mốc γ (g_old, g_acf, g_one) như P2r; σ_a đúng (7 ms) ở mọi ô (nhánh σ_a của P2r không lặp lại, kết quả trượt của nó giữ nguyên). Ngân sách = P2r (Oracle 500, B3b 125, B3c 250, B3c-R 500, B3d 250, B3d-Sa 250, M2-Sa 250) + P2 cho B4a–d (125/125/500/250) + kế thừa cho phương pháp mới (PM2 250, BK2 250, HM2 125, Ctl-GP 250); TCN: `budgets_tcn` từ stage `dev-budgets` (luật budget_selection của protocol_p2 trên dev 902–905) hoặc null = bằng CNN-GRU. **Nhánh 500 vòng lặp cho mọi phương pháp** (`equal_budget_arm`, công bố là do T2 (v) gợi ý sau khi đã xem realization test): ghi trên cùng quỹ đạo, chỉ báo cáo, không luật nào dùng.
|
||||||
|
|
||||||
|
**Ô.**
|
||||||
|
|
||||||
|
| Study | Ô | SMC mới | Train | Phương pháp |
|
||||||
|
| --- | --- | --- | --- | --- |
|
||||||
|
| S1 lấp lưới | 5 regime × 14 (c, N) mới của lưới c ∈ {0, 0.5, 1, 1.5, 2} × N ∈ {2, 4, 8, 16} × 8 rid | 560 | 560 | Oracle, B3b, B3c, B3c-R, B3d, B3d-Sa, M2-Sa |
|
||||||
|
| S2 misspec | 2 regime (R10, Rm5) × 7 preset (rp_L1/L2, wv_L1/L2, wv_Q, dr_L1/L2) × c = 1 × N ∈ {4, 16} × 8 rid (+ 32 ô control rp_C, wv_C ở N = 4, tuỳ chọn) | 224 (+32) | 224 | Oracle, B3b, B3c, B3c-R, B3d-Sa, M2-Sa, Ctl-GP |
|
||||||
|
| S3 B4 dưới ô P2r | 5 regime × c ∈ {0, 1, 2} × N ∈ {4, 16} × 8 rid; hạt P2r | 0 | 240 | B4a–d, Ctl-GP (ghép với run P2r của ô) |
|
||||||
|
| S4 backbone TCN | (R10, Rm5, R0h) × c = 1 × N ∈ {4, 16} × 8 rid; hạt P2r | 0 | 48 | Oracle, B3b, B3c, B3c-R, B3d-Sa, M2-Sa (-TCN) |
|
||||||
|
| S8 cycle-skip có kiểm soát | (R10, Rm5) × c = 1 × N ∈ {4, 16} × Δ ∈ {8, 16, 32} ms × 8 rid; posterior hai mode dựng từ warp thật | 0 | 96 | Oracle, PM2, BK2, HM2 |
|
||||||
|
|
||||||
|
**Luật** (P2/P2r, không đổi): metric band RMSE (6 Hz) macro 8 giếng test; improves = tỉ số ≤ 0.90 hoặc ΔPCC ≥ 0.05; cell_pass = ≥ 4/5 seed và > 1/2 realization; "better" = cùng luật hướng không lề; no-harm 1.02; wide = σ_post ≥ 1.5 ms; CI bootstrap 2000 trên realization; hoán vị 10 000, p một phía < 0.05. Ô c = 2 giữ cờ "unstable posterior".
|
||||||
|
|
||||||
|
**Giả thuyết** (`claim` = có pass/fail với luật cố định; `descriptive` = bảng; `disclosed` = động cơ từ T2 đã xem realization test):
|
||||||
|
|
||||||
|
| Mã | Loại | Nội dung | Dự đoán |
|
||||||
|
| --- | --- | --- | --- |
|
||||||
|
| S1-H1 | claim | H2a mở rộng sang c = 1.5 ở R10 (B3d-Sa thắng point tie tốt nhất, cell_pass, cả hai N) | pass |
|
||||||
|
| S1-H2 | claim | Lợi ích bank tăng theo N ở σ_post cố định: trong các family (regime, c) rộng ở N = 16, r(16) < r(2) ở ≥ 2/3 family VÀ Spearman ρ(log₂N, r) < 0, p hoán vị trong family < 0.05 | pass |
|
||||||
|
| S1-D | descriptive | phase diagram c × N; σ_post; fit cộng tính band_rmse²(B3d-Sa) = band_rmse²(Oracle) + β σ_post² | — |
|
||||||
|
| S2-H1 | claim | Mỗi trục ở L1, R10: B3d-Sa thắng point tie tốt nhất (cell_pass) cả hai N; một verdict/trục; Rm5, L2, wv_Q chỉ báo cáo; null khai báo trước ở Rm5 cho rp | pass rp và wv_L1; wv_L2 trượt; dr không chắc |
|
||||||
|
| S2-H2 | claim | No-harm của bank: mean ratio M2-Sa/B3d-Sa ≤ 1.02 ở mọi 14 cặp (preset × regime) | pass |
|
||||||
|
| S2-D | descriptive | chẩn đoán SMC theo preset (warp RMSE, cov90, σ_post, overconfidence, phase_R); suy giảm so với ô danh nghĩa P2r; M2-Sa ở ô rộng; Ctl-GP (disclosed); bảng 500 vòng lặp (disclosed) | — |
|
||||||
|
| S3-H1 | claim | H2a với tập đối thủ mở rộng {B3b, B3c, B3c-R, B4a–d} theo luật regime của P2r (R10 quyết định; phạm vi theo regime đạt) | pass |
|
||||||
|
| S3-D / T2-1 | descriptive / disclosed | bảng benchmark đầy đủ; Ctl-GP so với B3d-Sa và M2-Sa trên 30 ô P2r | T2: M2-Sa > Ctl-GP ở c = 2, không ở c = 1 |
|
||||||
|
| S4-H1 | claim | H2a độc lập backbone ở R10 c = 1 (TCN, cả hai N) | pass |
|
||||||
|
| S4-H2 | claim | Lợi ích bank ở ô rộng độc lập backbone (M2-Sa-TCN better B3d-Sa-TCN ở Rm5 và R0h c = 1 N = 16) | pass, không chắc |
|
||||||
|
| S8-H1 | claim | Hệ quả 3: Ĥ_PM2(f) trung bình trên (1/(2Δ), 3/(2Δ)) âm ở Δ = 32 ms, R10, cả hai N | pass (dev rid 902 N = 4 seed 0: −0.14; zero crossing 17.6 Hz so với 15.6 lý thuyết) |
|
||||||
|
| S8-H2 | claim | BK2 better PM2 ở Δ ∈ {16, 32}, N = 16, cả hai regime (4 ô) | pass (dev: BK2/PM2 0.43 và 0.32); Δ = 8 chuyển sang mô tả (dev: 1.4, bank không tách được hai mode cách nửa chu kỳ) |
|
||||||
|
|
||||||
|
**Deviation ghi trong protocol:** thiết kế sau P2r và sau post hoc 29/10; S1/S3/S4 tái dùng realization và hạt P2r; nhánh 500 và Ctl-GP là bổ sung disclosed do T2; mức S2 chọn trên dev; nhãn test không chọn gì. **Thứ tự cắt:** S4 → S8 → S2 còn trục rock physics (bài gọi là "controlled synthetic study") → S1 còn c ∈ {0.5, 1.5} × N ∈ {4, 16} trên R10, Rm5, R0 (trong S1: R0h, R10tb cắt trước; trong S2: wv_Q cắt trước hai mức pha; control luôn tuỳ chọn).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 5. Chi phí và phân bổ GPU
|
||||||
|
|
||||||
|
**Đo được ngày 29/10 (H200 dùng chung; project khác giữ 125–135 GB mỗi card, util 0–93 %):**
|
||||||
|
|
||||||
|
| Việc | Đo | Nguồn |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| SMC N = 4, c = 1, P = 1024, một worker, lịch ba mốc | 142 s (rid 8 R10, cuda:1) ; 156 s (rid 902, cuda:1, trong đó fit pha 96 s) | runlog `bench_repro_r8`, `bench_dev_smoke_r902` |
|
||||||
|
| SMC N = 4, lịch một mốc (scripts/33) | 62–153 s/ô (trung vị ≈ 100 s) khi GPU ít tải; 211 s khi tải nặng | `bench_cal_smc_rid90{2,3,4,5}` |
|
||||||
|
| SMC N = 16, c = 1, P = 1024, một worker, lịch ba mốc | 695 s (rid 902 R10, cuda:0, GPU có job khác ở 0–93 % util) ; P2r: 600–1150 s/job khi 3–5 worker chen nhau | runlog `bench_dev_budgets_tcn` |
|
||||||
|
| Train N = 4, 7 phương pháp × 5 seed, ngân sách P2r | 73 s | repro |
|
||||||
|
| Train N = 4, 7 phương pháp × 1 seed | 19 s | smoke |
|
||||||
|
| Train S8, 4 phương pháp × 1 seed, hai ngân sách (250/125 + 500) | 16–17 s/ô | smoke S8 |
|
||||||
|
|
||||||
|
**Ước tính giai đoạn chính** (4 worker/GPU, `MEM_GB=6`, hai GPU; "sạch" = một pipeline mỗi GPU như lần chạy đầu của P2r; "chen" = hệ số 1.37 của P2r):
|
||||||
|
|
||||||
|
| Giai đoạn | Job | Thời gian job (s) | Worker-giờ | Wall trên 8 worker (sạch → chen) |
|
||||||
|
| --- | --- | --- | --- | --- |
|
||||||
|
| S1 posterior (560: c ∈ {0.5, 1.5} × N ∈ {2, 4, 8, 16} và c ∈ {0, 1, 2} × N ∈ {2, 8}; 5 regime) | 560 | N = 2 ≈ 235, N = 4 ≈ 270, N = 8 ≈ 550, N = 16 ≈ 830 (c = 1; c = 0 rẻ hơn 30 %, c = 2 đắt hơn 15 %) | ≈ 70 | **≈ 8.8 h → 12 h** |
|
||||||
|
| S2 posterior (224: 7 preset × 2 regime × N 4/16 × 8 rid) | 224 | (270 + 830)/2 ≈ 550 (misspec có thể đổi số stage; chưa đo ở N = 16) | ≈ 34 | **≈ 4.3 h → 5.9 h** |
|
||||||
|
| S2 controls (32, N = 4) | 32 | 270 | 2.4 | 0.3 h |
|
||||||
|
| S1 train (560 ô; 7 phương pháp × 5 seed; nhánh 500 cho mọi phương pháp → 3 500 bước/seed) | 560 | ≈ 120 (N ≤ 8) – 250 (N = 16) | ≈ 25 | **≈ 3 h** |
|
||||||
|
| S2 train (224 ô; 7 phương pháp kể cả Ctl-GP; 4 000 bước/seed) | 224 | ≈ 150–280 | ≈ 13 | **≈ 1.6 h** |
|
||||||
|
| S3 train (240 ô; B4a–d + Ctl-GP; soft-DTW/DILATE chậm) | 240 | ≈ 200–350 | ≈ 18 | **≈ 2.3 h** |
|
||||||
|
| S4 train (48 ô TCN; 6 phương pháp, quỹ đạo tới 500 do nhánh 500) | 48 | ≈ 150 | 2 | 0.25 h |
|
||||||
|
| S8 train (96 ô; 4 phương pháp × 5 seed) | 96 | ≈ 80 | 2 | 0.3 h |
|
||||||
|
| summarize | — | — | — | < 10 phút |
|
||||||
|
| **Tổng** | | | **≈ 167 worker-giờ** | **≈ 21 h sạch → 26 h chen** trên 8 worker; ≈ 42 h nếu chỉ có 4 worker |
|
||||||
|
|
||||||
|
Đĩa: hạt g_acf 3.2 MB/giếng: S1 ≈ 560 × 7.5 giếng TB × 3.2 MB ≈ 13 GB, S2 ≈ 224 × 10 × 3.2 ≈ 7 GB; npz dự đoán nhỏ (< 1 GB). `/home` còn 274 GB.
|
||||||
|
|
||||||
|
**Phân bổ đề xuất** (`compute.split` của protocol): cuda:0 — S1 R10, Rm5, R0h rồi S2 R10; cuda:1 — S1 R0, R10tb rồi S2 Rm5, rồi S3, S4, S8 (chỉ train). Với lịch 4–7/11 (4 ngày) đủ chỗ ngay cả ở kịch bản chen, **với điều kiện** mỗi GPU có ≥ 25 GB trống (4 worker × 6 GB); hiện chỉ còn 8–12 GB mỗi card nên nếu project kia không trả bộ nhớ, chạy 1–2 worker/GPU (N = 16 cần ≈ 4–6 GB) và S1 kéo dài 2–3 ngày: khi đó áp thứ tự cắt (R0h, R10tb của S1 trước).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 6. Tác dụng phụ lên hash code của lock F3 và Volve
|
||||||
|
|
||||||
|
`ml_porosity/f3/protocol.source_hash` băm **mọi** `scripts/*.py`, còn `ml_porosity/volve/protocol.code_files` băm **mọi** `ml_porosity/**/*.py`. Các tệp mới của P6 (`scripts/32_t2_mechanism.py`, `33_bench_generator_qc.py`, `34_run_bench.py`, gói `ml_porosity/benchmark/`, và các sửa bổ sung của T2 trong `bank_train.py`/`rml.py`, của p6-gen trong `synth_d2.py`) làm `code_sha256` của cây làm việc khác với `configs/protocol_f3.lock.json` và `configs/protocol_volve.lock.json`. Hệ quả: `freeze(check=True)` của P3/P4 sẽ raise "lock mismatch" nếu chạy lại một stage đã đóng băng. Điều này **chấp nhận được** vì P3 và P4 đã hoàn tất và không bao giờ chạy lại (AGENTS.md); hai lock đó **không được sửa**. Kết quả P3/P4 vẫn tái lập được từ cây commit mang tag `protocol-volve` (hash code tính lại từ cây đó khớp lock, plan §12 ý 25). Lock của protocol_bench vì vậy chỉ băm code sau khi code đã chốt, và phải khoá **sau** mọi sửa code của P6 (kể cả T2) — nếu T2 còn sửa `bank_train.py`/`rml.py` sau khi khoá bench thì bench cũng rơi vào tình huống tương tự; thứ tự cần giữ: T2 xong việc sửa code → khoá bench → chạy chính.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 7. Rủi ro còn mở
|
||||||
|
|
||||||
|
1. **GPU.** Project khác giữ 125–135 GB mỗi H200 từ 13:00 UTC 29/10; chỉ còn 8–12 GB trống mỗi card. Lịch chính (≈ 21–26 h trên 8 worker) chỉ kịp 4–7/11 nếu mỗi card có ≥ 25 GB; nếu không, 1–2 worker/GPU và S1 kéo dài 2–3 ngày → áp thứ tự cắt. Ô N = 16 cần ≈ 4–6 GB/worker (cap `--gpu-mem-gb`), N ≤ 8 ≈ 2–3 GB.
|
||||||
|
2. **Khoá sau mọi sửa code.** `code_sha256` của lock bench băm `ml_porosity/**/*.py`; mọi sửa sau khoá (kể cả của agent khác) làm `freeze(check=True)` từ chối chạy tiếp → phải khoá khi code đã chốt (T2 xong), và không ai sửa `ml_porosity/` trong lúc bench chạy.
|
||||||
|
3. **Chi phí SMC dưới misspec chưa đo ở N = 16** (số stage có thể tăng khi likelihood xung đột với anchor); ước tính S2 dùng số danh nghĩa.
|
||||||
|
4. **S1-H2 là dự đoán mới** (heuristic mẫu hữu hạn): có thể trượt; ghi là claim với dự đoán pass. **S8-H2** đã chỉnh trên dev (bỏ vế Δ = 8). **S2-H1 trục drift** không có dự đoán rõ.
|
||||||
|
5. **Ô P2r-grid trong S1 không chạy lại** (đọc từ `outputs/p2r`): hợp lệ vì tái lập từng bit (mục 2), nhưng nếu môi trường đổi (torch/cuDNN) trước 4/11 thì S1 trộn hai môi trường; khi đó chạy lại ô repro để kiểm.
|
||||||
|
6. **Dev-budgets TCN**: đã xong trước khi khoá; mọi phương pháp TCN chọn 125 vòng lặp (biên dưới của danh sách ứng viên) — S4 so sánh TCN ở 125 với CNN-GRU ở ngân sách P2r (125–500); nhánh 500 cho cả hai cho phép so sánh cùng ngân sách (disclosed).
|
||||||
|
7. **Số dev 904/905**: chạy xác nhận mức đã chọn; nếu trái ngược rõ (ví dụ wv_L1 không còn thắng point tie ở R10 trên 3/4 rid), mức được cân nhắc lại trước khi khoá và ghi ở mục 3.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 8. Kết quả và verdict (02/11/2026)
|
||||||
|
|
||||||
|
Nguồn: `outputs/bench/summary/verdict_final.json` và `verdict_final.md` (do `scripts/36_bench_verdicts.py` ghi), `verdict.json` và `summary.md` (code đã khoá, `scripts/34_run_bench.py summarize`). Chi tiết đầy đủ và hệ quả cho bài: `docs/plan.md` §12 ý 28.
|
||||||
|
|
||||||
|
- **Kiểm trước:** lock khớp ở mọi khoá; 8.799 file `outputs/bench/` khớp `docs/research/unpushed_outputs.sha256`; đủ số ô ở mọi study.
|
||||||
|
- **Deviation thực thi (D-13):** code tổng hợp đã khoá khác lời phát biểu ở ba chỗ: S1-H1 trả null vì cần đúng 2 dòng, mà S1 có 4 giá trị N; S2-H1 không có khoá `pass` mức trên; S3-H1 đưa Ctl-GP vào tập đối thủ. Không sửa code đã khoá. Script 36 (ngoài tập hash, gọi `freeze(check=True)` trước) đọc lại đúng phát biểu. Hai cách đọc đều được báo cáo; chỉ S3-H1 đổi kết luận.
|
||||||
|
- **Verdict theo phát biểu, 9/11 đạt.** Tỉ số là band RMSE của B3d-Sa chia cho tie điểm tốt nhất, ở N = 4 / 16:
|
||||||
|
|
||||||
|
| Verdict | Kết luận | Số liệu |
|
||||||
|
|---|---|---|
|
||||||
|
| S1-H1 | đạt (code: null) | R10, c = 1,5: 0,853 / 0,796 (B3c-R) |
|
||||||
|
| S1-H2 | đạt | 13/13 họ rộng; ρ = −0,47, p < 10⁻⁴ |
|
||||||
|
| S2-H1 rock physics | **không đạt** (dự đoán đạt) | rp_L1 0,940 / 0,934 |
|
||||||
|
| S2-H1 wavelet | **không đạt** (dự đoán đạt) | wv_L1 1,023 / 1,042; posterior quá tự tin (cov90 0,17 / 0,10) |
|
||||||
|
| S2-H1 drift | đạt (dự đoán không chắc) | dr_L1 0,862 / 0,798 |
|
||||||
|
| S2-H2 | đạt | 14/14 cặp ≤ 1,02 |
|
||||||
|
| S3-H1 | đạt ở R10, R0, Rm5 (code: không đạt) | R10 0,857 / 0,782; R0 0,888 / 0,888; Rm5 0,915 / 0,923 |
|
||||||
|
| S4-H1 | đạt | TCN 0,840 / 0,823 |
|
||||||
|
| S4-H2 | đạt | M2-Sa/B3d-Sa: R0h 0,977, Rm5 0,983 |
|
||||||
|
| S8-H1 | đạt | Ĥ trong băng đảo dấu −0,70 / −0,49 |
|
||||||
|
| S8-H2 | đạt | BK2/PM2: R10 0,34 / 0,28; Rm5 0,71 / 0,64 |
|
||||||
|
|
||||||
|
- **Đối chiếu với rủi ro mục 7:** S1-H2 (dự đoán mới) đạt. Trục drift của S2-H1 đạt. Hai trục được dự đoán đạt lại trượt. Trên dev (mục 3.1), wv_L1 đã quá tự tin (cov90 0,11) nhưng warp SMC vẫn tốt hơn B3c ở 4/4 rid. Trên realization 8–15, sự quá tự tin đó đủ xoá lợi ích H2a về porosity. Với rp_L1, warp gần danh nghĩa (mục 3.4 ý 1), nhưng lợi ích porosity vẫn co lại dưới ngưỡng 0,90.
|
||||||
|
|
||||||
|
- **Ghi chú về chữ "calibrated" của S8 (02/11/2026, khi viết bài).** Lời phát biểu S8-H2 trong protocol đã khoá gọi BK2 là "a calibrated bank: the truth is a member". Đây chỉ là nghĩa yếu: warp thật là một thành viên của bank. BK2 không phải bank hiệu chỉnh theo Mệnh đề 4 của bài (bank là mẫu đúng của posterior). Theo Hệ quả 3, cấu trúc (a), khi λ → 0 transfer của BK2 là cos²(πfΔ), không phải 1. Đo được ở N = 16, trong băng đảo dấu 1/(2Δ) < f < 3/(2Δ), BK2 có transfer 0,92–1,00, trong khi trung bình cos² chỉ là 0,05–0,59 (`scripts/38_bench_figures.py --flipband`; post hoc, không phải verdict). Kết quả này khớp với việc responsibility tái đăng ký nhãn (Remark 1 của bài). Verdict S8-H2 không đổi. Bài (Sec. 6.5) ghi rõ nghĩa yếu này và không gọi BK2 là bank hiệu chỉnh.
|
||||||
|
|
||||||
|
## 9. Gói benchmark S7 (02/11/2026)
|
||||||
|
|
||||||
|
`scripts/37_bench_package.py` nằm ngoài tập hash của lock và chỉ đọc output đã khoá. `generate` và `tables` chạy `freeze(check=True)` trước. Hướng dẫn cho người dùng benchmark (tiếng Anh): `benchmark/README.md`. Chi tiết số: `docs/plan.md` §12 ý 29.
|
||||||
|
|
||||||
|
- **Task.** Mỗi file `tasks/<split>/<setting>/r<rid>_c<c>.npz` chứa đúng quan sát của runner (`Inputs.observe`): 16 giếng pool gồm patch 3 × 3, φ và AI trên τ, anchor; 8 giếng test chỉ có patch. Task dùng N giếng thì lấy N giếng đầu. Setting: 5 regime danh nghĩa × c ∈ {0; 0,5; 1; 1,5; 2}; 14 setting S2 (`R10__rp_L1`, …) và 6 setting S8 (`R10__s8d16`, …) ở c = 1. Split test là rid 8–15, dev là 900–905; tổng 630 task.
|
||||||
|
- **Truth ẩn** nằm trong `truth/`: `y_test` (p.u.), warp thật của giếng train, và dấu s của S8. Truth test được công bố vì bộ sinh vốn công khai; README yêu cầu mọi lựa chọn thiết kế chỉ dựa trên dev.
|
||||||
|
- **Hash.** `benchmark/MANIFEST.json` ghi sha256 nội dung mảng của 1.260 file và sha256 của 5 input; sha256 input khớp sha256 đăng ký trong protocol. Lần `generate` thứ hai tái lập đủ 1.260 hash.
|
||||||
|
- **Chấm điểm.** `score` dùng metric của scripts/11 và luật ô H2a cùng luật `better` của `summary.py`, chỉ so với các realization và seed đã nộp. `selftest` chép dự đoán đã lưu của phương pháp tham chiếu thành một bài nộp và đạt: metric, truth và luật đều khớp. Ví dụ S1-H1 cho 0,8529 / 0,7964, khớp mục 8.
|
||||||
|
- **Bảng tham chiếu.** `benchmark/reference/cells.csv` (1.130 dòng ô, kèm σ_post) và `main_table.md`, tính từ 45.200 run.
|
||||||
|
- **Chưa làm:** deposit Zenodo. Cần tài khoản và danh sách tác giả của người dùng, và cần kiểm giấy phép trước. Metadata nháp nằm ở `benchmark/zenodo_metadata.json`.
|
||||||
181
docs/research/paper-audit.md
Normal file
181
docs/research/paper-audit.md
Normal file
@@ -0,0 +1,181 @@
|
|||||||
|
# Rà soát chống hallucination của bản thảo (04/11/2026)
|
||||||
|
|
||||||
|
Theo yêu cầu của người dùng: dùng các skill `scientific-writing`, `literature-review`, `citation-management` và `academic-humanizer` để rà soát và viết lại paper (`docs/plan.md` §12 item 36).
|
||||||
|
|
||||||
|
## Cách làm
|
||||||
|
|
||||||
|
1. **Audit (pha A).** Năm subagent (Opus; Fable bị giới hạn tốc độ) đọc năm nhóm section và truy mọi số, trích dẫn và claim về nguồn: file trong `outputs/`, protocol bị khóa, code, `docs/`, toàn văn tài liệu tham khảo có trong `refs/` (bản trích văn bản). Phân loại: CITE, NUM, FACT, CLAIM, XREF; mức S1 (phải sửa), S2 (nên sửa), S3 (nhỏ).
|
||||||
|
2. **Kiểm lại.** Phiên chính tự kiểm lại mọi phát hiện S1 và các phát hiện S2/S3 sẽ dùng để sửa, đối chiếu với file gốc. Ví dụ: `outputs/td_qc.csv` cho bảng `tab:audit`; `outputs/p2/warp_prior_f3.json` và `ml_porosity/registration/pipeline.py` cho cách fit prior; `outputs/p4/summary/metrics.csv` cho R² từng giếng ở Volve.
|
||||||
|
3. **Sửa.** Một script áp 106 thay thế chính xác (mỗi chuỗi cũ phải khớp đúng một lần) vào 10 section và `highlights.txt`. Script `guard.py` so token được bảo vệ (cite, ref, label, math, số) với bản ở HEAD 423a333. Mọi khác biệt còn lại là thay đổi đã duyệt.
|
||||||
|
4. **Văn phong (`academic-humanizer`).** Quét các dấu hiệu văn phong AI (em-dash, từ vựng AI, động từ quá mạnh, từ nhấn rỗng, liên từ lặp). Bản thảo hầu như không còn các dấu hiệu này; các lượt chạm còn lại đều hợp lệ (phủ định, "This proves (a)" trong chứng minh). Đã tách 7 câu quá dài quanh các chỗ vừa sửa. Guard không đổi sau lượt này.
|
||||||
|
5. **Build.** `main.pdf` 69 trang, không có tham chiếu chưa định nghĩa, bibtex không cảnh báo.
|
||||||
|
|
||||||
|
## Số phát hiện
|
||||||
|
|
||||||
|
| Nhóm | Phạm vi | Tổng | S1 |
|
||||||
|
|---|---|---|---|
|
||||||
|
| G1 | abstract, 1, 2, 8, highlights | 17 | G1-01 |
|
||||||
|
| G2 | 3, 4, 5, App. A | 11 | G2-01 |
|
||||||
|
| G3 | 6 (dòng 1–224) | 14 | G3-01 |
|
||||||
|
| G4 | 6 (dòng 225–421) | 18 | 0 |
|
||||||
|
| G5 | 7, App. B | 27 | G5-01 |
|
||||||
|
|
||||||
|
Bốn lỗi S1:
|
||||||
|
- **G1-01.** Intro nói "hai mô hình TD lệch marker tới 36 ms". Thực tế chỉ mô hình OpendTect lệch tới 36 ms; bộ file thứ hai lệch trung bình −15 đến +41 ms.
|
||||||
|
- **G2-01.** Bài nói prior warp fit bằng type-II ML. Code đăng ký dùng MAP-II với hyperprior log-normal trên σ_g và ℓ, cố định σ_a = 7 ms và σ_b = 50 ms. Con số σ_b = 19 ms đến từ một lần fit ML riêng cho cả năm tham số; generator dùng lần fit đó.
|
||||||
|
- **G3-01.** Bài nói protocol của Thí nghiệm 1 đã được commit và gắn tag trước lần chạy chính. Thực tế nó chỉ được khóa bằng hash trước lần chạy, commit sau đó và không có tag.
|
||||||
|
- **G5-01.** Bài nói nhãn F3 tuyến tính theo sonic ở ba trên bốn giếng. Thực tế PHIE_DT tuyến tính ở cả bốn giếng; ba giếng là của PHIE gốc.
|
||||||
|
|
||||||
|
Các sửa S2 chính:
|
||||||
|
- giới hạn phạm vi các claim: một regime cho nhánh σ_a, R10 và c = 1,5 cho phần mở rộng, chỉ dr_L1 cho prior warp sai, power analysis là exploratory và dựa trên simulator;
|
||||||
|
- bỏ hai trích dẫn không hỗ trợ claim ở intro (prabowo2025f3, tao2025structural); bỏ DILATE khỏi claim về nhận dạng;
|
||||||
|
- tách di2023welltie (học tự giám sát) khỏi li2025cascadedtie (không dùng học máy);
|
||||||
|
- cố định số liệu bảng `tab:audit` theo `td_qc.csv`;
|
||||||
|
- giới hạn H2a/H2b cho các ô c = 2; ghi "post hoc" cho phép so sánh cos² của BK2;
|
||||||
|
- mô tả đúng nhánh 500 vòng lặp: không huấn luyện lại, chỉ ghi lại dự đoán trên cùng quỹ đạo huấn luyện; 14/70 ô đổi kết quả theo luật *better*;
|
||||||
|
- ngoại lệ R² dương ở F-1 B (Volve).
|
||||||
|
|
||||||
|
Không có verdict, gate hay ngưỡng nào thay đổi. Không sửa protocol hay code bị khóa.
|
||||||
|
|
||||||
|
## Còn mở (cần tác giả)
|
||||||
|
|
||||||
|
- **G1-14.** Dấu "DL ✓" ở dòng Rizzuti/BootNet của `tab:positioning` cần tác giả xác nhận.
|
||||||
|
- Bảy PDF tải tay trong `refs/` chưa có trên máy này. Các claim từ toàn văn của AWSM, Castagna, Rizzuti, P05 và Guillon nên được kiểm lại khi có file.
|
||||||
|
- **G2-10.** Cách ghi licence Volve: file licence ghi "Creative Commons Attribution 4.0 International license (CC BY NC SA)".
|
||||||
|
- **G4-04.** Null khai báo trước ở Rm5 viết "within the CI". Bài nay báo "trong 22%" và nêu rằng vài preset vượt ±10% của dev. Chưa có phép thử CI cho null này.
|
||||||
|
- Tùy chọn: skill `scientific-writing` gợi ý trích dẫn Kassis et al. 2026 (arXiv:2609.00065). Chưa thêm; cần tác giả quyết định.
|
||||||
|
|
||||||
|
## Phụ lục: bảng phát hiện gốc (tiếng Anh)
|
||||||
|
|
||||||
|
### Findings G1: abstract, intro, related (tab:positioning), conclusion, highlights (saved by main session from subagent report)
|
||||||
|
|
||||||
|
Counts: S1 1, S2 8, S3 8. 108 cite uses (~85 OK, 12 flagged, ~11 unverifiable here); 41 numbers (39 OK); 32 claims (22 OK).
|
||||||
|
|
||||||
|
| ID | file:line | quote | class | sev | evidence | proposed fix |
|
||||||
|
|---|---|---|---|---|---|---|
|
||||||
|
| G1-01 | 01:8 | "Two time--depth models distributed with the data disagree with the markers by up to 36\,ms." | NUM/XREF | S1 | td_qc.csv wlt max_abs 28.6/9.6/8.8/36.5; dt_model max_abs 43.2/44.6/29.0/41.8, mean offsets +40.5,+40.2,+25.2,−14.6 (03:35). | "The OpendTect time--depth model distributed with the data deviates from the markers by up to 36\,ms, and a second set of model files is offset from them by $-15$ to $+41$\,ms on average." (VERIFY) |
|
||||||
|
| G1-02 | 00:2; 08:8 | "Teapot Dome has independent time--depth references at no more than two of its 152 wells." | NUM/FACT | S2 | inventory summary.json 1,182 wells; 152 = subset in 3-D footprint with tops+density (applicability-teapot.md L102; 06:421 correct). | "...at no more than two of its wells; 152 wells inside its 3-D survey have density logs across the target." |
|
||||||
|
| G1-03 | 00:2 | "but failed when the anchor uncertainty was set at half or twice its true value." | CLAIM | S2 | arm only R10 c=1 (06:77); 14 ms 0.985/0.928, 3.5 ms 0.977/1.141. | "...but, in the one regime tested (R10, $c = 1$), no longer passed the registered rule when..." |
|
||||||
|
| G1-04 | highlights:4 | "Tie-posterior label gains on the benchmark fail if anchor error is misset twofold" | CLAIM | S2 | as G1-03. | "In the one regime tested, posterior-mean label gains no longer pass when anchor error is misset twofold" |
|
||||||
|
| G1-05 | 08:6 | "provided that the anchor uncertainty was correctly specified." | CLAIM | S3 | as G1-03. | "...and, in the one regime where this was tested, only when the anchor uncertainty was correctly specified." |
|
||||||
|
| G1-06 | 00:2; 01:18; 08:6 | "The posterior-mean advantage extended to stronger drift, a second backbone and a misspecified warp prior" | CLAIM | S2 | verdict_final.md S1-H1 R10 c=1.5; S2 drift R10; S4-H1 R10 c=1; 06:373 "At R10...". | prefix "At R10," and "($c = 1.5$)" for drift. |
|
||||||
|
| G1-07 | 00:2; 01:18 | "Detecting such gains at blind wells requires an accurate reference: with an exact reference, 5--18 wells gave a power of 0.8" | CLAIM | S2 | T3 exploratory, simulator-based; compares RML vs point tie at c=1 (06:384); referent ambiguous. | "In an exploratory power analysis under the benchmark simulator, detecting the gain ... at blind wells required..." |
|
||||||
|
| G1-08 | 01:4 | "...score blind wells against labels produced by the same tie \citep[e.g.][]{xu2024sts,prabowo2025f3,tao2025structural,liu2023lowfrequency}" | CITE | S2 | Prabowo and Tao full texts never mention a tie / TD conversion. | keep xu, liu; drop prabowo, tao (or "implicitly") |
|
||||||
|
| G1-09 | 02:10 | "In the studies we read in full, the labels are placed on the seismic time axis by a tie that is taken as given" | CITE/CLAIM | S2 | alfarraj, vashisth synthetic only; corrales synthetic; rezaei depth-converted cube. | "In the field studies we read in full that work in time, ...; the synthetic-only studies need no tie, and \citet{rezaei2026krigingrf} work on a depth-converted cube." |
|
||||||
|
| G1-10 | 01:12 | "...such as soft-DTW ... and DILATE ..., cannot fix absolute timing." | CLAIM/XREF | S2 | 04:107 covers shift losses + soft-DTW only; DILATE temporal term penalizes off-diagonal. | drop DILATE or qualify |
|
||||||
|
| G1-11 | 02:13 | "These losses use no time anchors, no physical tie model and no prior over warps." | CITE | S3 | DILATE TDI term = penalty on path distance from diagonal. | "...no physical tie model and, apart from DILATE's penalty on departure from the label time axis, no prior over warps." |
|
||||||
|
| G1-12 | 02:7 | "Among learning-based methods, ... \citet{di2023welltie} and \citet{li2025cascadedtie} automate the tie with self-supervised learning and cascaded matching." | CITE | S3 | li2025cascadedtie: local similarity + DTW, not learning. | separate the two |
|
||||||
|
| G1-13 | 02:10 | "Recent studies predict porosity or impedance with convolutional, recurrent or transformer networks" | CITE | S3 | rezaei2026 = kriging RF; ntibahanana dense layers. | "...with neural networks (convolutional, recurrent, transformer or fully connected) or tree ensembles" |
|
||||||
|
| G1-14 | 02:33 | Rizzuti/BootNet row DL ✓ | CITE | S3 | Rizzuti = normalizing-flow VI without training labels (abstract+annote). | needs author / full text (missing here) |
|
||||||
|
| G1-15 | 00:2; 01:18 | "...exceeded the registered population bound ... in seven cells, but in only three the post hoc bound for Berkson error" | CLAIM | S3 | meta.json post 7 (ci_below 6); post_b 3 (ci_below 1). | add "(one with its interval clear of the bound)" |
|
||||||
|
| G1-16 | 08:6 | "the first pre-registered comparison failed because the anchor-only posterior was not informative." | FACT | S3 | 06:65, 07:5: anchor-conditioned samples reweighted by tempered tie likelihoods; cause from post hoc dev diagnosis. | "...failed; a diagnosis on development realizations showed that its likelihood-reweighted, anchor-conditioned posterior was not informative." |
|
||||||
|
| G1-17 | highlights:5 | "Blind-well tests need references accurate to ~1 ms; tested public datasets lack them" | CLAIM | S3 | nstar.csv: at 1 ms 4/6 cells need 11–30 wells; exploratory. | "Under the benchmark simulator, blind-well tests need references accurate to ~1 ms; the field datasets tested lack them" |
|
||||||
|
|
||||||
|
Unverifiable here (PDFs missing on this machine): lim2025awsm details (44 wells, median/min-misfit models, "no later step uses posterior"), castagna2026 Discussion claims, rizzuti 2024/2025 details, li2024bpinn deterministic tie, guillon "a few pixels"/future loss, quesada (no abstract), dou2024 (no abstract). Abstract-only ᵃ entries OK as scoped.
|
||||||
|
|
||||||
|
### Findings G2: 03_data, 04_theory, 05_method, A_proofs (saved by main session from the subagent report)
|
||||||
|
|
||||||
|
Counts: S1 1, S2 3, S3 7. ~150 numbers (~140 OK), ~40 claims (~33 OK). Props/Cors vs App. A: no mismatch.
|
||||||
|
|
||||||
|
| ID | file:line | quote | class | sev | evidence | proposed fix |
|
||||||
|
|---|---|---|---|---|---|---|
|
||||||
|
| G2-01 | 05:14 | "The hyperparameters $(m_g, \sigma_g, \ell)$ are fitted by type-II maximum likelihood on the anchors of the training wells only." | FACT | S1 | pipeline.py:23 "MAP-II ... log-normal hyperprior"; protocol_p2.yaml:25–30 hyperprior sigma_g [0.05,1.0], ell_ms [150,1.0], hyper_starts 4; protocol_bench.yaml:70 MAP-II. | "...are fitted by type-II maximum a posteriori estimation, with log-normal hyperpriors on $\sigma_g$ and $\ell$, on the anchors of the training wells only." |
|
||||||
|
| G2-02 | 05:14–16 | "$\sigma_a$ and $\sigma_b$ are fixed." ... "The fitted bulk spread is $\sigma_b = 19$\,ms." | FACT/XREF | S2 | registration fixes σ_a=7, σ_b=50 ms (all protocols); 19 ms is from 5-parameter type-II ML fit (warp_prior_f3.json matern32 σ_b 19.4, σ_a 0.39) used by generator; 04:101 and 06:57 use σ_b=50. | "$\sigma_a = 7$\,ms and $\sigma_b = 50$\,ms are fixed."; L16 "A separate type-II maximum-likelihood fit of all five hyperparameters to the F3 anchors gives ... $\sigma_b = 19$\,ms." |
|
||||||
|
| G2-03 | 03:23–26, 35 | tab:audit max\|Δt_wlt\| 28.5/10.2/9.2/36.4; "up to 36.4\,ms" | NUM | S2 | outputs/td_qc.csv wlt max_abs_ms 28.6/9.6/8.8/36.5; paper values from docs/plan.md §1.2(c) L86–89. | 28.6, 9.6, 8.8, 36.5; "up to 36.5 ms" (verify) |
|
||||||
|
| G2-04 | 05:61 | "All five statements are exact and are checked numerically in the code's unit tests." | CLAIM | S2 | tests/test_losses.py: soft-DTW lemma only band 0 + fast vs autograd. | append "(the soft-DTW identity only in its single-path case)" |
|
||||||
|
| G2-05 | 05:34 | "$P = 1024$ meets it at $c = 1$ on development data." | CLAIM | S3 | protocol_p2r.yaml stability.dev_result: 4/4 at SNR 10; 3/4 at SNR −5 (r900 N=4 0.95 ms); disclosed 07:36. | "...at SNR 10\,dB (4 of 4 cells; 3 of 4 at $-5$\,dB, Section~\ref{...})." |
|
||||||
|
| G2-06 | 03:9 | "the amplitude spectrum around the wells and over the volume peaks near 60\,Hz with a mean frequency of 49\,Hz" | NUM | S3 | plan L190–196: volume 60 Hz, mean 49; wells 55/43/62/58 Hz. | "the spectrum of the volume peaks at 60\,Hz (43--62\,Hz around the wells), with a mean frequency of 49\,Hz" |
|
||||||
|
| G2-07 | 05:58 | "$\tau_c \approx 2.7$ samples and $\lambda \approx 0.37$, nearly constant across the grid." | NUM | S3 | p2 summary.md tau_c 2.70–2.90 (main 16 cells), lam 0.356–0.373. | "$\tau_c \approx 2.7$--$2.9$ samples and $\lambda \approx 0.36$--$0.37$" |
|
||||||
|
| G2-08 | 05:104 | "The number of iterations is selected separately for each method from $\{125, ...\}$" | FACT | S3 | PM2/BK2/HM2/Ctl-GP inherit budgets (protocol_bench.yaml; tab:benchdesign). | append "(benchmark controls inherit the budget of the method they modify; Table~\ref{tab:benchdesign})" |
|
||||||
|
| G2-09 | 03:74 | "Only F-11 T2 has a zero-offset VSP." | FACT | S3 | volve-inventory.md:27–29: F-15 A and 15/9-19 also have VSP; not among the six wells. | "Of the six wells, only F-11 T2 has a zero-offset VSP." |
|
||||||
|
| G2-10 | 03:68 | "the licence files of the release name CC BY-NC-SA 4.0" | FACT | S3 | license.txt: "Creative Commons Attribution 4.0 International license (CC BY NC SA)". | "the licence files of the release name a Creative Commons 4.0 licence with BY-NC-SA terms" |
|
||||||
|
| G2-11 | 04:7; 05:163 | "The split uses a zero-phase fourth-order Butterworth filter." | FACT | S3 | butter(4) + sosfiltfilt. | "a fourth-order Butterworth filter applied forward and backward (zero phase)" |
|
||||||
|
|
||||||
|
Could not check: fuller1987, carroll2006, berkson1950, sakoe1978 (no text); mensch2018 HVP claim (not in abstract); pauli/ribatet "simplest magnitude adjustment" (abstract only); H1 "6.8–22.5 Hz, 72%" only in docs/theory.md; S2 dev diagnostics only vs docs; B0/B1 rows only vs protocol_p2; full proofs out of scope.
|
||||||
|
|
||||||
|
### Findings G3: paper/sections/06_experiments.tex L1–224 (saved by main session from the subagent report)
|
||||||
|
|
||||||
|
Counts: S1 1, S2 5, S3 8. NUM 6, CLAIM 5, FACT 2, XREF 1, CITE 0. ~330 numbers traced (~322 OK); ~45 claims (~37 OK).
|
||||||
|
|
||||||
|
| ID | file:line | quote | class | sev | evidence | proposed fix |
|
||||||
|
|---|---|---|---|---|---|---|
|
||||||
|
| G3-01 | 06:4 | "The protocols of Experiments~1 and~2 were also committed and tagged in version control before their main runs." | FACT | S1 | protocol_p2.yaml first commit cee2ff0 2026-10-27 06:03 UTC; P2 main run 26/10 10:51–12:20 UTC on a76e613 dirty tree (logs/index.csv); no P2 tag (tags: protocol-v2, protocol-p2r, protocol-f3, protocol-volve). Hash lock before run is supported. protocol-p2r tagged 06:48 27/10, before 06:55 main run. | "The protocol of Experiment~2 was also committed and tagged in version control before its main runs; that of Experiment~1 was locked by hash before its main run but committed only afterwards, without a tag." |
|
||||||
|
| G3-02 | 06:80 (+L161 caption) | "Cells at $c = 2$ are reported with an ``unstable posterior'' flag and are not used as primary evidence" | CLAIM | S2 | protocol_p2r.yaml: flag = not primary evidence for H2a; H2b 8/8 includes 4 c=2 cells, ρ over all c (verdict.json h2b). | "...not used as primary evidence for H2a (...); the registered H2b tests include them." / caption "...not primary evidence for H2a." |
|
||||||
|
| G3-03 | 06:166 | "The SMC posterior was close to calibrated when the anchors were dense and $\sigma_a$ was correct." | CLAIM | S2 | sigma_post.csv c=1 N=16 warp_cov90: R10 0.886, R0 0.860, Rm5 0.862; plan §10 bars calibration wording. | "When the anchors were dense and $\sigma_a$ was correct, the 90\% coverage of the SMC warp posterior was near, but below, nominal." |
|
||||||
|
| G3-04 | 06:83 | "by 11\% at R0 and by 8\% at Rm5" | NUM | S3 | Rm5 c=1 ratios 0.915 (N=4), 0.923 (N=16) → 8.5%, 7.7%. | "by 8--9\% at Rm5" |
|
||||||
|
| G3-05 | 06:208 vs 129 | "two of these by at most 0.003, and in no cell at the measured warp error." | XREF | S3 | bound.csv margins R0h 0.0023, R10tb 0.0037; L129 says "less than 0.004"; b60/cross-spectral variants give 1 cell (R0 c=1), reported at L131. | "two of these by less than 0.004, and in no cell at the measured warp error under the base estimator (one, R0, under the 60\,Hz and cross-spectral variants)." |
|
||||||
|
| G3-06 | 06:15 | "it stayed 20--24\% above the oracle" | NUM | S3 | p2 methods.csv c=1 M2/Oracle: 1.1997, 1.1998, 1.2468, 1.2420. | "20--25\%" |
|
||||||
|
| G3-07 | 06:208 | "At $c = 2$ neither structure fitted, and for B3c-R the anchor-referenced test is not clean" | FACT | S2 | t2/test_iv.csv B3d-Sa N=16 c=2 verdict_anch: Rm5 "Berkson"; others "neither". | "At $c = 2$ the anchored test gave Berkson only at Rm5 and neither structure in the other three cells, and for B3c-R..." |
|
||||||
|
| G3-08 | 06:214 (heading 213; also 223) | "...and one (R0, $c = 1$) was borderline" | CLAIM | S2 | t2-mechanism.md (ii) categories A/B/C/D, no "borderline"; test_ii.csv & meta.json: R0 c=1 = "B: against (a)" (Ctl-GP/PM 0.987 [0.972,1.003] vs M2-Sa/PM 0.967 [0.955,0.979]). "most of the gain at c=1" holds 3/4 cells. | "...and one (R0, $c = 1$) was read as against label augmentation under the declared rule (Ctl-GP interval reaching 1.003)"; heading "...gets most of the gain in three of the four cells at $c = 1$"; same at L223. |
|
||||||
|
| G3-09 | 06:223 | "information specific to the SMC bank mattered at $c = 2$, where the posterior is unstable and often multimodal." | CLAIM | S2 | test_iii.csv m_u N=16 c=2: R0 0.070, R0h 0.188, R10tb 0.508, Rm5 0.039; contradicts L220. | "...at $c = 2$, where the posterior is unstable (and, at R10tb, often multimodal)." |
|
||||||
|
| G3-10 | 06:219–220 | "No evidence that multimodality drives the gain." ... "a borderline result." | CLAIM | S3 | primary (m_u≥0.25): no evidence (D_adj −0.012 [−0.043,0.020]); sensitivity criterion meets declared "evidence for (b)" (meta.json test_iii.any.verdict). | heading "(iii) No evidence under the primary criterion that multimodality drives the gain."; "...which meets the declared criterion for evidence of (b) only marginally." |
|
||||||
|
| G3-11 | 06:214 | "marginal standard deviation 0.98--0.99 ... warp error 1.00--1.03 times" | NUM | S3 | test_ii.csv cell-level ctl_sd_ratio 0.978–0.999; err ratio 0.998–1.023 (all), 1.005–1.023 (wide). No file gives paper ranges. | "0.98--1.00" and "1.00--1.02" (or author) |
|
||||||
|
| G3-12 | 06:211 | "Training length thus accounts for 29--35\% of the registered gap" | NUM | S3 | test_v.csv c=1: 0.2955, 0.3107, 0.3493. | "30--35\%" |
|
||||||
|
| G3-13 | 06:178 | "...a larger $\xi$ and a higher coverage than the Oracle in 80--99\% of the 240 realization cells." | NUM | S3 | t4/cells.csv: each separately 80–99%; both jointly 75.0–98.3%. | "...a larger $\xi$, and a higher coverage, than the Oracle in 80--99\% of the 240 realization cells (each criterion separately)." |
|
||||||
|
| G3-14 | 06:217 | "with 13--40\% lower warp error" | NUM | S3 | test_i.csv: 0.126–0.394. | "13--39\%" |
|
||||||
|
|
||||||
|
Not checked: figure contents (captions only), blur_ab.csv, content of internal cross-refs, T2 declaration timing beyond self-recorded hash + logs/index.csv, sd(β)≈25 ms formula.
|
||||||
|
|
||||||
|
### Findings G4: 06_experiments.tex L225–421 (benchmark, T3, field scope) (saved by main session from subagent report)
|
||||||
|
|
||||||
|
Counts: S1 0, S2 4, S3 14. ~400 numbers (~392 OK), 1 cite OK, ~50 claims (~38 OK). Both D-13 readings reported; S2-H1 failures stated; no general-robustness claim.
|
||||||
|
|
||||||
|
| ID | file:line | issue | sev | evidence | fix |
|
||||||
|
|---|---|---|---|---|---|
|
||||||
|
| G4-01 | 06:250, 370 | "every method retrained at 500 iterations" | S2 | protocol_bench.yaml training.equal_budget_arm: trajectories record prediction at 500 its; equal_budget.csv 70 S1 rows (30 Exp.2 cells absent) | :250 "and a record of every method's prediction at 500 iterations of the same training trajectories"; :370 "Every method's training trajectory was also evaluated at 500 iterations, in the cells run in Experiment 3 (not in the cells read from Experiment 2); no rule uses this arm." |
|
||||||
|
| G4-02 | 06:370 | "No result above changed direction." | S2 | rule better RML/PM flips 14/70 S1 cells (wide 30/36→26/36), ratios 0.970–1.0035; PM/best crosses 1 at R0h c1 N2 | "No verdict-level result changed direction; the rule *better* for RML/PM changed outcome in 14 of the 70 S1 cells evaluated, all with ratios between 0.97 and 1.01 at both budgets." |
|
||||||
|
| G4-03 | 06:232 caption | budgets "those of Experiment 2" | S3 | B4a–d use protocol_p2 values 125/125/500/250 | add "(for B4a--B4d, those of Experiment~1)" |
|
||||||
|
| G4-04 | 06:303 | "diagnostics stayed near nominal (3.1–4.1 ms; 0.74–0.88) except dr_L1" | S2 | s2_smc.csv: ranges include dr_L1; without: 3.08–4.01, 0.742–0.858; wv_L2 +22%, dr_L2 +21% | "stayed within 22% of nominal (3.1--4.0 ms; 0.74--0.86), except dr_L1; several presets exceeded the ±10% seen on dev" |
|
||||||
|
| G4-05 | 06:303 (+Sec 3.2) | "0.22--0.34 of the noise" | S3 | bench-protocol dev table wv_L1 0.19 | "0.19--0.34" |
|
||||||
|
| G4-06 | 06:326 tab:s2 dr_L2 | "1.03" | S3 | s2_degradation.csv 1.02479 | "1.02" |
|
||||||
|
| G4-07 | 06:332 | "1.21 … 0.82 and 0.79 … 0.46 for PM" | S3 | 1.2049, 0.8147, 0.7848, 0.4547 | "1.20, 1.14, 0.81 and 0.78 … 0.45" |
|
||||||
|
| G4-08 | 06:340 | "37% at Rm5" | S3 | BK2/PM2 0.6353 | "36%" |
|
||||||
|
| G4-09 | 06:370 | "unchanged within 0.01" | S3 | max change 0.0125 at Δ8 | "changed by at most 0.013 (0.01 at Δ∈{16,32} ms)" |
|
||||||
|
| G4-10 | 06:253 | D-13 "three places … differ only for S3-H1" | S3 | S2-H1 no top-level pass; S1-H1 as run null | reword |
|
||||||
|
| G4-11 | 06:340, 373 | BK2 "more than average … re-registration" | S2 | cos² comparison post hoc (--flipband) | add "In a post hoc comparison," / "(post hoc)" |
|
||||||
|
| G4-12 | 06:334 | "beyond first two moments mattered where unstable" | S3 | s3_control: c=2 only, descriptive | "mattered mainly at c=2, where the posterior is unstable (descriptive)" |
|
||||||
|
| G4-13 | 06:228 | "S4 repeats three cells" | S3 | six cells (3 regimes × N 4,16) | "six cells (three regimes, N∈{4,16})" |
|
||||||
|
| G4-14 | 06:228 | "numbered as in the protocol" | S3 | protocol has no S5–S7 | "numbered as in the study plan" |
|
||||||
|
| G4-15 | 06:373 | "misspecified warp prior" | S3 | only dr_L1 passes | "a moderately misspecified warp prior (dr_L1)" |
|
||||||
|
| G4-16 | 06:421 | "Three … synthetic seismograms" | S3 | 2 "synthetic log", 1 "synthetic seismogram" | reword |
|
||||||
|
| G4-17 | 06:414–415 | "Both field gates failed." | S3 | G-D declared descriptive | add "(G-D was declared descriptive)" |
|
||||||
|
| G4-18 | 06:421 | 1.5 ms tolerance at ≤115 wells | S3 | N*=58 at 1.5 ms by script-27 formula; not in an output file | add "(58 wells by the formula of the power analysis; Table stops at 40)" |
|
||||||
|
|
||||||
|
Not checkable: neighbour-well correlation (prose only), VSP depth, declaration timing vs download, 91/100 at 500 its, figure images.
|
||||||
|
|
||||||
|
### Findings G5: 07_discussion (all), B_field (all) (saved by main session from subagent report)
|
||||||
|
|
||||||
|
Counts: S1 1, S2 12, S3 14. ~610 numbers (~585 OK), ~85 claims (~70 OK). Gate verdicts correct; no P4x; no field/calibration claim.
|
||||||
|
|
||||||
|
| ID | file:line | issue | sev | fix |
|
||||||
|
|---|---|---|---|---|
|
||||||
|
| G5-01 | 07:27 | "F3 label linear in sonic at three of four wells" — PHIE_DT is linear at all four | S1 (verified) | "The F3 label PHIE_DT is, moreover, a linear function of the sonic at all four wells (the original PHIE at three of them)" |
|
||||||
|
| G5-02 | 07:18 | "passed in all eight wide cells at N=16" — 4 at c=2 (unstable flag) | S2 | add "(four at c=1; the other four at c=2, flagged unstable)" |
|
||||||
|
| G5-03 | 07:21 | "Halving or doubling removed the H2a advantage in every cell" — 14 ms left 7% gain at N=16 | S2 | "No cell passed the H2a rule when halved or doubled (doubling left a 7% gain at N=16 whose interval reached 1)" |
|
||||||
|
| G5-04 | 07:5 | "Exp. 1 direct evidence marginalization does not rescue" — M2 beat B3d by 3%, 11% | S2 | "in Exp. 1 marginalizing over a poor posterior improved on its mean but not on the best point tie" |
|
||||||
|
| G5-05 | 07:31 | "three axes, at two levels each; H2a held only under misspecified warp prior" — seven presets, wavelet three | S2 | "three axes (seven presets); at R10, H2a held in both cells only under dr_L1" |
|
||||||
|
| G5-06 | 07:34 (+05) | "At c=2 the SMC posterior was multimodal" — 51% R10tb, 19% R0h | S2 | "mean warp unstable between runs, and the posterior often multimodal (51% of wells at R10tb, 19% at R0h)" |
|
||||||
|
| G5-07 | 07:37 | F3 macro cov80 0.38–0.52 "every probabilistic method" — M2-fixed-sigma ablation 0.87 | S2 | "every registered method (Table f3all)" |
|
||||||
|
| G5-08 | B:104 | "without B3a, the 13 networks" — 12 | S2 | "the other 12 networks" |
|
||||||
|
| G5-09 | B:104 | "by up to 0.06 p.u." — up to 0.14 vs B3a | S2 | "by 0.002–0.14 p.u. (up to 0.06 relative to PM and RML)" |
|
||||||
|
| G5-10 | B:104 | "Band PCC did not exceed 0.22 for any network" — M2-bulk ablation 0.242 | S2 | "for any network in Table f3all" |
|
||||||
|
| G5-11 | B:104 | "Every probabilistic method under-covered" | S3 | "of Table f3all" |
|
||||||
|
| G5-12 | B:226 (+06:415) | "each method predicted held-out well worse than own mean" — F-1 B lowo R² 0.10–0.34 | S2 | add exception F-1 B |
|
||||||
|
| G5-13 | 07:18 | "cheaper alternative" Ctl-GP — no cost result | S2 | delete "cheaper" |
|
||||||
|
| G5-14 | 07:18 | "Exp 3 confirms" | S3 | "extends" |
|
||||||
|
| G5-15 | 07:15 | "No evidence linked gain to multimodality" | S3 | "No clear evidence (one borderline split)" |
|
||||||
|
| G5-16 | 07:5 | "stayed as wide as anchors allowed" — 3.15 vs 3.71 | S3 | "barely contracted (3.15 against 3.71 ms)" |
|
||||||
|
| G5-17 | B:108 | omits F06-1 worse by 1.2% | S3 | add |
|
||||||
|
| G5-18 | B:111 | "no ratio by more than 0.01" — 0.0107; 8 Hz 2/4 | S3 | reword |
|
||||||
|
| G5-19 | 07:27 | "shift ... up to 0.15" — is 5–95% range width | S3 | reword |
|
||||||
|
| G5-20 | B:192 | 5.8%, 7.1% → 5.7, 7.2 | S3 | |
|
||||||
|
| G5-21 | B:251 | at most 0.06 → 0.07 | S3 | |
|
||||||
|
| G5-22 | B:226, 07:27 | up to 0.25 → 0.26 | S3 | |
|
||||||
|
| G5-23 | B:226 | "Networks beat it only at F-1 and F-1 B" — slot F-1 only PM, RML | S3 | add qualifier |
|
||||||
|
| G5-24 | 07:24 | check shots/VSP "can meet" | S3 | "can in principle meet; we did not test their accuracy" |
|
||||||
|
| G5-25 | 07:24 | "per-well error 5–7 ms" | S3 | "residual SD 6.75 ms (robust 5.0 ms)" |
|
||||||
|
| G5-26 | B:135 | 1.8–6.2 → 1.9–6.2 | S3 | |
|
||||||
|
| G5-27 | B:140 | twelve variants of RML — one is PM | S3 | "twelve ablations, eleven of RML and one of PM" |
|
||||||
|
|
||||||
|
Could not check: B:104 1.224 (not stored), 07:36 phase attribution, B:207 gate recompute, pilot/smoke logs, "adds little to training".
|
||||||
|
|
||||||
104
docs/research/paper-style-survey.md
Normal file
104
docs/research/paper-style-survey.md
Normal file
@@ -0,0 +1,104 @@
|
|||||||
|
# Văn phong bản thảo: bài học từ abstract, survey C&G và bảng tên gọi (09/11/2026)
|
||||||
|
|
||||||
|
Tài liệu này ghi lại cơ sở của đợt viết lại `paper/sections/` ngày 09/11/2026 (`docs/plan.md` §12 mục 38).
|
||||||
|
|
||||||
|
## 1. Abstract đã thay đổi thế nào qua các commit
|
||||||
|
|
||||||
|
| Commit | Ngày | Số từ | Đặc điểm |
|
||||||
|
|---|---|---|---|
|
||||||
|
| 4a5d0b2 | 28/10 | khoảng 480 | Kể theo trình tự làm việc: số liệu F3, Mệnh đề 1, RML, thất bại, SMC, field. Như nhật ký thí nghiệm. |
|
||||||
|
| 0cfe202, 381b5ff, 423a333, bbdb829 | 29/10–04/11 | 270 → 458 | Một đoạn dài. Mỗi đợt audit chèn thêm một ngoặc điều kiện: "(R10, $c = 1$)", "(one with its interval clear of the bound)", "9 of its 11 verdicts", "We make no field or calibration claim". |
|
||||||
|
| fc15bf6 | 09/11 | 241 | Bản người dùng chọn làm mẫu. |
|
||||||
|
|
||||||
|
Bản fc15bf6 làm khác các bản trước ở những điểm sau, và đây là các quy tắc áp dụng cho phần còn lại của bài:
|
||||||
|
|
||||||
|
1. **Vấn đề một câu, câu hỏi một câu.** Không dẫn dắt.
|
||||||
|
2. **Nói kết quả bằng lời trước, ký hiệu sau.** "errors independent of the data blur the optimal predictor and attenuate the seismic band".
|
||||||
|
3. **Đặt điều kiện ở đầu câu, không nhét ngoặc ở cuối.** "When the tie model is correctly specified and dense time--depth anchors have known uncertainty, ...".
|
||||||
|
4. **Dùng đại lượng vật lý thay mã.** "signal-to-noise ratios of 10, 0 and $-5$\,dB" thay cho R10, R0, Rm5.
|
||||||
|
5. **Một ý tương phản dùng một liên từ** ("whereas"), không tách thành hai câu rào đón.
|
||||||
|
6. **Con số đi sau ý, kèm đơn vị và đối tượng so sánh.** "reducing seismic-band RMSE by 8--22% relative to the best deterministic tie".
|
||||||
|
7. **Không kể quy trình** (số verdict, hash, ai làm trước ai). Quy trình vẫn được công bố, nhưng ở chỗ dành cho nó.
|
||||||
|
8. **Thất bại được viết như một phát hiện có lý do.** "Field validation remains open: F3 and Volve, where we found no consistent improvement, have too few wells with independent, accurate time--depth references to detect such gains."
|
||||||
|
9. **Kết bằng một yêu cầu định lượng**, không bằng lời miễn trừ.
|
||||||
|
|
||||||
|
## 2. Survey C&G
|
||||||
|
|
||||||
|
**Giới hạn cần nói rõ.** Elsevier từ chối truy cập tự động, nên agent không tự đọc được toàn văn các bài C&G bản chính thức: Gravey 2026, Shishaev et al. 2026, Tschannen et al. 2022, Yunjun et al. 2019. Tôi không cố vượt qua việc chặn này. Bằng chứng gồm:
|
||||||
|
|
||||||
|
- Baddeley et al. 2025 (C&G 204, 105965), bản chính thức do người dùng tải về `refs/baddeley2025.pdf`: đọc toàn bộ thân bài, Phụ lục A và phần định lý của Phụ lục C; không đọc Phụ lục B và phần cuối Phụ lục C.
|
||||||
|
- Toàn văn preprint arXiv của hai bài đã đăng trên C&G: Zhu et al. (arXiv 2003.06027, DOI 10.1016/j.cageo.2021.104751; đọc toàn bộ thân bài) và Barbosa et al. (arXiv 2001.06444, DOI 10.1016/j.cageo.2020.104615; đọc đến khoảng 65%). Preprint có thể khác bản đã đăng.
|
||||||
|
- Abstract của 36 bài C&G lấy từ OpenAlex (lọc ISSN 0098-3004, 2015–2026), gồm cả Baddeley, Gravey, Shishaev.
|
||||||
|
|
||||||
|
Nếu muốn mở rộng survey, người dùng có thể tải PDF bốn bài còn lại (đều open access, trừ cần kiểm lại Yunjun) vào `refs/`.
|
||||||
|
|
||||||
|
**Kết quả.**
|
||||||
|
|
||||||
|
| Quy ước | Baddeley et al. | Zhu et al. | Barbosa et al. | 36 abstract |
|
||||||
|
|---|---|---|---|---|
|
||||||
|
| Tên kịch bản và phương pháp | Dữ liệu bằng lời ("Murchison example"); vài mã có nghĩa, định nghĩa ngay khi đưa ra: rule S ("separate"), rule R ("respect"), S1–S4, R1–R4 | Bằng lời ("Marmousi benchmark model") | Bằng lời, thêm số giai đoạn ("Stage 1") | 2/36 có mã tự đặt kiểu thuật ngữ riêng (H11/H22, WSM6), không có mã kịch bản như R10 |
|
||||||
|
| Bảng ký hiệu | Có, ở phụ lục (Table C.2 "Summary of notation"); thân bài định nghĩa tại chỗ | Không có; định nghĩa trong "where" sau phương trình | Như vậy | -- |
|
||||||
|
| Từ viết tắt | Định nghĩa tại chỗ (WofE, MPM) | Định nghĩa tại chỗ lần đầu | Như vậy | -- |
|
||||||
|
| Trình bày lý thuyết | Thân bài giải thích bằng lời và hình; Theorem C.1 và 2 hệ quả ở Phụ lục C, chứng minh ở tài liệu riêng; có mục ví dụ số "Practical application of error bounds" | Một Theorem chính thức, chứng minh ngắn, ý chính nói bằng lời ngay ở abstract | Dẫn giải, không có định lý | -- |
|
||||||
|
| Giới hạn | Phần việc gác lại nêu ngay ở Introduction; mục "Limitations of study" và mục riêng "Practical advice" | Mục "Limitations" riêng, 3 ý, mỗi ý có hướng xử lý | Một lưu ý rồi kiểm tra ngay | -- |
|
||||||
|
| Độ dài | 13 trang; thân bài khoảng 6.500 từ kể cả chú thích; câu trung vị 22 từ, p90 là 41 từ (đếm thô) | Câu 20–40 từ, đoạn 4–7 câu | Câu 20–35 từ, đoạn 4–7 câu | Abstract trung vị 248 từ, câu trung vị 22 từ |
|
||||||
|
|
||||||
|
Baddeley et al. 2025 là mẫu gần nhất: bài có toán, kết luận là một phân tích phổ biến bị bất ổn. Mạch bài là cho thấy thất bại trên dữ liệu thật ngay ở Sec. 2 ("does not converge to a single value"), giải thích nguyên nhân gốc ở Sec. 3–4 ("The root cause of the numerical instability is a geometrical effect"), đề xuất cách sửa ở Sec. 5, chạy lại ở Sec. 6, rồi đưa cận sai số kèm ví dụ số ở Sec. 7. Thất bại, nguyên nhân, cách sửa nối nhau thành xương sống của bài. Bài này không báo cáo thử nghiệm field thất bại theo kiểu của ta, và cũng không có quy trình pre-registration, nên hai phần đó vẫn không có khuôn mẫu trực tiếp.
|
||||||
|
|
||||||
|
**Hệ quả cho bài.** Không dùng mã tùy ý trong văn bản, bảng và chú thích; một vài mã ngắn có nghĩa, định nghĩa ngay tại chỗ, thì C&G vẫn chấp nhận (Baddeley dùng S và R). Bảng ký hiệu có tiền lệ (Table C.2) và đã được thêm theo yêu cầu của referee (`tab:symbols`). Giữ môi trường Proposition, mỗi kết quả có câu nói bằng lời ngay trước nó. Giới hạn nêu kèm hướng xử lý.
|
||||||
|
|
||||||
|
**Gợi ý từ Baddeley, đã áp dụng ngày 09/11 (`docs/plan.md` §12 ý 39).** (1) Thêm một ví dụ số cho cận sai số của reference, dùng số đã có trong bài. (2) Gom các khuyến nghị thành một đoạn "Practical advice". (3) Chuyển phát biểu hình thức của Sec. 5 sang phụ lục và giữ lời giải thích ở thân bài: đây là cách rút độ dài mạnh nhất (thân bài của ta khoảng 16.000 từ so với khoảng 6.500), nhưng là thay đổi cấu trúc lớn.
|
||||||
|
|
||||||
|
## 3. Quy tắc viết (áp dụng cho Sec. 1–8 và phụ lục)
|
||||||
|
|
||||||
|
1. Câu đầu đoạn nói kết luận của đoạn; tiêu đề `\paragraph` là một câu trả lời khi có thể.
|
||||||
|
2. Mỗi thất bại đi theo thứ tự: điều gì trượt, vì sao (bằng chứng), bài học. Nếu nguyên nhân chưa được kiểm tra thì viết rõ là chưa kiểm tra.
|
||||||
|
3. Thành công và thất bại được nêu ngang nhau ở Sec. 1, 7, 8 (bảng `tab:lessons`).
|
||||||
|
4. Hồ sơ quy trình (thời điểm khóa, độ lệch, hai cách đọc verdict, cấu hình phụ) chuyển sang Phụ lục C; thân bài chỉ giữ một câu công bố cùng tham chiếu.
|
||||||
|
5. Áp dụng `.agents/skills/academic-humanizer` (không có skill tên `/humanizer`; đây là skill tương ứng trong repo): không em-dash, không từ vựng AI, câu dài hơn khoảng 30 từ thì tách, động từ không mạnh hơn bằng chứng.
|
||||||
|
6. Không đổi số, verdict, ngưỡng, trích dẫn; không xóa `\todo`.
|
||||||
|
|
||||||
|
## 4. Bảng tên gọi: bài báo ↔ mã trong repo
|
||||||
|
|
||||||
|
Mã trong repo (config, output, code) không đổi. Mapping đầy đủ cũng nằm trong `paper/README.md`.
|
||||||
|
|
||||||
|
| Trong bài | Mã repo |
|
||||||
|
|---|---|
|
||||||
|
| 10 dB / 0 dB / $-5$ dB (full anchors) | R10 / R0 / Rm5 |
|
||||||
|
| 0 dB, half anchors | R0h |
|
||||||
|
| 10 dB, two anchors | R10tb |
|
||||||
|
| SMC mean | B3d-Sa |
|
||||||
|
| SMC bank | M2-Sa |
|
||||||
|
| anchor mean | B3d |
|
||||||
|
| anchor bank / reweighted anchor bank | M1 / M2 |
|
||||||
|
| sonic tie / calibrated sonic | B3a / B3b |
|
||||||
|
| correlation tie / phase-estimated correlation tie | B3c / B3c-R |
|
||||||
|
| hard-min shift / soft-min shift / soft-DTW / DILATE | B4a / B4b / B4c / B4d |
|
||||||
|
| calibrated-sonic ensemble | B5 |
|
||||||
|
| depth--time trend / attribute models / impedance inversion / composite loss | B0a / B0b / B1 / B2 |
|
||||||
|
| Gaussian bank | Ctl-GP |
|
||||||
|
| midpoint label / two-member bank / two-member hard-min | PM2 / BK2 / HM2 |
|
||||||
|
| blur test / anchor-removal test / calibration hypothesis | H1 / H4 / H3 |
|
||||||
|
| posterior-mean claim / bank claim | H2a / H2b |
|
||||||
|
| drift--well-count grid / misspecification study / alignment-loss comparison / backbone check / two-mode study | S1 / S2 / S3 / S4 / S8 |
|
||||||
|
| rock physics mild, strong / wavelet phase mild, strong / attenuation / scaled warp prior / out-of-family warp | rp_L1, rp_L2 / wv_L1, wv_L2 / wv_Q / dr_L1 / dr_L2 |
|
||||||
|
| Experiment 1 pass rule / F3 pass rule / Volve pass rule | G-B / G-C / G-D |
|
||||||
|
| skill, width, anchor-uncertainty, well-count conditions | C1, C2, C3, C4 (Sec. 6.7) |
|
||||||
|
| classical bound $\rho^\star_{\mathrm{cl}}$ / Berkson bound $\rho^\star_{\mathrm{Bk}}$ | $1/B_a$ / $1/B_b$ |
|
||||||
|
| assumption (A3) | (B) trong Mệnh đề nhận dạng |
|
||||||
|
| blind wells needed $n^\star$ | $N^\star$ |
|
||||||
|
| $N_p$ (số particle) | $P$ |
|
||||||
|
| $\nu$ và $\omega = 1/\nu$ (tie tempering) | $\kappa$ và $\gamma = 1/\kappa$ |
|
||||||
|
|
||||||
|
## 5. Kết quả kiểm tra bằng 2 referee Fable (09/11/2026)
|
||||||
|
|
||||||
|
| Tiêu chí | Vòng 1: R1 / R2 | Vòng 2: R1 / R2 | Vòng 3: R1 / R2 |
|
||||||
|
|---|---|---|---|
|
||||||
|
| Chuyên môn | Đạt có điều kiện / Đạt có điều kiện | Đạt / Đạt | Đạt / Đạt |
|
||||||
|
| Dễ hiểu | Trượt / Trượt | Đạt / Đạt | Đạt / Đạt |
|
||||||
|
| Súc tích | Trượt / Trượt | Đạt / Đạt | Đạt / Đạt |
|
||||||
|
| Cân đối fail và thành công | Đạt / Đạt | Đạt / Đạt | Đạt / Đạt |
|
||||||
|
| Fail có insight | Đạt nhưng còn thiếu / Đạt nhưng còn thiếu | Đạt / Đạt | Đạt / Đạt |
|
||||||
|
| Khuyến nghị | Major / Major | Minor / Minor | Accept sau sửa nhỏ / Accept sau sửa nhỏ |
|
||||||
|
|
||||||
|
R1 là góc địa vật lý, R2 là góc thống kê và lý thuyết (R2 chứng minh lại toàn bộ Sec. 5 và Phụ lục A). Vòng 3 đọc bản đã chuyển phát biểu hình thức sang Phụ lục A. Các sửa nhỏ cuối đã áp dụng; cả hai referee cho biết không cần đọc thêm.
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
# Phân tích hiện trạng và hướng chuyển sang bài lý thuyết + synthetic benchmark
|
# Phân tích hiện trạng và hướng chuyển sang bài lý thuyết + synthetic benchmark
|
||||||
|
|
||||||
Ngày viết: **29/10/2026**. Trạng thái: **đã chốt** ở mục 6 (29/10/2026); mức A viết xong sớm ngày 29/10 (`docs/plan.md` §12 ý 24). Mục 0–5 giữ nguyên phân tích lúc viết; chỗ nào đã đổi có ghi chú *Cập nhật* hoặc *Sửa* kèm ngày. Mọi số liệu dưới đây lấy từ `docs/plan.md` §12, `docs/theory.md`, `outputs/p2r/summary/`, `outputs/p3/summary/`, `outputs/p4/summary/`, `outputs/p4x/summary/` và bản nháp `paper/sections/`. Không có kết quả mới nào được tính trong tài liệu này.
|
Ngày viết: **29/10/2026**. Trạng thái: **đã chốt** ở mục 6 (29/10/2026); mức A viết xong sớm ngày 29/10 (`docs/plan.md` §12 ý 24). Benchmark S1–S8 (P6) đã chạy (29–30/10) và tổng hợp ngày 02/11/2026: 9/11 verdict đạt, S2-H1 trượt ở trục rock physics và wavelet (`docs/plan.md` §12 ý 28). S7 đóng gói xong cùng ngày, trừ deposit Zenodo (§12 ý 29). Các mục 1–2 dưới đây là phân tích khoảng trống tại 29/10, giữ nguyên làm lịch sử. Mục 0–5 giữ nguyên phân tích lúc viết; chỗ nào đã đổi có ghi chú *Cập nhật* hoặc *Sửa* kèm ngày. Mọi số liệu dưới đây lấy từ `docs/plan.md` §12, `docs/theory.md`, `outputs/p2r/summary/`, `outputs/p3/summary/`, `outputs/p4/summary/`, `outputs/p4x/summary/` và bản nháp `paper/sections/`. Không có kết quả mới nào được tính trong tài liệu này.
|
||||||
|
|
||||||
Bối cảnh: cả hai field test đều âm (G-C trên F3, G-D trên Volve). Plan §9 đã liệt kê sẵn **Pivot 1** ("chuyển thành bài phân tích: lý thuyết, benchmark và đánh giá có xét registration; phương pháp chỉ là phần phụ"). Tài liệu này rà lại toàn bộ đề tài để tìm các vấn đề tồn đọng, rồi đề xuất cách triển khai Pivot 1 thành một bài **lý thuyết + benchmark**.
|
Bối cảnh: cả hai field test đều âm (G-C trên F3, G-D trên Volve). Plan §9 đã liệt kê sẵn **Pivot 1** ("chuyển thành bài phân tích: lý thuyết, benchmark và đánh giá có xét registration; phương pháp chỉ là phần phụ"). Tài liệu này rà lại toàn bộ đề tài để tìm các vấn đề tồn đọng, rồi đề xuất cách triển khai Pivot 1 thành một bài **lý thuyết + benchmark**.
|
||||||
|
|
||||||
@@ -167,7 +167,7 @@ Không "first"; không gọi synthetic là generalization ra field; không claim
|
|||||||
- A1: abstract (292 từ sau lượt tự sửa A6), intro, đóng góp C1–C4, discussion, conclusion, tiêu đề, keywords, `paper/highlights.txt` viết lại theo khung Pivot 1. F3 và Volve thành mục "scope" (bài mục 6.6); chi tiết sang Phụ lục B.
|
- A1: abstract (292 từ sau lượt tự sửa A6), intro, đóng góp C1–C4, discussion, conclusion, tiêu đề, keywords, `paper/highlights.txt` viết lại theo khung Pivot 1. F3 và Volve thành mục "scope" (bài mục 6.6); chi tiết sang Phụ lục B.
|
||||||
- A2: T1 thành Mệnh đề 3–4 (kèm sửa cách đọc cận, xem hàng T1 ở mục 2.1), T4 thành Mệnh đề 5, T8 thành Hệ quả 3; thêm Nhận xét 1 (λ > 0), Mệnh đề 6 và Hệ quả 4 (reference lệch, dung sai σ_r < σ/√2).
|
- A2: T1 thành Mệnh đề 3–4 (kèm sửa cách đọc cận, xem hàng T1 ở mục 2.1), T4 thành Mệnh đề 5, T8 thành Hệ quả 3; thêm Nhận xét 1 (λ > 0), Mệnh đề 6 và Hệ quả 4 (reference lệch, dung sai σ_r < σ/√2).
|
||||||
- A3: `scripts/30_t4_coverage.py` → `outputs/t4/` (bài mục 6.3, Bảng `tab:t4`).
|
- A3: `scripts/30_t4_coverage.py` → `outputs/t4/` (bài mục 6.3, Bảng `tab:t4`).
|
||||||
- A4: `scripts/27_t3_power.py` → `outputs/t3/` (bài mục 6.5). Khác với phác thảo ở bảng trên: reference là nhãn thật đọc tại một warp nhiễu loạn có độ lớn σ_ref (không phải nhãn point tie), và luật được đánh giá là sign test một phía; luật k-of-n chỉ dùng để chỉ ra nó không phải phép kiểm. Khai báo trước ở `docs/research/applicability-teapot.md` (Deviation 1: mở rộng lưới σ_ref).
|
- A4: `scripts/27_t3_power.py` → `outputs/t3/` (bài mục 6.5; từ 02/11/2026 là 6.6, sau khi Thí nghiệm 3 thành mục 6.5). Khác với phác thảo ở bảng trên: reference là nhãn thật đọc tại một warp nhiễu loạn có độ lớn σ_ref (không phải nhãn point tie), và luật được đánh giá là sign test một phía; luật k-of-n chỉ dùng để chỉ ra nó không phải phép kiểm. Khai báo trước ở `docs/research/applicability-teapot.md` (Deviation 1: mở rộng lưới σ_ref).
|
||||||
- A5: đoạn "Label noise and errors in variables" ở bài mục 2 (Mnih & Hinton 2012 đọc toàn văn; Balakrishnan 1962 chỉ có metadata).
|
- A5: đoạn "Label noise and errors in variables" ở bài mục 2 (Mnih & Hinton 2012 đọc toàn văn; Balakrishnan 1962 chỉ có metadata).
|
||||||
- A6: `docs/plan.md` §12 ý 22–24, `AGENTS.md`, `report.html`, `docs/theory.md` mục 6. Trong A6, agent phát hiện và sửa hai nhận định sai của chính mình về cận ρ*: hệ số giữa hai cấu trúc, và câu "lợi ích vượt cận" (`docs/plan.md` §12 ý 24).
|
- A6: `docs/plan.md` §12 ý 22–24, `AGENTS.md`, `report.html`, `docs/theory.md` mục 6. Trong A6, agent phát hiện và sửa hai nhận định sai của chính mình về cận ρ*: hệ số giữa hai cấu trúc, và câu "lợi ích vượt cận" (`docs/plan.md` §12 ý 24).
|
||||||
|
|
||||||
|
|||||||
45
docs/research/server-migration.md
Normal file
45
docs/research/server-migration.md
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
# Chuyển sang server mới
|
||||||
|
|
||||||
|
Ngày viết: **30/10/2026** (server H200 sắp bị thu hồi). Remote: `https://gitea.vts-ai.space/lamlvh/ML-Porosity`, nhánh `main`.
|
||||||
|
|
||||||
|
**Cách chuyển:** sync nguyên thư mục repo sang server mới (quyết định của người dùng, 30/10 khoảng 01:30 UTC). Git chỉ giữ code, config, docs và paper như bình thường; không đưa thêm file lớn lên gitea.
|
||||||
|
|
||||||
|
## 1. Có trong git
|
||||||
|
|
||||||
|
- Toàn bộ code, config, test, docs, paper; `configs/protocol_bench.{yaml,sha256,lock.json}` (khoá 29/10 14:39 UTC).
|
||||||
|
- Không có gì trong `outputs/`. Khoảng 600 MB output từng được `git add -f` và push lúc 30/10 01:05–01:15 UTC, theo 13 commit. Theo yêu cầu của người dùng, lịch sử đã được viết lại và force-push lúc khoảng 01:40 UTC: `main` = 381b5ff, chỉ code và docs.
|
||||||
|
|
||||||
|
## 2. Không có trong git (đi theo bản sync thư mục)
|
||||||
|
|
||||||
|
Danh sách từng file của `outputs/`, kèm sha256 (21.987 file, tạo 30/10 khoảng 02:20 UTC sau khi mọi chạy P6 đã xong, gồm cả `outputs/bench/s1`): `docs/research/unpushed_outputs.sha256`. Sau khi sync, kiểm tra bằng `sha256sum -c --quiet docs/research/unpushed_outputs.sha256`.
|
||||||
|
|
||||||
|
| Đường dẫn | Dung lượng | Vai trò |
|
||||||
|
|---|---|---|
|
||||||
|
| `outputs/bench/s1/` | khoảng 0,2 GB | Kết quả S1 (train cells, npz); `summarize` cần. |
|
||||||
|
| `outputs/bench/posterior/**/*_particles.npz` | 8,6 GB (784 file) | Particle SMC của P6; cần khi chạy thêm stage train. `summarize` chỉ đọc csv. |
|
||||||
|
| `outputs/bench/dev/posterior/**/*.npz` | 0,12 GB | Chỉ dùng cho dev. |
|
||||||
|
| `outputs/p2r/**` (npz) | 8,2 GB | Trong đó 102 artifact tham chiếu (1,4 GB, khoá `p2r_reference` của lock) được `freeze(check=True)` kiểm tra trước mọi stage posterior/train chính của P6. |
|
||||||
|
| `outputs/p3/**`, `outputs/p4/**`, `outputs/p2/**` (npz) | 5,2 + 4,7 + 2,4 GB | Lịch sử; P2/P3/P4 không chạy lại. |
|
||||||
|
| `outputs/p4x/` | 0,09 GB | Bản ghi P4x đã bỏ; không trích dẫn. |
|
||||||
|
| `data/Volve/` | 165 GB | Hash ở `data_manifest/volve.json`. P6 không dùng. |
|
||||||
|
| `data/F3_Demo_2023/` | 9,4 GB | Hash ở `data_manifest/f3_demo_2023.json`. P6 không dùng: bộ sinh D2 chỉ đọc `outputs/d2/horizon_grid.npz` và `outputs/wavelets.npz`. |
|
||||||
|
| `data/Teapot/` | 1,8 GB | Teapot đã dừng. |
|
||||||
|
| `data/NLOG/` | 0,03 GB | Hash ở `data_manifest/nlog.json`. |
|
||||||
|
| `refs/*.pdf` | khoảng 0,4 GB | Bản quyền nhà xuất bản; chỉ giữ cục bộ. |
|
||||||
|
| `logs/*.out`, `logs/runs/`, `logs/p2r_resume_*`, `logs/p6_*` | nhỏ | Log thô (`logs/index.csv` có trong git). |
|
||||||
|
| `.venv/` | | Tạo lại theo `README.md` nếu đường dẫn Python khác. |
|
||||||
|
|
||||||
|
## 3. Sau khi sync
|
||||||
|
|
||||||
|
- Kiểm tra dữ liệu: `python scripts/00_data_manifest.py --check` và lệnh `sha256sum -c` ở trên.
|
||||||
|
- Lock ghi torch 2.14.0+cu130. Nếu môi trường mới khác, `freeze(check=True)` báo lệch ở khoá `environment`. Khi đó **không** sửa lock: mọi lần chạy thêm phải là một phiên bản protocol mới, có ghi deviation. `summarize` không gọi `freeze(check=True)`.
|
||||||
|
- Các session tmux (`p6_*`) không đi theo bản sync. Mọi driver P6 đã xong lúc 02:16 UTC 30/10 và supervisor đã dừng (xem `docs/plan.md` §12 ý 26); không có gì cần resume. Summarize đã chạy trên server mới ngày 02/11/2026 (lock và sha256 của `outputs/bench/` khớp trước khi chạy; `docs/plan.md` §12 ý 28).
|
||||||
|
- `outputs/bench/package/` (S7, 02/11/2026, khoảng 845 MB) sinh sau bản sync nên không có trong `unpushed_outputs.sha256`. Không cần chép sang máy khác: chạy `scripts/37_bench_package.py generate` để sinh lại; lệnh này so sha256 nội dung với `benchmark/MANIFEST.json` (trong git). Sau đó chạy `tables` (cần `outputs/p2r` và `outputs/bench`).
|
||||||
|
|
||||||
|
## 4. Chuyển sang máy thứ ba (04/11/2026)
|
||||||
|
|
||||||
|
Máy hiện tại (`ssh-idp-lab-v2-0`, 2 × H200) có git ở `423a333`, còn `outputs/`, `data/` và `refs/` lấy từ bản chụp ngày 30/10. Kiểm tra ngày 04/11: 21.987/21.987 file của `unpushed_outputs.sha256` khớp sha256; F3, NLOG và Volve đủ file, đúng kích thước theo `data_manifest/*.json` (chưa băm lại). Thiếu các file sinh ra trên server trước ngày 02/11, ngoài git:
|
||||||
|
|
||||||
|
- **Đã sinh lại ngày 04/11 (khớp từng byte):** `outputs/bench/summary/` (`34_run_bench.py summarize`, rồi `36_bench_verdicts.py`), `outputs/bench/package/` (`37_bench_package.py generate`: 1.260 hash nội dung khớp `benchmark/MANIFEST.json`; `tables`: `benchmark/reference/` không đổi so với git; `selftest` PASS) và `outputs/repro/*.tar.gz` (`39_repro_package.py build`: `repro/MANIFEST.json` không đổi, gồm sha256 của cả 5 archive và của 22 file trong `outputs/bench/summary/`). `paper/main.pdf` đã build lại (68 trang, không có tham chiếu thiếu, bibtex không warning). Log ở `logs/runs/20261104-*`.
|
||||||
|
- **Môi trường:** `.venv` (system-site-packages trên `/opt/conda`) lệch lock `protocol_bench` ở numpy (2.5.3 so với 2.5.4), và thiếu tabulate cùng segyio. Đã cài vào `.venv` đúng các phiên bản đã khoá: `numpy==2.5.4 tabulate==0.10.0 segyio==1.9.14`.
|
||||||
|
- **Còn thiếu, cần người dùng chép từ máy cũ:** 7 PDF tải tay ngày 02/11 (`refs/{lim2025awsm,lim2025bootnet,li2024bpinn,guillon2020gtmetrics,castagna2026quality,rizzuti2024waveletflows,rizzuti2025uhr}.pdf`); `outputs_thesis/` (7 artifact, `data_manifest/thesis_outputs.json`; có lẽ chỉ từng có trên máy Windows); log thô ngày 02/11 (`logs/runs/20261102-*`, `logs/*.out`) và log P3 của máy Windows (chỉ là bản ghi).
|
||||||
205
docs/research/t2-mechanism.md
Normal file
205
docs/research/t2-mechanism.md
Normal file
@@ -0,0 +1,205 @@
|
|||||||
|
# T2 — Cơ chế của lợi ích bank (exploratory): khai báo trước
|
||||||
|
|
||||||
|
Ngày viết: **29/10/2026** (lịch gốc ở `docs/plan.md` §6.1 là 1/11/2026; làm sớm). Trạng thái: **exploratory, khai báo trước** (pre-declaration). Tài liệu này được viết và băm SHA-256 (`t2-mechanism.sha256`) **trước** khi tính bất kỳ đại lượng mới nào trên `outputs/p2r/` cho T2. Không sửa sau khi băm; thay đổi phải ghi thành mục "Deviation" có ngày ở cuối tài liệu kèm một dòng hash mới.
|
||||||
|
|
||||||
|
Liên quan: `docs/plan.md` §12 ý 22 (quyết định 3: T2 exploratory) và ý 24 (câu hỏi đổi ngày 29/10), `docs/research/pivot-theory-benchmark.md` §2.1 hàng T2 và §6, `docs/theory.md` §6 (Mệnh đề 3–6, Nhận xét 1, Hệ quả 3), `paper/sections/06_experiments.tex` mục 6.3–6.4 (todoblock T2), `configs/protocol_p2r.yaml` (khóa; không đụng).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 0. Trạng thái, phạm vi và công bố những gì đã xem
|
||||||
|
|
||||||
|
### 0.1 Tính chất
|
||||||
|
|
||||||
|
1. **Exploratory.** T2 được thiết kế **sau khi** đã thấy toàn bộ kết quả P2r (H2a, H2b, nhánh σ_a, H3 mô tả) và phân tích post hoc ngày 29/10/2026 (mục 0.2). Vì vậy không kết quả nào của T2 là confirmatory; không kết quả nào thay đổi H2a, H2b, σ_a arm hay bất kỳ số đã đăng ký nào của `protocol_p2r`; không giao thức khóa nào bị đụng. Trong bài, T2 là "mechanism analysis (exploratory)" ở mục 6.4.
|
||||||
|
2. **Dữ liệu.** Chỉ dùng realization 8–15 của P2r, với bank SMC đã có (`outputs/p2r/posterior/<regime>/r<rid>_c<c>_n<N>_s0_particles.npz`, key `<well>/estR/g_acf`, mảng (1024, 390): hạt u = [b, g(389 nút lưới warp)], t(τ) = `R.grid.t_of_tau(U[:, 0], U[:, 1:], tau=R.tau_fine)` như `scripts/15_diag_train.py` `run_cell`), dự đoán đã lưu (`outputs/p2r/train/<regime>/cells/*.npz`, `*.csv`, `*_diag.csv`) và tổng hợp đã đăng ký (`outputs/p2r/summary/`). Không sinh realization mới. `outputs/p2r/` là **chỉ đọc**; mọi đầu ra của T2 ghi vào `outputs/t2/`.
|
||||||
|
3. **Nhãn test** chỉ dùng để chấm điểm theo đúng metric đã đăng ký (`run_d2.evaluate`, band RMSE với f_c = 6 Hz). Mọi ô, đại lượng, ước lượng và luật quyết định được cố định trong tài liệu này trước khi tính; không chọn gì theo kết quả.
|
||||||
|
|
||||||
|
### 0.2 Công bố (disclosure): những gì đã được xem ngày 29/10/2026, trước khai báo này
|
||||||
|
|
||||||
|
Các số dưới đây được **chép lại** từ file đã có (`outputs/p2r/posthoc/bound.csv`, `meta.json`; `outputs/p2r/summary/h2b.csv`, `sigma_post.csv`), không tính lại. Chúng là lý do T2 đổi câu hỏi (plan §12 ý 24), nên người đọc phải biết chúng đã được xem trước khi năm phép kiểm được viết ra.
|
||||||
|
|
||||||
|
**Bảng A. N = 16, tất cả ô (regime, c). rml_pm = tỉ số band RMSE M2-Sa/B3d-Sa đã đăng ký (H2b) với CI 95%; o_pm = Oracle/B3d-Sa; rml_o = M2-Sa/Oracle; gap_closed = (pm − rml)/(pm − oracle).**
|
||||||
|
|
||||||
|
| Ô | wide | σ_post (ms) | warp RMSE B3d-Sa (ms) | rml_pm [CI] | o_pm | rml_o | gap_closed |
|
||||||
|
| --- | --- | --- | --- | --- | --- | --- | --- |
|
||||||
|
| R10 c=0 | không | 0.283 | 0.211 | 0.994 [0.975, 1.014] | 0.984 | 1.010 | 0.382 |
|
||||||
|
| R10tb c=0 | không | 0.310 | 0.231 | 0.990 [0.968, 1.012] | 0.986 | 1.004 | 0.740 |
|
||||||
|
| R0 c=0 | không | 0.616 | 0.442 | 0.993 [0.978, 1.008] | 0.969 | 1.024 | 0.239 |
|
||||||
|
| R0h c=0 | không | 0.689 | 0.498 | 0.999 [0.983, 1.012] | 0.972 | 1.027 | 0.045 |
|
||||||
|
| Rm5 c=0 | không | 0.914 | 0.681 | 1.003 [0.988, 1.017] | 0.986 | 1.017 | −0.210 |
|
||||||
|
| R10 c=1 | không | 0.588 | 0.629 | 1.004 [0.994, 1.017] | 0.996 | 1.008 | −1.069 |
|
||||||
|
| R0 c=1 | **có** | 1.527 | 1.862 | 0.967 [0.956, 0.979] | 0.927 | 1.043 | 0.447 |
|
||||||
|
| R0h c=1 | **có** | 1.717 | 2.364 | 0.970 [0.953, 0.989] | 0.919 | 1.056 | 0.370 |
|
||||||
|
| R10tb c=1 | **có** | 1.916 | 4.784 | 0.890 [0.866, 0.915] | 0.758 | 1.174 | 0.455 |
|
||||||
|
| Rm5 c=1 | **có** | 2.559 | 2.911 | 0.982 [0.966, 0.995] | 0.933 | 1.052 | 0.275 |
|
||||||
|
| R10 c=2 | không | 1.181 | 0.997 | 0.987 [0.972, 1.002] | 0.974 | 1.013 | 0.513 |
|
||||||
|
| R0 c=2 | **có** | 2.792 | 2.719 | 0.952 [0.940, 0.962] | 0.899 | 1.059 | 0.477 |
|
||||||
|
| Rm5 c=2 | **có** | 3.955 | 3.924 | 0.964 [0.953, 0.977] | 0.909 | 1.061 | 0.395 |
|
||||||
|
| R0h c=2 | **có** | 4.176 | 4.102 | 0.904 [0.889, 0.925] | 0.853 | 1.060 | 0.652 |
|
||||||
|
| R10tb c=2 | **có** | 11.489 | 19.081 | 0.667 [0.615, 0.713] | 0.408 | 1.634 | 0.563 |
|
||||||
|
|
||||||
|
Tóm tắt đã ghi ở plan §12 ý 24: Oracle tốt hơn B3d-Sa 7–8% ở R0, R0h, Rm5 (c = 1, N = 16; o_pm 0.927, 0.919, 0.933) và 24% ở R10tb; ở c = 0 Oracle vẫn tốt hơn 1–3% dù sai số warp SMC chỉ 0.2–0.7 ms; M2-Sa đóng 27–46% khoảng cách B3d-Sa–Oracle ở c = 1 (39–65% ở c = 2) và không ô rộng nào đạt mức Oracle.
|
||||||
|
|
||||||
|
**Bảng B. Mọi cận đã xem (N = 16), tại σ_post. bound_post = 1/B_a đã đăng ký (nội suy trên lưới blur; tại R10tb c=2 kẹp ở 6 ms); a_exact = 1/B_a tính đúng tại σ_post; b = 1/B_b (Berkson, plug-in); b60 = b giữ hệ số ở 60 Hz; a_spec, b_spec = ρ* từ phổ chéo với nhãn thật.**
|
||||||
|
|
||||||
|
| Ô | 1/B_a đăng ký | a_exact | b | b60 | a_spec | b_spec |
|
||||||
|
| --- | --- | --- | --- | --- | --- | --- |
|
||||||
|
| R10 c=0 | 1.001 | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 |
|
||||||
|
| R10tb c=0 | 1.001 | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 |
|
||||||
|
| R0 c=0 | 1.001 | 1.001 | 0.999 | 0.999 | 1.000 | 1.000 |
|
||||||
|
| R0h c=0 | 1.001 | 1.001 | 0.998 | 0.999 | 1.000 | 1.000 |
|
||||||
|
| Rm5 c=0 | 1.002 | 1.002 | 0.997 | 0.998 | 1.000 | 1.000 |
|
||||||
|
| R10 c=1 | 1.000 | 1.001 | 0.998 | 0.999 | 1.000 | 0.999 |
|
||||||
|
| R0 c=1 | 0.999 | 0.999 | 0.982 | 0.991 | 0.994 | 0.990 |
|
||||||
|
| R0h c=1 | 0.996 | 0.996 | 0.972 | 0.986 | 0.991 | 0.984 |
|
||||||
|
| R10tb c=1 | 0.964 | 0.966 | 0.893 | 0.953 | 0.960 | 0.921 |
|
||||||
|
| Rm5 c=1 | 1.000 | 1.000 | 0.904 | 0.958 | 0.985 | 0.952 |
|
||||||
|
| R10 c=2 | 0.994 | 0.996 | 0.984 | 0.993 | 0.993 | 0.990 |
|
||||||
|
| R0 c=2 | 0.968 | 0.968 | 0.768 | 0.911 | 0.957 | 0.833 |
|
||||||
|
| Rm5 c=2 | 0.980 | 0.980 | 0.285 | 0.776 | 0.955 | 0.447 |
|
||||||
|
| R0h c=2 | 0.910 | 0.910 | 0.132 | 0.604 | 0.893 | 0.191 |
|
||||||
|
| R10tb c=2 | 0.634 | 0.481 | 0.000 | 0.000 | 0.476 | 0.000 |
|
||||||
|
|
||||||
|
**Bảng C. Cùng các cận, tại sai số warp RMS của B3d-Sa trên giếng train (bound_warp = 1/B_a; b, b60, a_spec, b_spec như trên).**
|
||||||
|
|
||||||
|
| Ô | 1/B_a | b | b60 | a_spec | b_spec |
|
||||||
|
| --- | --- | --- | --- | --- | --- |
|
||||||
|
| R10 c=0 | 1.001 | 1.000 | 1.000 | 1.000 | 1.000 |
|
||||||
|
| R10tb c=0 | 1.001 | 1.000 | 1.000 | 1.000 | 1.000 |
|
||||||
|
| R0 c=0 | 1.001 | 0.999 | 1.000 | 1.000 | 1.000 |
|
||||||
|
| R0h c=0 | 1.001 | 0.999 | 1.000 | 1.000 | 1.000 |
|
||||||
|
| Rm5 c=0 | 1.001 | 0.998 | 0.999 | 1.000 | 1.000 |
|
||||||
|
| R10 c=1 | 1.000 | 0.998 | 0.999 | 0.999 | 0.999 |
|
||||||
|
| R0 c=1 | 0.994 | 0.961 | 0.981 | 0.988 | 0.976 |
|
||||||
|
| R0h c=1 | 0.982 | 0.894 | 0.955 | 0.974 | 0.927 |
|
||||||
|
| R10tb c=1 | 0.710 | 0.017 | 0.258 | 0.703 | 0.025 |
|
||||||
|
| Rm5 c=1 | 0.996 | 0.820 | 0.933 | 0.979 | 0.902 |
|
||||||
|
| R10 c=2 | 0.999 | 0.991 | 0.996 | 0.996 | 0.995 |
|
||||||
|
| R0 c=2 | 0.971 | 0.794 | 0.920 | 0.960 | 0.853 |
|
||||||
|
| Rm5 c=2 | 0.980 | 0.301 | 0.783 | 0.956 | 0.466 |
|
||||||
|
| R0h c=2 | 0.913 | 0.154 | 0.626 | 0.897 | 0.221 |
|
||||||
|
| R10tb c=2 | 0.634 | 0.000 | 0.000 | 0.396 | 0.000 |
|
||||||
|
|
||||||
|
**Số đếm đã ghi** (`meta.json`, 8 ô rộng ở N = 16; "vượt" = rml_pm thấp hơn cận; trong ngoặc: cả mép trên CI thấp hơn cận): classical tại σ_post 7/8 (6), tại sai số warp 6/8 (4); a_exact tại σ_post 7/8 (6); Berkson b tại σ_post 3/8 (1; R0, R0h, R10tb, đều c = 1), tại sai số warp 0/8; b60 tại σ_post 3/8 (2), tại sai số warp 1/8 (1; R0 c=1); a_spec tại σ_post 5/8 (3), tại sai số warp 3/8 (1); b_spec tại σ_post 3/8 (2), tại sai số warp 1/8 (0). Tỉ số (b)/(a) của tích phân méo: 1.5–1.7 tại σ = 1.5 ms, 2.1–2.6 tại 2 ms, 3.3–4.6 tại 2.5 ms; tần số trung vị có trọng số f⁴ 67–72 Hz.
|
||||||
|
|
||||||
|
**Cũng đã tính từ cùng các dự đoán này:** T4 (`scripts/30_t4_coverage.py` → `outputs/t4/`: ξ, coverage, phân tách theo ngân sách; plan §12 ý 24) và T3 (`scripts/27_t3_power.py` → `outputs/t3/`: N*, power, tỉ số trung vị theo σ_ref; `applicability-results.md`). Cả hai không dùng responsibilities, bank đối chứng, thống kê đa mode hay hiệp phương sai offset; các đại lượng của năm phép kiểm dưới đây **chưa được tính** ở bất kỳ đâu trước tài liệu này. Những gì đã tính trên dev P2 (900/901) về λ ∈ {1, 3, ∞} (`outputs/p2/diag/train/`, M2@k và M2-Sa@k, dùng để chọn λ = 1/τ_c giữ nguyên) cũng đã được xem; T2 không chọn lại λ.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 1. Câu hỏi và ba cơ chế
|
||||||
|
|
||||||
|
**Câu hỏi (đổi ngày 29/10/2026):** sau khi trừ hiệu chỉnh quần thể của cấu trúc Berkson (cận 1/B_b), lợi ích của bank (M2-Sa so với B3d-Sa) còn phần nào không, và nếu còn thì cơ chế gì tạo ra nó? Ba ứng viên, mỗi ứng viên kèm hệ quả quan sát được mà nó dự đoán:
|
||||||
|
|
||||||
|
- **(a) Tăng cường nhãn / regularization.** Bank làm mạng không nhớ được một nhãn lệch duy nhất; phương sai học được hấp thụ độ trải của bank. Hệ quả: một bank **không mang thông tin** về warp nào khớp với seismic, chỉ có cùng độ rộng và cùng cấu trúc tương quan (phép kiểm ii), phải cho lợi ích gần bằng M2-Sa.
|
||||||
|
- **(b) Lệch của warp trung bình khi posterior đa mode.** Khi posterior có hai mode (cycle skip), warp trung bình nằm giữa hai mode và nhãn của nó sai ở mọi mode (Hệ quả 3); bank giữ cả hai mode. Hệ quả: lợi ích tập trung ở các đơn vị (regime, c, rid) có giếng đa mode (phép kiểm iii).
|
||||||
|
- **(c) Tái đăng ký ngầm qua responsibilities.** Với λ > 0, gradient của RML là NLL có trọng số r_{w,j,s} = softmax_s(log π_s + λ ℓ_{w,j,s}) (Bổ đề 3; Nhận xét 1): mạng dùng chung giữa các giếng dồn trọng số về các hạt mà nhãn khớp với dự đoán nhất quán liên giếng. Hệ quả: warp có trọng số r gần warp thật hơn warp trung bình (phép kiểm i), ở λ của giao thức.
|
||||||
|
|
||||||
|
Hai phép kiểm còn lại không phân biệt (a)/(b)/(c) mà định vị câu hỏi: **(iv)** quyết định cấu trúc sai số của tie trung bình posterior (Berkson hay classical), tức cận nào (1/B_b hay 1/B_a) áp dụng cho B3d-Sa; **(v)** tách phần của khoảng cách B3d-Sa–Oracle do số vòng lặp (250 so với 500) khỏi phần do sai số nhãn.
|
||||||
|
|
||||||
|
Ba cơ chế không loại trừ nhau. Một kết quả "không cơ chế nào" cũng là kết quả và sẽ được báo cáo như vậy.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 2. Thiết lập chung (tái dựng đúng `scripts/15 run_cell`)
|
||||||
|
|
||||||
|
- **Giao thức và kiểm tra hash.** `P = run_d2.load_protocol(check=True)` (protocol_p2, nguồn của backbone, optimizer, cửa sổ, chuẩn hóa nhãn, f_c); `run_d2.check_rids([8..15], P)` phải trả về protocol_p2r khớp SHA-256 (như scripts 14/15). Regime (snr_db, anchor_density) đọc từ `configs/d2_synth_p2r.yaml` như `scripts/run_p2r_main.sh`.
|
||||||
|
- **Realization và giếng.** `R = D2Realization(cfg, rid, hg, WarpHyper(**prior["hyper"]), wav)`; train = `R.pool[:N]`, test = `R.test` (8 giếng); `obs = R.observe(w, c, snr, σ_a = 7, density)`; test quan sát ở cùng SNR với anchor đầy đủ (không dùng anchor test). Input `X = zscore_patch(seis, R.main)`; nhãn test `yt = 100·y_true`.
|
||||||
|
- **Đăng ký.** `out = register(R, obs, reg_settings(P), reg_seed = 0)`; kiểm `out["phase"] == phase0` của `r<rid>_c<c>_n<N>_s0_phase.json`; wavelet pha R: `phase_wavelet(phase_basis(statistical_wavelet(...), fac), phase_R)`; `t_b3b = tie_b3b`, `t3c = tie_b3c` (B3c-R) như run_cell.
|
||||||
|
- **Bank SMC.** `U = smc["<well>/estR/g_acf"]`; `Tf = R.grid.t_of_tau(U[:, 0], U[:, 1:], tau=R.tau_fine)` (1024, 3101); warp trung bình B3d-Sa `tm = warp_mean(Tf, 0)` (đều trên 1024 hạt); tập con 64 thành viên `sub = np.random.default_rng([0, i, 29]).choice(1024, 64, replace=False)` (i = chỉ số giếng train); nhãn `labels_for_warps(R.tau_fine, antialias(phi_log, 0.5, 4), T, R.t_main)`; thành viên không hợp lệ (nhãn không hữu hạn) thay bằng thành viên hợp lệ đầu tiên và log π = −∞; π đều trên thành viên hợp lệ. Nhãn chuẩn hóa `(Y − m0)/s0` với `out["norm"]`.
|
||||||
|
- **Huấn luyện.** `train_predict(X, Xte, spec, tcfg, seed, budgets, device)` với `tcfg = P.training.model | P.training.optimizer` (CNNGRUHetero d = 64, dropout 0.05, Adam 5e-3, grad clip 5, full batch, cửa sổ 64 mẫu bắt đầu 0, 2, …, 62: 32 cửa sổ/giếng); λ = `out["lam"]` = 1/τ_c của ô; seed 0–4; ngân sách khóa: Oracle 500, B3d-Sa 250, M2-Sa 250. Dự đoán về p.u.: μ = 100(μ̂ s0 + m0), σ = 100 σ̂ s0; chấm bằng `run_d2.evaluate(yt, μ, σ, f_c = 6)` → `band_rmse` theo giếng test.
|
||||||
|
- **Thống kê.** Trung bình ô = trung bình trên realization × seed × giếng test. Tỉ số = tỉ số hai trung bình ô. CI 95% = bootstrap trên realization (2000 lần, `np.random.default_rng(0)`, như `scripts/13 boot`): lấy mẫu lại 8 realization có hoàn lại, trung bình theo realization rồi tỉ số/hiệu. Hiệu ghép cặp = trung bình trên realization của (hiệu theo realization). "Majority" = tỉ lệ > 0.5.
|
||||||
|
- **Sai số warp.** `warp_errors(t_of_tau[None], R.tau_fine, o["t_of_tau_true"], R.t_main)["warp_rmse_ms"]`: RMSE trên 126 mẫu của t_main của τ(t) − τ_true(t), với τ(t) = nghịch đảo của t(τ) (`invert_warps`). Đây là đại lượng ở cột `B3d-Sa_warp_rmse_ms` của `_diag.csv` (sẽ đối chiếu).
|
||||||
|
- **Tập nút cửa sổ theo τ** (cho iii, iv): K_w = {k : t_b3b(τ_k) ∈ [600, 1100] ms} trên lưới warp τ_k (bước 4 ms), xác định từ tie anchor B3b (chỉ dữ liệu), dùng chung cho mọi phương pháp và hạt của giếng đó.
|
||||||
|
- **Ô.** WIDE16 = 8 ô có `wide = True` ở N = 16 trong `h2b.csv`: R0 c=1, R0h c=1, R10tb c=1, Rm5 c=1, R0 c=2, Rm5 c=2, R0h c=2, R10tb c=2. NARROW16 = R10 c=0, R0 c=0, Rm5 c=0 (N = 16). Phép kiểm (i), (ii), (v): WIDE16 ∪ NARROW16 (11 ô × 8 realization = 88 cell-realization). Phép kiểm (iii), (iv): cả 30 ô (5 regime × c ∈ {0, 1, 2} × N ∈ {4, 16}); luật quyết định chỉ dùng các ô nêu trong từng phép kiểm. Ô c = 2 mang cờ "unstable posterior" như P2r.
|
||||||
|
- **Thay đổi code.** Thêm **bổ sung** vào `ml_porosity/models/bank_train.py`: tham số `on_budget=None` của `train_predict`, gọi `on_budget(step, model)` ngay sau khi lấy dự đoán tại mỗi ngân sách; mặc định `None` giữ đường chạy cũ nguyên vẹn. Thêm helper thuần `responsibilities(mu, sigma, Y, logpi, starts, win, lam)` vào `ml_porosity/losses/rml.py` (không đổi ngữ nghĩa hàm nào). `pytest tests/test_losses.py tests/test_models.py` chạy trước và sau (trước: 24 pass, 29/10 12:3x UTC).
|
||||||
|
- **Tái lập (self-check).** Ô R0, rid 8, c = 1, N = 16, seed 0: band RMSE theo giếng test của M2-Sa(250), B3d-Sa(250), Oracle(500) huấn luyện lại so với `outputs/p2r/train/R0/cells/r8_c1_n16.csv`; báo sai lệch tuyệt đối lớn nhất (mục tiêu ~1e-4; GPU/GRU không tất định và torch đã đổi phiên bản, nên sai lệch thực đo được sẽ được ghi nguyên). Thêm: `B3d-Sa_warp_rmse_ms` và `M2-Sa_n_valid` theo giếng của `_diag.csv` phải khớp giá trị tính lại tới 1e-9 (CPU). Trên cả 88 cell-realization, sai lệch band RMSE giữa bản huấn luyện lại và bản đã đăng ký (Oracle 500, B3d-Sa 250, M2-Sa 250) được ghi (trung bình, lớn nhất) làm thước đo bất định tính; mọi tỉ số của T2 được báo cả hai cách: mẫu số đã đăng ký và mẫu số huấn luyện lại trong cùng phiên.
|
||||||
|
|
||||||
|
Các ngân sách [250, 500] trong một quỹ đạo: `train_predict` lấy dự đoán tại từng bước của `budgets` trên một quỹ đạo (tương đương huấn luyện riêng từng ngân sách; docstring của module). Callback tại bước 250 lấy responsibilities trước khi quỹ đạo tiếp tục.
|
||||||
|
|
||||||
|
Mỗi cell-realization, mỗi seed, huấn luyện 6 mạng: M2-Sa (λ giao thức) [250, 500] (callback tại 250), M2-Sa@1 [250] (callback), M2-Sa@3 [250] (callback), B3d-Sa [250, 500], Oracle [250, 500], Control [250]. Tổng 88 × 5 × 6 = 2.640 mạng.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 3. Năm phép kiểm
|
||||||
|
|
||||||
|
### (i) Sai số warp có trọng số responsibility so với warp trung bình
|
||||||
|
|
||||||
|
**Ô:** WIDE16 ∪ NARROW16. **Mạng:** M2-Sa cuối huấn luyện (bước 250) với λ giao thức; chẩn đoán đã khai báo tại λ ∈ {1, 3} (M2-Sa@1, M2-Sa@3 của `scripts/15`: cùng bank, cùng π, cùng ngân sách 250). Seed 0–4.
|
||||||
|
|
||||||
|
**Đại lượng (theo giếng train w, trên input train X, mạng ở chế độ eval):**
|
||||||
|
- ℓ_{w,j,s} = `window_loglik(μ, σ, Y_norm, starts, 64)` trên 32 cửa sổ cố định; r_{w,j,s} = softmax_s(log π_{w,s} + λ ℓ_{w,j,s}).
|
||||||
|
- Trọng số theo thành viên r̄_{w,s} = mean_j r_{w,j,s}; trọng số theo mẫu r_{w,i,s} = trung bình của r_{w,j,s} trên các cửa sổ j chứa mẫu i.
|
||||||
|
- E_r: sai số warp của T_r(τ) = Σ_s r̄_{w,s} T_s(τ) (`warp_mean(Tf[sub], log r̄)`).
|
||||||
|
- E_r,win: RMSE trên t_main của Σ_s r_{w,i,s} τ_s(t_i) − τ_true(t_i), với τ_s(t) = `invert_warps(Tf[sub], tau_fine, t_main)`.
|
||||||
|
- E_64: sai số warp của warp trung bình đều trên cùng 64 thành viên (`warp_mean(Tf[sub], 0)`). **So sánh chính** (cùng bank; chỉ khác trọng số).
|
||||||
|
- E_1024: sai số warp của `warp_mean(Tf, 0)` (warp của B3d-Sa). So sánh phụ.
|
||||||
|
- ē_r = Σ_s r̄_s e_s và ē_u = Σ_{s hợp lệ} e_s / S_ok, với e_s = RMSE trên t_main của τ_s(t) − τ_true(t) (sai số từng thành viên).
|
||||||
|
- S_eff = 1/Σ_s r̄_s², H = −Σ_s r̄_s log r̄_s (nat; tối đa log 64 = 4.159); S_eff theo cửa sổ (trung bình trên j) và max_s r_{w,j,s} trung bình.
|
||||||
|
|
||||||
|
**Tổng hợp:** Δ_r = E_r − E_64 (chính), Δ_r,1024 = E_r − E_1024, Δ_win = E_r,win − E_64, Δ_e = ē_r − ē_u; theo ô: trung bình trên (rid, seed, giếng) với CI bootstrap trên realization; tỉ lệ (rid, seed, giếng) có Δ < 0.
|
||||||
|
|
||||||
|
**Luật quyết định (tại λ giao thức):** một ô "có (c)" nếu tỉ lệ (rid, seed, giếng) có Δ_r < 0 vượt 0.5 **và** CI 95% của Δ_r nằm hoàn toàn dưới 0. **Bằng chứng cho (c)** nếu ≥ 5/8 ô rộng "có (c)". Nếu điều đó chỉ xảy ra tại λ ∈ {1, 3}: ghi "(c) khả dụng nhưng không phải điều phương pháp của giao thức làm" (không claim về λ; `protocol_p2r` wording.forbidden). Nếu không ô rộng nào đạt: không bằng chứng cho (c). Ô hẹp được báo cáo để đối chiếu (kỳ vọng Δ ≈ 0 vì các thành viên gần trùng nhau). Δ_e và S_eff là mô tả: S_eff gần 64 nghĩa là responsibilities gần đều (RML gần trung bình theo π, Mệnh đề 4), S_eff nhỏ nghĩa là gần hard-min.
|
||||||
|
|
||||||
|
**Ý nghĩa:** E_r < E_64 cho thấy responsibilities mang thông tin về warp thật vượt ngoài posterior, tức có tái đăng ký. Đây là điều kiện cần cho (c) là nguồn của lợi ích, không phải điều kiện đủ.
|
||||||
|
|
||||||
|
### (ii) Bank nhiễu GP ngẫu nhiên (đối chứng cho (a))
|
||||||
|
|
||||||
|
**Ô:** WIDE16 ∪ NARROW16. **Xây bank đối chứng theo giếng train:** T_grid = `R.grid.t_of_tau(U[:, 0], U[:, 1:])` (1024 × 389, trên lưới warp); T̄ = trung bình theo hạt; C = hiệp phương sai thực nghiệm (ddof 0, 389 × 389) của T_grid quanh T̄. Phân rã C = V diag(λ) Vᵀ, cắt λ⁺ = max(λ, 0). Nhiễu η_s = V diag(√λ⁺) z_s, z_s ~ N(0, I_389), `rng = np.random.default_rng([0, i, 2029])`, rút tuần tự. SD biên của η tại mỗi nút bằng SD của hạt tại nút đó (đúng tới phần cắt), và tương quan theo τ là tương quan của tập hạt; đó là nghĩa của "cùng độ rộng, cùng cấu trúc tương quan, không mang thông tin về warp nào khớp seismic" (phân phối Gauss cùng hai mômen đầu, mất mọi cấu trúc cao hơn như đa mode và mất liên hệ giữa hạt với seismic). Chấp nhận một lần rút nếu diff(T̄ + η_s) > 0.05 ms tại mọi nút (t(τ) tăng ngặt); nếu không thì rút lại, tối đa 1.280 lần cho 64 thành viên; số lần loại được ghi. Nếu không đủ 64 thành viên, giếng dùng **phương án dự phòng** rút Gauss trong không gian u = [b, g] (ū, C_u từ hạt; đơn điệu theo cấu trúc) và được gắn cờ. t_s trên tau_fine = `np.interp(tau_fine, grid.tau, T̄ + η_s)` (như `D2Realization.observe` làm với warp thật). Nhãn và thành viên không hợp lệ xử lý như bank SMC (mục 2). Báo thêm: SD biên của bank đối chứng so với SD của hạt tại các nút K_w (tỉ số), sai số warp trung bình thành viên ē_ctl so với ē_u của 64 thành viên SMC.
|
||||||
|
|
||||||
|
**Huấn luyện:** RML, λ = `out["lam"]`, π đều, ngân sách 250, seed 0–4, chấm trên 8 giếng test như M2-Sa.
|
||||||
|
|
||||||
|
**Tỉ số theo ô (CI bootstrap trên realization):** ρ_ctl = Control/B3d-Sa (mẫu số đã đăng ký), ρ_rml = M2-Sa/B3d-Sa (đã đăng ký; bằng tỉ số H2b), ρ_ctl,rml = Control/M2-Sa (đã đăng ký); phiên bản mẫu số huấn luyện lại trong phiên cho cả ba (độ nhạy với bất định tính); hiệu ghép cặp D_ctl = band RMSE(Control) − band RMSE(M2-Sa) theo realization (trung bình trên seed, giếng) với CI.
|
||||||
|
|
||||||
|
**Luật quyết định theo ô rộng:** (A) "nhất quán với (a)" nếu CI(ρ_ctl) nằm dưới 1 **và** CI(D_ctl) chứa 0; (B) "chống (a)" nếu CI(ρ_ctl) chứa 1 trong khi CI(ρ_rml) nằm dưới 1; (C) "(a) một phần" nếu CI(ρ_ctl) nằm dưới 1 và CI(D_ctl) nằm trên 0 (đối chứng có lợi nhưng kém M2-Sa); (D) còn lại: không xác định. Kết luận chung = loại chiếm đa số trong 8 ô rộng, báo kèm số đếm từng loại. Ô hẹp: kỳ vọng ρ_ctl ≈ 1; nếu CI(ρ_ctl) nằm trên 1.02 ở ô hẹp thì ghi "bank nhiễu có hại khi posterior hẹp" (mô tả).
|
||||||
|
|
||||||
|
### (iii) Tách theo đa mode (cho (b))
|
||||||
|
|
||||||
|
**Thống kê đa mode (theo giếng train, cố định trước):** offset trung bình cửa sổ của từng hạt a_s = mean_{k ∈ K_w} (t_s(τ_k) − τ_k), s = 1..1024 (ms). Khớp Gaussian mixture 1 và 2 thành phần (`sklearn.mixture.GaussianMixture`, sklearn 1.9.1, `covariance_type="full"`, `n_init=5`, `random_state=0`, `reg_covar=1e-6`) trên a_s; ΔBIC = BIC₁ − BIC₂. Giếng **đa mode** nếu ΔBIC > 10 **và** |μ₁ − μ₂| > 4 ms (một mẫu) **và** min(w₁, w₂) ≥ 0.1. Lý do chọn a_s thay cho b = U[:, 0] (gợi ý trong todoblock): b là offset tại τ = 100 ms, đầu trên của miền log, ngoài cửa sổ chấm điểm 600–1100 ms; nhãn trong cửa sổ phụ thuộc t(τ) trong cửa sổ, và a_s cũng là đại lượng của phép kiểm (iv). Thống kê trên b được tính và báo cáo như **phụ**, không dùng trong luật.
|
||||||
|
|
||||||
|
**Đơn vị và nhóm:** đơn vị = (regime, c, rid) ở N = 16; m_u = tỉ lệ giếng đa mode trong 16 giếng train. Nhóm "đa mode" nếu m_u ≥ 0.25 (≥ 4 giếng); độ nhạy: m_u > 0 (≥ 1 giếng). Tỉ lệ m_u cũng được báo theo ô cho cả 30 ô (mô tả; kỳ vọng cao nhất ở R10tb c = 2, ô có cờ đa mode trong `protocol_p2r`).
|
||||||
|
|
||||||
|
**Đại lượng:** ρ_u = trung bình trên seed × giếng test của band RMSE(M2-Sa) chia cho cùng đại lượng của B3d-Sa, từ dự đoán đã lưu (không huấn luyện lại); dùng log ρ_u.
|
||||||
|
|
||||||
|
**So sánh (64 đơn vị của 8 ô rộng):** D = mean log ρ_u (đa mode) − mean log ρ_u (đơn mode): (1) không hiệu chỉnh; (2) **hiệu chỉnh theo ô** (chính): hiệu trong ô, trung bình trên các ô có cả hai nhóm với trọng số n₁n₂/(n₁ + n₂). CI: bootstrap đơn vị trong từng ô (2000, rng 0). Thêm: Spearman giữa m_u và log ρ_u trên 64 đơn vị và trong từng ô.
|
||||||
|
|
||||||
|
**Luật quyết định:** bằng chứng cho (b) nếu D hiệu chỉnh < 0 với CI không chứa 0 (lợi ích lớn hơn ở nhóm đa mode). Nếu không ô rộng nào có cả hai nhóm (nhóm trùng với ô), phép tách bị trộn với ô: không rút kết luận, chỉ báo m_u theo ô và D không hiệu chỉnh kèm cảnh báo. Nếu không đơn vị nào đa mode: "(b) không kiểm được trên P2r; không bằng chứng".
|
||||||
|
|
||||||
|
### (iv) Kiểm hiệp phương sai Berkson so với classical (quyết định cận nào áp dụng)
|
||||||
|
|
||||||
|
**Đại lượng theo giếng train (trên K_w):** offset thật a*_w = mean_k (t_true(τ_k) − τ_k); offset gán â^m_w = mean_k (t_m(τ_k) − τ_k) với m ∈ {B3d-Sa: `warp_mean(Tf, 0)`; B3c-R: t3c; B3b: t_b3b}; sai số e^m_w = â^m_w − a*_w. (Tương đương định nghĩa theo t trong `docs/theory.md` §6.1 tới dấu và tới hiệu ứng biên; hệ số tương quan không đổi dấu khi đổi dấu cả hai đại lượng.)
|
||||||
|
|
||||||
|
**Thống kê thô (như bài mục 4.3):** r_C = corr(e, a*) (classical dự đoán 0), r_B = corr(e, â) (Berkson dự đoán 0), V = Var(â)/Var(a*) (classical > 1, Berkson < 1); gộp 8 realization × N giếng cho mỗi ô. Ghi chú về lực: a* biến thiên giữa giếng với SD = c · σ_b = c · 19.4 ms (prior F3 của generator; `outputs/p2/warp_prior_f3.json`), trong khi σ_e ≈ 1–5 ms, nên |r| ≤ σ_e/σ_a* ≈ 0.05–0.25 với SE ≈ 0.09 tại n = 128: thống kê thô có lực thấp ở c = 1 và **suy biến ở c = 0** (a* ≡ 0; Cov(e, a*) = 0 tầm thường). Vì vậy c = 0 được báo nhưng không dùng trong luật.
|
||||||
|
|
||||||
|
**Thống kê neo theo anchor (chính):** a*'_w = a*_w − â^{B3b}_w, â'_w = â^m_w − â^{B3b}_w (cùng e). r'_C = corr(e, a*'), r'_B = corr(e, â'), V' = Var(â')/Var(a*'). Lý do: â^{B3b} là hàm của dữ liệu (chỉ anchor); trừ nó giữ nguyên e và đưa biến thiên của "giá trị thật" về thang sai số anchor (σ_a/√n_k ≈ 2–3 ms), cùng bậc với σ_e, nên tương quan có thể phát hiện được. Dưới Berkson (a* − â độc lập với dữ liệu): r'_B = 0 **chính xác** và Cov(e, a*') = −Var(e) < 0. Dưới classical (e độc lập với a*): Cov(e, a*') = −Cov(e, n_B) với n_B = â^{B3b} − a* (nhiễu anchor), bằng 0 chỉ khi thêm e ⊥ n_B; điều này hợp lý cho tie chỉ dùng seismic, **không bảo đảm** cho B3d-Sa (dùng anchor) và B3c-R (khởi từ B3b). Hệ quả cho cách đọc: với B3d-Sa, thống kê quyết định là r'_B (0 ⇔ trọng số tương đối anchor/seismic của posterior đúng ⇔ Berkson; r'_B > 0 ⇔ seismic được tin quá; r'_B < 0 ⇔ tin chưa đủ); r'_C < 0 không phân biệt được hai cấu trúc cho B3d-Sa và chỉ được báo.
|
||||||
|
|
||||||
|
**CI:** bootstrap cụm trên realization (lấy mẫu lại 8 realization có hoàn lại, giữ nguyên mọi giếng của realization; 2000 lần, rng 0); CI phân vị 95%.
|
||||||
|
|
||||||
|
**Độ nhạy theo mẫu:** cùng các tương quan với đại lượng theo nút (t_m(τ_k) − τ_k, t_true(τ_k) − τ_k, hiệu, và phiên bản neo theo anchor theo nút) gộp trên k ∈ K_w, giếng, realization; cùng bootstrap cụm.
|
||||||
|
|
||||||
|
**Luật quyết định theo ô (c ≥ 1) và phương pháp, trên thống kê neo:** "Berkson" nếu CI(r'_B) chứa 0 và CI(r'_C) không chứa 0; "classical" nếu CI(r'_C) chứa 0 và CI(r'_B) không chứa 0; còn lại "neither" (ghi rõ "không lực" nếu cả hai chứa 0, "không cấu trúc nào" nếu cả hai không chứa 0). Ô dùng cho kết luận: bốn ô rộng c = 1, N = 16 (R0, R0h, R10tb, Rm5) và bản gộp mọi ô c = 1 (5 regime × 2 N; bootstrap cụm trên realization). Kết quả thô được báo với cùng luật, làm đối chiếu. **Hệ quả:** ở ô kết luận "Berkson" cho B3d-Sa, cận 1/B_b (cột `bound_post_b`, Bảng B) là cận áp dụng; "classical" → 1/B_a; "neither" → không cận nào được claim cho ô đó. Điều này chỉ làm rõ cách đọc Bảng `tab:h2b`, không đổi số nào.
|
||||||
|
|
||||||
|
### (v) B3d-Sa và M2-Sa ở ngân sách của Oracle (500 vòng lặp)
|
||||||
|
|
||||||
|
**Ô:** WIDE16 ∪ NARROW16. **Huấn luyện lại** B3d-Sa, M2-Sa (λ giao thức) và Oracle với ngân sách [250, 500] trên một quỹ đạo, seed 0–4, spec y hệt bản đã đăng ký (mục 2).
|
||||||
|
|
||||||
|
**Tỉ số theo ô (trung bình ô; CI bootstrap trên realization):** Oracle(500)/B3d-Sa(500); B3d-Sa(500)/B3d-Sa(250) (cả hai huấn luyện lại; và so với B3d-Sa(250) đã đăng ký); M2-Sa(500)/B3d-Sa(500); Oracle(250)/B3d-Sa(250); M2-Sa(250)/B3d-Sa(250) (tái lập tỉ số H2b trong phiên); Oracle(500)/B3d-Sa(250) (tái lập o_pm, Bảng A). Thêm band PCC cho cùng các cặp.
|
||||||
|
|
||||||
|
**Cách đọc (không phải gate):** phần của khoảng cách B3d-Sa–Oracle do số vòng lặp = 1 − [1 − Oracle(500)/B3d-Sa(500)]/[1 − Oracle(500)/B3d-Sa(250)] khi cả hai tỉ số dưới 1; phần còn lại ở cùng ngân sách được quy cho sai số nhãn (và bất định tính, theo thước đo ở mục 2). Nếu B3d-Sa(500) kém B3d-Sa(250) (tỉ số > 1 với CI trên 1), ngân sách 250 đã chọn trên dev là phù hợp và khoảng cách không do thiếu vòng lặp. M2-Sa(500)/B3d-Sa(500) so với tỉ số H2b: lợi ích bank còn hay mất ở ngân sách dài hơn, chỉ báo cáo. Các so sánh đã đăng ký ở 250 vẫn là số được báo trong bài; (v) là bổ sung mô tả.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 4. Báo cáo, claim cấm, ngân sách, đầu ra
|
||||||
|
|
||||||
|
**Báo cáo bất kể chiều kết quả:** mọi bảng của mục 3 với ước lượng và CI theo ô, tỉ lệ (rid, seed, giếng) cho (i), số đếm loại (A)–(D) cho (ii), m_u theo ô và D cho (iii), verdict theo ô và phương pháp cho (iv), các tỉ số của (v); sai lệch tái lập; số lần loại/cờ dự phòng của bank đối chứng; thời gian chạy và lệnh. Kết quả âm hoặc null được báo như kết quả dương.
|
||||||
|
|
||||||
|
**Claim cấm** (plan §10; `protocol_p2r` wording.forbidden; thêm cho T2): không câu nào confirmatory; không đổi H2a/H2b/σ_a arm hay bất kỳ số đã đăng ký; không "mechanism proven" / "cơ chế đã được chứng minh" (chỉ "consistent with" / "against", exploratory); không claim λ khác tốt hơn λ giao thức (M2-Sa@1, @3 chỉ là chẩn đoán responsibilities); không claim calibration; không ngoại suy sang field; không gọi lợi ích "vượt cận" nếu (iv) không cho Berkson và tỉ số không dưới 1/B_b; ô c = 2 giữ cờ unstable.
|
||||||
|
|
||||||
|
**Tài nguyên:** GPU cuda:0 (trống lúc 12:28 UTC 29/10; chọn lại nếu tình trạng đổi), 4 worker, `OMP/MKL/OPENBLAS/NUMEXPR_NUM_THREADS = 2`; ước tính: giai đoạn huấn luyện 88 cell-realization × (đăng ký ≈ 1–2 phút + 30 mạng ≈ 2–3 phút) ≈ 1.5–2 h với 4 worker; (iii), (iv) chỉ CPU, 240 cell-realization, ≈ 15–30 phút. Mọi lần chạy qua `scripts/runlog.sh -n t2_<stage>`; lần chạy dài tách bằng `setsid nohup`, log `logs/t2_<stage>.out`.
|
||||||
|
|
||||||
|
**Đầu ra:** `scripts/32_t2_mechanism.py` (`--tests i ii iii iv v`, `--device`, `--workers`, `--out-dir` mặc định `outputs/t2`, resume theo (giai đoạn, cell-realization)); `outputs/t2/cells/<regime>_r<rid>_c<c>_n16.csv` (metric test của mọi mạng huấn luyện lại), `_resp.csv` (i), `_ctl.csv` (ii); `outputs/t2/iii/`, `outputs/t2/iv/` theo cell-realization; tổng hợp `test_i.csv`, `test_ii.csv`, `test_iii.csv`, `test_iv.csv`, `test_v.csv`, `selfcheck.json`, `meta.json`, `summary.md`, `figures/*.pdf` (nhãn tiếng Anh, `ml_porosity.eval.figstyle`); tài liệu kết quả `docs/research/t2-results.md` (tiếng Việt). Không ghi vào `outputs/p2r/`, không sửa `configs/*`, `scripts/14`, `15`, `18`, `synth_d2.py`, bài, `docs/plan.md`, `AGENTS.md`, `report.html` (orchestrator đồng bộ).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Deviation
|
||||||
|
|
||||||
|
(Trống lúc băm. Mọi thay đổi sau khi băm ghi ở đây, có ngày, kèm một dòng hash mới trong `t2-mechanism.sha256`.)
|
||||||
1
docs/research/t2-mechanism.sha256
Normal file
1
docs/research/t2-mechanism.sha256
Normal file
@@ -0,0 +1 @@
|
|||||||
|
f04e660792faf301c9f433347a5d1258bded098bb9a7ec05f808823f4efb2b87 t2-mechanism.md # hashed 2026-10-29T12:39:35Z before any T2 computation
|
||||||
225
docs/research/t2-results.md
Normal file
225
docs/research/t2-results.md
Normal file
@@ -0,0 +1,225 @@
|
|||||||
|
# Kết quả T2 — cơ chế của lợi ích bank (exploratory) — 29/10/2026
|
||||||
|
|
||||||
|
Khai báo trước: `t2-mechanism.md` (SHA-256 `f04e6607…` trong `t2-mechanism.sha256`, băm 12:39:35 UTC 29/10/2026 trước mọi phép tính; bản sao byte `outputs/t2/declaration_v1.md`). **Exploratory, không confirmatory**: không số nào ở đây thay đổi H2a, H2b, nhánh σ_a hay bất kỳ số đã đăng ký nào của `protocol_p2r`; `outputs/p2r/` chỉ đọc. Script: `scripts/32_t2_mechanism.py` → `outputs/t2/` (`test_i.csv` … `test_v.csv`, `test_iv_persample.csv`, `test_iii_*.csv`, `selfcheck.json`, `meta.json`, `summary.md`, `figures/t2_{i,ii,iii,iv,v}_*.pdf`). Mọi CI là bootstrap 95% trên realization (2000 lần, `rng(0)`), như khai báo §2.
|
||||||
|
|
||||||
|
**Tóm tắt một đoạn.** (iv) Sai số của tie trung bình posterior (B3d-Sa) ở c = 1 có cấu trúc **Berkson** trong cả bốn ô rộng N = 16 và trong hai tập gộp c = 1, nên cận quần thể áp dụng cho B3d-Sa là 1/B_b; so với cận đó, tỉ số H2b chỉ thấp hơn ở tối đa 3/8 ô tại σ_post với lề ≤ 0.015 (hai ô ≤ 0.003) và ở 0/8 ô tại sai số warp đo được, tức **không xác lập được lợi ích vượt hiệu chỉnh quần thể của cấu trúc Berkson**. (v) Ở cùng ngân sách 500 vòng lặp, Oracle chỉ còn hơn B3d-Sa 4.3–5.6% ở R0, R0h, Rm5 (c = 1): khoảng 30–35% khoảng cách đã đăng ký (7–8%) là do số vòng lặp; lợi ích bank còn ở ngân sách 500 nhưng nhỏ hơn (R0, R0h: 2%). Về cơ chế: (i) responsibilities của RML tái đăng ký nhãn train (warp có trọng số r gần warp thật hơn warp trung bình ở 8/8 ô rộng, giảm 13–40% sai số warp) — (c) có thật như một hiện tượng; nhưng (ii) một bank nhiễu GP **không mang thông tin ngoài hai mômen đầu của posterior** thu được phần lớn lợi ích ở c = 1 (3/4 ô loại A), nên lợi ích ở c = 1 chủ yếu là tăng cường nhãn (a); ở c = 2 (posterior không ổn định) bank SMC hơn bank đối chứng (3/4 ô loại C), nơi thông tin của posterior có đóng góp; (iii) không có bằng chứng cho (b) theo luật chính. Tất cả là exploratory.
|
||||||
|
|
||||||
|
## 0. Lệnh, tài nguyên và thời gian chạy
|
||||||
|
|
||||||
|
| Giai đoạn | Lệnh (qua `scripts/runlog.sh`) | Thiết bị | Wall | Ghi chú |
|
||||||
|
| --- | --- | --- | --- | --- |
|
||||||
|
| particles (iii, iv) | `scripts/32_t2_mechanism.py --tests iii iv --workers 4` (`CUDA_VISIBLE_DEVICES=`) | CPU | 0:06:46 | 240/240 cell-realization |
|
||||||
|
| train (i, ii, v), lần 1 | `--tests i ii v --device cuda:0 --workers 4` | cuda:0 | 0:09:11 (dừng) | 13/88 xong; dừng chủ động (SIGTERM cả nhóm tiến trình) để chia sang hai GPU theo yêu cầu điều phối; 13 file đã xong được kiểm (360 dòng mỗi file) và giữ lại |
|
||||||
|
| train, lần 2a | `--tests i ii v --device cuda:0 --workers 4 --rids 8 9 10 11` | cuda:0 | 0:17:52 | 36 job, ~120 s/job |
|
||||||
|
| train, lần 2b | `--tests i ii v --device cuda:1 --workers 3 --rids 12 13 14 15` | cuda:1 | 0:25:28 | 39 job, ~125 s/job; 3 worker vì cuda:1 chỉ còn 4.5 GB trống |
|
||||||
|
| summary | `--tests summary` (`CUDA_VISIBLE_DEVICES=`) | CPU | 0:02:27 | bảng, hình, self-check |
|
||||||
|
|
||||||
|
Tổng thời gian từ lần khởi chạy đầu đến hết summary: 12:48–13:27 UTC (≈ 38 phút); thời gian worker huấn luyện ≈ 2.9 worker-giờ (2.640 mạng); mỗi worker giữ 710 MiB GPU. Trong lúc chạy, một job của người dùng khác (`gpu_hold.py` + hai tiến trình SFT) chiếm ≈ 135 GB trên mỗi GPU; **không có OOM**, không job nào thất bại, không đụng tiến trình của người khác. Biến môi trường `OMP/MKL/OPENBLAS/NUMEXPR/NUMBA_NUM_THREADS = 2`. Log: `logs/t2_particles.out`, `logs/t2_train.out`, `logs/t2_train_a.out`, `logs/t2_train_b.out`; `logs/runs/20261029-12*_t2_*`, `20261029-132408_t2_summary`.
|
||||||
|
|
||||||
|
Thay đổi code (bổ sung, không đổi đường chạy mặc định): `ml_porosity/models/bank_train.py` thêm tham số `on_budget=None` cho `train_predict` (callback `on_budget(step, model)` sau dự đoán tại mỗi ngân sách); `ml_porosity/losses/rml.py` thêm helper thuần `responsibilities(...)`. `pytest tests/test_losses.py tests/test_models.py`: 24 pass trước và sau.
|
||||||
|
|
||||||
|
## 1. Tái lập (self-check; `outputs/t2/selfcheck.json`)
|
||||||
|
|
||||||
|
Band RMSE theo (ô, realization, seed, giếng test) của Oracle(500), B3d-Sa(250), M2-Sa(250) huấn luyện lại so với `outputs/p2r/train/<regime>/cells/*.csv`: **10.560 dòng, sai lệch tuyệt đối lớn nhất 0.0** (trung bình 0.0; sai lệch tương đối của trung bình ô 0.0). Ô R0 r8 c1 n16 seed 0: 0.0 cho cả ba phương pháp (B3d-Sa 0.7274, M2-Sa 0.7154, Oracle 0.7246 p.u., trùng số đã đăng ký). `B3d-Sa_warp_rmse_ms`, `M2-Sa_n_valid` và λ theo giếng khớp `_diag.csv` tới 0.0. Huấn luyện trên H200 với torch 2.14.0+cu130 vì vậy tất định ở đây; mọi tỉ số "mẫu số huấn luyện lại" trùng "mẫu số đã đăng ký".
|
||||||
|
|
||||||
|
## 2. Phép kiểm (i): warp có trọng số responsibility so với warp trung bình
|
||||||
|
|
||||||
|
E (ms) = sai số warp RMS trên cửa sổ chính (giếng train), trung bình trên realization × seed × giếng. E_64: warp trung bình đều của 64 thành viên bank; E_1024: warp của B3d-Sa; E_r: Σ_s r̄_s T_s; E_r,win: trọng số theo mẫu; Δ_r = E_r − E_64 (chính); Δ_e = ē_r − ē_u (sai số thành viên có trọng số r trừ trung bình đều); S_eff = 1/Σ r̄²; H = entropy (nat, tối đa 4.16). Ngân sách 250 (cuối huấn luyện).
|
||||||
|
|
||||||
|
| Ô | wide | E_64 | E_1024 | E_r | E_r,win | Δ_r [CI] | tỉ lệ Δ_r<0 | Δ_e [CI] | S_eff | H | (c) | Δ_r λ=1 | S_eff λ=1 | Δ_r λ=3 | S_eff λ=3 |
|
||||||
|
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
|
||||||
|
| R0 c=1 | có | 1.86 | 1.86 | 1.38 | 1.24 | -0.480 [-0.670, -0.316] | 0.83 | -0.74 [-0.89, -0.63] | 15.2 | 2.84 | có | -0.535 [-0.765, -0.324] | 4.5 | -0.536 [-0.770, -0.303] | 2.7 |
|
||||||
|
| R0h c=1 | có | 2.39 | 2.36 | 1.84 | 1.70 | -0.547 [-0.796, -0.350] | 0.82 | -0.87 [-1.16, -0.62] | 14.3 | 2.70 | có | -0.573 [-0.793, -0.384] | 4.5 | -0.600 [-0.816, -0.387] | 2.7 |
|
||||||
|
| R10tb c=1 | có | 4.86 | 4.79 | 3.05 | 2.87 | -1.808 [-2.222, -1.439] | 0.89 | -2.01 [-2.37, -1.66] | 27.8 | 3.13 | có | -1.934 [-2.331, -1.567] | 11.6 | -1.967 [-2.331, -1.601] | 4.3 |
|
||||||
|
| Rm5 c=1 | có | 2.92 | 2.91 | 2.35 | 2.20 | -0.572 [-0.752, -0.369] | 0.80 | -1.13 [-1.37, -0.86] | 9.7 | 2.25 | có | -0.628 [-0.788, -0.432] | 3.1 | -0.520 [-0.671, -0.353] | 2.1 |
|
||||||
|
| R0 c=2 | có | 2.74 | 2.71 | 2.04 | 1.78 | -0.702 [-0.890, -0.524] | 0.80 | -1.43 [-1.64, -1.20] | 6.5 | 1.89 | có | -0.662 [-0.883, -0.457] | 2.4 | -0.579 [-0.796, -0.364] | 2.1 |
|
||||||
|
| Rm5 c=2 | có | 3.94 | 3.91 | 3.44 | 3.27 | -0.494 [-0.645, -0.301] | 0.67 | -1.69 [-1.89, -1.48] | 3.5 | 1.20 | có | -0.398 [-0.566, -0.185] | 1.9 | -0.275 [-0.433, -0.086] | 1.7 |
|
||||||
|
| R0h c=2 | có | 4.15 | 4.09 | 2.67 | 2.27 | -1.485 [-1.743, -1.229] | 0.84 | -2.62 [-2.88, -2.36] | 4.8 | 1.56 | có | -1.298 [-1.611, -0.955] | 2.8 | -1.388 [-1.673, -1.068] | 1.9 |
|
||||||
|
| R10tb c=2 | có | 19.33 | 19.08 | 11.71 | 11.24 | -7.620 [-9.204, -6.226] | 0.81 | -9.75 [-11.66, -7.73] | 9.4 | 1.67 | có | -8.087 [-9.538, -6.768] | 3.9 | -8.113 [-9.335, -6.843] | 2.2 |
|
||||||
|
| R10 c=0 | không | 0.21 | 0.21 | 0.21 | 0.21 | -0.005 [-0.007, -0.002] | 0.60 | -0.02 [-0.02, -0.02] | 52.6 | 4.03 | có | -0.007 [-0.011, -0.001] | 33.7 | 0.001 [-0.004, 0.007] | 13.1 |
|
||||||
|
| R0 c=0 | không | 0.45 | 0.44 | 0.41 | 0.40 | -0.035 [-0.044, -0.027] | 0.66 | -0.12 [-0.13, -0.11] | 38.1 | 3.76 | có | -0.039 [-0.055, -0.019] | 17.4 | 0.018 [-0.018, 0.060] | 6.4 |
|
||||||
|
| Rm5 c=0 | không | 0.69 | 0.68 | 0.63 | 0.62 | -0.055 [-0.089, -0.026] | 0.59 | -0.22 [-0.25, -0.19] | 31.6 | 3.59 | có | 0.023 [-0.044, 0.095] | 13.8 | 0.251 [0.168, 0.333] | 5.7 |
|
||||||
|
|
||||||
|
**Luật đã khai báo:** ô "có (c)" nếu tỉ lệ (rid, seed, giếng) có Δ_r < 0 vượt 0.5 và CI của Δ_r dưới 0; bằng chứng cho (c) nếu ≥ 5/8 ô rộng. **Kết quả: 8/8 ô rộng tại λ giao thức → bằng chứng cho (c)** (cũng 8/8 tại λ = 1 và λ = 3). Độ lớn: warp có trọng số r giảm sai số warp 13–40% so với warp trung bình (R0 c=1: 1.86 → 1.38 ms; R10tb c=1: 4.86 → 3.05; R0h c=2: 4.15 → 2.67; R10tb c=2: 19.3 → 11.7; Rm5 c=2: 3.94 → 3.44). Phiên bản theo mẫu E_r,win còn thấp hơn. Δ_e âm ở mọi ô: responsibilities dồn về các thành viên gần warp thật hơn. S_eff tại λ giao thức là 3.5–28 trên 64 (R10tb c=1 cao nhất, Rm5 c=2 thấp nhất): RML ở λ = 1/τ_c **không** ở gần giới hạn λ → 0 (trung bình theo π, Mệnh đề 4) mà có responsibilities tập trung. Tại λ = 1 và 3, Δ_r trong ô rộng tương đương, S_eff 1.7–12; ở ô hẹp λ = 3 làm xấu warp (Rm5 c=0: +0.25 ms [0.17, 0.33]; R0 c=0: +0.02) nên không có cơ sở nói λ lớn hơn tốt hơn; không claim về λ. Ô hẹp tại λ giao thức: |Δ_r| ≤ 0.06 ms (luật cơ học cho "có" nhưng độ lớn không đáng kể so với sai số warp 0.2–0.7 ms). Ở bước 500 (mô tả, không khai báo trước) Δ_r gần như không đổi còn S_eff giảm (R0 c=1: 15.2 → 5.8): responsibilities sắc dần theo huấn luyện.
|
||||||
|
|
||||||
|
**Cách đọc.** E_r < E_64 là tính chất in-sample của responsibilities trên giếng train: thành viên gần dự đoán của mạng (dùng chung 16 giếng) thì gần warp thật hơn, tức mạng mang thông tin về warp và tái đăng ký nhãn trong lúc huấn luyện (Nhận xét 1). Đây là điều kiện cần để (c) là nguồn của lợi ích trên giếng test, không phải điều kiện đủ, và không đo được phần lợi ích test do (c).
|
||||||
|
|
||||||
|
## 3. Phép kiểm (ii): bank nhiễu GP đối chứng
|
||||||
|
|
||||||
|
Bank đối chứng: 64 warp T̄ + η_s, η_s ~ GP với hiệp phương sai thực nghiệm của 1024 hạt trên lưới warp (§3 ii của khai báo). Trên 1.408 giếng × 64 thành viên: 7 lần rút bị loại vì không đơn điệu, **0 giếng dùng phương án dự phòng**; SD biên của bank đối chứng bằng 0.98–0.99 SD của hạt; sai số warp của từng thành viên đối chứng bằng 1.00–1.03 lần của thành viên SMC (bank đối chứng "xa sự thật" ngang bank SMC). Huấn luyện RML, λ = 1/τ_c, π đều, 250 vòng lặp, seed 0–4; D_ctl = band RMSE(Control) − band RMSE(M2-Sa) theo realization.
|
||||||
|
|
||||||
|
| Ô | wide | Control/B3d-Sa [CI] | M2-Sa/B3d-Sa (H2b) [CI] | Control/M2-Sa [CI] | D_ctl (p.u.) [CI] | SD ctl/hạt | sai số thành viên ctl / SMC (ms) | loại |
|
||||||
|
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
|
||||||
|
| R0 c=1 | có | 0.987 [0.972, 1.003] | 0.967 [0.955, 0.979] | 1.021 [1.014, 1.027] | 0.016 [0.011, 0.022] | 0.978 | 2.47 / 2.43 | B: against (a) |
|
||||||
|
| R0h c=1 | có | 0.970 [0.955, 0.985] | 0.970 [0.952, 0.989] | 1.000 [0.990, 1.011] | 0.000 [-0.008, 0.009] | 0.984 | 3.08 / 3.01 | A: consistent with (a) |
|
||||||
|
| R10tb c=1 | có | 0.904 [0.879, 0.930] | 0.890 [0.867, 0.915] | 1.016 [0.996, 1.037] | 0.009 [-0.002, 0.022] | 0.992 | 5.21 / 5.16 | A: consistent with (a) |
|
||||||
|
| Rm5 c=1 | có | 0.984 [0.975, 0.994] | 0.982 [0.967, 0.994] | 1.003 [0.992, 1.018] | 0.003 [-0.009, 0.018] | 0.982 | 3.87 / 3.85 | A: consistent with (a) |
|
||||||
|
| R0 c=2 | có | 0.969 [0.959, 0.978] | 0.952 [0.941, 0.963] | 1.018 [1.009, 1.028] | 0.014 [0.007, 0.022] | 0.980 | 4.05 / 3.97 | C: partial (a) |
|
||||||
|
| Rm5 c=2 | có | 0.973 [0.961, 0.985] | 0.964 [0.953, 0.976] | 1.010 [0.999, 1.021] | 0.011 [-0.001, 0.024] | 0.978 | 5.60 / 5.57 | A: consistent with (a) |
|
||||||
|
| R0h c=2 | có | 0.944 [0.933, 0.956] | 0.904 [0.889, 0.924] | 1.044 [1.023, 1.060] | 0.036 [0.019, 0.046] | 0.981 | 6.03 / 5.89 | C: partial (a) |
|
||||||
|
| R10tb c=2 | có | 0.753 [0.709, 0.791] | 0.667 [0.614, 0.713] | 1.129 [1.085, 1.188] | 0.097 [0.068, 0.130] | 0.999 | 22.28 / 21.81 | C: partial (a) |
|
||||||
|
| R10 c=0 | không | 0.994 [0.976, 1.012] | 0.994 [0.974, 1.014] | 1.000 [0.990, 1.013] | 0.000 [-0.005, 0.006] | 0.987 | 0.35 / 0.35 | D: undetermined |
|
||||||
|
| R0 c=0 | không | 0.994 [0.982, 1.006] | 0.993 [0.980, 1.009] | 1.002 [0.989, 1.015] | 0.001 [-0.008, 0.012] | 0.990 | 0.73 / 0.73 | D: undetermined |
|
||||||
|
| Rm5 c=0 | không | 0.998 [0.988, 1.007] | 1.003 [0.988, 1.017] | 0.995 [0.979, 1.008] | -0.006 [-0.023, 0.008] | 0.994 | 1.10 / 1.09 | D: undetermined |
|
||||||
|
|
||||||
|
**Luật đã khai báo:** (A) CI(Control/B3d-Sa) < 1 và CI(D_ctl) ∋ 0; (B) CI(Control/B3d-Sa) ∋ 1 trong khi M2-Sa có lợi; (C) đối chứng có lợi nhưng kém M2-Sa; kết luận chung = loại chiếm đa số trong 8 ô rộng. **Kết quả: A 4, C 3, B 1 — không loại nào quá bán; loại A chiếm đa số tương đối.** Bank đối chứng có lợi (CI < 1) ở 7/8 ô rộng. Ở c = 1 nó bằng M2-Sa ở 3/4 ô (R0h 0.970 so với 0.970; R10tb 0.904 so với 0.890; Rm5 0.984 so với 0.982) và kém một chút ở R0 (0.987 [0.972, 1.003] so với 0.967; D_ctl = +0.016 p.u. [0.011, 0.022]; loại B theo luật, nhưng ở sát ranh giới). Ở c = 2 đối chứng có lợi nhưng kém M2-Sa rõ (R0 0.969 so với 0.952; R0h 0.944 so với 0.904; R10tb 0.753 so với 0.667; Rm5 c=2 loại A). Ô hẹp: 0.994–0.998, không có hại.
|
||||||
|
|
||||||
|
**Cách đọc.** Phần lớn lợi ích ở c = 1 có được với một bank chỉ mang độ rộng và tương quan của posterior, không mang thông tin về hạt nào khớp seismic: nhất quán với (a) tăng cường nhãn. Phần vượt của M2-Sa so với đối chứng xuất hiện ở c = 2 (posterior không ổn định, nhiều giếng đa mode, Bảng (iii)) và nhẹ ở R0 c=1: ở đó bank SMC mang thông tin ngoài hai mômen đầu (đa mode, liên hệ hạt–seismic) mà đối chứng không có, phù hợp với (c) và/hoặc (b) đóng góp thêm. Lưu ý đối chứng không phải "không thông tin": hiệp phương sai posterior đã mã hóa ràng buộc của seismic lên độ rộng.
|
||||||
|
|
||||||
|
## 4. Phép kiểm (iii): tách theo đa mode
|
||||||
|
|
||||||
|
Thống kê theo giếng train (khai báo §3 iii): GMM 2 so với 1 thành phần trên offset trung bình cửa sổ của hạt a_s; đa mode nếu ΔBIC > 10, |μ₁ − μ₂| > 4 ms, min w ≥ 0.1. m_u = tỉ lệ giếng đa mode trong đơn vị (regime, c, rid). Cột `m_u (b)` là thống kê phụ trên b = U[:, 0] (không dùng trong luật).
|
||||||
|
|
||||||
|
| Ô (N=16) | m_u (a_s) | m_u (b) | đơn vị m_u ≥ 0.25 | đơn vị m_u > 0 | SD posterior của a_s (ms) |
|
||||||
|
| --- | --- | --- | --- | --- | --- |
|
||||||
|
| R0 c=0 | 0.000 | 0.000 | 0 | 0 | 0.410 |
|
||||||
|
| R0 c=1 | 0.047 | 0.055 | 0 | 6 | 0.850 |
|
||||||
|
| R0 c=2 | 0.070 | 0.203 | 1 | 5 | 1.530 |
|
||||||
|
| R0h c=0 | 0.000 | 0.000 | 0 | 0 | 0.430 |
|
||||||
|
| R0h c=1 | 0.078 | 0.055 | 0 | 6 | 1.040 |
|
||||||
|
| R0h c=2 | 0.188 | 0.219 | 3 | 7 | 2.520 |
|
||||||
|
| R10 c=0 | 0.000 | 0.000 | 0 | 0 | 0.150 |
|
||||||
|
| R10 c=1 | 0.008 | 0.836 | 0 | 1 | 0.240 |
|
||||||
|
| R10 c=2 | 0.008 | 0.695 | 0 | 1 | 0.530 |
|
||||||
|
| R10tb c=0 | 0.000 | 0.000 | 0 | 0 | 0.150 |
|
||||||
|
| R10tb c=1 | 0.148 | 0.336 | 2 | 8 | 1.730 |
|
||||||
|
| R10tb c=2 | 0.508 | 0.195 | 8 | 8 | 11.550 |
|
||||||
|
| Rm5 c=0 | 0.000 | 0.000 | 0 | 0 | 0.680 |
|
||||||
|
| Rm5 c=1 | 0.070 | 0.008 | 0 | 6 | 1.540 |
|
||||||
|
| Rm5 c=2 | 0.039 | 0.047 | 0 | 4 | 2.100 |
|
||||||
|
|
||||||
|
Đa mode theo a_s hiếm ngoài R10tb c=2 (m_u = 0.51; 8/8 đơn vị có m_u ≥ 0.25) và R0h c=2 (0.19; 3/8); ở c = 1 tối đa 0.15 (R10tb) và không đơn vị nào đạt 0.25 ngoài R10tb c=1 (2/8). Thống kê trên b cho tỉ lệ cao ở R10 c=1,2 (0.84, 0.70) dù posterior ở cửa sổ hẹp (SD a_s 0.24–0.53 ms): b là offset tại τ = 100 ms, ngoài cửa sổ, nên không phản ánh đa mode của nhãn; điều này ủng hộ lựa chọn a_s làm thống kê chính.
|
||||||
|
|
||||||
|
So sánh log ρ_u = log(band RMSE M2-Sa / B3d-Sa) theo đơn vị (dự đoán đã đăng ký) giữa nhóm đa mode và đơn mode, 64 đơn vị của 8 ô rộng:
|
||||||
|
|
||||||
|
| nhóm | n đa mode | n đơn mode | ô có cả hai nhóm | D không hiệu chỉnh [CI] | D hiệu chỉnh theo ô [CI] | Spearman(m_u, log ρ_u) | kết luận |
|
||||||
|
| --- | --- | --- | --- | --- | --- | --- | --- |
|
||||||
|
| m_u ≥ 0.25 (chính) | 14 | 50 | 3 | -0.235 [-0.323, -0.181] | -0.012 [-0.043, 0.020] | -0.71 | no evidence for (b) |
|
||||||
|
| m_u > 0 (độ nhạy) | 50 | 14 | 6 | -0.091 [-0.112, -0.070] | -0.017 [-0.031, -0.000] | -0.71 | evidence for (b) |
|
||||||
|
|
||||||
|
Spearman trong từng ô và số đơn vị theo nhóm:
|
||||||
|
|
||||||
|
| Ô | Spearman trong ô | đơn vị m_u ≥ 0.25 | đơn vị m_u > 0 |
|
||||||
|
| --- | --- | --- | --- |
|
||||||
|
| R0 c=1 | 0.130 | 0 | 6 |
|
||||||
|
| R0 c=2 | -0.200 | 1 | 5 |
|
||||||
|
| R0h c=1 | -0.620 | 0 | 6 |
|
||||||
|
| R0h c=2 | -0.880 | 3 | 7 |
|
||||||
|
| R10tb c=1 | 0.230 | 2 | 8 |
|
||||||
|
| R10tb c=2 | -0.270 | 8 | 8 |
|
||||||
|
| Rm5 c=1 | -0.940 | 0 | 6 |
|
||||||
|
| Rm5 c=2 | 0.460 | 0 | 4 |
|
||||||
|
|
||||||
|
**Luật đã khai báo:** bằng chứng cho (b) nếu D hiệu chỉnh theo ô < 0 với CI không chứa 0, nhóm m_u ≥ 0.25. **Kết quả: không có bằng chứng cho (b)** (D hiệu chỉnh −0.012 [−0.043, +0.020]; chỉ 3 ô có cả hai nhóm). Độ nhạy m_u > 0: D hiệu chỉnh −0.017 [−0.031, −0.0002], sát 0, "evidence for (b)" theo luật cơ học nhưng ở mức biên. D không hiệu chỉnh (−0.23) và Spearman −0.71 trên 64 đơn vị bị trộn với ô: R10tb c=2 vừa đa mode nhất vừa có lợi ích lớn nhất (vì σ_post 11.5 ms), còn Spearman trong ô đổi dấu giữa các ô. Kết luận: trên P2r, (b) nhiều nhất là đóng góp nhỏ; phép tách có ít lực vì đa mode hiếm ngoài ô không ổn định.
|
||||||
|
|
||||||
|
## 5. Phép kiểm (iv): Berkson hay classical
|
||||||
|
|
||||||
|
Offset trung bình cửa sổ theo giếng train trên tập nút K_w (từ tie anchor B3b): a* (thật), â^m (phương pháp), e = â^m − a*. Thống kê **neo theo anchor** (chính): â′ = â^m − â^{B3b}, a*′ = a* − â^{B3b}; Berkson dự đoán r′_B = corr(e, â′) = 0 và r′_C = corr(e, a*′) < 0; classical (với e ⊥ nhiễu anchor) dự đoán r′_C = 0 và r′_B > 0. Thống kê **thô** (r_B = corr(e, â), r_C = corr(e, a*)) như bài mục 4.3, lực thấp vì SD(a*) = c·19.4 ms ≫ SD(e). CI: bootstrap cụm trên realization. Ô kết luận: bốn ô rộng c = 1, N = 16 và hai tập gộp c = 1.
|
||||||
|
|
||||||
|
| Ô | pp | n giếng | SD e (ms) | SD a*′ (ms) | r′_B = corr(e, â′) [CI] | r′_C = corr(e, a*′) [CI] | Var(â′)/Var(a*′) | kết luận (neo) | r_B thô [CI] | r_C thô [CI] | kết luận thô |
|
||||||
|
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
|
||||||
|
| R0 c=1 N=16 | B3d-Sa | 128 | 1.400 | 2.670 | 0.017 [-0.138, 0.210] | -0.508 [-0.580, -0.391] | 0.740 | Berkson | 0.205 [0.104, 0.310] | 0.171 [0.076, 0.275] | neither (no structure) |
|
||||||
|
| R0 c=1 N=16 | B3c-R | 128 | 2.300 | 2.670 | 0.321 [0.189, 0.465] | -0.586 [-0.667, -0.453] | 0.730 | neither (no structure) | 0.255 [0.098, 0.397] | 0.201 [0.044, 0.345] | neither (no structure) |
|
||||||
|
| R0h c=1 N=16 | B3d-Sa | 128 | 2.000 | 3.620 | -0.035 [-0.140, 0.085] | -0.580 [-0.668, -0.427] | 0.660 | Berkson | 0.145 [-0.029, 0.288] | 0.096 [-0.058, 0.242] | neither (no power) |
|
||||||
|
| R0h c=1 N=16 | B3c-R | 128 | 2.340 | 3.620 | -0.019 [-0.179, 0.160] | -0.662 [-0.768, -0.507] | 0.560 | Berkson | 0.138 [0.019, 0.261] | 0.081 [-0.047, 0.216] | classical |
|
||||||
|
| R10tb c=1 N=16 | B3d-Sa | 128 | 5.680 | 13.800 | -0.027 [-0.157, 0.077] | -0.436 [-0.520, -0.334] | 0.810 | Berkson | -0.004 [-0.143, 0.120] | -0.146 [-0.293, -0.012] | Berkson |
|
||||||
|
| R10tb c=1 N=16 | B3c-R | 128 | 11.740 | 13.800 | -0.193 [-0.302, -0.097] | -0.925 [-0.942, -0.904] | 0.150 | neither (no structure) | -0.041 [-0.098, 0.019] | -0.332 [-0.407, -0.254] | Berkson |
|
||||||
|
| Rm5 c=1 N=16 | B3d-Sa | 128 | 1.970 | 2.670 | -0.052 [-0.264, 0.177] | -0.771 [-0.829, -0.682] | 0.410 | Berkson | 0.106 [-0.064, 0.268] | 0.057 [-0.110, 0.219] | neither (no power) |
|
||||||
|
| Rm5 c=1 N=16 | B3c-R | 128 | 3.060 | 2.670 | 0.551 [0.463, 0.639] | -0.637 [-0.702, -0.513] | 0.850 | neither (no structure) | 0.210 [0.026, 0.339] | 0.137 [-0.048, 0.272] | classical |
|
||||||
|
| R10 c=1 N=16 | B3d-Sa | 128 | 0.460 | 2.670 | -0.161 [-0.231, -0.127] | -0.327 [-0.414, -0.212] | 0.920 | neither (no structure) | 0.122 [-0.088, 0.212] | 0.111 [-0.095, 0.196] | neither (no power) |
|
||||||
|
| R10 c=1 N=16 | B3c-R | 128 | 1.510 | 2.670 | 0.076 [-0.033, 0.219] | -0.501 [-0.590, -0.363] | 0.750 | Berkson | 0.158 [-0.099, 0.371] | 0.121 [-0.124, 0.339] | neither (no power) |
|
||||||
|
| gộp mọi ô c=1 (5 regime × 2 N) | B3d-Sa | 800 | 3.010 | 6.590 | -0.042 [-0.126, 0.049] | -0.493 [-0.561, -0.402] | 0.760 | Berkson | 0.091 [-0.006, 0.216] | 0.013 [-0.095, 0.141] | neither (no power) |
|
||||||
|
| gộp mọi ô c=1 (5 regime × 2 N) | B3c-R | 800 | 5.440 | 6.590 | -0.089 [-0.155, -0.015] | -0.869 [-0.898, -0.829] | 0.250 | neither (no structure) | 0.055 [-0.018, 0.125] | -0.085 [-0.171, -0.005] | Berkson |
|
||||||
|
| gộp 4 ô rộng c=1, N=16 | B3d-Sa | 512 | 3.240 | 7.440 | -0.026 [-0.124, 0.072] | -0.458 [-0.529, -0.376] | 0.790 | Berkson | 0.059 [-0.012, 0.151] | -0.022 [-0.098, 0.073] | neither (no power) |
|
||||||
|
| gộp 4 ô rộng c=1, N=16 | B3c-R | 512 | 6.310 | 7.440 | -0.086 [-0.163, -0.004] | -0.887 [-0.912, -0.851] | 0.210 | neither (no structure) | 0.046 [-0.006, 0.100] | -0.112 [-0.182, -0.049] | Berkson |
|
||||||
|
|
||||||
|
Ô c = 2 (cờ unstable posterior), N = 16:
|
||||||
|
|
||||||
|
| Ô | pp | n giếng | SD e (ms) | SD a*′ (ms) | r′_B = corr(e, â′) [CI] | r′_C = corr(e, a*′) [CI] | Var(â′)/Var(a*′) | kết luận (neo) | r_B thô [CI] | r_C thô [CI] | kết luận thô |
|
||||||
|
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
|
||||||
|
| R0 c=2 N=16 | B3d-Sa | 128 | 1.620 | 2.750 | -0.218 [-0.326, -0.093] | -0.741 [-0.788, -0.673] | 0.470 | neither (no structure) | 0.105 [-0.031, 0.245] | 0.085 [-0.051, 0.238] | neither (no power) |
|
||||||
|
| R0 c=2 N=16 | B3c-R | 128 | 2.290 | 2.750 | 0.248 [0.100, 0.408] | -0.636 [-0.713, -0.520] | 0.630 | neither (no structure) | 0.194 [-0.017, 0.354] | 0.166 [-0.042, 0.326] | neither (no power) |
|
||||||
|
| R0h c=2 N=16 | B3d-Sa | 128 | 2.690 | 4.000 | -0.263 [-0.367, -0.146] | -0.827 [-0.875, -0.772] | 0.340 | neither (no structure) | 0.170 [-0.016, 0.307] | 0.137 [-0.047, 0.276] | neither (no power) |
|
||||||
|
| R0h c=2 N=16 | B3c-R | 128 | 2.910 | 4.000 | -0.072 [-0.252, 0.098] | -0.774 [-0.851, -0.656] | 0.400 | Berkson | 0.154 [-0.027, 0.320] | 0.118 [-0.061, 0.298] | neither (no power) |
|
||||||
|
| R10 c=2 N=16 | B3d-Sa | 128 | 0.630 | 2.750 | -0.228 [-0.289, -0.140] | -0.441 [-0.510, -0.319] | 0.850 | neither (no structure) | 0.040 [-0.149, 0.180] | 0.032 [-0.158, 0.169] | neither (no power) |
|
||||||
|
| R10 c=2 N=16 | B3c-R | 128 | 1.540 | 2.750 | 0.052 [-0.054, 0.181] | -0.516 [-0.626, -0.379] | 0.740 | Berkson | 0.120 [-0.133, 0.332] | 0.100 [-0.148, 0.305] | neither (no power) |
|
||||||
|
| R10tb c=2 N=16 | B3d-Sa | 128 | 20.290 | 26.590 | -0.112 [-0.213, -0.030] | -0.826 [-0.859, -0.793] | 0.320 | neither (no structure) | 0.048 [-0.054, 0.142] | -0.209 [-0.327, -0.086] | Berkson |
|
||||||
|
| R10tb c=2 N=16 | B3c-R | 128 | 26.160 | 26.590 | -0.049 [-0.222, 0.102] | -0.991 [-0.993, -0.987] | 0.020 | Berkson | -0.016 [-0.107, 0.061] | -0.345 [-0.422, -0.247] | Berkson |
|
||||||
|
| Rm5 c=2 N=16 | B3d-Sa | 128 | 2.310 | 2.750 | -0.130 [-0.327, 0.045] | -0.898 [-0.928, -0.862] | 0.200 | Berkson | 0.087 [-0.100, 0.255] | 0.058 [-0.126, 0.228] | neither (no power) |
|
||||||
|
| Rm5 c=2 N=16 | B3c-R | 128 | 3.060 | 2.750 | 0.503 [0.371, 0.619] | -0.697 [-0.742, -0.620] | 0.690 | neither (no structure) | 0.173 [-0.007, 0.309] | 0.135 [-0.055, 0.279] | neither (no power) |
|
||||||
|
|
||||||
|
N = 4, c = 1 (CI rộng, 32 giếng):
|
||||||
|
|
||||||
|
| Ô | pp | r′_B [CI] | r′_C [CI] | kết luận (neo) |
|
||||||
|
| --- | --- | --- | --- | --- |
|
||||||
|
| R0 c=1 N=4 | B3d-Sa | 0.055 [-0.707, 0.611] | -0.688 [-0.883, -0.395] | Berkson |
|
||||||
|
| R0 c=1 N=4 | B3c-R | 0.004 [-0.465, 0.616] | -0.741 [-0.891, -0.511] | Berkson |
|
||||||
|
| R0h c=1 N=4 | B3d-Sa | 0.003 [-0.447, 0.233] | -0.661 [-0.833, -0.362] | Berkson |
|
||||||
|
| R0h c=1 N=4 | B3c-R | -0.094 [-0.461, 0.401] | -0.679 [-0.856, -0.225] | Berkson |
|
||||||
|
| R10 c=1 N=4 | B3d-Sa | 0.141 [-0.588, 0.498] | -0.439 [-0.676, -0.082] | Berkson |
|
||||||
|
| R10 c=1 N=4 | B3c-R | -0.220 [-0.542, 0.231] | -0.571 [-0.723, -0.393] | Berkson |
|
||||||
|
| R10tb c=1 N=4 | B3d-Sa | -0.183 [-0.355, 0.005] | -0.667 [-0.818, -0.381] | Berkson |
|
||||||
|
| R10tb c=1 N=4 | B3c-R | -0.221 [-0.357, -0.126] | -0.861 [-0.939, -0.722] | neither (no structure) |
|
||||||
|
| Rm5 c=1 N=4 | B3d-Sa | 0.143 [-0.284, 0.566] | -0.864 [-0.930, -0.607] | Berkson |
|
||||||
|
| Rm5 c=1 N=4 | B3c-R | 0.465 [0.002, 0.829] | -0.760 [-0.862, -0.625] | neither (no structure) |
|
||||||
|
|
||||||
|
Độ nhạy theo mẫu (offset theo nút, gộp ≈ 15.700 mẫu mỗi ô, N = 16, c = 1):
|
||||||
|
|
||||||
|
| Ô (N=16, c=1) | pp | n mẫu | r′_B [CI] | r′_C [CI] | kết luận (neo) | kết luận thô |
|
||||||
|
| --- | --- | --- | --- | --- | --- | --- |
|
||||||
|
| R10 | B3d-Sa | 15689 | -0.014 [-0.088, 0.038] | -0.162 [-0.229, -0.075] | Berkson | neither (no power) |
|
||||||
|
| R10 | B3c-R | 15689 | 0.192 [0.123, 0.251] | -0.559 [-0.591, -0.520] | neither (no structure) | classical |
|
||||||
|
| R0 | B3d-Sa | 15689 | 0.055 [-0.047, 0.159] | -0.369 [-0.412, -0.319] | Berkson | classical |
|
||||||
|
| R0 | B3c-R | 15689 | 0.449 [0.398, 0.489] | -0.590 [-0.614, -0.558] | neither (no structure) | classical |
|
||||||
|
| Rm5 | B3d-Sa | 15689 | 0.024 [-0.095, 0.148] | -0.563 [-0.619, -0.489] | Berkson | neither (no power) |
|
||||||
|
| Rm5 | B3c-R | 15689 | 0.625 [0.602, 0.655] | -0.622 [-0.647, -0.589] | neither (no structure) | classical |
|
||||||
|
| R0h | B3d-Sa | 15683 | 0.024 [-0.069, 0.111] | -0.503 [-0.564, -0.429] | Berkson | neither (no power) |
|
||||||
|
| R0h | B3c-R | 15683 | 0.331 [0.280, 0.383] | -0.536 [-0.586, -0.477] | neither (no structure) | classical |
|
||||||
|
| R10tb | B3d-Sa | 15707 | -0.023 [-0.110, 0.056] | -0.502 [-0.551, -0.435] | Berkson | Berkson |
|
||||||
|
| R10tb | B3c-R | 15707 | 0.108 [0.067, 0.146] | -0.857 [-0.879, -0.826] | neither (no structure) | Berkson |
|
||||||
|
|
||||||
|
**Kết quả cho B3d-Sa (luật đã khai báo).** **Berkson ở cả bốn ô rộng c = 1, N = 16** (r′_B = 0.017, −0.035, −0.027, −0.052 với CI chứa 0; r′_C = −0.44 … −0.77 với CI xa 0), ở hai tập gộp c = 1 (wide16: r′_B = −0.026 [−0.124, 0.072]; mọi ô c = 1: −0.042 [−0.126, 0.049]), ở cả 5 regime tại N = 4 và trong phiên bản theo mẫu (5/5 regime c = 1). Tỉ số phương sai Var(â′)/Var(a*′) = 0.41–0.81 < 1: offset của warp trung bình **ít phân tán hơn** offset thật quanh tie anchor, đúng như co rút kiểu Berkson. Ở ô hẹp R10 c=1: "neither" vì r′_B = −0.16 [−0.23, −0.13] (sai số chỉ 0.46 ms; hiệu chỉnh theo seismic hơi nhỏ so với cần thiết). Ở c = 2: "neither (no structure)" với r′_B âm (−0.11 … −0.26): sai số của warp trung bình tương quan âm với chính phần hiệu chỉnh theo seismic, tức ở posterior không ổn định warp trung bình không còn là trung bình có điều kiện đúng; nhất quán với cờ unstable và với việc B3d-Sa thua đối chứng ở (ii). **B3c-R:** "neither" ở hầu hết ô (r′_B dương mạnh ở R0, Rm5: 0.32, 0.55 — dịch theo tương quan thêm sai số tương quan với chính nó), chỉ R0h ra Berkson với CI rộng; đúng như cảnh báo trong khai báo, phiên bản neo không sạch cho B3c-R (sai số chứa nhiễu anchor) nên không rút kết luận cấu trúc cho B3c-R. **Thô:** chủ yếu "no power" như dự đoán; R0 c=1 (B3d-Sa) cho cả hai tương quan thô dương (0.21, 0.17) → một thành phần nhỏ tỉ lệ với offset thật (hệ số ≈ 0.012, tức ≈ 0.2 ms ở offset 20 ms) không nằm trong cả hai lý tưởng hóa; R10tb thô ra Berkson.
|
||||||
|
|
||||||
|
**Hệ quả cho Bảng `tab:h2b`.** Với B3d-Sa ở c = 1, cận áp dụng là **1/B_b**. Đối chiếu tỉ số H2b đã đăng ký với 1/B_b (Bảng B, C của khai báo): tại σ_post thấp hơn cận ở R0 (0.967 < 0.982), R0h (0.970 < 0.972) và R10tb (0.890 < 0.893), không ở Rm5 (0.982 > 0.904); tại sai số warp đo được: 0/4. Hai lề ≤ 0.003 nằm trong CI của tỉ số. Ở c = 2 không cấu trúc nào được xác lập nên **không claim cận nào**. Kết luận: không xác lập được lợi ích vượt hiệu chỉnh quần thể của cấu trúc Berkson; cách đọc "vượt cận classical ở 7/8 ô" không áp dụng cho B3d-Sa.
|
||||||
|
|
||||||
|
## 6. Phép kiểm (v): ngân sách 500
|
||||||
|
|
||||||
|
Huấn luyện lại B3d-Sa (PM), M2-Sa (RML) và Oracle (O) với ngân sách [250, 500] trên một quỹ đạo, seed 0–4; tỉ số của trung bình ô band RMSE. Cột "đã đăng ký" lấy từ `outputs/p2r` (trùng số huấn luyện lại, mục 1). Phần khoảng cách do số vòng lặp = 1 − [1 − O(500)/PM(500)]/[1 − O(500)/PM(250)].
|
||||||
|
|
||||||
|
| Ô | O(500)/PM(250) đã đăng ký | O(500)/PM(500) [CI] | O(250)/PM(250) [CI] | PM(500)/PM(250) [CI] | RML(250)/PM(250) (H2b) | RML(500)/PM(500) [CI] | RML(500)/RML(250) | O(500)/O(250) | phần khoảng cách do số vòng lặp |
|
||||||
|
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
|
||||||
|
| R0 c=1 | 0.927 | 0.949 [0.930, 0.965] | 0.945 [0.932, 0.956] | 0.977 [0.971, 0.984] | 0.967 | 0.980 [0.966, 0.994] | 0.990 | 0.981 | 0.300 |
|
||||||
|
| R0h c=1 | 0.919 | 0.944 [0.920, 0.967] | 0.939 [0.922, 0.953] | 0.973 [0.962, 0.985] | 0.970 | 0.981 [0.970, 0.994] | 0.984 | 0.979 | 0.310 |
|
||||||
|
| R10tb c=1 | 0.758 | 0.745 [0.702, 0.795] | 0.765 [0.712, 0.818] | 1.017 [0.999, 1.034] | 0.890 | 0.887 [0.869, 0.910] | 1.014 | 0.990 | -0.050 |
|
||||||
|
| Rm5 c=1 | 0.933 | 0.957 [0.942, 0.971] | 0.954 [0.943, 0.967] | 0.976 [0.970, 0.982] | 0.982 | 0.986 [0.974, 1.000] | 0.980 | 0.978 | 0.350 |
|
||||||
|
| R0 c=2 | 0.899 | 0.924 [0.908, 0.937] | 0.923 [0.906, 0.941] | 0.973 [0.963, 0.983] | 0.952 | 0.962 [0.952, 0.971] | 0.983 | 0.974 | 0.240 |
|
||||||
|
| Rm5 c=2 | 0.909 | 0.924 [0.909, 0.939] | 0.932 [0.918, 0.947] | 0.984 [0.974, 0.993] | 0.964 | 0.966 [0.957, 0.974] | 0.986 | 0.976 | 0.160 |
|
||||||
|
| R0h c=2 | 0.853 | 0.871 [0.854, 0.887] | 0.874 [0.855, 0.894] | 0.980 [0.973, 0.987] | 0.904 | 0.913 [0.898, 0.928] | 0.989 | 0.977 | 0.120 |
|
||||||
|
| R10tb c=2 | 0.408 | 0.414 [0.387, 0.446] | 0.410 [0.384, 0.440] | 0.985 [0.976, 0.993] | 0.667 | 0.687 [0.632, 0.733] | 1.014 | 0.995 | 0.010 |
|
||||||
|
| R10 c=0 | 0.984 | 0.985 [0.961, 1.009] | 0.992 [0.969, 1.010] | 0.999 [0.986, 1.013] | 0.994 | 0.989 [0.981, 0.997] | 0.994 | 0.992 | 0.080 |
|
||||||
|
| R0 c=0 | 0.969 | 0.991 [0.984, 0.999] | 0.994 [0.983, 1.007] | 0.978 [0.968, 0.988] | 0.993 | 0.995 [0.986, 1.004] | 0.981 | 0.975 | 0.720 |
|
||||||
|
| Rm5 c=0 | 0.986 | 1.006 [0.994, 1.017] | 1.006 [0.991, 1.021] | 0.980 [0.975, 0.986] | 1.003 | 1.002 [0.993, 1.012] | 0.979 | 0.980 | — |
|
||||||
|
|
||||||
|
**Kết quả.** B3d-Sa tốt hơn ở 500 vòng lặp trong 7/8 ô rộng (PM(500)/PM(250) = 0.973–0.985, CI dưới 1; R10tb c=1: 1.017 [0.999, 1.034]); ngân sách 250 chọn trên dev (R10, c = 1) không tối ưu cho B3d-Sa ở các ô này. Ở cùng ngân sách 500, Oracle hơn B3d-Sa 5.1%, 5.6%, 4.3% ở R0, R0h, Rm5 (c = 1) thay vì 7.3%, 8.1%, 6.7%: **29–35% khoảng cách B3d-Sa–Oracle đã đăng ký ở c = 1 là do số vòng lặp**, phần còn lại (≈ 4–6%) quy cho sai số nhãn; ở R10tb c=1 khoảng cách không đổi (−5%), ở c = 2 phần do số vòng lặp 1–24%. Ở ô hẹp c = 0, khoảng cách 1–3% đã đăng ký gần như biến mất khi cùng ngân sách (O(500)/PM(500) = 0.991, 0.985, 1.006; phần do số vòng lặp 0.72 ở R0). Lợi ích bank ở cùng ngân sách 500 **còn nhưng nhỏ hơn** ở R0, R0h (RML(500)/PM(500) = 0.980 [0.966, 0.994], 0.981 [0.970, 0.994] so với 0.967, 0.970 đã đăng ký), gần như không đổi ở R10tb c=1 (0.887) và Rm5 c=1 (0.986 [0.974, 1.000]), và ở c = 2 là 0.962, 0.913, 0.687, 0.966. M2-Sa cũng tốt hơn ở 500 (0.98–0.99) trừ R10tb (1.014). Các so sánh đã đăng ký ở 250 vẫn là số được báo trong bài; (v) chỉ bổ sung mô tả.
|
||||||
|
|
||||||
|
## 7. Tổng hợp
|
||||||
|
|
||||||
|
Năm phép kiểm cùng nói rằng: (1) nhãn tại warp trung bình posterior có sai số cấu trúc Berkson ở c = 1 (iv), nên cận quần thể áp dụng cho B3d-Sa là 1/B_b, và so với cận này lợi ích H2b không vượt hiệu chỉnh quần thể (tối đa 3/8 ô tại σ_post với lề ≤ 0.015, 0/8 tại sai số warp); (2) khoảng cách B3d-Sa–Oracle đã đăng ký gồm khoảng một phần ba do số vòng lặp và phần còn lại 4–6% do sai số nhãn ở c = 1 (v), và lợi ích bank còn ở cùng ngân sách nhưng nhỏ hơn; (3) về cơ chế của phần lợi ích hữu hạn mẫu, tái đăng ký ngầm (c) có thật như hiện tượng trên giếng train ở 8/8 ô rộng (i), nhưng một bank chỉ mang hai mômen đầu của posterior thu được phần lớn lợi ích ở c = 1 (ii), nên lợi ích ở c = 1 được giải thích chủ yếu bằng tăng cường nhãn (a) mà không cần (c); thông tin riêng của bank SMC (và theo đó (c), có thể cả (b)) chỉ cần đến ở c = 2, nơi posterior không ổn định và đa mode, còn tách theo đa mode không cho bằng chứng cho (b) theo luật chính (iii). Cả (a) lẫn (c) là hiệu ứng mẫu hữu hạn, phù hợp với lập luận heuristic ở `docs/theory.md` §6.5 rằng với ít giếng hiệu ứng mẫu hữu hạn có thể lấn sai lệch quần thể. Không kết luận nào ở đây là confirmatory; không "cơ chế nào được chứng minh"; H2a, H2b và mọi số đã đăng ký giữ nguyên.
|
||||||
|
|
||||||
|
## 8. Giới hạn
|
||||||
|
|
||||||
|
- Exploratory: thiết kế sau khi đã thấy P2r và phân tích post hoc 29/10 (công bố ở khai báo §0.2); realization 8–15 dùng lại; không có realization mới nên không thể xác nhận.
|
||||||
|
- Huấn luyện lại tất định trên máy và torch hiện tại (sai lệch 0.0), nhưng điều đó không bảo đảm trên GPU/phiên bản khác; mọi tỉ số được báo với cả mẫu số đã đăng ký và mẫu số huấn luyện lại (ở đây trùng nhau).
|
||||||
|
- (i) là đại lượng in-sample trên giếng train; phụ thuộc λ: tại λ = 1, 3 hiện tượng tương tự nhưng ở ô hẹp λ = 3 làm xấu warp; không claim về λ (giữ λ = 1/τ_c như giao thức).
|
||||||
|
- (ii) bank đối chứng dùng hiệp phương sai posterior nên vẫn mang thông tin về độ rộng do seismic đặt; "không thông tin" chỉ theo nghĩa ngoài hai mômen đầu. Luật "đa số" không cho loại quá bán (4/8 A).
|
||||||
|
- (iii) đa mode hiếm ngoài R10tb c=2 nên lực thấp; nhóm trộn với ô; thống kê chính a_s thay cho b đã được lý giải trước khi tính.
|
||||||
|
- (iv) phiên bản neo chỉ sạch cho giả thuyết Berkson; phía classical cần thêm e ⊥ nhiễu anchor, không đúng cho B3c-R; c = 0 suy biến; c = 2 không ổn định; phiên bản thô ít lực và ở R0 c=1 lộ một thành phần tỉ lệ nhỏ không nằm trong hai lý tưởng hóa.
|
||||||
|
- (v) một quỹ đạo cho hai ngân sách (tương đương huấn luyện riêng theo docstring của `bank_train`); không chọn lại ngân sách; số đã đăng ký ở 250 giữ nguyên.
|
||||||
|
|
||||||
|
## 9. Deviation so với khai báo
|
||||||
|
|
||||||
|
Không có deviation phân tích: mọi ô, đại lượng, ước lượng và luật quyết định đúng như `t2-mechanism.md` (hash không đổi). Ghi chú tài nguyên và bổ sung mô tả:
|
||||||
|
|
||||||
|
1. Giai đoạn huấn luyện chạy lần đầu trên cuda:0 với 4 worker (như khai báo), bị dừng chủ động ở 13/88 theo yêu cầu điều phối rồi chạy lại chia theo realization trên cuda:0 (4 worker, rid 8–11) và cuda:1 (3 worker, rid 12–15). Khai báo cho phép chọn lại GPU khi tình trạng đổi; kết quả tất định nên cách chia không ảnh hưởng (mục 1).
|
||||||
|
2. Responsibilities của M2-Sa còn được lưu ở bước 500 (mô tả; không khai báo trước; không dùng trong luật nào).
|
||||||
|
3. Luật kết luận chung của (ii) ("loại chiếm đa số") không cho loại nào quá bán; báo số đếm từng loại và loại chiếm đa số tương đối.
|
||||||
21987
docs/research/unpushed_outputs.sha256
Normal file
21987
docs/research/unpushed_outputs.sha256
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -29,7 +29,7 @@ Ngày 26/10/2026. Tài liệu này viết phần lý thuyết mà [plan.md](plan
|
|||||||
|
|
||||||
**Giả thiết.**
|
**Giả thiết.**
|
||||||
- (A1) Với mọi t, δ(t) độc lập với (X, y(·)) và có phân phối p_t.
|
- (A1) Với mọi t, δ(t) độc lập với (X, y(·)) và có phân phối p_t.
|
||||||
- (A2) E[y(t)²] < ∞.
|
- (A2) sup_t E[y(t)²] < ∞ (dưới giả thiết dừng thì tương đương E[y(t)²] < ∞; cần cho Fubini trong chứng minh).
|
||||||
|
|
||||||
**Mệnh đề 1.** Predictor tối ưu MSE cho nhãn quan sát là
|
**Mệnh đề 1.** Predictor tối ưu MSE cho nhãn quan sát là
|
||||||
|
|
||||||
@@ -195,7 +195,7 @@ Gọi δ(t) = τ̄(t) − τ(t) là sai số của warp trung bình. Nếu poste
|
|||||||
- 𝓛_w là log-likelihood Gaussian trên các cửa sổ. Với RML, áp cùng phép dịch cho mọi mẫu warp trong bank; lập luận không đổi.
|
- 𝓛_w là log-likelihood Gaussian trên các cửa sổ. Với RML, áp cùng phép dịch cho mọi mẫu warp trong bank; lập luận không đổi.
|
||||||
|
|
||||||
**Giả thiết (B): lớp mô hình đóng dưới phép dịch đầu ra.** Với mỗi θ và mỗi β (bội của Δt, |β| ≤ β_max), tồn tại θ' sao cho μ_θ'(X) = T_β μ_θ(X) và σ_θ'(X) = T_β σ_θ(X).
|
**Giả thiết (B): lớp mô hình đóng dưới phép dịch đầu ra.** Với mỗi θ và mỗi β (bội của Δt, |β| ≤ β_max), tồn tại θ' sao cho μ_θ'(X) = T_β μ_θ(X) và σ_θ'(X) = T_β σ_θ(X).
|
||||||
- Đúng chính xác khi lớp mô hình chứa phép dịch đầu ra. Ví dụ: mạng tích chập hoàn toàn có tầng cuối đủ rộng để dời tap kernel đi c mẫu.
|
- Đúng chính xác khi lớp mô hình chứa phép dịch đầu ra. Ví dụ: mạng tích chập hoàn toàn có kernel tầng cuối rộng hơn phần trọng số nó dùng ít nhất β_max mẫu mỗi bên (sai khác chỉ ở mép cửa sổ).
|
||||||
- Đúng xấp xỉ với CNN–biGRU.
|
- Đúng xấp xỉ với CNN–biGRU.
|
||||||
- Trong mọi trường hợp, chỉ đúng tới hiệu ứng biên của cửa sổ hữu hạn.
|
- Trong mọi trường hợp, chỉ đúng tới hiệu ứng biên của cửa sổ hữu hạn.
|
||||||
|
|
||||||
@@ -213,6 +213,7 @@ Gọi δ(t) = τ̄(t) − τ(t) là sai số của warp trung bình. Nếu poste
|
|||||||
\operatorname{sd}(\beta)\approx\Big(\frac{\sum_wK_w}{\sigma_a^2}+\frac{N}{\sigma_b^2}\Big)^{-1/2}\approx\frac{\sigma_a}{\sqrt{\sum_wK_w}} .
|
\operatorname{sd}(\beta)\approx\Big(\frac{\sum_wK_w}{\sigma_a^2}+\frac{N}{\sigma_b^2}\Big)^{-1/2}\approx\frac{\sigma_a}{\sqrt{\sum_wK_w}} .
|
||||||
\]
|
\]
|
||||||
|
|
||||||
|
- sd(β) ở đây là độ trải dọc ridge khi giữ các tham số khác cố định (nghịch đảo căn độ cong). Độ trải biên duyên, có lấy tích phân qua drift của từng giếng, không nhỏ hơn giá trị này (luật phương sai toàn phần).
|
||||||
- Ví dụ có anchor: 4 giếng × 16 anchor với σ_a = 7 ms cho sd(β) ≈ 0.9 ms.
|
- Ví dụ có anchor: 4 giếng × 16 anchor với σ_a = 7 ms cho sd(β) ≈ 0.9 ms.
|
||||||
- Nếu chỉ có prior σ_b = 50 ms (giá trị trong protocol P2), sd(β) ≈ 50/√N: 35 ms với N = 2 và 12.5 ms với N = 16.
|
- Nếu chỉ có prior σ_b = 50 ms (giá trị trong protocol P2), sd(β) ≈ 50/√N: 35 ms với N = 2 và 12.5 ms với N = 16.
|
||||||
- Cả hai đều lớn so với chu kỳ trong băng seismic. Theo nhận xét cuối mục 1.1, dịch chung β nhân thành phần tần số f của PCC với cos(2πfβ), và cos(2π · 20 Hz · 12.5 ms) = 0.
|
- Cả hai đều lớn so với chu kỳ trong băng seismic. Theo nhận xét cuối mục 1.1, dịch chung β nhân thành phần tần số f của PCC với cos(2πfβ), và cos(2π · 20 Hz · 12.5 ms) = 0.
|
||||||
@@ -421,7 +422,7 @@ Giả thiết (A2) cho y và ỹ.
|
|||||||
**Ý nghĩa.**
|
**Ý nghĩa.**
|
||||||
- (a) là cấu trúc classical của mô hình sai số đo (sai số độc lập với giá trị thật); (b) là cấu trúc Berkson (sai số độc lập với giá trị được gán). Ở đây sai số nằm ở chỉ số thời gian của nhãn, và hai cấu trúc làm lệch predictor học được theo hai chiều ngược nhau: (a) làm mờ predictor và nới rộng phương sai học được; (b) làm sắc predictor và thu hẹp phương sai.
|
- (a) là cấu trúc classical của mô hình sai số đo (sai số độc lập với giá trị thật); (b) là cấu trúc Berkson (sai số độc lập với giá trị được gán). Ở đây sai số nằm ở chỉ số thời gian của nhãn, và hai cấu trúc làm lệch predictor học được theo hai chiều ngược nhau: (a) làm mờ predictor và nới rộng phương sai học được; (b) làm sắc predictor và thu hẹp phương sai.
|
||||||
- Tie lấy bằng trung bình posterior, û = E[u* | D], là lý tưởng hoá tự nhiên của (b): E[u* − û | D] = 0 theo cách dựng, và trong mô hình tuyến tính–Gauss u* − û độc lập với D. Với offset b của warp, sai số thời gian bằng sai số posterior của b nên thừa hưởng tính chất này; với drift thì chỉ gần đúng, khi posterior hẹp.
|
- Tie lấy bằng trung bình posterior, û = E[u* | D], là lý tưởng hoá tự nhiên của (b): E[u* − û | D] = 0 theo cách dựng, và trong mô hình tuyến tính–Gauss u* − û độc lập với D. Với offset b của warp, sai số thời gian bằng sai số posterior của b nên thừa hưởng tính chất này; với drift thì chỉ gần đúng, khi posterior hẹp.
|
||||||
- Tie khớp theo cách khác (ví dụ cực đại tương quan synthetic–seismic) có thể theo một trong hai cấu trúc hoặc không theo cấu trúc nào. Trên dữ liệu synthetic phân biệt được: với offset, classical nghĩa là Cov(b̂ − b*, b*) = 0, Berkson nghĩa là Cov(b* − b̂, b̂) = 0.
|
- Tie khớp theo cách khác (ví dụ cực đại tương quan synthetic–seismic) có thể theo một trong hai cấu trúc hoặc không theo cấu trúc nào. Trên dữ liệu synthetic phân biệt được: với offset, classical kéo theo Cov(b̂ − b*, b*) = 0, Berkson kéo theo Cov(b* − b̂, b̂) = 0 (điều kiện cần, dùng làm phép kiểm ở T2).
|
||||||
|
|
||||||
### 6.2 Mệnh đề 4 (bank hiệu chỉnh)
|
### 6.2 Mệnh đề 4 (bank hiệu chỉnh)
|
||||||
|
|
||||||
@@ -433,12 +434,12 @@ Do đó giới hạn λ → 0 của RML (Bổ đề 2) có cùng nghiệm tối
|
|||||||
|
|
||||||
**Lưu ý.**
|
**Lưu ý.**
|
||||||
- Hiệu chỉnh là lý tưởng hoá; nó đúng với mẫu posterior chính xác khi S → ∞. Dưới giả thiết này, lấy biên theo posterior khử sai lệch quần thể của cả hai cấu trúc.
|
- Hiệu chỉnh là lý tưởng hoá; nó đúng với mẫu posterior chính xác khi S → ∞. Dưới giả thiết này, lấy biên theo posterior khử sai lệch quần thể của cả hai cấu trúc.
|
||||||
- Warp trung bình không có tính chất này. B3d-Sa học nhãn tại warp trung bình ū, không phải nhãn trung bình. Khai triển y^u quanh ū: ȳ − y^{ū} = ½ Σ_s π_s (u_s − ū)ᵀ ∇²_u y^{ū} (u_s − ū) + O(‖u_s − ū‖³), nên hai nhãn chỉ trùng nhau tới bậc một theo độ trải posterior. Nếu sai số thời gian của warp trung bình theo (b), tối ưu quần thể của B3d-Sa bị làm sắc bởi 1/Q, còn của nhãn trung bình thì đúng.
|
- Warp trung bình không có tính chất này. B3d-Sa học nhãn tại warp trung bình ū, không phải nhãn trung bình. Khai triển hình thức y^u quanh ū (u chứa hàm drift g): ȳ − y^{ū} = ½ Σ_s π_s (u_s − ū)ᵀ ∇²_u y^{ū} (u_s − ū) + O(Σ_s π_s ‖u_s − ū‖³), nên hai nhãn chỉ trùng nhau tới bậc một theo độ trải posterior. Nếu sai số thời gian của warp trung bình theo (b), tối ưu quần thể của B3d-Sa bị làm sắc bởi 1/Q, còn của nhãn trung bình thì đúng.
|
||||||
|
|
||||||
### 6.3 Hệ quả 3 (hai mode) và Nhận xét 1 (λ > 0)
|
### 6.3 Hệ quả 3 (hai mode) và Nhận xét 1 (λ > 0)
|
||||||
|
|
||||||
- **Hệ quả 3.** Cho sai số (δ dưới (a), ε dưới (b)) hằng trên cửa sổ, bằng ±Δ/2 với xác suất ½ mỗi bên, độc lập với X. Khi đó P = Q = cos(πfΔ), và dưới cả hai cấu trúc hệ số truyền từ m sang m̃ âm khi 1/(2Δ) < |f| < 3/(2Δ): ở đó nhãn điểm kéo mạng về sai dấu. Sai số Gauss cùng phương sai Δ²/4 có P = e^{−π²Δ²f²/2} > 0 ở mọi tần số. Nhãn trung bình của bank hiệu chỉnh có hệ số truyền 1. Dưới (a), bank gồm nhãn điểm dịch ±Δ/2 với trọng số bằng nhau có hệ số truyền cos²(πfΔ) ≥ 0.
|
- **Hệ quả 3.** Cho sai số (δ dưới (a), ε dưới (b)) hằng trên cửa sổ, bằng ±Δ/2 với xác suất ½ mỗi bên, độc lập với (X, y) dưới (a) và với D dưới (b). Khi đó P = Q = cos(πfΔ), và dưới cả hai cấu trúc hệ số truyền từ m sang m̃ âm khi 1/(2Δ) < |f| < 3/(2Δ): ở đó nhãn điểm kéo mạng về sai dấu. Sai số Gauss cùng phương sai Δ²/4 có P = e^{−π²Δ²f²/2} > 0 ở mọi tần số. Nhãn trung bình của bank hiệu chỉnh có hệ số truyền 1. Dưới (a), lấy bank gồm nhãn điểm dịch ±Δ/2 với trọng số bằng nhau: tối ưu quần thể của MSE trên nhãn trung bình của nó, cũng là của RML trên bank này khi λ → 0, có hệ số truyền cos²(πfΔ) ≥ 0. Bank này chứa nhãn tại warp thật nhưng không hiệu chỉnh: trọng số ½–½ không phải xác suất posterior của hai thành viên (nếu hiệu chỉnh thì hệ số truyền là 1 theo Mệnh đề 4(a)). Dưới (b), m̂ = Q·m̂̃, nên hệ số truyền 1/Q chỉ xác định ở nơi Q ≠ 0; Q không có không điểm trong dải đảo, và tại không điểm của Q thì m̂ = 0.
|
||||||
- Đảo pha là tính chất của sai số đa mode mà một tóm tắt Gauss che mất. Nếu hai mode cách nhau một chu kỳ trội, Δ = 1/f_0, dải đảo là f_0/2 < |f| < 3f_0/2. Seismic F3 có đỉnh gần 60 Hz, nên dải đảo là 30–90 Hz. Bước nhảy chu kỳ cho sai số kiểu này; ở c = 2 posterior SMC đa mode. Trong ví dụ này, bank đặt tâm tại nhãn điểm chỉ khử đảo dấu bằng cách làm suy giảm thêm băng.
|
- Đảo pha là tính chất của sai số đa mode mà một tóm tắt Gauss che mất. Nếu hai mode cách nhau một chu kỳ trội, Δ = 1/f_0, dải đảo đầu tiên là f_0/2 < |f| < 3f_0/2 (các dải đảo sau bắt đầu từ 5f_0/2). Seismic F3 có đỉnh gần 60 Hz, nên dải đảo là 30–90 Hz. Bước nhảy chu kỳ cho sai số kiểu này; ở c = 2 posterior SMC đa mode. Trong ví dụ này, bank đặt tâm tại nhãn điểm chỉ khử đảo dấu bằng cách làm suy giảm thêm băng.
|
||||||
- **Nhận xét 1.** Mệnh đề 4 chỉ nói về giới hạn λ → 0. Khai triển hàm sinh cumulant: RML_λ = −(1/n)[Σ_s π_s ℓ_s + (λ/2) Var_π(ℓ) + O(λ²)]. Số hạng thứ hai thưởng cho predictor khớp một số thành viên của bank tốt hơn hẳn các thành viên khác. Với λ > 0, responsibilities của Bổ đề 3 dồn trọng số về các thành viên khớp với mạng hiện tại, tức một kiểu tái đăng ký ngầm, và nghiệm tối ưu quần thể nói chung không còn là (m, Var(y | X)).
|
- **Nhận xét 1.** Mệnh đề 4 chỉ nói về giới hạn λ → 0. Khai triển hàm sinh cumulant: RML_λ = −(1/n)[Σ_s π_s ℓ_s + (λ/2) Var_π(ℓ) + O(λ²)]. Số hạng thứ hai thưởng cho predictor khớp một số thành viên của bank tốt hơn hẳn các thành viên khác. Với λ > 0, responsibilities của Bổ đề 3 dồn trọng số về các thành viên khớp với mạng hiện tại, tức một kiểu tái đăng ký ngầm, và nghiệm tối ưu quần thể nói chung không còn là (m, Var(y | X)).
|
||||||
|
|
||||||
### 6.4 Bank được lợi tối đa bao nhiêu (ρ*)
|
### 6.4 Bank được lợi tối đa bao nhiêu (ρ*)
|
||||||
@@ -458,12 +459,12 @@ Do đó giới hạn λ → 0 của RML (Bổ đề 2) có cùng nghiệm tối
|
|||||||
|
|
||||||
Ký hiệu: phương pháp j dự báo trung bình μ và phương sai s² ở mọi mẫu test; v_j = E s², w_j = E(y − μ)², ξ_j = v_j / w_j, kỳ vọng lấy trên mẫu test. ξ = 1 nghĩa là phương sai dự báo khớp sai số bình phương trung bình. `scripts/30_t4_coverage.py` ghi ξ ở cột `kappa`.
|
Ký hiệu: phương pháp j dự báo trung bình μ và phương sai s² ở mọi mẫu test; v_j = E s², w_j = E(y − μ)², ξ_j = v_j / w_j, kỳ vọng lấy trên mẫu test. ξ = 1 nghĩa là phương sai dự báo khớp sai số bình phương trung bình. `scripts/30_t4_coverage.py` ghi ξ ở cột `kappa`.
|
||||||
- (a) Với mọi j và O: ξ_j − ξ_O = (Δv − ξ_O Δw) / w_j, với Δv = v_j − v_O, Δw = w_j − w_O.
|
- (a) Với mọi j và O: ξ_j − ξ_O = (Δv − ξ_O Δw) / w_j, với Δv = v_j − v_O, Δw = w_j − w_O.
|
||||||
- (b) Cho y dừng và (A1) với P thực, 0 ≤ P ≤ 1. So nhãn điểm tại tối ưu quần thể (μ = m̃, s² = Var(ỹ | X)) với Oracle tại tối ưu (μ = m, s² = Var(y | X)). Khi đó ξ_O = 1 và ξ_j − ξ_O = (2 / w_j) ∫ P(1 − P) S_m df ≥ 0.
|
- (b) Cho m và y đồng dừng, và (A1) với p_t ≡ p, P thực, 0 ≤ P ≤ 1. So nhãn điểm tại tối ưu quần thể (μ = m̃, s² = Var(ỹ | X)) với Oracle tại tối ưu (μ = m, s² = Var(y | X)). Khi đó ξ_O = 1 và ξ_j − ξ_O = (2 / w_j) ∫ P(1 − P) S_m df ≥ 0.
|
||||||
- (c) Dưới cấu trúc (b) của Mệnh đề 3, với q_t không phụ thuộc t và y dừng, nhãn điểm tại tối ưu quần thể có ξ_j ≤ 1. Bank hiệu chỉnh có ξ_j = 1.
|
- (c) Dưới cấu trúc (b) của Mệnh đề 3, với q_t không phụ thuộc t và y dừng, nhãn điểm tại tối ưu quần thể có ξ_j ≤ 1. Bank hiệu chỉnh tại tối ưu quần thể λ → 0 của Mệnh đề 4 có ξ = 1.
|
||||||
- Nếu y − μ = sZ/√ξ với Z chuẩn tắc độc lập với s, khoảng μ ± z·s phủ với xác suất 2Φ(z√ξ) − 1, tăng theo ξ.
|
- Nếu y − μ = sZ/√ξ với Z chuẩn tắc độc lập với s, khoảng μ ± z·s phủ với xác suất 2Φ(z√ξ) − 1, tăng theo ξ.
|
||||||
|
|
||||||
**Ý nghĩa và T4 (post hoc, bài mục 6.3, Bảng `tab:t4`).**
|
**Ý nghĩa và T4 (post hoc, bài mục 6.3, Bảng `tab:t4`).**
|
||||||
- (a) là đồng nhất thức, đúng cho mọi ensemble hữu hạn: j phủ nhiều hơn Oracle khi phương sai dự báo vượt Oracle quá ξ_O lần phần sai số bình phương dư. (b) và (c) là giới hạn quần thể: classical làm rộng khoảng của nhãn điểm, Berkson làm hẹp, bank hiệu chỉnh khớp Oracle.
|
- (a) là đồng nhất thức, đúng cho mọi ensemble hữu hạn: j phủ nhiều hơn Oracle khi phương sai dự báo vượt Oracle quá ξ_O lần phần sai số bình phương dư. (b) và (c) là giới hạn quần thể (bank ở λ → 0): classical làm rộng khoảng của nhãn điểm, Berkson làm hẹp, bank hiệu chỉnh khớp Oracle.
|
||||||
- Ở ô R10, c = 1, N = 16, mọi ensemble đều quá hẹp: ξ là 0,19 ở Oracle và tối đa 0,66 (B5). Vì ξ_O nhỏ, chỉ cần dư một chút phương sai là phủ nhiều hơn Oracle.
|
- Ở ô R10, c = 1, N = 16, mọi ensemble đều quá hẹp: ξ là 0,19 ở Oracle và tối đa 0,66 (B5). Vì ξ_O nhỏ, chỉ cần dư một chút phương sai là phủ nhiều hơn Oracle.
|
||||||
- Độ dài huấn luyện và nguồn nhãn lẫn nhau: B3c-R học 500 vòng lặp (như Oracle) đạt cùng ξ với B3d-Sa ở 250 vòng. Trên dev của Thí nghiệm 1, coverage90 của Oracle đơn lẻ giảm 0,47 → 0,23 → 0,10 sau 125/500/2000 vòng lặp. Vì vậy (b) và (c) **chưa được kiểm**. Không claim hiệu chỉnh.
|
- Độ dài huấn luyện và nguồn nhãn lẫn nhau: B3c-R học 500 vòng lặp (như Oracle) đạt cùng ξ với B3d-Sa ở 250 vòng. Trên dev của Thí nghiệm 1, coverage90 của Oracle đơn lẻ giảm 0,47 → 0,23 → 0,10 sau 125/500/2000 vòng lặp. Vì vậy (b) và (c) **chưa được kiểm**. Không claim hiệu chỉnh.
|
||||||
|
|
||||||
@@ -472,14 +473,14 @@ Ký hiệu: phương pháp j dự báo trung bình μ và phương sai s² ở m
|
|||||||
Thiết lập: reference ở giếng blind là y_ref(t) = y(t + ε_r), với ε_r hằng trên cửa sổ, độc lập với dự đoán ŷ và với nhãn thật y, có hàm đặc trưng Q_r; ŷ và y đồng dừng với phổ chéo S_{ŷy}.
|
Thiết lập: reference ở giếng blind là y_ref(t) = y(t + ε_r), với ε_r hằng trên cửa sổ, độc lập với dự đoán ŷ và với nhãn thật y, có hàm đặc trưng Q_r; ŷ và y đồng dừng với phổ chéo S_{ŷy}.
|
||||||
- **Mệnh đề 6.** E|B(ŷ − y_ref)|² = E|B(ŷ − y)|² + 2 ∫_{|f|≥f_c} Re[(1 − Q_r(f)) S_{ŷy}(f)] df.
|
- **Mệnh đề 6.** E|B(ŷ − y_ref)|² = E|B(ŷ − y)|² + 2 ∫_{|f|≥f_c} Re[(1 − Q_r(f)) S_{ŷy}(f)] df.
|
||||||
- Với sai số đối xứng, 0 ≤ 1 − Q_r ≤ 2, nên reference phạt sự khớp trong băng với nhãn thật. Số hạng thêm phụ thuộc phương pháp, nên có thể đảo thứ hạng hai phương pháp, và không triệt tiêu khi lấy trung bình qua giếng: thêm giếng blind giảm phương sai của phép so sánh, không giảm độ lệch.
|
- Với sai số đối xứng, 0 ≤ 1 − Q_r ≤ 2, nên reference phạt sự khớp trong băng với nhãn thật. Số hạng thêm phụ thuộc phương pháp, nên có thể đảo thứ hạng hai phương pháp, và không triệt tiêu khi lấy trung bình qua giếng: thêm giếng blind giảm phương sai của phép so sánh, không giảm độ lệch.
|
||||||
- **Hệ quả 4.** Với hai phương pháp A và B, gọi G là lợi thế band MSE thật của A và G_r là lợi thế đo với y_ref. Khi đó G_r − G = 2 ∫_{|f|≥f_c} Re[(1 − Q_r)(S_{ŷ_B y} − S_{ŷ_A y})] df.
|
- **Hệ quả 4.** Với hai phương pháp 1 và 2 (bài đổi tên từ A, B ngày 02/11/2026 vì B là toán tử băng), gọi G là lợi thế band MSE thật của phương pháp 1 và G_r là lợi thế đo với y_ref. Khi đó G_r − G = 2 ∫_{|f|≥f_c} Re[(1 − Q_r)(S_{ŷ_2 y} − S_{ŷ_1 y})] df.
|
||||||
- Lấy ŷ_A = Hm và ŷ_B = HPm với các bộ lọc thực 0 ≤ H, P ≤ 1 (A học Oracle, B học tối ưu bị mờ của (a), cả hai bị co bởi cùng hệ số mẫu hữu hạn H). Khi đó G = ∫ H(1 − P)[2 − H(1 + P)] S_m df ≥ 0 và G_r = ∫ H(1 − P)[2Q_r − H(1 + P)] S_m df.
|
- Lấy ŷ_1 = Hm và ŷ_2 = HPm với các bộ lọc thực 0 ≤ H, P ≤ 1 (phương pháp 1 học Oracle, phương pháp 2 học tối ưu bị mờ của (a), cả hai bị co bởi cùng hệ số mẫu hữu hạn H). Khi đó G = ∫ H(1 − P)[2 − H(1 + P)] S_m df ≥ 0 và G_r = ∫ H(1 − P)[2Q_r − H(1 + P)] S_m df.
|
||||||
- Với H = 1 và sai số Gauss trung bình 0 có độ lệch chuẩn σ (tie của nhãn điểm) và σ_r (reference): 2Q_r − 1 − P = 2π²f²(σ² − 2σ_r²) + O(f⁴). Ở bậc dẫn, **lợi thế đo được cùng dấu với lợi thế thật chỉ khi σ_r < σ/√2**.
|
- Với H = 1 và sai số Gauss trung bình 0 có độ lệch chuẩn σ (tie của nhãn điểm) và σ_r (reference): 2Q_r − 1 − P = 2π²f²(σ² − 2σ_r²) + O(f⁴). Vì vậy **lợi thế đo được chỉ có thể cùng dấu với lợi thế thật khi σ_r < σ/√2**. Điều kiện này cần ở mọi bậc, không chỉ bậc dẫn: nếu σ_r ≥ σ/√2 thì 2Q_r − 1 − P ≤ −(1 − e^{−π²σ²f²})² ≤ 0 ở mọi f, nên G_r ≤ 0 (H = 1). Nó không đủ: điểm đổi dấu thật nằm dưới σ/√2 (kiểm độc lập 02/11/2026, docs/plan.md §12 mục 32).
|
||||||
- Co rút nới điều kiện này, vì 2Q_r − H(1 + P) tăng khi H giảm. Nếu B quá sắc, như dưới (b), với ŷ_B = HKm và K ≥ 1, thì G_r − G = 2 ∫ H(K − 1)(1 − Q_r) S_m df ≥ 0: reference phóng đại lợi thế của A.
|
- Co rút nới điều kiện này, vì 2Q_r − H(1 + P) tăng khi H giảm. Nếu phương pháp 2 quá sắc, như dưới (b), với ŷ_2 = HKm và K ≥ 1, thì G_r − G = 2 ∫ H(K − 1)(1 − Q_r) S_m df ≥ 0: reference phóng đại lợi thế của phương pháp 1.
|
||||||
- Độc lập giữa ε_r và dự đoán hợp lý với reference từ checkshot hoặc VSP. Reference tie bằng khớp synthetic–seismic phụ thuộc cùng seismic với dự đoán, và sai số của nó thêm một số hạng hiệp phương sai vào công thức của Mệnh đề 6.
|
- Độc lập giữa ε_r và dự đoán hợp lý với reference từ checkshot hoặc VSP. Reference tie bằng khớp synthetic–seismic phụ thuộc cùng seismic với dự đoán, và sai số của nó thêm một số hạng hiệp phương sai vào công thức của Mệnh đề 6.
|
||||||
|
|
||||||
**Kiểm bằng mô phỏng (T3, exploratory; bài mục 6.5, Bảng `tab:t3`; `scripts/27_t3_power.py`).**
|
**Kiểm bằng mô phỏng (T3, exploratory; bài mục 6.6 (trước 02/11/2026 là 6.5), Bảng `tab:t3`; `scripts/27_t3_power.py`).**
|
||||||
- Ở ba ô N = 16, tỉ số band RMSE trung vị M2-Sa/đối thủ cắt 1 ở σ_ref = 3,6–4,3 ms, so với σ/√2 = 3,0/4,1/5,1 ms (sai số warp RMS của B3c-R trên giếng train là 4,2/5,8/7,3 ms ở R10/R0/Rm5): cùng thứ tự, lệch không quá 1 ms.
|
- Ở ba ô N = 16, tỉ số band RMSE trung vị M2-Sa/đối thủ cắt 1 ở σ_ref = 3,6–4,3 ms, so với σ/√2 = 3,0/4,1/5,1 ms (sai số warp RMS của B3c-R trên giếng train là 4,2/5,8/7,3 ms ở R10/R0/Rm5): cùng thứ tự, lệch không quá 1 ms. Nội suy tuyến tính cho 3,6/3,8/4,3 ms: dưới σ/√2 ở R0 và Rm5, trên 0,6 ms ở R10; điều đó không mâu thuẫn với Hệ quả 4 vì co rút (H < 1) nới điều kiện và M2-Sa không phải Oracle.
|
||||||
- Với reference chính xác, sign test một phía (α = 0,05) đạt power 0,8 với 5–18 giếng blind ở 5/6 ô (ô R10, N = 4 không đạt vì ICC 0,45). Ở σ_ref = 1 ms, bốn ô cần 11–30 giếng; ở 2 ms chỉ R0 còn trong 40 giếng (23 và 37); từ 3 ms trở lên không ô nào đạt.
|
- Với reference chính xác, sign test một phía (α = 0,05) đạt power 0,8 với 5–18 giếng blind ở 5/6 ô (ô R10, N = 4 không đạt vì ICC 0,45). Ở σ_ref = 1 ms, bốn ô cần 11–30 giếng; ở 2 ms chỉ R0 còn trong 40 giếng (23 và 37); từ 3 ms trở lên không ô nào đạt.
|
||||||
- Luật k-of-n của hai gate field không phải phép kiểm: khi không có khác biệt thật và giếng độc lập, nó vẫn đạt với xác suất 5/16 = 0,31 (n = 4) và 7/64 = 0,11 (n = 6).
|
- Luật k-of-n của hai gate field không phải phép kiểm: khi không có khác biệt thật và giếng độc lập, nó vẫn đạt với xác suất 5/16 = 0,31 (n = 4) và 7/64 = 0,11 (n = 6).
|
||||||
|
|
||||||
|
|||||||
@@ -152,3 +152,61 @@ run_id,parent,name,status,exit_code,start,end,wall_s,wall,device,git,dirty,code_
|
|||||||
20261029-012825_p4_train_sensitivity,,p4_train_sensitivity,ok,0,2026-10-29T01:28:25+00:00,2026-10-29T02:21:04+00:00,3159.2,0:52:39,cuda:0,7da6b077b6e3,True,984655c40e2413fc,runlog,.venv/bin/python scripts/24_run_volve.py train --device cuda:0 --workers 8 --arms sensitivity
|
20261029-012825_p4_train_sensitivity,,p4_train_sensitivity,ok,0,2026-10-29T01:28:25+00:00,2026-10-29T02:21:04+00:00,3159.2,0:52:39,cuda:0,7da6b077b6e3,True,984655c40e2413fc,runlog,.venv/bin/python scripts/24_run_volve.py train --device cuda:0 --workers 8 --arms sensitivity
|
||||||
20261029-022117_p4_summarize_all,,p4_summarize_all,ok,0,2026-10-29T02:21:17+00:00,2026-10-29T02:21:36+00:00,18.7,0:00:19,cpu,7da6b077b6e3,True,984655c40e2413fc,runlog,.venv/bin/python scripts/24_run_volve.py summarize --device cpu --workers 4 --arms all
|
20261029-022117_p4_summarize_all,,p4_summarize_all,ok,0,2026-10-29T02:21:17+00:00,2026-10-29T02:21:36+00:00,18.7,0:00:19,cpu,7da6b077b6e3,True,984655c40e2413fc,runlog,.venv/bin/python scripts/24_run_volve.py summarize --device cpu --workers 4 --arms all
|
||||||
20261029-040703_p4x_summarize_partial,,p4x_summarize_partial,ok,0,2026-10-29T04:07:03+00:00,2026-10-29T04:07:10+00:00,7.1,0:00:07,,7da6b077b6e3,True,9b97ea3ba76b1136,runlog,/home/jovyan/lamlvh/ML-Porosity/.venv/bin/python exploratory/p4x_volve.py summarize
|
20261029-040703_p4x_summarize_partial,,p4x_summarize_partial,ok,0,2026-10-29T04:07:03+00:00,2026-10-29T04:07:10+00:00,7.1,0:00:07,,7da6b077b6e3,True,9b97ea3ba76b1136,runlog,/home/jovyan/lamlvh/ML-Porosity/.venv/bin/python exploratory/p4x_volve.py summarize
|
||||||
|
20261029-124821_t2_particles,,t2_particles,ok,0,2026-10-29T12:48:21+00:00,2026-10-29T12:55:07+00:00,405.9,0:06:46,,0cfe202a8b5a,True,6fc54aafba932674,runlog,/home/jovyan/lamlvh/ML-Porosity/.venv/bin/python scripts/32_t2_mechanism.py --tests iii iv --workers 4
|
||||||
|
20261029-124821_t2_train,,t2_train,interrupted,-15,2026-10-29T12:48:21+00:00,2026-10-29T12:57:32+00:00,551.2,0:09:11,cuda:0,0cfe202a8b5a,True,6fc54aafba932674,runlog,/home/jovyan/lamlvh/ML-Porosity/.venv/bin/python scripts/32_t2_mechanism.py --tests i ii v --device cuda:0 --workers 4
|
||||||
|
20261029-125820_t2_train_a,,t2_train_a,ok,0,2026-10-29T12:58:20+00:00,2026-10-29T13:16:13+00:00,1072.1,0:17:52,cuda:0,0cfe202a8b5a,True,d5ffd3022ad63893,runlog,/home/jovyan/lamlvh/ML-Porosity/.venv/bin/python scripts/32_t2_mechanism.py --tests i ii v --device cuda:0 --workers 4 --rids 8 9 10 11
|
||||||
|
20261029-125820_t2_train_b,,t2_train_b,ok,0,2026-10-29T12:58:20+00:00,2026-10-29T13:23:49+00:00,1528.1,0:25:28,cuda:1,0cfe202a8b5a,True,d5ffd3022ad63893,runlog,/home/jovyan/lamlvh/ML-Porosity/.venv/bin/python scripts/32_t2_mechanism.py --tests i ii v --device cuda:1 --workers 3 --rids 12 13 14 15
|
||||||
|
20261029-132408_t2_summary,,t2_summary,ok,0,2026-10-29T13:24:08+00:00,2026-10-29T13:26:35+00:00,147.4,0:02:27,,0cfe202a8b5a,True,01ca5e31bfcacc2a,runlog,/home/jovyan/lamlvh/ML-Porosity/.venv/bin/python scripts/32_t2_mechanism.py --tests summary
|
||||||
|
20261029-132859_bench_dev_smoke_r902,,bench_dev_smoke_r902,ok,0,2026-10-29T13:28:59+00:00,2026-10-29T13:31:37+00:00,157.8,0:02:38,cuda:1,0cfe202a8b5a,True,b988c8d625db1fb0,runlog,.venv/bin/python scripts/34_run_bench.py posterior train --dev --studies S1 --rids 902 --regimes R10 --drift 1 --n-train 4 --seeds 0 --device cuda:1 --workers 1 --gpu-mem-gb 2
|
||||||
|
20261029-130144_bench_gen_smc_rid902,,bench_gen_smc_rid902,ok,0,2026-10-29T13:01:44+00:00,2026-10-29T13:34:15+00:00,1950.7,0:32:31,cuda:1,0cfe202a8b5a,True,915234d81957318d,runlog,/home/jovyan/lamlvh/ML-Porosity/.venv/bin/python scripts/33_bench_generator_qc.py --rid 902 --skip-qc --smc --device cuda:1 --regimes R10 Rm5 --n-train 4 --particles 1024 --gpu-mem-gb 2
|
||||||
|
20261029-133329_bench_repro_r8,,bench_repro_r8,ok,0,2026-10-29T13:33:29+00:00,2026-10-29T13:37:18+00:00,228.2,0:03:48,cuda:1,0cfe202a8b5a,True,bb548925ace61986,runlog,.venv/bin/python scripts/34_run_bench.py repro --device cuda:1 --workers 1 --gpu-mem-gb 3
|
||||||
|
20261029-134258_bench_dev_smoke_s8,,bench_dev_smoke_s8,ok,0,2026-10-29T13:42:58+00:00,2026-10-29T13:43:55+00:00,57.0,0:00:57,cuda:1,0cfe202a8b5a,True,d39fff13e52542d0,runlog,.venv/bin/python scripts/34_run_bench.py train --dev --studies S8 --rids 902 --regimes R10 --n-train 4 --seeds 0 --device cuda:1 --workers 1
|
||||||
|
20261029-134525_bench_dev_smoke_s34_post,,bench_dev_smoke_s34_post,ok,0,2026-10-29T13:45:25+00:00,2026-10-29T13:48:25+00:00,179.7,0:03:00,cuda:1,0cfe202a8b5a,True,80aee9582b02e6a1,runlog,.venv/bin/python scripts/34_run_bench.py posterior --dev --studies S1 --rids 903 --regimes R10 --drift 1 --n-train 4 --device cuda:1 --workers 1 --gpu-mem-gb 2
|
||||||
|
20261029-134825_bench_dev_smoke_s34_train,,bench_dev_smoke_s34_train,ok,0,2026-10-29T13:48:25+00:00,2026-10-29T13:49:56+00:00,91.1,0:01:31,cuda:1,0cfe202a8b5a,True,180f5354143361ce,runlog,.venv/bin/python scripts/34_run_bench.py train --dev --studies S3 S4 --rids 903 --regimes R10 --drift 1 --n-train 4 --seeds 0 --device cuda:1 --workers 1
|
||||||
|
20261029-131331_bench_cal_smc_rid903,,bench_cal_smc_rid903,ok,0,2026-10-29T13:13:31+00:00,2026-10-29T13:51:09+00:00,2257.4,0:37:37,cuda:0,0cfe202a8b5a,True,d4161e1bad992af2,runlog,.venv/bin/python scripts/33_bench_generator_qc.py --rid 903 --skip-qc --smc --device cuda:0 --regimes R10 Rm5 --n-train 4 --particles 1024 --gpu-mem-gb 2 --presets cand_rp_a cand_rp_b cand_rp_c cand_wv_a cand_wv_b cand_wv_c cand_wv_d cand_wv_e cand_dr_h cand_dr_s cand_dr_hs cand_dr_s2
|
||||||
|
20261029-135351_bench_status,,bench_status,ok,0,2026-10-29T13:53:51+00:00,2026-10-29T13:53:54+00:00,3.0,0:00:03,cuda:0,0cfe202a8b5a,True,b94e242cb0842a56,runlog,.venv/bin/python scripts/34_run_bench.py status --device cuda:0 --workers 4 --threads 2 --gpu-mem-gb 6 --studies S8 --dev
|
||||||
|
20261029-133932_bench_cal_smc_rid904,,bench_cal_smc_rid904,ok,0,2026-10-29T13:39:32+00:00,2026-10-29T14:04:35+00:00,1503.1,0:25:03,cuda:0,0cfe202a8b5a,True,b589912958c89ef3,runlog,.venv/bin/python scripts/33_bench_generator_qc.py --rid 904 --skip-qc --smc --device cuda:0 --regimes R10 Rm5 --n-train 4 --particles 1024 --gpu-mem-gb 2 --presets rp_L1 rp_L2 wv_L1 wv_L2 wv_Q dr_L1 dr_L2
|
||||||
|
20261029-133619_bench_cal_smc_rid902b,,bench_cal_smc_rid902b,ok,0,2026-10-29T13:36:19+00:00,2026-10-29T14:05:35+00:00,1755.8,0:29:16,cuda:1,0cfe202a8b5a,True,ab1b54d59886b91e,runlog,.venv/bin/python scripts/33_bench_generator_qc.py --rid 902 --skip-qc --smc --device cuda:1 --regimes R10 Rm5 --n-train 4 --particles 1024 --gpu-mem-gb 2 --presets cand_rp_c cand_rp_d cand_wv_a cand_wv_b cand_wv_d cand_wv_e cand_wv_f cand_wv_g cand_wv_h cand_dr_hs cand_dr_s2
|
||||||
|
20261029-133933_bench_cal_smc_rid905,,bench_cal_smc_rid905,ok,0,2026-10-29T13:39:33+00:00,2026-10-29T14:06:24+00:00,1611.3,0:26:51,cuda:1,0cfe202a8b5a,True,b589912958c89ef3,runlog,.venv/bin/python scripts/33_bench_generator_qc.py --rid 905 --skip-qc --smc --device cuda:1 --regimes R10 Rm5 --n-train 4 --particles 1024 --gpu-mem-gb 2 --presets rp_L1 rp_L2 wv_L1 wv_L2 wv_Q dr_L1 dr_L2
|
||||||
|
20261029-133330_bench_dev_budgets_tcn,,bench_dev_budgets_tcn,ok,0,2026-10-29T13:33:30+00:00,2026-10-29T14:37:24+00:00,3833.3,1:03:53,cuda:0,0cfe202a8b5a,True,bb548925ace61986,runlog,.venv/bin/python scripts/34_run_bench.py dev-budgets --device cuda:0 --workers 1 --gpu-mem-gb 4
|
||||||
|
20261029-143914_bench_lock,,bench_lock,ok,0,2026-10-29T14:39:14+00:00,2026-10-29T14:39:21+00:00,6.9,0:00:07,cuda:0,0cfe202a8b5a,True,0e0956f31f33d3ee,runlog,.venv/bin/python scripts/34_run_bench.py lock --device cuda:0 --workers 4 --threads 2 --gpu-mem-gb 6 --studies S1 S2 S3 S4 S8
|
||||||
|
20261029-144311_bench_posterior_S2_cuda1,,bench_posterior_S2_cuda1,interrupted,-15,2026-10-29T14:43:11+00:00,2026-10-29T15:26:55+00:00,2624.6,0:43:45,cuda:1,0cfe202a8b5a,True,ba88b1f22934cb8d,runlog,.venv/bin/python scripts/34_run_bench.py posterior --device cuda:1 --workers 3 --threads 2 --gpu-mem-gb 2 --studies S2
|
||||||
|
20261029-144311_bench_posterior_S1_cuda0,,bench_posterior_S1_cuda0,interrupted,-15,2026-10-29T14:43:11+00:00,2026-10-29T15:26:55+00:00,2624.6,0:43:45,cuda:0,0cfe202a8b5a,True,ba88b1f22934cb8d,runlog,.venv/bin/python scripts/34_run_bench.py posterior --device cuda:0 --workers 3 --threads 2 --gpu-mem-gb 2 --studies S1 --regimes R10 Rm5 R0h
|
||||||
|
20261029-144311_bench_train_S3_S4_S8_cuda1,,bench_train_S3_S4_S8_cuda1,interrupted,-15,2026-10-29T14:43:11+00:00,2026-10-29T15:26:55+00:00,2624.6,0:43:45,cuda:1,0cfe202a8b5a,True,ba88b1f22934cb8d,runlog,.venv/bin/python scripts/34_run_bench.py train --device cuda:1 --workers 2 --threads 2 --gpu-mem-gb 6 --studies S3 S4 S8
|
||||||
|
20261029-144311_bench_posterior_S1_cuda1,,bench_posterior_S1_cuda1,interrupted,-15,2026-10-29T14:43:11+00:00,2026-10-29T15:26:56+00:00,2625.2,0:43:45,cuda:1,0cfe202a8b5a,True,ba88b1f22934cb8d,runlog,.venv/bin/python scripts/34_run_bench.py posterior --device cuda:1 --workers 1 --threads 2 --gpu-mem-gb 2 --studies S1 --regimes R0 R10tb
|
||||||
|
20261029-154110_bench_posterior_S2_cuda0,,bench_posterior_S2_cuda0,interrupted,-1,2026-10-29T15:41:10+00:00,2026-10-29T16:06:44+00:00,1534.2,0:25:34,cuda:0,0cfe202a8b5a,True,ba88b1f22934cb8d,runlog,.venv/bin/python scripts/34_run_bench.py posterior --device cuda:0 --workers 2 --threads 2 --gpu-mem-gb 2 --studies S2
|
||||||
|
20261029-154110_bench_train_S3_S4_S8_cuda0,,bench_train_S3_S4_S8_cuda0,interrupted,-1,2026-10-29T15:41:10+00:00,2026-10-29T16:07:30+00:00,1580.1,0:26:20,cuda:0,0cfe202a8b5a,True,ba88b1f22934cb8d,runlog,.venv/bin/python scripts/34_run_bench.py train --device cuda:0 --workers 2 --threads 2 --gpu-mem-gb 6 --studies S3 S4 S8
|
||||||
|
20261029-160659_bench_posterior_S2_cuda1,,bench_posterior_S2_cuda1,ok,0,2026-10-29T16:06:59+00:00,2026-10-29T21:04:21+00:00,17841.6,4:57:22,cuda:1,0cfe202a8b5a,True,ba88b1f22934cb8d,runlog,.venv/bin/python scripts/34_run_bench.py posterior --device cuda:1 --workers 6 --threads 2 --gpu-mem-gb 2 --studies S2
|
||||||
|
20261029-160659_bench_posterior_S1_cuda0,,bench_posterior_S1_cuda0,ok,0,2026-10-29T16:06:59+00:00,2026-10-29T21:39:32+00:00,19952.6,5:32:33,cuda:0,0cfe202a8b5a,True,ba88b1f22934cb8d,runlog,.venv/bin/python scripts/34_run_bench.py posterior --device cuda:0 --workers 5 --threads 2 --gpu-mem-gb 2 --studies S1 --regimes R10 Rm5 R0
|
||||||
|
20261029-160659_bench_posterior_S1_cuda1,,bench_posterior_S1_cuda1,interrupted,-15,2026-10-29T16:06:59+00:00,2026-10-29T22:26:15+00:00,22755.5,6:19:16,cuda:1,0cfe202a8b5a,True,ba88b1f22934cb8d,runlog,.venv/bin/python scripts/34_run_bench.py posterior --device cuda:1 --workers 2 --threads 2 --gpu-mem-gb 2 --studies S1 --regimes R0h R10tb
|
||||||
|
20261029-210421_bench_train_S2_cuda1,,bench_train_S2_cuda1,ok,0,2026-10-29T21:04:21+00:00,2026-10-30T00:12:09+00:00,11268.3,3:07:48,cuda:1,0cfe202a8b5a,True,ba88b1f22934cb8d,runlog,.venv/bin/python scripts/34_run_bench.py train --device cuda:1 --workers 6 --threads 2 --gpu-mem-gb 2 --studies S2
|
||||||
|
20261029-222635_bench_posterior_S1_cuda1,,bench_posterior_S1_cuda1,interrupted,-15,2026-10-29T22:26:35+00:00,2026-10-30T00:16:37+00:00,6602.4,1:50:02,cuda:1,0cfe202a8b5a,True,ba88b1f22934cb8d,runlog,.venv/bin/python scripts/34_run_bench.py posterior --device cuda:1 --workers 6 --threads 2 --gpu-mem-gb 2 --studies S1 --regimes R0h R10tb
|
||||||
|
20261030-001657_bench_posterior_S1_cuda1,,bench_posterior_S1_cuda1,ok,0,2026-10-30T00:16:57+00:00,2026-10-30T00:38:49+00:00,1311.6,0:21:52,cuda:1,0cfe202a8b5a,True,ba88b1f22934cb8d,runlog,.venv/bin/python scripts/34_run_bench.py posterior --device cuda:1 --workers 10 --threads 2 --gpu-mem-gb 2 --studies S1 --regimes R0h R10tb
|
||||||
|
20261029-160738_bench_train_S3_S4_S8_cuda0,,bench_train_S3_S4_S8_cuda0,ok,0,2026-10-29T16:07:38+00:00,2026-10-30T00:58:19+00:00,31840.7,8:50:41,cuda:0,0cfe202a8b5a,True,ba88b1f22934cb8d,runlog,.venv/bin/python scripts/34_run_bench.py train --device cuda:0 --workers 4 --threads 2 --gpu-mem-gb 6 --studies S3 S4 S8
|
||||||
|
20261030-003849_bench_train_S1_cuda1,,bench_train_S1_cuda1,interrupted,-15,2026-10-30T00:38:49+00:00,2026-10-30T01:01:59+00:00,1390.2,0:23:10,cuda:1,0cfe202a8b5a,True,ba88b1f22934cb8d,runlog,.venv/bin/python scripts/34_run_bench.py train --device cuda:1 --workers 10 --threads 2 --gpu-mem-gb 2 --studies S1 --regimes R0h R10tb
|
||||||
|
20261029-213932_bench_train_S1_cuda0,,bench_train_S1_cuda0,interrupted,-15,2026-10-29T21:39:32+00:00,2026-10-30T01:02:37+00:00,12185.3,3:23:05,cuda:0,0cfe202a8b5a,True,ba88b1f22934cb8d,runlog,.venv/bin/python scripts/34_run_bench.py train --device cuda:0 --workers 5 --threads 2 --gpu-mem-gb 2 --studies S1 --regimes R10 Rm5 R0
|
||||||
|
20261030-010257_bench_posterior_S1_cuda0,,bench_posterior_S1_cuda0,ok,0,2026-10-30T01:02:57+00:00,2026-10-30T01:03:12+00:00,14.4,0:00:14,cuda:0,0cfe202a8b5a,True,ba88b1f22934cb8d,runlog,.venv/bin/python scripts/34_run_bench.py posterior --device cuda:0 --workers 14 --threads 2 --gpu-mem-gb 2 --studies S1 --regimes R0h
|
||||||
|
20261030-010257_bench_posterior_S1_cuda1,,bench_posterior_S1_cuda1,ok,0,2026-10-30T01:02:57+00:00,2026-10-30T01:03:12+00:00,14.4,0:00:14,cuda:1,0cfe202a8b5a,True,ba88b1f22934cb8d,runlog,.venv/bin/python scripts/34_run_bench.py posterior --device cuda:1 --workers 14 --threads 2 --gpu-mem-gb 2 --studies S1 --regimes R10tb
|
||||||
|
20261030-010257_bench_posterior_S1_cuda0-2,,bench_posterior_S1_cuda0,ok,0,2026-10-30T01:02:57+00:00,2026-10-30T01:03:12+00:00,14.6,0:00:15,cuda:0,0cfe202a8b5a,True,ba88b1f22934cb8d,runlog,.venv/bin/python scripts/34_run_bench.py posterior --device cuda:0 --workers 8 --threads 2 --gpu-mem-gb 2 --studies S1 --regimes R10 Rm5 R0
|
||||||
|
20261030-010312_bench_train_S1_cuda1,,bench_train_S1_cuda1,ok,0,2026-10-30T01:03:12+00:00,2026-10-30T01:50:38+00:00,2846.3,0:47:26,cuda:1,0cfe202a8b5a,True,ba88b1f22934cb8d,runlog,.venv/bin/python scripts/34_run_bench.py train --device cuda:1 --workers 14 --threads 2 --gpu-mem-gb 2 --studies S1 --regimes R10tb
|
||||||
|
20261030-010312_bench_train_S1_cuda0,,bench_train_S1_cuda0,interrupted,-15,2026-10-30T01:03:12+00:00,2026-10-30T01:53:00+00:00,2988.2,0:49:48,cuda:0,0cfe202a8b5a,True,ba88b1f22934cb8d,runlog,.venv/bin/python scripts/34_run_bench.py train --device cuda:0 --workers 14 --threads 2 --gpu-mem-gb 2 --studies S1 --regimes R0h
|
||||||
|
20261030-015319_bench_posterior_S1_cuda1,,bench_posterior_S1_cuda1,ok,0,2026-10-30T01:53:19+00:00,2026-10-30T01:53:31+00:00,12.0,0:00:12,cuda:1,381b5ffb0620,True,ba88b1f22934cb8d,runlog,.venv/bin/python scripts/34_run_bench.py posterior --device cuda:1 --workers 16 --threads 2 --gpu-mem-gb 2 --studies S1 --regimes R0h
|
||||||
|
20261030-010312_bench_train_S1_cuda0-2,,bench_train_S1_cuda0,ok,0,2026-10-30T01:03:12+00:00,2026-10-30T01:57:20+00:00,3247.9,0:54:08,cuda:0,0cfe202a8b5a,True,ba88b1f22934cb8d,runlog,.venv/bin/python scripts/34_run_bench.py train --device cuda:0 --workers 8 --threads 2 --gpu-mem-gb 2 --studies S1 --regimes R10 Rm5 R0
|
||||||
|
20261030-015331_bench_train_S1_cuda1,,bench_train_S1_cuda1,interrupted,-15,2026-10-30T01:53:31+00:00,2026-10-30T01:58:21+00:00,289.6,0:04:50,cuda:1,381b5ffb0620,True,ba88b1f22934cb8d,runlog,.venv/bin/python scripts/34_run_bench.py train --device cuda:1 --workers 16 --threads 2 --gpu-mem-gb 2 --studies S1 --regimes R0h
|
||||||
|
20261030-015840_bench_posterior_S1_cuda1,,bench_posterior_S1_cuda1,ok,0,2026-10-30T01:58:40+00:00,2026-10-30T01:58:53+00:00,13.7,0:00:14,cuda:1,381b5ffb0620,True,ba88b1f22934cb8d,runlog,.venv/bin/python scripts/34_run_bench.py posterior --device cuda:1 --workers 16 --threads 2 --gpu-mem-gb 2 --studies S1 --regimes R0h
|
||||||
|
20261030-015854_bench_train_S1_cuda1,,bench_train_S1_cuda1,ok,0,2026-10-30T01:58:54+00:00,2026-10-30T02:16:17+00:00,1043.7,0:17:24,cuda:1,381b5ffb0620,True,ba88b1f22934cb8d,runlog,.venv/bin/python scripts/34_run_bench.py train --device cuda:1 --workers 16 --threads 2 --gpu-mem-gb 2 --studies S1 --regimes R0h
|
||||||
|
20261102-020220_bench_summarize,,bench_summarize,ok,0,2026-11-02T02:02:20+00:00,2026-11-02T02:02:49+00:00,29.4,0:00:29,cuda:0,2e4f618947c4,True,ba88b1f22934cb8d,runlog,.venv/bin/python scripts/34_run_bench.py summarize --device cuda:0 --workers 4 --threads 2 --gpu-mem-gb 6 --studies S1 S2 S3 S4 S8
|
||||||
|
20261102-020738_bench_verdicts,,bench_verdicts,ok,0,2026-11-02T02:07:38+00:00,2026-11-02T02:07:47+00:00,8.7,0:00:09,,2e4f618947c4,True,f7a25a280cf5e0e6,runlog,/home/jovyan/lamlvh/ML-Porosity/.venv/bin/python scripts/36_bench_verdicts.py
|
||||||
|
20261102-020804_bench_verdicts,,bench_verdicts,ok,0,2026-11-02T02:08:04+00:00,2026-11-02T02:08:13+00:00,9.0,0:00:09,,2e4f618947c4,True,862a5c2f37ff3586,runlog,/home/jovyan/lamlvh/ML-Porosity/.venv/bin/python scripts/36_bench_verdicts.py
|
||||||
|
20261102-022806_bench_package_tables,,bench_package_tables,ok,0,2026-11-02T02:28:06+00:00,2026-11-02T02:28:24+00:00,18.4,0:00:18,,2e4f618947c4,True,0ae7d821416ef8af,runlog,/home/jovyan/lamlvh/ML-Porosity/.venv/bin/python scripts/37_bench_package.py tables
|
||||||
|
20261102-022758_bench_package_generate,,bench_package_generate,ok,0,2026-11-02T02:27:58+00:00,2026-11-02T02:30:19+00:00,140.9,0:02:21,,2e4f618947c4,True,0ae7d821416ef8af,runlog,/home/jovyan/lamlvh/ML-Porosity/.venv/bin/python scripts/37_bench_package.py generate
|
||||||
|
20261102-023050_bench_package_selftest,,bench_package_selftest,failed,1,2026-11-02T02:30:50+00:00,2026-11-02T02:31:01+00:00,10.3,0:00:10,,2e4f618947c4,True,0ae7d821416ef8af,runlog,/home/jovyan/lamlvh/ML-Porosity/.venv/bin/python scripts/37_bench_package.py selftest
|
||||||
|
20261102-023112_bench_package_selftest,,bench_package_selftest,ok,0,2026-11-02T02:31:12+00:00,2026-11-02T02:31:25+00:00,12.9,0:00:13,,2e4f618947c4,True,c03b0775b199945d,runlog,/home/jovyan/lamlvh/ML-Porosity/.venv/bin/python scripts/37_bench_package.py selftest
|
||||||
|
20261102-023145_bench_package_regenerate,,bench_package_regenerate,ok,0,2026-11-02T02:31:45+00:00,2026-11-02T02:33:52+00:00,127.0,0:02:07,,2e4f618947c4,True,c03b0775b199945d,runlog,/home/jovyan/lamlvh/ML-Porosity/.venv/bin/python scripts/37_bench_package.py generate
|
||||||
|
20261104-042853_bench_summarize,,bench_summarize,failed,1,2026-11-04T04:28:53+00:00,2026-11-04T04:29:28+00:00,35.6,0:00:36,,423a333ae9da,False,bc14c15fd6a3cb25,runlog,/home/jovyan/lamlvh/ML-Porosity/.venv/bin/python scripts/34_run_bench.py summarize
|
||||||
|
20261104-043002_bench_summarize,,bench_summarize,ok,0,2026-11-04T04:30:02+00:00,2026-11-04T04:30:35+00:00,32.6,0:00:33,,423a333ae9da,True,bc14c15fd6a3cb25,runlog,/home/jovyan/lamlvh/ML-Porosity/.venv/bin/python scripts/34_run_bench.py summarize
|
||||||
|
20261104-043043_bench_verdicts,,bench_verdicts,ok,0,2026-11-04T04:30:43+00:00,2026-11-04T04:30:52+00:00,9.9,0:00:10,,423a333ae9da,True,bc14c15fd6a3cb25,runlog,/home/jovyan/lamlvh/ML-Porosity/.venv/bin/python scripts/36_bench_verdicts.py
|
||||||
|
20261104-043106_bench_package_generate,,bench_package_generate,ok,0,2026-11-04T04:31:06+00:00,2026-11-04T04:33:22+00:00,136.3,0:02:16,,423a333ae9da,True,bc14c15fd6a3cb25,runlog,/home/jovyan/lamlvh/ML-Porosity/.venv/bin/python scripts/37_bench_package.py generate
|
||||||
|
20261104-043322_bench_package_tables,,bench_package_tables,ok,0,2026-11-04T04:33:22+00:00,2026-11-04T04:33:41+00:00,18.9,0:00:19,,423a333ae9da,True,bc14c15fd6a3cb25,runlog,/home/jovyan/lamlvh/ML-Porosity/.venv/bin/python scripts/37_bench_package.py tables
|
||||||
|
20261104-043341_bench_package_selftest,,bench_package_selftest,ok,0,2026-11-04T04:33:41+00:00,2026-11-04T04:33:57+00:00,15.7,0:00:16,,423a333ae9da,True,bc14c15fd6a3cb25,runlog,/home/jovyan/lamlvh/ML-Porosity/.venv/bin/python scripts/37_bench_package.py selftest
|
||||||
|
20261104-043403_repro_build,,repro_build,ok,0,2026-11-04T04:34:03+00:00,2026-11-04T04:37:08+00:00,185.0,0:03:05,,423a333ae9da,True,bc14c15fd6a3cb25,runlog,/home/jovyan/lamlvh/ML-Porosity/.venv/bin/python scripts/39_repro_package.py build
|
||||||
|
|||||||
|
7
ml_porosity/benchmark/__init__.py
Normal file
7
ml_porosity/benchmark/__init__.py
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
"""protocol_bench (phase P6, level B): registration-aware synthetic benchmark on D2.
|
||||||
|
|
||||||
|
Studies (configs/protocol_bench.yaml, `studies:`): S1 grid fill, S2 misspecification axes, S3 anchor-free B4
|
||||||
|
baselines under the P2r cells, S4 second backbone (TCN), S8 controlled cycle-skip (two-mode) regime. The modules
|
||||||
|
mirror ml_porosity/volve (freeze/check/lock, fingerprinted resume) and scripts 14/15/18 (SMC posterior, training,
|
||||||
|
summary) so that the default generator path reproduces protocol_p2r.
|
||||||
|
"""
|
||||||
153
ml_porosity/benchmark/cells.py
Normal file
153
ml_porosity/benchmark/cells.py
Normal file
@@ -0,0 +1,153 @@
|
|||||||
|
"""Cell enumeration and output paths of protocol_bench.
|
||||||
|
|
||||||
|
A cell is one (study, regime, preset, c, N, rid[, Δ]) with its method list, budgets and backbone. Paths are flat and
|
||||||
|
deterministic. Posterior files follow the protocol_p2r layout (r{rid}_c{c}_n{N}_s{reg_seed}{.csv,_particles.npz,
|
||||||
|
_phase.json}) so that scripts 15/18-style readers and the P2r reference share one reader.
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import itertools
|
||||||
|
from dataclasses import dataclass, field
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
from ml_porosity.paths import outputs_dir
|
||||||
|
|
||||||
|
P2R_GRID = {"drift_factors": (0.0, 1.0, 2.0), "n_train": (4, 16)}
|
||||||
|
|
||||||
|
|
||||||
|
@dataclass(frozen=True)
|
||||||
|
class Cell:
|
||||||
|
study: str
|
||||||
|
regime: str
|
||||||
|
preset: str | None # misspecification preset of configs/d2_synth_bench.yaml (None: nominal)
|
||||||
|
c: float
|
||||||
|
n_train: int
|
||||||
|
rid: int
|
||||||
|
methods: tuple[str, ...]
|
||||||
|
backbone: str = "cnngru" # cnngru (bank_train.train_predict, as P2r) | tcn (f3.training.TCNHetero)
|
||||||
|
posterior: str = "bench" # bench (this protocol's SMC) | p2r (outputs/p2r/posterior) | none
|
||||||
|
delta_ms: float | None = None # S8 two-mode separation
|
||||||
|
tags: tuple[str, ...] = field(default_factory=tuple)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def setting(self) -> str:
|
||||||
|
return self.regime if self.preset in (None, "nominal") else f"{self.regime}__{self.preset}"
|
||||||
|
|
||||||
|
@property
|
||||||
|
def tag(self) -> str:
|
||||||
|
t = f"r{self.rid}_c{self.c:g}_n{self.n_train}"
|
||||||
|
if self.delta_ms is not None:
|
||||||
|
t += f"_d{self.delta_ms:g}"
|
||||||
|
return t
|
||||||
|
|
||||||
|
def suffix(self) -> str:
|
||||||
|
return "" if self.backbone == "cnngru" else f"__{self.backbone}"
|
||||||
|
|
||||||
|
|
||||||
|
def bench_root(dev: bool = False, repro: bool = False) -> Path:
|
||||||
|
root = outputs_dir() / "bench"
|
||||||
|
return root / ("repro" if repro else "dev" if dev else "")
|
||||||
|
|
||||||
|
|
||||||
|
def posterior_dir(cell: Cell, root: Path) -> Path | None:
|
||||||
|
if cell.posterior == "none":
|
||||||
|
return None
|
||||||
|
if cell.posterior == "p2r":
|
||||||
|
return outputs_dir() / "p2r" / "posterior" / cell.regime
|
||||||
|
return root / "posterior" / cell.setting # shared by every study that needs the same (regime, preset) posterior
|
||||||
|
|
||||||
|
|
||||||
|
def posterior_paths(cell: Cell, root: Path, reg_seed: int) -> dict[str, Path]:
|
||||||
|
d = posterior_dir(cell, root)
|
||||||
|
tag = f"r{cell.rid}_c{cell.c:g}_n{cell.n_train}_s{reg_seed}"
|
||||||
|
return {"csv": d / f"{tag}.csv", "particles": d / f"{tag}_particles.npz", "phase": d / f"{tag}_phase.json",
|
||||||
|
"meta": d / f"{tag}.json"}
|
||||||
|
|
||||||
|
|
||||||
|
def train_dir(cell: Cell, root: Path) -> Path:
|
||||||
|
return root / cell.study.lower() / "train" / cell.setting / "cells"
|
||||||
|
|
||||||
|
|
||||||
|
def train_paths(cell: Cell, root: Path) -> dict[str, Path]:
|
||||||
|
d = train_dir(cell, root)
|
||||||
|
stem = cell.tag + cell.suffix()
|
||||||
|
return {"csv": d / f"{stem}.csv", "npz": d / f"{stem}.npz", "diag": d / f"{stem}_diag.csv", "meta": d / f"{stem}.json"}
|
||||||
|
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------- study → cells
|
||||||
|
|
||||||
|
def _rids(p: dict, rids) -> list[int]:
|
||||||
|
return [int(r) for r in (p["grid"]["realizations"] if rids is None else rids)]
|
||||||
|
|
||||||
|
|
||||||
|
def _grid(s: dict, grid: dict | None) -> tuple[list, list]:
|
||||||
|
g = grid or {}
|
||||||
|
return list(g.get("drift_factors") or s.get("drift_factors", [])), list(g.get("n_train") or s["n_train"])
|
||||||
|
|
||||||
|
|
||||||
|
def s1_cells(p: dict, rids=None, regimes=None, grid: dict | None = None) -> list[Cell]:
|
||||||
|
"""grid: dev-only override {drift_factors, n_train}; with an override the P2r-grid exclusion is lifted."""
|
||||||
|
s = p["studies"]["S1"]
|
||||||
|
cs, ns = _grid(s, grid)
|
||||||
|
cells = []
|
||||||
|
for reg in (regimes or s["regimes"]):
|
||||||
|
for c, N in itertools.product(cs, ns):
|
||||||
|
if grid is None and float(c) in P2R_GRID["drift_factors"] and int(N) in P2R_GRID["n_train"]:
|
||||||
|
continue # existing protocol_p2r cell: read, not recomputed
|
||||||
|
for rid in _rids(p, rids):
|
||||||
|
cells.append(Cell("S1", reg, None, float(c), int(N), rid, tuple(s["methods"])))
|
||||||
|
return cells
|
||||||
|
|
||||||
|
|
||||||
|
def s2_cells(p: dict, rids=None, regimes=None, presets=None, controls: bool = False, grid: dict | None = None) -> list[Cell]:
|
||||||
|
s = p["studies"]["S2"]
|
||||||
|
names = presets or [name for axis in s["presets"].values() for name in axis]
|
||||||
|
if controls:
|
||||||
|
names = list(names) + list(s.get("controls", {}).get("presets", []))
|
||||||
|
cs, ns0 = _grid(s, grid)
|
||||||
|
cells = []
|
||||||
|
for reg in (regimes or s["regimes"]):
|
||||||
|
for name in names:
|
||||||
|
ns = ns0 if (grid or name not in s.get("controls", {}).get("presets", [])) else s["controls"]["n_train"]
|
||||||
|
for c, N in itertools.product(cs, ns):
|
||||||
|
for rid in _rids(p, rids):
|
||||||
|
cells.append(Cell("S2", reg, name, float(c), int(N), rid, tuple(s["methods"])))
|
||||||
|
return cells
|
||||||
|
|
||||||
|
|
||||||
|
def s3_cells(p: dict, rids=None, regimes=None, grid: dict | None = None) -> list[Cell]:
|
||||||
|
s = p["studies"]["S3"]
|
||||||
|
cs, ns = _grid(s, grid)
|
||||||
|
post = "bench" if grid is not None else s.get("posterior", "none") # dev override: dev posteriors of the setting
|
||||||
|
return [Cell("S3", reg, None, float(c), int(N), rid, tuple(s["methods"]), posterior=post)
|
||||||
|
for reg in (regimes or s["regimes"]) for c, N in itertools.product(cs, ns) for rid in _rids(p, rids)]
|
||||||
|
|
||||||
|
|
||||||
|
def s4_cells(p: dict, rids=None, regimes=None, grid: dict | None = None) -> list[Cell]:
|
||||||
|
"""Dev override: posterior 'bench' (dev posteriors of the same setting) instead of the P2r particles."""
|
||||||
|
s = p["studies"]["S4"]
|
||||||
|
ns = _grid(s, grid)[1]
|
||||||
|
return [Cell("S4", cell["regime"], None, float(cell["c"]), int(N), rid, tuple(s["methods"]), backbone=s["backbone"],
|
||||||
|
posterior="bench" if grid is not None else s["posterior"])
|
||||||
|
for cell in s["cells"] if regimes is None or cell["regime"] in regimes
|
||||||
|
for N in ns for rid in _rids(p, rids)]
|
||||||
|
|
||||||
|
|
||||||
|
def s8_cells(p: dict, rids=None, regimes=None, grid: dict | None = None) -> list[Cell]:
|
||||||
|
s = p["studies"]["S8"]
|
||||||
|
cs, ns = _grid(s, grid)
|
||||||
|
return [Cell("S8", reg, None, float(c), int(N), rid, tuple(s["methods"]), posterior="none", delta_ms=float(d))
|
||||||
|
for reg in (regimes or s["regimes"]) for d in s["delta_ms"]
|
||||||
|
for c, N in itertools.product(cs, ns) for rid in _rids(p, rids)]
|
||||||
|
|
||||||
|
|
||||||
|
STUDIES = {"S1": s1_cells, "S2": s2_cells, "S3": s3_cells, "S4": s4_cells, "S8": s8_cells}
|
||||||
|
|
||||||
|
|
||||||
|
def study_cells(p: dict, study: str, rids=None, regimes=None, **kw) -> list[Cell]:
|
||||||
|
return STUDIES[study](p, rids=rids, regimes=regimes, **kw)
|
||||||
|
|
||||||
|
|
||||||
|
def needs_posterior(cell: Cell) -> bool:
|
||||||
|
return cell.posterior == "bench"
|
||||||
90
ml_porosity/benchmark/data.py
Normal file
90
ml_porosity/benchmark/data.py
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
"""Inputs of protocol_bench: generator configuration, horizon grid, warp prior, wavelet, and the registration /
|
||||||
|
training / metric blocks of protocol_p2 (the same objects scripts 11/14/15 build), plus the realization builder with
|
||||||
|
misspecification presets and the nominal-fingerprint helper of tests/test_d2_misspec.py."""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import hashlib
|
||||||
|
import importlib.util
|
||||||
|
import json
|
||||||
|
from dataclasses import dataclass
|
||||||
|
from functools import lru_cache
|
||||||
|
|
||||||
|
import numpy as np
|
||||||
|
|
||||||
|
from ml_porosity.benchmark.protocol import generator_config, protocol_p2
|
||||||
|
from ml_porosity.data.synth_d2 import D2Realization, load_horizon_grid, preset_misspec
|
||||||
|
from ml_porosity.paths import REPO_ROOT
|
||||||
|
from ml_porosity.registration.warp_prior import WarpHyper
|
||||||
|
|
||||||
|
WELL_FIELDS = ("seis_clean", "noise_unit", "phi_t", "z_g", "z_b", "boundaries_t", "eps_a")
|
||||||
|
OBS_KEYS = ("seis", "phi_log", "ai_log", "tau_k", "t_k", "b", "g", "t_of_tau_true", "y_true")
|
||||||
|
FP_DRIFT, FP_SNR_DB, FP_SIGMA_A, FP_DENSITY = (0.0, 1.0, 2.0), 10, 7.0, "full"
|
||||||
|
|
||||||
|
|
||||||
|
@lru_cache(maxsize=None)
|
||||||
|
def load_script(name: str):
|
||||||
|
"""scripts/<name> as a module (scripts 11's reg_settings / method_specs / evaluate are the P2r semantics)."""
|
||||||
|
spec = importlib.util.spec_from_file_location("bench_" + name[:2], REPO_ROOT / "scripts" / name)
|
||||||
|
mod = importlib.util.module_from_spec(spec)
|
||||||
|
spec.loader.exec_module(mod)
|
||||||
|
return mod
|
||||||
|
|
||||||
|
|
||||||
|
@dataclass
|
||||||
|
class Inputs:
|
||||||
|
p: dict
|
||||||
|
cfg: dict
|
||||||
|
hg: object
|
||||||
|
prior_hyper: dict
|
||||||
|
wav: np.ndarray
|
||||||
|
P2: dict
|
||||||
|
reg: dict
|
||||||
|
tcfg: dict
|
||||||
|
f_c: float
|
||||||
|
|
||||||
|
def realization(self, rid: int, preset: str | None) -> D2Realization:
|
||||||
|
return D2Realization(self.cfg, int(rid), self.hg, WarpHyper(**self.prior_hyper), self.wav,
|
||||||
|
misspec=preset_misspec(self.cfg, preset))
|
||||||
|
|
||||||
|
def regime(self, name: str) -> dict:
|
||||||
|
return dict(self.cfg["regimes"][name])
|
||||||
|
|
||||||
|
@property
|
||||||
|
def sigma_a(self) -> float:
|
||||||
|
return float(self.cfg["anchors"]["sigma_a_ms"])
|
||||||
|
|
||||||
|
def observe(self, R: D2Realization, c: float, regime: str, N: int) -> tuple[list[dict], list[dict]]:
|
||||||
|
"""Training observations (first N pool wells, regime anchors) and the 8 test wells (full anchors, same SNR),
|
||||||
|
exactly as scripts 14/15."""
|
||||||
|
st = self.regime(regime)
|
||||||
|
obs = [R.observe(w, c, st["snr_db"], self.sigma_a, st["anchor_density"]) for w in R.pool[:N]]
|
||||||
|
test = [R.observe(w, c, st["snr_db"], self.sigma_a) for w in R.test]
|
||||||
|
return obs, test
|
||||||
|
|
||||||
|
|
||||||
|
def load_inputs(p: dict) -> Inputs:
|
||||||
|
cfg = generator_config(p)
|
||||||
|
P2 = protocol_p2(p)
|
||||||
|
hg = load_horizon_grid(cfg["horizons"], REPO_ROOT / cfg["horizon_cache"])
|
||||||
|
wp = p["inputs"]["warp_prior"]
|
||||||
|
prior = json.loads((REPO_ROOT / wp["path"]).read_text())["fits"][wp["fit"]]
|
||||||
|
wav = np.load(REPO_ROOT / p["inputs"]["wavelet"]["path"])[p["inputs"]["wavelet"]["key"]]
|
||||||
|
run_d2 = load_script("11_run_d2.py")
|
||||||
|
return Inputs(p, cfg, hg, prior["hyper"], wav, P2, run_d2.reg_settings(P2),
|
||||||
|
P2["training"]["model"] | P2["training"]["optimizer"], float(P2["metrics"]["bands"]["f_c_hz"]))
|
||||||
|
|
||||||
|
|
||||||
|
def _sha(chunks) -> str:
|
||||||
|
h = hashlib.sha256()
|
||||||
|
for a in chunks:
|
||||||
|
h.update(np.ascontiguousarray(np.asarray(a)).tobytes())
|
||||||
|
return h.hexdigest()
|
||||||
|
|
||||||
|
|
||||||
|
def fingerprint_realization(R: D2Realization) -> dict:
|
||||||
|
"""{"wells": {field: sha}, "obs": {key: sha}} as tests/test_d2_misspec.py records them."""
|
||||||
|
wells = R.test + R.pool[:4]
|
||||||
|
obs = [R.observe(w, c, FP_SNR_DB, FP_SIGMA_A, FP_DENSITY) for c in FP_DRIFT for w in wells]
|
||||||
|
return {"wells": {k: _sha(getattr(w, k) for w in R.wells) for k in WELL_FIELDS},
|
||||||
|
"obs": {k: _sha(o[k] for o in obs) for k in OBS_KEYS}}
|
||||||
73
ml_porosity/benchmark/devbudgets.py
Normal file
73
ml_porosity/benchmark/devbudgets.py
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
"""S4 TCN budgets on dev realizations (protocol_p2 budget_selection rule applied to the TCN backbone).
|
||||||
|
|
||||||
|
Every S4 method is trained with the TCN at every candidate budget (one trajectory per seed) on dev realizations
|
||||||
|
902–905 at R10, c = 1, N ∈ {4, 16}, seeds 0–1; per method the budget with the smallest mean total RMSE (macro over
|
||||||
|
test wells → mean over rid × N × seed) is selected. The dev SMC posteriors of those cells are produced by the
|
||||||
|
ordinary posterior stage (outputs/bench/dev/posterior/R10). Output: outputs/bench/dev/budgets_tcn.json; the chosen
|
||||||
|
values are copied into protocol_bench.yaml training.budgets_tcn before the lock.
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import dataclasses
|
||||||
|
import json
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
import pandas as pd
|
||||||
|
|
||||||
|
from ml_porosity.benchmark.cells import Cell, bench_root, posterior_paths, train_paths
|
||||||
|
from ml_porosity.benchmark.protocol import check_rids, dev_stamp, fingerprint
|
||||||
|
from ml_porosity.benchmark.runner import cell_from, make_jobs, posterior_worker, run_jobs
|
||||||
|
from ml_porosity.f3.progress import write_json
|
||||||
|
|
||||||
|
DEV_RIDS = (902, 903, 904, 905)
|
||||||
|
DEV_SEEDS = (0, 1)
|
||||||
|
|
||||||
|
|
||||||
|
def dev_budget_worker(job: dict) -> dict:
|
||||||
|
import torch
|
||||||
|
from ml_porosity.benchmark.data import load_inputs
|
||||||
|
from ml_porosity.benchmark.training import train_cell
|
||||||
|
|
||||||
|
torch.set_num_threads(job["threads"])
|
||||||
|
p, cell, root = job["p"], cell_from(job["cell"]), Path(job["root"])
|
||||||
|
paths = train_paths(cell, root)
|
||||||
|
if paths["meta"].exists() and json.loads(paths["meta"].read_text()).get("fingerprint") == job["key"]:
|
||||||
|
return {"cached": True, "path": str(paths["csv"])}
|
||||||
|
cand = [int(b) for b in p["training"]["budget_candidates"]]
|
||||||
|
post = posterior_paths(cell, root, int(p["registration"]["reg_seed"]))
|
||||||
|
rows, diag, _, meta = train_cell(cell, p, load_inputs(p), job["device"], post, save_preds=False, seeds=job["seeds"],
|
||||||
|
budget_lists={m.removesuffix("-TCN"): cand for m in cell.methods})
|
||||||
|
paths["csv"].parent.mkdir(parents=True, exist_ok=True)
|
||||||
|
pd.DataFrame(diag).to_csv(paths["diag"], index=False)
|
||||||
|
pd.DataFrame(rows).to_csv(paths["csv"], index=False)
|
||||||
|
write_json(paths["meta"], meta | {"fingerprint": job["key"], "candidates": cand, "cell": dataclasses.asdict(cell)})
|
||||||
|
return {"cached": False, "path": str(paths["csv"]), "wall_seconds": meta["wall_seconds"]}
|
||||||
|
|
||||||
|
|
||||||
|
def dev_budgets(p: dict, device: str, workers: int, mem_gb: float, threads: int, rids=None) -> dict:
|
||||||
|
rids = [int(r) for r in (rids or DEV_RIDS)]
|
||||||
|
check_rids(rids, p, dev=True)
|
||||||
|
s4, root, stamp = p["studies"]["S4"], bench_root(dev=True), dev_stamp(p)
|
||||||
|
cells = [Cell("S4", "R10", None, 1.0, int(N), rid, tuple(s4["methods"]), backbone=s4["backbone"], posterior="bench")
|
||||||
|
for N in s4["n_train"] for rid in rids]
|
||||||
|
run_jobs(make_jobs(p, cells, "posterior", stamp, root, device, mem_gb, threads), posterior_worker, workers, root,
|
||||||
|
"posterior:dev-budgets")
|
||||||
|
jobs = []
|
||||||
|
for c in cells:
|
||||||
|
settings = dict(stage="dev-budgets", setting=c.setting, misspec=None, rid=c.rid, c=c.c, n_train=c.n_train, methods=list(c.methods),
|
||||||
|
backbone=c.backbone, candidates=list(p["training"]["budget_candidates"]), seeds=list(DEV_SEEDS))
|
||||||
|
jobs.append(dict(p=p, cell=dataclasses.asdict(c), root=str(root), device=device, mem_gb=mem_gb, threads=threads,
|
||||||
|
seeds=list(DEV_SEEDS), key=fingerprint(stamp, **settings)))
|
||||||
|
jobs.sort(key=lambda j: -j["cell"]["n_train"])
|
||||||
|
run_jobs(jobs, dev_budget_worker, workers, root, "train:dev-budgets")
|
||||||
|
df = pd.concat([pd.read_csv(train_paths(cell_from(j["cell"]), root)["csv"]) for j in jobs], ignore_index=True)
|
||||||
|
run = df.groupby(["method", "budget", "rid", "n_train", "seed"])["rmse"].mean().groupby(["method", "budget"]).mean()
|
||||||
|
chosen = {m.removesuffix("-TCN"): int(run.loc[m].idxmin()) for m in run.index.get_level_values(0).unique()}
|
||||||
|
table = run.unstack("budget")
|
||||||
|
out = {"rule": "protocol_p2 budget_selection (lowest mean total RMSE at c = 1 over dev rid × N × seed) applied to the TCN backbone",
|
||||||
|
"rids": rids, "seeds": list(DEV_SEEDS), "candidates": list(p["training"]["budget_candidates"]), "budgets_tcn": chosen,
|
||||||
|
"mean_total_rmse": {m: {int(b): float(v) for b, v in r.items()} for m, r in table.iterrows()}}
|
||||||
|
(root / "budgets_tcn.json").write_text(json.dumps(out, indent=1))
|
||||||
|
print(table.round(4).to_string())
|
||||||
|
return out
|
||||||
196
ml_porosity/benchmark/protocol.py
Normal file
196
ml_porosity/benchmark/protocol.py
Normal file
@@ -0,0 +1,196 @@
|
|||||||
|
"""Protocol loading, locking and realization guards for protocol_bench.
|
||||||
|
|
||||||
|
The lock (configs/protocol_bench.lock.json + .sha256) records the protocol text, the code (ml_porosity/**/*.py, the
|
||||||
|
bench scripts, pyproject.toml), the environment, every hash-listed input, the protocol_p2r artifacts that S2/S4 read,
|
||||||
|
and the nominal generator fingerprints of two realizations. Main realizations 8–15 are refused unless the lock exists
|
||||||
|
and matches; dev realizations 900–905 never need the lock; the protocol_p2 realizations 0–7 are always refused.
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import hashlib
|
||||||
|
import json
|
||||||
|
from datetime import datetime, timezone
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
import yaml
|
||||||
|
|
||||||
|
from ml_porosity.f3.protocol import digest, environment
|
||||||
|
from ml_porosity.paths import REPO_ROOT, outputs_dir
|
||||||
|
|
||||||
|
__all__ = ["CONFIG", "LOCK", "check_rids", "current_stamp", "dev_stamp", "fingerprint", "freeze", "load_protocol",
|
||||||
|
"protocol_p2", "protocol_p2r", "generator_config"]
|
||||||
|
|
||||||
|
CONFIG = REPO_ROOT / "configs/protocol_bench.yaml"
|
||||||
|
LOCK = REPO_ROOT / "configs/protocol_bench.lock.json"
|
||||||
|
SCRIPTS = ("scripts/34_run_bench.py", "scripts/run_bench.sh")
|
||||||
|
RESULT_DIRS = ("s1", "s2", "s3", "s4", "s8", "summary")
|
||||||
|
|
||||||
|
|
||||||
|
def load_protocol(check_inputs: bool = True) -> dict:
|
||||||
|
p = yaml.safe_load(CONFIG.read_text(encoding="utf-8"))
|
||||||
|
if check_inputs:
|
||||||
|
for k, v in p["inputs"].items():
|
||||||
|
f = REPO_ROOT / v["path"]
|
||||||
|
if not f.exists():
|
||||||
|
raise FileNotFoundError(f"protocol_bench input {k} missing: {v['path']} (sync outputs/ first)")
|
||||||
|
h = digest(f, text=f.suffix in (".yaml", ".json"))
|
||||||
|
if v.get("sha256") not in (None, "TBD") and h != v["sha256"]:
|
||||||
|
raise RuntimeError(f"{v['path']} differs from the hash recorded in protocol_bench ({h[:12]} ≠ {v['sha256'][:12]})")
|
||||||
|
from ml_porosity.data.synth_d2 import normalize_misspec, preset_misspec
|
||||||
|
cfg = generator_config(p)
|
||||||
|
for name, spec in (p.get("calibration", {}).get("chosen") or {}).items():
|
||||||
|
if normalize_misspec(spec) != normalize_misspec(preset_misspec(cfg, name)):
|
||||||
|
raise RuntimeError(f"preset {name} in {p['inputs']['d2_config']['path']} differs from calibration.chosen of protocol_bench")
|
||||||
|
return p
|
||||||
|
|
||||||
|
|
||||||
|
def generator_config(p: dict) -> dict:
|
||||||
|
return yaml.safe_load((REPO_ROOT / p["inputs"]["d2_config"]["path"]).read_text(encoding="utf-8"))
|
||||||
|
|
||||||
|
|
||||||
|
def protocol_p2(p: dict) -> dict:
|
||||||
|
"""protocol_p2: source of the registration, training and metric blocks (as scripts 14/15 use it)."""
|
||||||
|
return yaml.safe_load((REPO_ROOT / p["inputs"]["protocol_p2"]["path"]).read_text(encoding="utf-8"))
|
||||||
|
|
||||||
|
|
||||||
|
def protocol_p2r(p: dict) -> dict:
|
||||||
|
return yaml.safe_load((REPO_ROOT / p["inputs"]["protocol_p2r"]["path"]).read_text(encoding="utf-8"))
|
||||||
|
|
||||||
|
|
||||||
|
def code_files() -> list[Path]:
|
||||||
|
paths = sorted((REPO_ROOT / "ml_porosity").rglob("*.py"))
|
||||||
|
paths += [REPO_ROOT / s for s in SCRIPTS if (REPO_ROOT / s).exists()]
|
||||||
|
return paths + [REPO_ROOT / "pyproject.toml"]
|
||||||
|
|
||||||
|
|
||||||
|
def source_hash() -> str:
|
||||||
|
h = hashlib.sha256()
|
||||||
|
for f in code_files():
|
||||||
|
h.update(f.relative_to(REPO_ROOT).as_posix().encode() + b"\0")
|
||||||
|
h.update(f.read_bytes().replace(b"\r\n", b"\n") + b"\0")
|
||||||
|
return h.hexdigest()
|
||||||
|
|
||||||
|
|
||||||
|
def p2r_reference_files(p: dict) -> list[Path]:
|
||||||
|
"""protocol_p2r artifacts the benchmark reads: SMC particles and phase of the S4 cells, the per-regime runs.csv
|
||||||
|
(S1 grid, S2 nominal reference, S3 join) and sigma_post.csv."""
|
||||||
|
root = outputs_dir() / "p2r"
|
||||||
|
ref = p["reference"]["p2r"]
|
||||||
|
files = [root / "summary" / "sigma_post.csv"]
|
||||||
|
files += [root / "train" / reg / "runs.csv" for reg in ref["regimes"]]
|
||||||
|
for cell in p["studies"]["S4"]["cells"]:
|
||||||
|
for N in p["studies"]["S4"]["n_train"]:
|
||||||
|
for rid in p["grid"]["realizations"]:
|
||||||
|
tag = f"r{rid}_c{cell['c']:g}_n{N}_s{p['registration']['reg_seed']}"
|
||||||
|
files += [root / "posterior" / cell["regime"] / f"{tag}_particles.npz",
|
||||||
|
root / "posterior" / cell["regime"] / f"{tag}_phase.json"]
|
||||||
|
return files
|
||||||
|
|
||||||
|
|
||||||
|
def portable(path: Path) -> str:
|
||||||
|
path = path.resolve()
|
||||||
|
for prefix, base in (("outputs", outputs_dir()), ("repo", REPO_ROOT)):
|
||||||
|
try:
|
||||||
|
return f"{prefix}:{path.relative_to(base.resolve()).as_posix()}"
|
||||||
|
except ValueError:
|
||||||
|
continue
|
||||||
|
raise ValueError(f"input outside the repository and outputs roots: {path}")
|
||||||
|
|
||||||
|
|
||||||
|
def nominal_fingerprints(p: dict) -> dict:
|
||||||
|
"""Recompute the nominal generator fingerprints of the realizations listed in the protocol and compare them with
|
||||||
|
tests/data/d2_fingerprints.json (recorded before the misspecification parameters were added)."""
|
||||||
|
from ml_porosity.benchmark.data import fingerprint_realization, load_inputs
|
||||||
|
|
||||||
|
inp = load_inputs(p)
|
||||||
|
stored = json.loads((REPO_ROOT / p["inputs"]["fingerprints"]["path"]).read_text(encoding="utf-8"))
|
||||||
|
out = {}
|
||||||
|
for rid in p["reference"]["fingerprint_rids"]:
|
||||||
|
fp = fingerprint_realization(inp.realization(rid, None))
|
||||||
|
ref = stored["realizations"][str(rid)]
|
||||||
|
ok = all(ref[block].get(k) == v for block, d in fp.items() for k, v in d.items() if k in ref[block])
|
||||||
|
out[str(rid)] = {"match": bool(ok), "sha256_of_fingerprint": hashlib.sha256(json.dumps(fp, sort_keys=True).encode()).hexdigest()}
|
||||||
|
if not ok:
|
||||||
|
raise RuntimeError(f"nominal generator fingerprint of realization {rid} differs from tests/data/d2_fingerprints.json")
|
||||||
|
return out
|
||||||
|
|
||||||
|
|
||||||
|
def current_stamp(p: dict | None = None, with_fingerprints: bool = True) -> dict:
|
||||||
|
p = load_protocol() if p is None else p
|
||||||
|
inputs = {k: REPO_ROOT / v["path"] for k, v in p["inputs"].items()}
|
||||||
|
refs = p2r_reference_files(p)
|
||||||
|
missing = [f for f in list(inputs.values()) + refs if not f.exists()]
|
||||||
|
if missing:
|
||||||
|
raise FileNotFoundError(f"protocol_bench inputs missing (sync outputs/ first): {[str(f) for f in missing[:5]]}"
|
||||||
|
f"{' ...' if len(missing) > 5 else ''}")
|
||||||
|
stamp = {"protocol_sha256": digest(CONFIG, True), "code_sha256": source_hash(), "environment": environment(),
|
||||||
|
"inputs": {portable(f): digest(f, f.suffix in (".yaml", ".json")) for f in inputs.values()},
|
||||||
|
"p2r_reference": {portable(f): digest(f, f.suffix == ".json") for f in refs}}
|
||||||
|
if with_fingerprints:
|
||||||
|
stamp["nominal_fingerprints"] = nominal_fingerprints(p)
|
||||||
|
return stamp
|
||||||
|
|
||||||
|
|
||||||
|
def freeze(check: bool = False) -> dict:
|
||||||
|
"""Return the lock; create it if absent and check is False. Any difference from an existing lock is an error."""
|
||||||
|
p = load_protocol()
|
||||||
|
stamp = current_stamp(p)
|
||||||
|
if LOCK.exists():
|
||||||
|
old = json.loads(LOCK.read_text(encoding="utf-8"))
|
||||||
|
for k, v in stamp.items():
|
||||||
|
if old[k] != v:
|
||||||
|
raise RuntimeError(f"protocol_bench lock mismatch: {k}. Preserve results and create a new protocol version.")
|
||||||
|
return old
|
||||||
|
if check:
|
||||||
|
raise RuntimeError("protocol_bench is not locked. Run the lock stage before any main-grid run.")
|
||||||
|
if any((outputs_dir() / "bench" / d).exists() for d in RESULT_DIRS):
|
||||||
|
raise RuntimeError("Refusing a first lock after protocol_bench results already exist.")
|
||||||
|
if any(v.get("sha256") in (None, "TBD") for v in p["inputs"].values()):
|
||||||
|
raise RuntimeError("protocol_bench.yaml has an input without a recorded sha256 (TBD): fill it before locking.")
|
||||||
|
if p.get("status", "").upper().startswith("DRAFT"):
|
||||||
|
raise RuntimeError("protocol_bench.yaml still says DRAFT: set status to LOCKED (with the date) before locking.")
|
||||||
|
stamp |= {"locked_utc": datetime.now(timezone.utc).isoformat(),
|
||||||
|
"canonical_text": "UTF-8, CRLF normalized to LF for code, protocol and text inputs; binary inputs exact",
|
||||||
|
"studies": sorted(p["studies"]), "realizations": p["grid"]["realizations"]}
|
||||||
|
LOCK.write_text(json.dumps(stamp, indent=2), encoding="utf-8")
|
||||||
|
CONFIG.with_suffix(".sha256").write_text(stamp["protocol_sha256"] + " configs/protocol_bench.yaml\n", encoding="utf-8")
|
||||||
|
return stamp
|
||||||
|
|
||||||
|
|
||||||
|
def dev_stamp(p: dict) -> dict:
|
||||||
|
"""Resume key for dev and repro runs: the nominal generator (configuration without the preset block) and the
|
||||||
|
registration block only; the misspecification preset enters the job settings as its normalised dict. Code and
|
||||||
|
protocol edits during dev therefore do not invalidate the cache (dev outputs are never results)."""
|
||||||
|
cfg = {k: v for k, v in generator_config(p).items() if k != "misspec_presets"}
|
||||||
|
return {"dev": True, "generator_nominal_sha256": hashlib.sha256(json.dumps(cfg, sort_keys=True, default=str).encode()).hexdigest(),
|
||||||
|
"registration": p["registration"]}
|
||||||
|
|
||||||
|
|
||||||
|
def fingerprint(stamp: dict, **settings) -> str:
|
||||||
|
return hashlib.sha256(json.dumps({"lock": stamp, **settings}, sort_keys=True).encode()).hexdigest()
|
||||||
|
|
||||||
|
|
||||||
|
def check_rids(rids, p: dict, dev: bool, repro: bool = False) -> None:
|
||||||
|
"""Main realizations only under the lock; dev realizations only with dev=True; protocol_p2 realizations never;
|
||||||
|
no mixing. repro: the single reproduction cell (reproduction.rid) is allowed without the lock."""
|
||||||
|
rids = sorted(set(int(r) for r in rids))
|
||||||
|
p2 = protocol_p2(p)["grid"]
|
||||||
|
if bad := sorted(set(rids) & set(p2["realizations"])):
|
||||||
|
raise SystemExit(f"realizations {bad} belong to the protocol_p2 main grid and are never used by protocol_bench")
|
||||||
|
main, devs = set(p["grid"]["realizations"]), set(p["grid"]["dev_realizations"])
|
||||||
|
if set(rids) & main and set(rids) & devs:
|
||||||
|
raise SystemExit("do not mix main-grid and dev realizations in one run")
|
||||||
|
if unknown := sorted(set(rids) - main - devs):
|
||||||
|
raise SystemExit(f"realizations {unknown} are neither main-grid nor dev realizations of protocol_bench")
|
||||||
|
if dev:
|
||||||
|
if set(rids) & main:
|
||||||
|
raise SystemExit("--dev runs use dev realizations 900–905 only")
|
||||||
|
return
|
||||||
|
if repro:
|
||||||
|
if rids != [int(p["reproduction"]["rid"])]:
|
||||||
|
raise SystemExit("the reproduction stage runs the single cell of protocol_bench reproduction:")
|
||||||
|
return
|
||||||
|
if set(rids) & devs:
|
||||||
|
raise SystemExit("dev realizations require --dev (outputs go to outputs/bench/dev)")
|
||||||
|
freeze(check=True)
|
||||||
111
ml_porosity/benchmark/registration.py
Normal file
111
ml_porosity/benchmark/registration.py
Normal file
@@ -0,0 +1,111 @@
|
|||||||
|
"""SMC tie posterior of one cell: the computation of scripts/14_diag_posterior.py run_job restricted to the arm
|
||||||
|
protocol_p2r used (statistical wavelet with the re-estimated phase, "estR"), with the same random streams
|
||||||
|
(anchor samples [k, i, 13], phase fit [k, 19], SMC [k, i, 17]) and the same γ checkpoints (g_old, g_acf, g_one), so
|
||||||
|
that the default generator reproduces the protocol_p2r particles. Only the γ = 1/κ (g_acf) particles are stored.
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import json
|
||||||
|
import time
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
import numpy as np
|
||||||
|
import pandas as pd
|
||||||
|
|
||||||
|
OLD = ["B3b", "B3c", "B3d", "M1", "M2"]
|
||||||
|
CHECKPOINTS = ("g_old", "g_acf", "g_one")
|
||||||
|
|
||||||
|
|
||||||
|
def posterior_cell(R, inp, obs: list[dict], c: float, N: int, regime: dict, reg_seed: int, smc_seed: int,
|
||||||
|
particles: int, device: str, mem_gb: float, paths: dict[str, Path], save=("estR/g_acf",),
|
||||||
|
checkpoints=CHECKPOINTS, extra_meta: dict | None = None, phase_kw: dict | None = None) -> pd.DataFrame:
|
||||||
|
from ml_porosity.data.wavelet import statistical_wavelet
|
||||||
|
from ml_porosity.registration.pipeline import register
|
||||||
|
from ml_porosity.registration.sampler import sample_warps
|
||||||
|
from ml_porosity.registration.smc import TiePosterior, gamma_acf, phase_basis, phase_wavelet, residual_kappa
|
||||||
|
from ml_porosity.registration.tie_likelihood import synth_for_warps
|
||||||
|
from ml_porosity.registration.ties import tie_b3b, tie_b3c, warp_errors
|
||||||
|
from ml_porosity.registration.warp_prior import WarpHyper
|
||||||
|
|
||||||
|
reg, cfg = dict(inp.reg), inp.cfg
|
||||||
|
k = smc_seed
|
||||||
|
mm = (R.t_ext >= R.t_main[0]) & (R.t_ext <= R.t_main[-1])
|
||||||
|
ncc = lambda a, b: float(np.corrcoef(a[mm], b[mm])[0, 1])
|
||||||
|
if device == "cpu":
|
||||||
|
from ml_porosity.registration.smc import smc_fit_phase, smc_tie_posterior
|
||||||
|
wrap = lambda T: T
|
||||||
|
else:
|
||||||
|
import torch
|
||||||
|
from ml_porosity.registration.smc_torch import TiePosteriorTorch, smc_fit_phase, smc_tie_posterior
|
||||||
|
dev = torch.device(device)
|
||||||
|
if dev.type == "cuda": # shared GPU: exceeding the cap makes this job OOM rather than encroach on others
|
||||||
|
total = torch.cuda.get_device_properties(dev).total_memory
|
||||||
|
torch.cuda.set_per_process_memory_fraction(min(1.0, mem_gb * 2**30 / total), dev)
|
||||||
|
wrap = lambda T: TiePosteriorTorch(T, device)
|
||||||
|
|
||||||
|
t_all = time.time()
|
||||||
|
out = register(R, obs, reg, reg_seed)
|
||||||
|
h = WarpHyper(**out["hyper"])
|
||||||
|
seis = [o["seis"][o["seis"].shape[0] // 2].astype(float) for o in obs]
|
||||||
|
B = phase_basis(statistical_wavelet(np.stack(seis), R.dt, reg["wavelet_ms"]), int(round(R.dt / cfg["fine_dt_ms"])))
|
||||||
|
Ts, Z0s = [], []
|
||||||
|
for i, o in enumerate(obs):
|
||||||
|
smp = sample_warps(R.grid, h, o["tau_k"], o["t_k"], particles, reg["g_max"], np.random.default_rng([k, i, 13]))
|
||||||
|
Ts.append(wrap(TiePosterior(R.grid, h, o["tau_k"], o["t_k"], reg["g_max"], R.tau_fine, o["ai_log"], R.t_fine,
|
||||||
|
R.t_ext, phase_wavelet(B, out["phase"]), seis[i], (R.t_main[0], R.t_main[-1]))))
|
||||||
|
Z0s.append(Ts[-1].z(smp["u"]))
|
||||||
|
t0 = time.time()
|
||||||
|
phase_r, ph = smc_fit_phase(Ts, Z0s, B, out["phase"], [k, 19], **(phase_kw or {}))
|
||||||
|
key = dict(rid=R.rid, c=c, n_train=N, seed=reg_seed, smc_seed=k, particles=particles, snr_db=regime["snr_db"],
|
||||||
|
anchor_density=regime["anchor_density"], sigma_a_reg=reg["sigma_a_ms"], phase=out["phase"],
|
||||||
|
phase_R=phase_r, phase_n=len(ph["phases"]), phase_edge=ph["edge"], phase_time_s=time.time() - t0)
|
||||||
|
wavelets = {"estR": phase_wavelet(B, phase_r)}
|
||||||
|
rows, saved = [], {}
|
||||||
|
for i, o in enumerate(obs):
|
||||||
|
d = out["diag"][i]
|
||||||
|
for m in OLD:
|
||||||
|
e = {kk.removeprefix(f"{m}_"): v for kk, v in d.items() if kk.startswith(f"{m}_warp")}
|
||||||
|
rows.append(key | {"well": o["name"], "method": m, "wavelet": "est",
|
||||||
|
"gamma": d["gamma"] if m == "M2" else np.nan} | e)
|
||||||
|
ut = np.concatenate([[o["b"]], o["g"]])[None]
|
||||||
|
t_b3b = tie_b3b(o["tau_k"], o["t_k"], R.tau_fine)
|
||||||
|
for wn, wf in wavelets.items():
|
||||||
|
syn_b = synth_for_warps(R.tau_fine, o["ai_log"], t_b3b, R.t_fine, R.t_ext, wf)[0]
|
||||||
|
t3c = tie_b3c(t_b3b, R.tau_fine, syn_b, seis[i], R.t_ext, R.dt)
|
||||||
|
rows.append(key | {"well": o["name"], "method": "B3c", "wavelet": wn}
|
||||||
|
| warp_errors(t3c[None], R.tau_fine, o["t_of_tau_true"], R.t_main))
|
||||||
|
T = Ts[i].with_wavelet(wf)
|
||||||
|
_, l0 = T.parts(Z0s[i])
|
||||||
|
cks_all = {"g_old": d["gamma"], "g_acf": gamma_acf(T, Z0s[i], l0), "g_one": 1.0}
|
||||||
|
cks = {n: cks_all[n] for n in checkpoints}
|
||||||
|
t0, T.n_eval = time.time(), 0
|
||||||
|
res = smc_tie_posterior(T, Z0s[i], cks.values(), np.random.default_rng([k, i, 17]))
|
||||||
|
sg = pd.DataFrame(res["stages"])
|
||||||
|
info = {"well": o["name"], "wavelet": wn, "kappa0": 1.0 / cks_all["g_acf"], "ll_true": float(T.loglik(ut)[0]),
|
||||||
|
"ll_anchor_max": float(l0.max()), "n_stages": len(sg), "n_eval": T.n_eval,
|
||||||
|
"time_s": time.time() - t0, "shrink_mean": float(sg["shrink"].mean()),
|
||||||
|
"jump_z_min": float(sg["jump_z"].min()), "r_true": ncc(T.synth(ut)[0], seis[i])}
|
||||||
|
for name, gk in cks.items():
|
||||||
|
U = T.u(res["Z"][float(gk)])
|
||||||
|
Tf = R.grid.t_of_tau(U[:, 0], U[:, 1:], tau=R.tau_fine)
|
||||||
|
e = warp_errors(Tf, R.tau_fine, o["t_of_tau_true"], R.t_main)
|
||||||
|
syn_m = T.synth(U.mean(0)[None])[0]
|
||||||
|
rows.append(key | info | {"method": f"SMC_{name}", "gamma": gk, "logZ": res["logZ"][float(gk)],
|
||||||
|
"ll_max": float(res["ll"][float(gk)].max()),
|
||||||
|
"ll_mean": float(res["ll"][float(gk)].mean()),
|
||||||
|
"kappa_post": residual_kappa(syn_m, seis[i]), "r_post": ncc(syn_m, seis[i])} | e)
|
||||||
|
if f"{wn}/{name}" in save:
|
||||||
|
saved[f"{o['name']}/{wn}/{name}"] = U.astype(np.float32)
|
||||||
|
paths["phase"].parent.mkdir(parents=True, exist_ok=True)
|
||||||
|
paths["phase"].write_text(json.dumps({"phase0": out["phase"], "phase_R": phase_r} | ph))
|
||||||
|
tmp = paths["particles"].with_suffix(".tmp.npz")
|
||||||
|
np.savez_compressed(tmp, **saved)
|
||||||
|
tmp.replace(paths["particles"])
|
||||||
|
df = pd.DataFrame(rows)
|
||||||
|
df.to_csv(paths["csv"], index=False)
|
||||||
|
meta = {"wall_seconds": time.time() - t_all, "device": device, "particles": particles, "phase0": out["phase"],
|
||||||
|
"phase_R": phase_r, "misspec_active": R.misspec_active, "monotone_repairs": R.misspec_info["monotone_repairs"],
|
||||||
|
"hyper": out["hyper"], "lam": out["lam"], "tau_c": out["tau_c"], "checkpoints": list(checkpoints),
|
||||||
|
"saved": sorted(saved)} | (extra_meta or {})
|
||||||
|
return df, meta
|
||||||
74
ml_porosity/benchmark/repro.py
Normal file
74
ml_porosity/benchmark/repro.py
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
"""P2r reproduction check: compare the reproduction cell of protocol_bench (outputs/bench/repro) with the stored
|
||||||
|
protocol_p2r artifacts. The P2r guard hashes no code, so this comparison is the evidence that the runner's default
|
||||||
|
path (generator, registration, SMC, label banks, training) is the one that produced outputs/p2r."""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import json
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
import numpy as np
|
||||||
|
import pandas as pd
|
||||||
|
|
||||||
|
from ml_porosity.benchmark.cells import Cell, bench_root, posterior_paths, train_paths
|
||||||
|
from ml_porosity.f3.progress import write_json
|
||||||
|
from ml_porosity.paths import outputs_dir
|
||||||
|
|
||||||
|
|
||||||
|
def _max_abs(a, b) -> float:
|
||||||
|
a, b = np.asarray(a, float), np.asarray(b, float)
|
||||||
|
return float(np.nanmax(np.abs(a - b))) if a.shape == b.shape else float("inf")
|
||||||
|
|
||||||
|
|
||||||
|
def compare(p: dict) -> dict:
|
||||||
|
rp = p["reproduction"]
|
||||||
|
cell = Cell("S1", rp["regime"], None, float(rp["c"]), int(rp["n_train"]), int(rp["rid"]), tuple(rp["methods"]))
|
||||||
|
root = bench_root(repro=True)
|
||||||
|
reg_seed = int(p["registration"]["reg_seed"])
|
||||||
|
new, ref = posterior_paths(cell, root, reg_seed), {}
|
||||||
|
tag = f"r{cell.rid}_c{cell.c:g}_n{cell.n_train}_s{reg_seed}"
|
||||||
|
p2r = outputs_dir() / "p2r"
|
||||||
|
ref = {"csv": p2r / "posterior" / cell.regime / f"{tag}.csv", "particles": p2r / "posterior" / cell.regime / f"{tag}_particles.npz",
|
||||||
|
"phase": p2r / "posterior" / cell.regime / f"{tag}_phase.json",
|
||||||
|
"train_csv": p2r / "train" / cell.regime / "cells" / f"{cell.tag}.csv", "train_npz": p2r / "train" / cell.regime / "cells" / f"{cell.tag}.npz",
|
||||||
|
"train_diag": p2r / "train" / cell.regime / "cells" / f"{cell.tag}_diag.csv"}
|
||||||
|
out = {"cell": {"regime": cell.regime, "rid": cell.rid, "c": cell.c, "n_train": cell.n_train}, "posterior": {}, "train": {}}
|
||||||
|
# posterior: phase, particles, warp diagnostics
|
||||||
|
pn, pr = json.loads(new["phase"].read_text()), json.loads(ref["phase"].read_text())
|
||||||
|
out["posterior"]["phase0"] = {"new": pn["phase0"], "p2r": pr["phase0"], "equal": pn["phase0"] == pr["phase0"]}
|
||||||
|
out["posterior"]["phase_R"] = {"new": pn["phase_R"], "p2r": pr["phase_R"], "abs_diff_deg": abs(pn["phase_R"] - pr["phase_R"])}
|
||||||
|
out["posterior"]["logZ_max_abs_diff"] = _max_abs(pn["logZ"], pr["logZ"]) if np.shape(pn["logZ"]) == np.shape(pr["logZ"]) else "shape differs"
|
||||||
|
with np.load(new["particles"]) as zn, np.load(ref["particles"]) as zr:
|
||||||
|
keys = sorted(k for k in zn.files if k in zr.files)
|
||||||
|
out["posterior"]["particle_keys_compared"] = keys
|
||||||
|
diffs = {k: _max_abs(zn[k], zr[k]) for k in keys}
|
||||||
|
out["posterior"]["particles_max_abs_diff"] = diffs
|
||||||
|
out["posterior"]["particles_bitwise"] = all(np.array_equal(zn[k], zr[k]) for k in keys)
|
||||||
|
out["posterior"]["warp_mean_max_abs_diff_ms"] = {k: _max_abs(zn[k].mean(0), zr[k].mean(0)) for k in keys}
|
||||||
|
dn, dr = pd.read_csv(new["csv"]), pd.read_csv(ref["csv"])
|
||||||
|
m = dn.merge(dr, on=["well", "method", "wavelet"], suffixes=("_new", "_p2r"))
|
||||||
|
cols = ["warp_rmse_ms", "warp_cov90", "warp_width90_ms", "logZ", "kappa_post", "r_post"]
|
||||||
|
out["posterior"]["csv_max_abs_diff"] = {c: _max_abs(m[f"{c}_new"], m[f"{c}_p2r"]) for c in cols if f"{c}_new" in m}
|
||||||
|
out["posterior"]["n_stages"] = {"new": dn[dn.method == "SMC_g_acf"].n_stages.tolist(), "p2r": dr[dr.method == "SMC_g_acf"].n_stages.tolist()}
|
||||||
|
# training: per (method, seed, test well) metrics and predictions
|
||||||
|
tn, tr = pd.read_csv(train_paths(cell, root)["csv"]), pd.read_csv(ref["train_csv"])
|
||||||
|
keys = ["method", "seed", "budget", "test_well"]
|
||||||
|
mt = tn.merge(tr, on=keys, suffixes=("_new", "_p2r"))
|
||||||
|
out["train"]["rows_compared"] = int(len(mt))
|
||||||
|
for c in ("band_rmse", "rmse", "band_pcc", "nll", "coverage_90"):
|
||||||
|
out["train"][f"{c}_max_abs_diff"] = _max_abs(mt[f"{c}_new"], mt[f"{c}_p2r"])
|
||||||
|
per_m = {m_: _max_abs(g[f"band_rmse_new"], g[f"band_rmse_p2r"]) for m_, g in mt.groupby("method")}
|
||||||
|
out["train"]["band_rmse_max_abs_diff_per_method"] = per_m
|
||||||
|
cm = mt.groupby("method")[["band_rmse_new", "band_rmse_p2r"]].mean()
|
||||||
|
out["train"]["cell_mean_band_rmse"] = {m_: {"new": float(r.band_rmse_new), "p2r": float(r.band_rmse_p2r)} for m_, r in cm.iterrows()}
|
||||||
|
with np.load(train_paths(cell, root)["npz"]) as zn, np.load(ref["train_npz"]) as zr:
|
||||||
|
ks = sorted(k for k in zn.files if k in zr.files and k.endswith("/mu"))
|
||||||
|
out["train"]["pred_mu_max_abs_diff_pu"] = {k: _max_abs(zn[k], zr[k]) for k in ks}
|
||||||
|
out["train"]["pred_bitwise"] = all(np.array_equal(zn[k], zr[k]) for k in ks)
|
||||||
|
out["train"]["y_true_bitwise"] = bool(np.array_equal(zn["y_true"], zr["y_true"]))
|
||||||
|
gn, gr = pd.read_csv(train_paths(cell, root)["diag"]), pd.read_csv(ref["train_diag"])
|
||||||
|
g = gn.merge(gr, on="well", suffixes=("_new", "_p2r"))
|
||||||
|
out["train"]["diag_max_abs_diff"] = {c: _max_abs(g[f"{c}_new"], g[f"{c}_p2r"]) for c in ("B3c-R_warp_rmse_ms", "B3d-Sa_warp_rmse_ms", "lam", "phase_R")}
|
||||||
|
out["train"]["M2-Sa_n_valid_equal"] = bool((g["M2-Sa_n_valid_new"] == g["M2-Sa_n_valid_p2r"]).all())
|
||||||
|
write_json(root / "comparison.json", out)
|
||||||
|
return out
|
||||||
233
ml_porosity/benchmark/runner.py
Normal file
233
ml_porosity/benchmark/runner.py
Normal file
@@ -0,0 +1,233 @@
|
|||||||
|
"""Resumable stages of protocol_bench: posterior (SMC), train, with fingerprinted completion markers.
|
||||||
|
|
||||||
|
Completion marker of a job: its `.json` sidecar carrying the resume fingerprint (lock stamp + cell settings) and the
|
||||||
|
SHA-256 of every artifact. A job whose sidecar matches is skipped; a sidecar with a different fingerprint or a
|
||||||
|
mismatched artifact raises (use a new output root), as in ml_porosity/volve/runner.py. Dev runs (realizations
|
||||||
|
900–905) write under outputs/bench/dev with a protocol-and-generator-only fingerprint; the reproduction cell writes
|
||||||
|
under outputs/bench/repro. Neither is a result.
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import dataclasses
|
||||||
|
import json
|
||||||
|
import os
|
||||||
|
import time
|
||||||
|
from concurrent.futures import FIRST_COMPLETED, ProcessPoolExecutor, wait
|
||||||
|
from datetime import datetime
|
||||||
|
from multiprocessing import get_context
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
import numpy as np
|
||||||
|
import pandas as pd
|
||||||
|
|
||||||
|
from ml_porosity.benchmark.cells import (Cell, bench_root, needs_posterior, posterior_dir, posterior_paths,
|
||||||
|
study_cells, train_paths)
|
||||||
|
from ml_porosity.benchmark.protocol import check_rids, dev_stamp, digest, fingerprint, freeze, generator_config
|
||||||
|
from ml_porosity.data.synth_d2 import normalize_misspec, preset_misspec
|
||||||
|
from ml_porosity.f3.progress import write_json
|
||||||
|
|
||||||
|
|
||||||
|
def _threads(n: int) -> None:
|
||||||
|
for k in ("OMP_NUM_THREADS", "MKL_NUM_THREADS", "OPENBLAS_NUM_THREADS", "NUMEXPR_NUM_THREADS", "NUMBA_NUM_THREADS"):
|
||||||
|
os.environ.setdefault(k, str(n))
|
||||||
|
|
||||||
|
|
||||||
|
def cell_from(d: dict) -> Cell:
|
||||||
|
d = dict(d)
|
||||||
|
d["methods"], d["tags"] = tuple(d["methods"]), tuple(d.get("tags", ()))
|
||||||
|
return Cell(**d)
|
||||||
|
|
||||||
|
|
||||||
|
def reusable(meta: Path, key: str, artifacts: list[Path]) -> bool:
|
||||||
|
if not meta.exists():
|
||||||
|
return False
|
||||||
|
stored = json.loads(meta.read_text(encoding="utf-8"))
|
||||||
|
if stored.get("fingerprint") != key:
|
||||||
|
raise RuntimeError(f"resume fingerprint mismatch: {meta}. Use a new output root (or a new protocol version).")
|
||||||
|
for a in artifacts:
|
||||||
|
if not a.exists() or digest(a) != stored.get("artifact_sha256", {}).get(a.name):
|
||||||
|
raise RuntimeError(f"missing or mismatched completed artifact: {a}")
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
def sidecar(meta_path: Path, key: str, artifacts: list[Path], extra: dict) -> None:
|
||||||
|
write_json(meta_path, extra | {"fingerprint": key, "artifact_sha256": {a.name: digest(a) for a in artifacts},
|
||||||
|
"finished": datetime.now().astimezone().isoformat(timespec="seconds")})
|
||||||
|
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------- workers (importable, spawn context)
|
||||||
|
|
||||||
|
def posterior_worker(job: dict) -> dict:
|
||||||
|
import torch
|
||||||
|
from ml_porosity.benchmark.data import load_inputs
|
||||||
|
from ml_porosity.benchmark.registration import posterior_cell
|
||||||
|
|
||||||
|
torch.set_num_threads(job["threads"])
|
||||||
|
p, cell, root = job["p"], cell_from(job["cell"]), Path(job["root"])
|
||||||
|
reg_seed = int(p["registration"]["reg_seed"])
|
||||||
|
paths = posterior_paths(cell, root, reg_seed)
|
||||||
|
arts = [paths["csv"], paths["particles"], paths["phase"]]
|
||||||
|
if reusable(paths["meta"], job["key"], arts):
|
||||||
|
return {"cached": True, "path": str(paths["csv"])}
|
||||||
|
inp = load_inputs(p)
|
||||||
|
R = inp.realization(cell.rid, cell.preset)
|
||||||
|
obs, _ = inp.observe(R, cell.c, cell.regime, cell.n_train)
|
||||||
|
smc = p["registration"]["smc"]
|
||||||
|
_, meta = posterior_cell(R, inp, obs, cell.c, cell.n_train, inp.regime(cell.regime), reg_seed,
|
||||||
|
int(smc["smc_seed"]), int(smc["particles"]), job["device"], job["mem_gb"], paths,
|
||||||
|
checkpoints=tuple(smc["checkpoints"]), extra_meta={"cell": dataclasses.asdict(cell)},
|
||||||
|
phase_kw={k: smc[f"phase_{k}"] for k in ("step", "half_width", "max_extra") if f"phase_{k}" in smc})
|
||||||
|
sidecar(paths["meta"], job["key"], arts, meta)
|
||||||
|
return {"cached": False, "path": str(paths["csv"]), "wall_seconds": meta["wall_seconds"]}
|
||||||
|
|
||||||
|
|
||||||
|
def training_worker(job: dict) -> dict:
|
||||||
|
import torch
|
||||||
|
from ml_porosity.benchmark.data import load_inputs
|
||||||
|
from ml_porosity.benchmark.training import train_cell
|
||||||
|
|
||||||
|
torch.set_num_threads(job["threads"])
|
||||||
|
p, cell, root = job["p"], cell_from(job["cell"]), Path(job["root"])
|
||||||
|
paths = train_paths(cell, root)
|
||||||
|
arts = [paths["csv"], paths["npz"], paths["diag"]]
|
||||||
|
if reusable(paths["meta"], job["key"], arts):
|
||||||
|
return {"cached": True, "path": str(paths["csv"])}
|
||||||
|
post = posterior_paths(cell, root, int(p["registration"]["reg_seed"])) if cell.posterior != "none" else None
|
||||||
|
if post is not None and not post["particles"].exists():
|
||||||
|
raise FileNotFoundError(f"{cell.tag}: posterior not available at {post['particles']}")
|
||||||
|
inp = load_inputs(p)
|
||||||
|
rows, diag, preds, meta = train_cell(cell, p, inp, job["device"], post, save_preds=True, seeds=job.get("seeds"))
|
||||||
|
paths["csv"].parent.mkdir(parents=True, exist_ok=True)
|
||||||
|
tmp = paths["npz"].with_suffix(".tmp.npz")
|
||||||
|
np.savez_compressed(tmp, **preds)
|
||||||
|
tmp.replace(paths["npz"])
|
||||||
|
pd.DataFrame(diag).to_csv(paths["diag"], index=False)
|
||||||
|
pd.DataFrame(rows).to_csv(paths["csv"], index=False)
|
||||||
|
sidecar(paths["meta"], job["key"], arts, meta | {"cell": dataclasses.asdict(cell)})
|
||||||
|
return {"cached": False, "path": str(paths["csv"]), "wall_seconds": meta["wall_seconds"]}
|
||||||
|
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------- pools
|
||||||
|
|
||||||
|
def progress(root: Path, name: str, **values) -> None:
|
||||||
|
path = root / "progress.json"
|
||||||
|
for attempt in range(10):
|
||||||
|
try:
|
||||||
|
old = json.loads(path.read_text(encoding="utf-8")) if path.exists() else {}
|
||||||
|
old[name] = old.get(name, {}) | values | {"updated": datetime.now().astimezone().isoformat(timespec="seconds")}
|
||||||
|
write_json(path, old)
|
||||||
|
return
|
||||||
|
except (PermissionError, json.JSONDecodeError):
|
||||||
|
time.sleep(0.25 * (attempt + 1))
|
||||||
|
|
||||||
|
|
||||||
|
def run_jobs(jobs: list[dict], fn, workers: int, root: Path, name: str) -> list[dict]:
|
||||||
|
if not jobs:
|
||||||
|
print(f"{name}: nothing to do", flush=True)
|
||||||
|
return []
|
||||||
|
started, results = time.perf_counter(), []
|
||||||
|
progress(root, name, status="running", completed=0, total=len(jobs), error=None)
|
||||||
|
with ProcessPoolExecutor(max_workers=workers, mp_context=get_context("spawn")) as pool:
|
||||||
|
futures = {pool.submit(fn, job): job for job in jobs}
|
||||||
|
pending = set(futures)
|
||||||
|
while pending:
|
||||||
|
done, pending = wait(pending, timeout=30, return_when=FIRST_COMPLETED)
|
||||||
|
for fut in done:
|
||||||
|
try:
|
||||||
|
result = fut.result()
|
||||||
|
except Exception as exc:
|
||||||
|
for other in pending:
|
||||||
|
other.cancel()
|
||||||
|
progress(root, name, status="failed; pending jobs cancelled", error=f"{futures[fut]['cell']['study']} "
|
||||||
|
f"{futures[fut]['cell']['regime']} {futures[fut]['cell']['rid']}: {exc}")
|
||||||
|
raise
|
||||||
|
results.append(result)
|
||||||
|
fresh = sum(not r.get("cached") for r in results)
|
||||||
|
elapsed = time.perf_counter() - started
|
||||||
|
eta = elapsed / fresh * (len(jobs) - len(results)) if fresh else None
|
||||||
|
progress(root, name, completed=len(results), cached=len(results) - fresh, elapsed_seconds=elapsed, eta_seconds=eta)
|
||||||
|
print(f"[{name} {len(results)}/{len(jobs)}] {'cached ' if result.get('cached') else ''}{result['path']}"
|
||||||
|
f"{'' if result.get('cached') else f' ({result.get('wall_seconds', 0):.0f} s)'} "
|
||||||
|
f"elapsed {elapsed:.0f} s{'' if eta is None else f', eta {eta:.0f} s'}", flush=True)
|
||||||
|
progress(root, name, status="done", eta_seconds=0)
|
||||||
|
return results
|
||||||
|
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------- planning
|
||||||
|
|
||||||
|
def plan(p: dict, studies: list[str], rids=None, regimes=None, presets=None, controls: bool = False,
|
||||||
|
grid: dict | None = None) -> list[Cell]:
|
||||||
|
cells = []
|
||||||
|
for s in studies:
|
||||||
|
kw = {"presets": presets, "controls": controls} if s == "S2" else {}
|
||||||
|
cells += study_cells(p, s, rids=rids, regimes=regimes, grid=grid, **kw)
|
||||||
|
return cells
|
||||||
|
|
||||||
|
|
||||||
|
def stamp_for(p: dict, mode: str) -> dict:
|
||||||
|
if mode == "dev":
|
||||||
|
return dev_stamp(p)
|
||||||
|
if mode == "repro":
|
||||||
|
return dev_stamp(p) | {"repro": True}
|
||||||
|
return freeze(check=True)
|
||||||
|
|
||||||
|
|
||||||
|
def make_jobs(p: dict, cells: list[Cell], stage: str, stamp: dict, root: Path, device: str, workers_mem_gb: float,
|
||||||
|
threads: int, seeds=None) -> list[dict]:
|
||||||
|
jobs, seen = [], set()
|
||||||
|
cfg = generator_config(p)
|
||||||
|
for cell in cells:
|
||||||
|
misspec = normalize_misspec(preset_misspec(cfg, cell.preset))
|
||||||
|
if stage == "posterior":
|
||||||
|
if not needs_posterior(cell):
|
||||||
|
continue
|
||||||
|
ident = (cell.study, cell.setting, cell.rid, cell.c, cell.n_train)
|
||||||
|
settings = dict(stage="posterior", setting=cell.setting, regime=cell.regime, preset=cell.preset, misspec=misspec,
|
||||||
|
rid=cell.rid, c=cell.c, n_train=cell.n_train, reg_seed=p["registration"]["reg_seed"],
|
||||||
|
smc=p["registration"]["smc"])
|
||||||
|
else:
|
||||||
|
ident = (cell.study, cell.setting, cell.tag, cell.backbone)
|
||||||
|
settings = dict(stage="train", study=cell.study, setting=cell.setting, regime=cell.regime, preset=cell.preset,
|
||||||
|
misspec=misspec, rid=cell.rid, c=cell.c, n_train=cell.n_train, methods=list(cell.methods), backbone=cell.backbone,
|
||||||
|
delta_ms=cell.delta_ms, posterior=cell.posterior, seeds=list(p["grid"]["seeds"] if seeds is None else seeds),
|
||||||
|
budgets={m: p["training"]["budgets"].get(m.removesuffix("-TCN")) for m in cell.methods},
|
||||||
|
equal_budget_arm=p["training"].get("equal_budget_arm"))
|
||||||
|
if ident in seen:
|
||||||
|
continue
|
||||||
|
seen.add(ident)
|
||||||
|
jobs.append(dict(p=p, cell=dataclasses.asdict(cell), root=str(root), device=device, mem_gb=workers_mem_gb,
|
||||||
|
threads=threads, seeds=seeds, key=fingerprint(stamp, **settings)))
|
||||||
|
# largest N first keeps the wall-clock tail short (as scripts 14/15)
|
||||||
|
jobs.sort(key=lambda j: (-j["cell"]["n_train"], j["cell"]["rid"]))
|
||||||
|
return jobs
|
||||||
|
|
||||||
|
|
||||||
|
def run(stage: str, p: dict, studies: list[str], device: str, workers: int, mem_gb: float, threads: int = 2,
|
||||||
|
mode: str = "main", rids=None, regimes=None, presets=None, controls: bool = False, seeds=None,
|
||||||
|
root: Path | None = None, grid: dict | None = None) -> list[dict]:
|
||||||
|
"""stage: posterior | train. mode: main (locked), dev (outputs/bench/dev), repro (outputs/bench/repro).
|
||||||
|
grid / seeds: dev-only overrides of the (c, N) lists and the network seeds."""
|
||||||
|
_threads(threads)
|
||||||
|
if (grid or seeds) and mode != "dev":
|
||||||
|
raise SystemExit("--drift / --n-train / --seeds are dev-only overrides")
|
||||||
|
if mode == "repro":
|
||||||
|
rp = p["reproduction"]
|
||||||
|
rids, regimes = [rp["rid"]], [rp["regime"]]
|
||||||
|
cells = [Cell("S1", rp["regime"], None, float(rp["c"]), int(rp["n_train"]), int(rp["rid"]), tuple(rp["methods"]))]
|
||||||
|
else:
|
||||||
|
cells = plan(p, studies, rids=rids, regimes=regimes, presets=presets, controls=controls, grid=grid)
|
||||||
|
check_rids([c.rid for c in cells] or (rids or []), p, dev=(mode == "dev"), repro=(mode == "repro"))
|
||||||
|
stamp = stamp_for(p, mode)
|
||||||
|
root = root or bench_root(dev=(mode == "dev"), repro=(mode == "repro"))
|
||||||
|
root.mkdir(parents=True, exist_ok=True)
|
||||||
|
jobs = make_jobs(p, cells, stage, stamp, root, device, mem_gb, threads, seeds)
|
||||||
|
name = f"{stage}:{'+'.join(studies) if mode != 'repro' else 'repro'}:{mode}"
|
||||||
|
print(f"{name}: {len(jobs)} jobs, {workers} workers, device {device}, root {root}", flush=True)
|
||||||
|
fn = posterior_worker if stage == "posterior" else training_worker
|
||||||
|
return run_jobs(jobs, fn, workers, root, name)
|
||||||
|
|
||||||
|
|
||||||
|
def status(root: Path) -> str:
|
||||||
|
path = root / "progress.json"
|
||||||
|
return path.read_text(encoding="utf-8") if path.exists() else "protocol_bench has not started."
|
||||||
539
ml_porosity/benchmark/summary.py
Normal file
539
ml_porosity/benchmark/summary.py
Normal file
@@ -0,0 +1,539 @@
|
|||||||
|
"""Pre-declared analyses of protocol_bench (hypotheses block of configs/protocol_bench.yaml), applied as written.
|
||||||
|
|
||||||
|
Rules are those of protocol_p2 / protocol_p2r through scripts/13 (gate_gb, boot) and scripts/18 (pair_cell). Runs of
|
||||||
|
the P2r cells come from outputs/p2r (reference, read-only). Everything is reported regardless of direction; a
|
||||||
|
hypothesis of kind `claim` gets a pass/fail, `descriptive` items get tables only.
|
||||||
|
→ <root>/summary/: s1_cells.csv, s1_h2a.csv, s1_families.csv, s1_additivity.csv, s2_cells.csv, s2_smc.csv, s2_h2a.csv,
|
||||||
|
s2_degradation.csv, s3_h2a.csv, s3_table.csv, s4_cells.csv, s4_h2a.csv, s8_cells.csv, s8_transfer.csv, verdict.json,
|
||||||
|
summary.md
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import json
|
||||||
|
import math
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
import numpy as np
|
||||||
|
import pandas as pd
|
||||||
|
|
||||||
|
from ml_porosity.benchmark.cells import Cell, bench_root, study_cells, train_paths
|
||||||
|
from ml_porosity.benchmark.data import load_script
|
||||||
|
from ml_porosity.paths import REPO_ROOT, outputs_dir
|
||||||
|
|
||||||
|
sp13 = load_script("13_summarize_p2.py")
|
||||||
|
METRICS = sp13.METRICS
|
||||||
|
Z90 = 3.29
|
||||||
|
NFFT = 256
|
||||||
|
POINT_TIES = ["B3b", "B3c", "B3c-R"]
|
||||||
|
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------- loading
|
||||||
|
|
||||||
|
def _runs_from_cells(files: list[Path], budgets: dict) -> tuple[pd.DataFrame, pd.DataFrame]:
|
||||||
|
if not files:
|
||||||
|
return pd.DataFrame(), pd.DataFrame()
|
||||||
|
df = pd.concat([pd.read_csv(f) for f in files], ignore_index=True)
|
||||||
|
df = df[df["budget"] == df["method"].map(lambda m: budgets.get(m, np.nan))]
|
||||||
|
by = ["study", "regime", "preset", "delta_ms", "rid", "c", "n_train", "method", "seed"]
|
||||||
|
by = [b for b in by if b in df.columns]
|
||||||
|
run = df.groupby(by, as_index=False, dropna=False)[METRICS].mean()
|
||||||
|
return df, run
|
||||||
|
|
||||||
|
|
||||||
|
def study_budgets(p: dict, study: str, arm: int | None = None) -> dict:
|
||||||
|
"""Registered budgets per method (TCN names for S4); arm: the equal-budget arm instead (every method at `arm`)."""
|
||||||
|
b = dict(p["training"]["budgets"])
|
||||||
|
if p["studies"][study].get("backbone", "cnngru") != "cnngru":
|
||||||
|
alt = p["training"].get("budgets_tcn") or {}
|
||||||
|
b = {f"{m}-TCN": int(alt.get(m, v)) for m, v in b.items()}
|
||||||
|
if arm:
|
||||||
|
b = {m: int(arm) for m in b}
|
||||||
|
return b
|
||||||
|
|
||||||
|
|
||||||
|
def load_study(p: dict, root: Path, study: str, arm: int | None = None) -> tuple[pd.DataFrame, pd.DataFrame, pd.DataFrame]:
|
||||||
|
"""(rows, runs, diag) of every completed cell of a study under root at the registered budgets (arm=None) or at
|
||||||
|
the equal-budget arm."""
|
||||||
|
d = root / study.lower() / "train"
|
||||||
|
files = sorted(f for f in d.glob("*/cells/*.csv") if not f.name.endswith("_diag.csv")) if d.exists() else []
|
||||||
|
rows, run = _runs_from_cells(files, study_budgets(p, study, arm))
|
||||||
|
diag = pd.concat([pd.read_csv(f.with_name(f.stem + "_diag.csv")) for f in files], ignore_index=True) if files else pd.DataFrame()
|
||||||
|
return rows, run, diag
|
||||||
|
|
||||||
|
|
||||||
|
USE_P2R = True # set to False by summarize(dev=True): a dev summary must never read main-grid results
|
||||||
|
|
||||||
|
|
||||||
|
def p2r_runs(p: dict) -> pd.DataFrame:
|
||||||
|
root = REPO_ROOT / p["reference"]["p2r"]["root"]
|
||||||
|
parts = []
|
||||||
|
if not USE_P2R:
|
||||||
|
return pd.DataFrame()
|
||||||
|
for reg in p["reference"]["p2r"]["regimes"]:
|
||||||
|
f = root / "train" / reg / "runs.csv"
|
||||||
|
if f.exists():
|
||||||
|
parts.append(pd.read_csv(f).assign(regime=reg, preset="nominal", study="P2r"))
|
||||||
|
return pd.concat(parts, ignore_index=True) if parts else pd.DataFrame()
|
||||||
|
|
||||||
|
|
||||||
|
def sigma_post_table(dirs: dict[str, Path]) -> pd.DataFrame:
|
||||||
|
"""σ_post and SMC diagnostics per (setting, c, N) from posterior CSVs (SMC_g_acf, estR), mean over wells then rids."""
|
||||||
|
rows = []
|
||||||
|
for setting, d in dirs.items():
|
||||||
|
files = sorted(d.glob("r*_s*.csv")) if d.exists() else []
|
||||||
|
if not files:
|
||||||
|
continue
|
||||||
|
df = pd.concat([pd.read_csv(f) for f in files], ignore_index=True)
|
||||||
|
s = df[(df.method == "SMC_g_acf") & (df.wavelet == "estR")]
|
||||||
|
per = s.groupby(["c", "n_train", "rid"]).agg(width90=("warp_width90_ms", "mean"), warp_rmse_ms=("warp_rmse_ms", "mean"),
|
||||||
|
warp_cov90=("warp_cov90", "mean"), kappa_post=("kappa_post", "mean"),
|
||||||
|
r_post=("r_post", "mean"), phase_R=("phase_R", "first"), phase0=("phase", "first"))
|
||||||
|
per["sigma_post_ms"] = per.width90 / Z90
|
||||||
|
per["overconfidence"] = per.warp_rmse_ms / per.sigma_post_ms
|
||||||
|
g = per.groupby(["c", "n_train"]).agg(sigma_post_ms=("sigma_post_ms", "mean"), warp_rmse_ms=("warp_rmse_ms", "mean"),
|
||||||
|
warp_cov90=("warp_cov90", "mean"), overconfidence=("overconfidence", "mean"),
|
||||||
|
kappa_post=("kappa_post", "mean"), r_post=("r_post", "mean"),
|
||||||
|
phase_R_mean=("phase_R", "mean"), phase_R_abs_mean=("phase_R", lambda x: float(np.mean(np.abs(x)))),
|
||||||
|
n_rid=("sigma_post_ms", "size")).reset_index()
|
||||||
|
rows.append(g.assign(setting=setting))
|
||||||
|
return pd.concat(rows, ignore_index=True) if rows else pd.DataFrame()
|
||||||
|
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------- rules
|
||||||
|
|
||||||
|
def h2a_cells(run: pd.DataFrame, cand: str, comp: list[str], rng, n_boot: int) -> pd.DataFrame:
|
||||||
|
"""protocol_p2 cell rule with `cand` in the role of M2 against the best of `comp` (scripts/13 gate_gb)."""
|
||||||
|
r = run[run.method.isin(comp) | (run.method == cand)].replace({"method": {cand: "M2"}})
|
||||||
|
if r.empty or "M2" not in set(r.method) or not (set(r.method) & set(comp)):
|
||||||
|
return pd.DataFrame()
|
||||||
|
if any(m.endswith("-TCN") for m in comp): # gate_gb reads 'B3b' by name: drop the backbone suffix locally
|
||||||
|
r = r.assign(method=r.method.str.replace("-TCN", "", regex=False))
|
||||||
|
comp = [m.removesuffix("-TCN") for m in comp]
|
||||||
|
grid = {"n_train": sorted(r.n_train.unique().tolist()), "drift_factors": sorted(r.c.unique().tolist()),
|
||||||
|
"realistic_drift": 1, "realizations": sorted(r.rid.unique().tolist()), "seeds": sorted(r.seed.unique().tolist())}
|
||||||
|
cells, _ = sp13.gate_gb(r, {"grid": grid, "gates": {"G-B": {"competitors": comp}}}, n_boot, rng)
|
||||||
|
return cells
|
||||||
|
|
||||||
|
|
||||||
|
def pair(run: pd.DataFrame, a: str, b: str, rng, n_boot: int) -> dict:
|
||||||
|
"""Ratio mean(a)/mean(b) of band RMSE with CI over realizations and the 'better' rule (scripts/18 pair_cell)."""
|
||||||
|
x = run[run.method == a].set_index(["rid", "seed"])["band_rmse"]
|
||||||
|
y = run[run.method == b].set_index(["rid", "seed"])["band_rmse"].reindex(x.index)
|
||||||
|
ok = y.notna()
|
||||||
|
x, y = x[ok], y[ok]
|
||||||
|
if len(x) == 0:
|
||||||
|
return {}
|
||||||
|
d = x - y
|
||||||
|
ds, dr = d.groupby("seed").mean(), d.groupby("rid").mean()
|
||||||
|
lo, hi = sp13.boot(x.groupby("rid").mean().to_numpy(), y.groupby("rid").mean().to_numpy(), n_boot, rng)
|
||||||
|
return {"ratio": float(x.mean() / y.mean()), "ratio_lo": lo, "ratio_hi": hi, "seeds_better": int((ds < 0).sum()),
|
||||||
|
"rids_better": int((dr < 0).sum()), "n_seed": len(ds), "n_rid": len(dr),
|
||||||
|
"better": bool((ds < 0).sum() >= math.ceil(sp13.SEED_FRAC * len(ds) - 1e-9) and (dr < 0).sum() > len(dr) / 2)}
|
||||||
|
|
||||||
|
|
||||||
|
def perm_spearman(x, y, groups, rng, n_perm: int) -> tuple[float, float]:
|
||||||
|
"""Spearman ρ(x, y) and one-sided permutation p (ρ ≤ observed) permuting y within groups."""
|
||||||
|
from scipy.stats import spearmanr
|
||||||
|
|
||||||
|
x, y, groups = np.asarray(x, float), np.asarray(y, float), np.asarray(groups)
|
||||||
|
if len(x) < 3:
|
||||||
|
return float("nan"), float("nan")
|
||||||
|
rho = spearmanr(x, y).statistic
|
||||||
|
idx = {g: np.flatnonzero(groups == g) for g in np.unique(groups)}
|
||||||
|
cnt = 0
|
||||||
|
for _ in range(n_perm):
|
||||||
|
yp = y.copy()
|
||||||
|
for ii in idx.values():
|
||||||
|
yp[ii] = y[rng.permutation(ii)]
|
||||||
|
cnt += spearmanr(x, yp).statistic <= rho
|
||||||
|
return float(rho), float(cnt / n_perm)
|
||||||
|
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------- S1
|
||||||
|
|
||||||
|
def s1(p: dict, root: Path, rng, n_boot: int, n_perm: int) -> tuple[dict, dict]:
|
||||||
|
_, run_new, _ = load_study(p, root, "S1")
|
||||||
|
run = pd.concat([p2r_runs(p), run_new], ignore_index=True) if len(run_new) else p2r_runs(p)
|
||||||
|
if run.empty:
|
||||||
|
return {}, {"available": False}
|
||||||
|
sp = sigma_post_table({reg: root / "posterior" / reg for reg in p["studies"]["S1"]["regimes"]})
|
||||||
|
sp_ref = REPO_ROOT / p["reference"]["p2r"]["root"] / "summary" / "sigma_post.csv"
|
||||||
|
if sp_ref.exists() and USE_P2R:
|
||||||
|
ref = pd.read_csv(sp_ref).rename(columns={"setting": "regime"})
|
||||||
|
ref = ref[ref.regime.isin(p["studies"]["S1"]["regimes"])][["regime", "c", "n_train", "sigma_post_ms", "warp_rmse_ms", "warp_cov90"]]
|
||||||
|
sp = pd.concat([sp.rename(columns={"setting": "regime"}), ref.assign(source="p2r")], ignore_index=True) if len(sp) else ref.assign(source="p2r")
|
||||||
|
else:
|
||||||
|
sp = sp.rename(columns={"setting": "regime"})
|
||||||
|
tables, verdict = {}, {}
|
||||||
|
# phase-diagram cells: per (regime, c, N) band RMSE per method, ratios with CI
|
||||||
|
cells = []
|
||||||
|
for (reg, c, N), g in run.groupby(["regime", "c", "n_train"]):
|
||||||
|
mean = g.groupby("method")["band_rmse"].mean()
|
||||||
|
row = {"regime": reg, "c": c, "n_train": N, "n_rid": g.rid.nunique(), "n_seed": g.seed.nunique()} | {f"band_rmse_{m}": v for m, v in mean.items()}
|
||||||
|
if "M2-Sa" in mean and "B3d-Sa" in mean:
|
||||||
|
row |= {f"m2_pm_{k}": v for k, v in pair(g, "M2-Sa", "B3d-Sa", rng, n_boot).items()}
|
||||||
|
pt = [m for m in POINT_TIES if m in mean.index]
|
||||||
|
if pt and "B3d-Sa" in mean:
|
||||||
|
best = mean.loc[pt].idxmin()
|
||||||
|
row |= {"best_point_tie": best} | {f"pm_best_{k}": v for k, v in pair(g, "B3d-Sa", best, rng, n_boot).items()}
|
||||||
|
cells.append(row)
|
||||||
|
cells = pd.DataFrame(cells).merge(sp[["regime", "c", "n_train", "sigma_post_ms"]].drop_duplicates(["regime", "c", "n_train"]),
|
||||||
|
on=["regime", "c", "n_train"], how="left")
|
||||||
|
tables["s1_cells"] = cells
|
||||||
|
# H2a rule at every (regime, c, N) (S1-H1: R10, c = 1.5, both N)
|
||||||
|
h2a = []
|
||||||
|
for reg, g in run.groupby("regime"):
|
||||||
|
t = h2a_cells(g, "B3d-Sa", POINT_TIES, rng, n_boot)
|
||||||
|
if len(t):
|
||||||
|
h2a.append(t.assign(regime=reg))
|
||||||
|
h2a = pd.concat(h2a, ignore_index=True) if h2a else pd.DataFrame()
|
||||||
|
tables["s1_h2a"] = h2a
|
||||||
|
if len(h2a):
|
||||||
|
t = h2a[(h2a.regime == "R10") & (h2a.c == 1.5)]
|
||||||
|
verdict["S1-H1"] = {"cells": {int(r.n_train): bool(r.cell_pass) for r in t.itertuples()},
|
||||||
|
"ratios": {int(r.n_train): [r.ratio, r.ratio_lo, r.ratio_hi] for r in t.itertuples()},
|
||||||
|
"pass": bool(t.cell_pass.all()) if len(t) == 2 else None,
|
||||||
|
"complete": bool(len(t) == 2 and (t.n_rid == len(p["grid"]["realizations"])).all())}
|
||||||
|
# S1-H2: families with σ_post(N = 16) ≥ 1.5 ms; r(N) decreasing in N
|
||||||
|
wide16 = cells[(cells.n_train == 16) & (cells.sigma_post_ms >= 1.5)][["regime", "c"]]
|
||||||
|
fam = cells.merge(wide16, on=["regime", "c"]).dropna(subset=["m2_pm_ratio"])
|
||||||
|
fam["family"] = fam.regime + "_c" + fam.c.map(lambda v: f"{v:g}")
|
||||||
|
tables["s1_families"] = fam[["family", "regime", "c", "n_train", "sigma_post_ms", "m2_pm_ratio", "m2_pm_ratio_lo", "m2_pm_ratio_hi", "m2_pm_better"]]
|
||||||
|
if len(fam):
|
||||||
|
r16 = fam[fam.n_train == 16].set_index("family").m2_pm_ratio
|
||||||
|
r2 = fam[fam.n_train == 2].set_index("family").m2_pm_ratio
|
||||||
|
both = r16.index.intersection(r2.index)
|
||||||
|
sign = int((r16[both] < r2[both]).sum())
|
||||||
|
rho, pval = perm_spearman(np.log2(fam.n_train), fam.m2_pm_ratio, fam.family, rng, n_perm)
|
||||||
|
a = bool(len(both) > 0 and sign >= math.ceil(2 / 3 * len(both) - 1e-9))
|
||||||
|
b = bool(rho < 0 and pval < 0.05)
|
||||||
|
verdict["S1-H2"] = {"families": sorted(fam.family.unique()), "families_with_N2_and_N16": int(len(both)), "r16_below_r2": sign,
|
||||||
|
"a_sign": a, "spearman_rho": rho, "perm_p_one_sided": pval, "b_dose": b,
|
||||||
|
"pass": (a and b) if len(both) > 0 and fam.n_train.nunique() >= 3 else None}
|
||||||
|
# S1-D additivity: band_rmse²(B3d-Sa) = band_rmse²(Oracle) + β σ_post² per regime
|
||||||
|
add = []
|
||||||
|
for reg, g in cells.dropna(subset=["sigma_post_ms"]).groupby("regime"):
|
||||||
|
if "band_rmse_B3d-Sa" not in g or "band_rmse_Oracle" not in g:
|
||||||
|
continue
|
||||||
|
y = g["band_rmse_B3d-Sa"] ** 2 - g["band_rmse_Oracle"] ** 2
|
||||||
|
x = g["sigma_post_ms"] ** 2
|
||||||
|
if len(g) < 3 or x.var() == 0:
|
||||||
|
continue
|
||||||
|
beta = float((x * y).sum() / (x * x).sum())
|
||||||
|
resid = y - beta * x
|
||||||
|
add.append({"regime": reg, "n_cells": len(g), "beta_pu2_per_ms2": beta,
|
||||||
|
"r2": float(1 - (resid ** 2).sum() / ((y - y.mean()) ** 2).sum()) if (y - y.mean()).abs().sum() > 0 else float("nan")})
|
||||||
|
tables["s1_additivity"] = pd.DataFrame(add)
|
||||||
|
return tables, verdict
|
||||||
|
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------- S2
|
||||||
|
|
||||||
|
def s2(p: dict, root: Path, rng, n_boot: int) -> tuple[dict, dict]:
|
||||||
|
_, run, diag = load_study(p, root, "S2")
|
||||||
|
if run.empty:
|
||||||
|
return {}, {"available": False}
|
||||||
|
s = p["studies"]["S2"]
|
||||||
|
axes = {name: axis for axis, names in s["presets"].items() for name in names}
|
||||||
|
levels = {name: i + 1 for names in s["presets"].values() for i, name in enumerate(names)}
|
||||||
|
settings = {f"{reg}__{name}": root / "posterior" / f"{reg}__{name}" for reg in s["regimes"] for name in list(axes) + list(s.get("controls", {}).get("presets", []))}
|
||||||
|
smc = sigma_post_table(settings)
|
||||||
|
if len(smc):
|
||||||
|
smc["regime"] = smc.setting.str.split("__").str[0]
|
||||||
|
smc["preset"] = smc.setting.str.split("__").str[1]
|
||||||
|
smc["axis"] = smc.preset.map(lambda n: axes.get(n, "control"))
|
||||||
|
smc["level"] = smc.preset.map(lambda n: levels.get(n, 0))
|
||||||
|
tables = {"s2_smc": smc}
|
||||||
|
ref = p2r_runs(p)
|
||||||
|
cells, h2a_rows, verdict = [], [], {"S2-H1": {"per_axis": {}}, "S2-H2": {"pairs": {}}}
|
||||||
|
for (reg, name), g in run.groupby(["regime", "preset"]):
|
||||||
|
h = h2a_cells(g, "B3d-Sa", POINT_TIES, rng, n_boot)
|
||||||
|
if len(h):
|
||||||
|
h2a_rows.append(h.assign(regime=reg, preset=name, axis=axes.get(name, "control"), level=levels.get(name, 0)))
|
||||||
|
ratios = {}
|
||||||
|
for N, gN in g.groupby("n_train"):
|
||||||
|
mean = gN.groupby("method")["band_rmse"].mean()
|
||||||
|
row = {"regime": reg, "preset": name, "axis": axes.get(name, "control"), "level": levels.get(name, 0), "c": 1.0, "n_train": N,
|
||||||
|
"n_rid": gN.rid.nunique(), "n_seed": gN.seed.nunique()} | {f"band_rmse_{m}": v for m, v in mean.items()}
|
||||||
|
pr = pair(gN, "M2-Sa", "B3d-Sa", rng, n_boot)
|
||||||
|
row |= {f"m2_pm_{k}": v for k, v in pr.items()}
|
||||||
|
ratios[N] = pr.get("ratio", np.nan)
|
||||||
|
if "Ctl-GP" in mean.index: # disclosed (T2 ii)
|
||||||
|
row |= {f"ctl_pm_{k}": v for k, v in pair(gN, "Ctl-GP", "B3d-Sa", rng, n_boot).items()}
|
||||||
|
row |= {f"m2_ctl_{k}": v for k, v in pair(gN, "M2-Sa", "Ctl-GP", rng, n_boot).items()}
|
||||||
|
pt = [m for m in POINT_TIES if m in mean.index]
|
||||||
|
if pt and "B3d-Sa" in mean:
|
||||||
|
best = mean.loc[pt].idxmin()
|
||||||
|
row |= {"best_point_tie": best} | {f"pm_best_{k}": v for k, v in pair(gN, "B3d-Sa", best, rng, n_boot).items()}
|
||||||
|
row["pm_no_harm"] = bool(row["pm_best_ratio"] <= sp13.GUARD)
|
||||||
|
# degradation vs the P2r nominal cell (descriptive)
|
||||||
|
if len(ref):
|
||||||
|
nom = ref[(ref.regime == reg) & (ref.c == 1) & (ref.n_train == N)]
|
||||||
|
for m in mean.index:
|
||||||
|
nm = nom[nom.method == m]
|
||||||
|
if len(nm):
|
||||||
|
row[f"degradation_{m}"] = float(mean[m] / nm.band_rmse.mean())
|
||||||
|
sm = smc[(smc.setting == f"{reg}__{name}") & (smc.n_train == N)] if len(smc) else pd.DataFrame()
|
||||||
|
if len(sm):
|
||||||
|
row |= {k: float(sm.iloc[0][k]) for k in ("sigma_post_ms", "warp_rmse_ms", "warp_cov90", "overconfidence")}
|
||||||
|
row["wide"] = bool(row["sigma_post_ms"] >= 1.5)
|
||||||
|
cells.append(row)
|
||||||
|
if name in axes:
|
||||||
|
mean_ratio = float(np.nanmean(list(ratios.values()))) if ratios else float("nan")
|
||||||
|
verdict["S2-H2"]["pairs"][f"{reg}/{name}"] = {"mean_ratio_M2-Sa/B3d-Sa": mean_ratio, "ok": bool(mean_ratio <= sp13.GUARD),
|
||||||
|
"n_cells": len(ratios)}
|
||||||
|
tables["s2_cells"] = pd.DataFrame(cells)
|
||||||
|
h2a = pd.concat(h2a_rows, ignore_index=True) if h2a_rows else pd.DataFrame()
|
||||||
|
tables["s2_h2a"] = h2a
|
||||||
|
for axis, names in s["presets"].items():
|
||||||
|
l1 = names[0]
|
||||||
|
t = h2a[(h2a.regime == "R10") & (h2a.preset == l1) & (h2a.c == 1)] if len(h2a) else pd.DataFrame()
|
||||||
|
per = {}
|
||||||
|
for reg in s["regimes"]:
|
||||||
|
for name in names:
|
||||||
|
tt = h2a[(h2a.regime == reg) & (h2a.preset == name) & (h2a.c == 1)] if len(h2a) else pd.DataFrame()
|
||||||
|
per[f"{reg}/{name}"] = {int(r.n_train): {"cell_pass": bool(r.cell_pass), "ratio": r.ratio, "ci": [r.ratio_lo, r.ratio_hi], "best": r.best}
|
||||||
|
for r in tt.itertuples()}
|
||||||
|
verdict["S2-H1"]["per_axis"][axis] = {"L1_R10_cells_pass": {int(r.n_train): bool(r.cell_pass) for r in t.itertuples()},
|
||||||
|
"pass": bool(t.cell_pass.all()) if len(t) == 2 else None,
|
||||||
|
"complete": bool(len(t) == 2 and (t.n_rid == len(p["grid"]["realizations"])).all()),
|
||||||
|
"all_cells": per}
|
||||||
|
verdict["S2-H1"]["axes_pass"] = [a for a, v in verdict["S2-H1"]["per_axis"].items() if v["pass"]]
|
||||||
|
verdict["S2-H1"]["pass_all_axes"] = bool(len(verdict["S2-H1"]["axes_pass"]) == len(s["presets"]))
|
||||||
|
pairs = verdict["S2-H2"]["pairs"]
|
||||||
|
expected = len(s["regimes"]) * sum(len(v) for v in s["presets"].values())
|
||||||
|
verdict["S2-H2"]["complete"] = bool(len(pairs) == expected)
|
||||||
|
verdict["S2-H2"]["pass"] = all(v["ok"] for v in pairs.values()) if len(pairs) == expected else None
|
||||||
|
tables["s2_degradation"] = tables["s2_cells"][[c for c in tables["s2_cells"].columns if c.startswith("degradation_") or c in ("regime", "preset", "axis", "level", "n_train")]] if len(cells) else pd.DataFrame()
|
||||||
|
return tables, verdict
|
||||||
|
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------- S3
|
||||||
|
|
||||||
|
def s3(p: dict, root: Path, rng, n_boot: int) -> tuple[dict, dict]:
|
||||||
|
_, run_b4, _ = load_study(p, root, "S3")
|
||||||
|
ref = p2r_runs(p)
|
||||||
|
if run_b4.empty or ref.empty:
|
||||||
|
return {}, {"available": False}
|
||||||
|
comp = POINT_TIES + list(p["studies"]["S3"]["methods"])
|
||||||
|
run = pd.concat([ref, run_b4], ignore_index=True)
|
||||||
|
rows, verdict = [], {"per_regime": {}}
|
||||||
|
for reg, g in run.groupby("regime"):
|
||||||
|
if "B3d-Sa" not in set(g.method):
|
||||||
|
continue
|
||||||
|
cells = h2a_cells(g, "B3d-Sa", comp, rng, n_boot)
|
||||||
|
if not len(cells):
|
||||||
|
continue
|
||||||
|
rows.append(cells.assign(regime=reg, flag=np.where(cells.c == 2, "unstable posterior", "")))
|
||||||
|
c1, c0 = cells[cells.c == 1], cells[cells.c == 0]
|
||||||
|
macro = c0.m2_band_rmse.mean() / c0.best_band_rmse.mean() if len(c0) else float("nan")
|
||||||
|
guard = bool(len(c0) == 2 and macro <= sp13.GUARD and (c0.ratio <= sp13.GUARD).all())
|
||||||
|
verdict["per_regime"][reg] = {"c1_cells_pass": f"{int(c1.cell_pass.sum())}/{len(c1)}", "best_at_c1": {int(r.n_train): r.best for r in c1.itertuples()},
|
||||||
|
"zero_drift_macro_ratio": macro, "zero_drift_guard": guard,
|
||||||
|
"regime_pass": bool(len(c1) == 2 and c1.cell_pass.all() and guard),
|
||||||
|
"complete": bool((cells.n_rid == len(p["grid"]["realizations"])).all() and len(cells) == 6)}
|
||||||
|
tab = pd.concat(rows, ignore_index=True) if rows else pd.DataFrame()
|
||||||
|
h2a_regimes = ["R10", "R0", "Rm5"]
|
||||||
|
verdict["pass"] = verdict["per_regime"].get("R10", {}).get("regime_pass")
|
||||||
|
verdict["regimes_pass"] = [r for r in h2a_regimes if verdict["per_regime"].get(r, {}).get("regime_pass")]
|
||||||
|
table = run.groupby(["regime", "c", "n_train", "method"])["band_rmse"].mean().unstack("method").reset_index()
|
||||||
|
ctl = []
|
||||||
|
if "Ctl-GP" in set(run.method): # T2-1 (disclosed): control bank across the P2r grid
|
||||||
|
for (reg, c, N), g in run.groupby(["regime", "c", "n_train"]):
|
||||||
|
if "Ctl-GP" not in set(g.method):
|
||||||
|
continue
|
||||||
|
ctl.append({"regime": reg, "c": c, "n_train": N, "n_rid": g.rid.nunique(), "flag": "unstable posterior" if c == 2 else ""}
|
||||||
|
| {f"ctl_pm_{k}": v for k, v in pair(g, "Ctl-GP", "B3d-Sa", rng, n_boot).items()}
|
||||||
|
| {f"m2_ctl_{k}": v for k, v in pair(g, "M2-Sa", "Ctl-GP", rng, n_boot).items()}
|
||||||
|
| {f"m2_pm_{k}": v for k, v in pair(g, "M2-Sa", "B3d-Sa", rng, n_boot).items()})
|
||||||
|
ctl = pd.DataFrame(ctl)
|
||||||
|
if len(ctl) and {"m2_ctl_better", "ctl_pm_better"} <= set(ctl.columns):
|
||||||
|
verdict["T2-1"] = {"cells": int(len(ctl)), "m2_better_than_ctl": int(ctl.m2_ctl_better.sum()),
|
||||||
|
"m2_better_than_ctl_by_c": {f"c{c:g}": int(d.m2_ctl_better.sum()) for c, d in ctl.groupby("c")},
|
||||||
|
"ctl_better_than_pm": int(ctl.ctl_pm_better.sum())}
|
||||||
|
return {"s3_h2a": tab, "s3_table": table, "s3_control": ctl}, verdict
|
||||||
|
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------- S4
|
||||||
|
|
||||||
|
def s4(p: dict, root: Path, rng, n_boot: int) -> tuple[dict, dict]:
|
||||||
|
_, run, _ = load_study(p, root, "S4")
|
||||||
|
if run.empty:
|
||||||
|
return {}, {"available": False}
|
||||||
|
pt = [f"{m}-TCN" for m in POINT_TIES]
|
||||||
|
rows, verdict = [], {}
|
||||||
|
for reg, g in run.groupby("regime"):
|
||||||
|
cells = h2a_cells(g, "B3d-Sa-TCN", pt, rng, n_boot)
|
||||||
|
if len(cells):
|
||||||
|
rows.append(cells.assign(regime=reg))
|
||||||
|
h2a = pd.concat(rows, ignore_index=True) if rows else pd.DataFrame()
|
||||||
|
t = h2a[(h2a.regime == "R10") & (h2a.c == 1)] if len(h2a) else pd.DataFrame()
|
||||||
|
verdict["S4-H1"] = {"cells": {int(r.n_train): bool(r.cell_pass) for r in t.itertuples()}, "ratios": {int(r.n_train): [r.ratio, r.ratio_lo, r.ratio_hi] for r in t.itertuples()},
|
||||||
|
"pass": bool(t.cell_pass.all()) if len(t) == 2 else None}
|
||||||
|
cells = []
|
||||||
|
ref = p2r_runs(p)
|
||||||
|
for (reg, N), g in run.groupby(["regime", "n_train"]):
|
||||||
|
mean = g.groupby("method")["band_rmse"].mean()
|
||||||
|
row = {"regime": reg, "c": 1.0, "n_train": N, "n_rid": g.rid.nunique()} | {f"band_rmse_{m}": v for m, v in mean.items()}
|
||||||
|
row |= {f"m2_pm_{k}": v for k, v in pair(g, "M2-Sa-TCN", "B3d-Sa-TCN", rng, n_boot).items()}
|
||||||
|
if len(ref):
|
||||||
|
nom = ref[(ref.regime == reg) & (ref.c == 1) & (ref.n_train == N)]
|
||||||
|
for m in mean.index:
|
||||||
|
nm = nom[nom.method == m.removesuffix("-TCN")]
|
||||||
|
if len(nm):
|
||||||
|
row[f"tcn_over_cnngru_{m.removesuffix('-TCN')}"] = float(mean[m] / nm.band_rmse.mean())
|
||||||
|
cells.append(row)
|
||||||
|
cells = pd.DataFrame(cells)
|
||||||
|
wide = cells[(cells.n_train == 16) & cells.regime.isin(["Rm5", "R0h"])]
|
||||||
|
verdict["S4-H2"] = {"cells": {r.regime: {"ratio": r.m2_pm_ratio, "ci": [r.m2_pm_ratio_lo, r.m2_pm_ratio_hi], "better": bool(r.m2_pm_better)} for r in wide.itertuples()},
|
||||||
|
"pass": bool(wide.m2_pm_better.all()) if len(wide) == 2 else None}
|
||||||
|
return {"s4_cells": cells, "s4_h2a": h2a}, verdict
|
||||||
|
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------- S8
|
||||||
|
|
||||||
|
def cross_spectrum(Y: np.ndarray, P: np.ndarray) -> np.ndarray:
|
||||||
|
w = np.hanning(Y.shape[1])
|
||||||
|
Fy = np.fft.rfft((Y - Y.mean(1, keepdims=True)) * w, NFFT)
|
||||||
|
Fp = np.fft.rfft((P - P.mean(1, keepdims=True)) * w, NFFT)
|
||||||
|
return np.real(np.conj(Fy) * Fp).sum(0)
|
||||||
|
|
||||||
|
|
||||||
|
def s8(p: dict, root: Path, rng, n_boot: int) -> tuple[dict, dict]:
|
||||||
|
rows_all, run, _ = load_study(p, root, "S8")
|
||||||
|
if run.empty:
|
||||||
|
return {}, {"available": False}
|
||||||
|
f = np.fft.rfftfreq(NFFT, 4.0 / 1000.0)
|
||||||
|
f_c = 6.0
|
||||||
|
budgets = study_budgets(p, "S8")
|
||||||
|
cells, transfer, verdict = [], [], {"S8-H1": {"cells": {}}, "S8-H2": {"cells": {}}}
|
||||||
|
for (reg, d, N), g in run.groupby(["regime", "delta_ms", "n_train"]):
|
||||||
|
mean = g.groupby("method")["band_rmse"].mean()
|
||||||
|
row = {"regime": reg, "delta_ms": d, "n_train": N, "n_rid": g.rid.nunique(), "n_seed": g.seed.nunique()} | {f"band_rmse_{m}": v for m, v in mean.items()}
|
||||||
|
for a, b, tag in (("PM2", "Oracle", "pm_or"), ("BK2", "PM2", "bk_pm"), ("HM2", "PM2", "hm_pm"), ("BK2", "Oracle", "bk_or")):
|
||||||
|
row |= {f"{tag}_{k}": v for k, v in pair(g, a, b, rng, n_boot).items()}
|
||||||
|
# transfer Ĥ(f) relative to the Oracle predictions, pooled over rids, seeds and test wells
|
||||||
|
S = {m: np.zeros(len(f)) for m in ("Oracle", "PM2", "BK2", "HM2")}
|
||||||
|
for rid in sorted(g.rid.unique()):
|
||||||
|
cell = Cell("S8", reg, None, 1.0, int(N), int(rid), tuple(p["studies"]["S8"]["methods"]), posterior="none", delta_ms=float(d))
|
||||||
|
npz = train_paths(cell, root)["npz"]
|
||||||
|
if not npz.exists():
|
||||||
|
continue
|
||||||
|
with np.load(npz) as z:
|
||||||
|
Y = z["y_true"].astype(float)
|
||||||
|
for m in S:
|
||||||
|
for k in (k for k in z.files if k.startswith(f"{m}/s") and k.endswith(f"/b{budgets[m]}/mu")):
|
||||||
|
S[m] += cross_spectrum(Y, z[k].astype(float))
|
||||||
|
band = f >= f_c
|
||||||
|
use = band & (S["Oracle"] >= 0.1 * S["Oracle"][band].max())
|
||||||
|
lo, hi = 1000.0 / (2 * d), 3000.0 / (2 * d)
|
||||||
|
flip = use & (f > lo) & (f < hi)
|
||||||
|
for m in ("PM2", "BK2", "HM2"):
|
||||||
|
H = S[m] / np.where(S["Oracle"] == 0, np.nan, S["Oracle"])
|
||||||
|
theory = np.cos(np.pi * f * d / 1000.0)
|
||||||
|
zero = f[band][np.flatnonzero(np.diff(np.sign(H[band])) != 0)[:1]]
|
||||||
|
transfer.append({"regime": reg, "delta_ms": d, "n_train": N, "method": m, "flip_band_hz": [lo, hi], "n_freq_flip": int(flip.sum()),
|
||||||
|
"mean_H_flip_band": float(np.nanmean(H[flip])) if flip.any() else float("nan"),
|
||||||
|
"mean_cos_flip_band": float(theory[flip].mean()) if flip.any() else float("nan"),
|
||||||
|
"first_zero_crossing_hz": float(zero[0]) if len(zero) else float("nan"), "theory_zero_hz": lo,
|
||||||
|
"H": H.tolist(), "f_hz": f.tolist()})
|
||||||
|
row[f"meanH_flip_{m}"] = transfer[-1]["mean_H_flip_band"]
|
||||||
|
cells.append(row)
|
||||||
|
if reg == "R10" and d == 32:
|
||||||
|
verdict["S8-H1"]["cells"][int(N)] = {"mean_H_PM2_flip_band": row["meanH_flip_PM2"], "negative": bool(row["meanH_flip_PM2"] < 0)}
|
||||||
|
if N == 16 and d in (16, 32):
|
||||||
|
verdict["S8-H2"]["cells"][f"{reg}/d{d:g}"] = {"ratio_BK2_PM2": row.get("bk_pm_ratio"), "ci": [row.get("bk_pm_ratio_lo"), row.get("bk_pm_ratio_hi")],
|
||||||
|
"better": bool(row.get("bk_pm_better", False))}
|
||||||
|
cells = pd.DataFrame(cells)
|
||||||
|
verdict["S8-H1"]["pass"] = all(v["negative"] for v in verdict["S8-H1"]["cells"].values()) if len(verdict["S8-H1"]["cells"]) == 2 else None
|
||||||
|
d8 = cells[cells.delta_ms == 8]
|
||||||
|
no_harm = float(d8.bk_pm_ratio.mean()) if len(d8) else float("nan")
|
||||||
|
verdict["S8-H2"]["no_harm_mean_ratio_d8"] = no_harm
|
||||||
|
verdict["S8-H2"]["pass"] = all(v["better"] for v in verdict["S8-H2"]["cells"].values()) if len(verdict["S8-H2"]["cells"]) == 4 else None
|
||||||
|
verdict["S8-H2"]["d8_descriptive"] = {f"{r.regime}/n{int(r.n_train)}": [r.bk_pm_ratio, r.bk_pm_ratio_lo, r.bk_pm_ratio_hi] for r in d8.itertuples()}
|
||||||
|
tr = pd.DataFrame(transfer)
|
||||||
|
return {"s8_cells": cells, "s8_transfer": tr.drop(columns=["H", "f_hz"]) if len(tr) else tr,
|
||||||
|
"s8_transfer_curves": tr}, verdict
|
||||||
|
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------- equal-budget arm (disclosed, T2 v)
|
||||||
|
|
||||||
|
def equal_budget(p: dict, root: Path, rng, n_boot: int) -> pd.DataFrame:
|
||||||
|
arm = p["training"].get("equal_budget_arm")
|
||||||
|
if not arm:
|
||||||
|
return pd.DataFrame()
|
||||||
|
rows = []
|
||||||
|
for study in p["studies"]:
|
||||||
|
_, run, _ = load_study(p, root, study, arm=int(arm))
|
||||||
|
if run.empty:
|
||||||
|
continue
|
||||||
|
keys = [k for k in ("regime", "preset", "delta_ms", "c", "n_train") if k in run.columns]
|
||||||
|
for key, g in run.groupby(keys, dropna=False):
|
||||||
|
mean = g.groupby("method")["band_rmse"].mean()
|
||||||
|
row = {"study": study, "budget": int(arm)} | dict(zip(keys, key)) | {"n_rid": g.rid.nunique()} | {f"band_rmse_{m}": v for m, v in mean.items()}
|
||||||
|
sfx = "-TCN" if p["studies"][study].get("backbone", "cnngru") != "cnngru" else ""
|
||||||
|
for a, b, tag in ((f"M2-Sa{sfx}", f"B3d-Sa{sfx}", "m2_pm"), (f"B3d-Sa{sfx}", f"Oracle{sfx}", "pm_or"), ("Ctl-GP", f"B3d-Sa{sfx}", "ctl_pm"),
|
||||||
|
("BK2", "PM2", "bk_pm"), ("PM2", "Oracle", "pm2_or")):
|
||||||
|
if a in mean.index and b in mean.index:
|
||||||
|
row |= {f"{tag}_{k}": v for k, v in pair(g, a, b, rng, n_boot).items() if k in ("ratio", "ratio_lo", "ratio_hi", "better")}
|
||||||
|
rows.append(row)
|
||||||
|
return pd.DataFrame(rows)
|
||||||
|
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------- report
|
||||||
|
|
||||||
|
def _md(df: pd.DataFrame, cols=None, fmt: str = ".3f") -> str:
|
||||||
|
if df is None or not len(df):
|
||||||
|
return "(no data)"
|
||||||
|
d = df[[c for c in cols if c in df.columns]] if cols else df
|
||||||
|
return d.to_markdown(index=False, floatfmt=fmt)
|
||||||
|
|
||||||
|
|
||||||
|
def summarize(p: dict, root: Path, n_boot: int = 2000, dev: bool = False, n_perm: int = 10000) -> dict:
|
||||||
|
global USE_P2R
|
||||||
|
USE_P2R = not dev
|
||||||
|
out = root / "summary"
|
||||||
|
out.mkdir(parents=True, exist_ok=True)
|
||||||
|
rng = np.random.default_rng(0)
|
||||||
|
tables, verdict = {}, {"protocol": "configs/protocol_bench.yaml", "dev": dev, "root": str(root)}
|
||||||
|
sha = REPO_ROOT / "configs" / "protocol_bench.sha256"
|
||||||
|
verdict["protocol_sha256"] = sha.read_text().split()[0] if sha.exists() else "UNLOCKED"
|
||||||
|
for name, fn, extra in (("S1", s1, (n_perm,)), ("S2", s2, ()), ("S3", s3, ()), ("S4", s4, ()), ("S8", s8, ())):
|
||||||
|
t, v = fn(p, root, rng, n_boot, *extra)
|
||||||
|
tables |= t
|
||||||
|
verdict[name] = v
|
||||||
|
tables["equal_budget"] = equal_budget(p, root, rng, n_boot)
|
||||||
|
for name, df in tables.items():
|
||||||
|
if name == "s8_transfer_curves":
|
||||||
|
(out / "s8_transfer_curves.json").write_text(df.to_json(orient="records"))
|
||||||
|
elif isinstance(df, pd.DataFrame):
|
||||||
|
df.to_csv(out / f"{name}.csv", index=False)
|
||||||
|
(out / "verdict.json").write_text(json.dumps(verdict, indent=1, default=float))
|
||||||
|
L = [f"# protocol_bench summary ({'DEV — never a result' if dev else 'main grid'})", "",
|
||||||
|
"Rules of configs/protocol_bench.yaml applied as written. Realizations and seeds as recorded per cell.", ""]
|
||||||
|
hyp = p["hypotheses"]
|
||||||
|
for key in ("S1-H1", "S1-H2", "S2-H1", "S2-H2", "S3-H1", "S4-H1", "S4-H2", "S8-H1", "S8-H2"):
|
||||||
|
v = verdict.get(key.split("-")[0], {})
|
||||||
|
v = v.get(key, v) if key != "S3-H1" else v
|
||||||
|
res = v.get("pass") if isinstance(v, dict) else None
|
||||||
|
L.append(f"- **{key}** ({hyp[key]['kind']}): {'PASS' if res else 'FAIL' if res is False else 'not available'} — {hyp[key]['statement'].strip()[:160]}…")
|
||||||
|
L.append("")
|
||||||
|
sections = [("S1 cells (phase diagram)", "s1_cells", ["regime", "c", "n_train", "sigma_post_ms", "best_point_tie", "pm_best_ratio", "pm_best_ratio_lo", "pm_best_ratio_hi", "m2_pm_ratio", "m2_pm_ratio_lo", "m2_pm_ratio_hi", "m2_pm_better", "n_rid"]),
|
||||||
|
("S1 families (S1-H2)", "s1_families", None), ("S1 additivity (descriptive)", "s1_additivity", None),
|
||||||
|
("S2 SMC diagnostics", "s2_smc", ["regime", "preset", "axis", "level", "n_train", "sigma_post_ms", "warp_rmse_ms", "warp_cov90", "overconfidence", "phase_R_mean", "kappa_post", "r_post", "n_rid"]),
|
||||||
|
("S2 cells", "s2_cells", ["regime", "preset", "axis", "level", "n_train", "best_point_tie", "pm_best_ratio", "pm_best_ratio_lo", "pm_best_ratio_hi", "pm_no_harm", "m2_pm_ratio", "m2_pm_ratio_lo", "m2_pm_ratio_hi", "m2_pm_better", "wide", "n_rid"]),
|
||||||
|
("S2 H2a rule per preset", "s2_h2a", ["regime", "preset", "axis", "level", "c", "n_train", "best", "ratio", "ratio_lo", "ratio_hi", "dpcc", "seeds_improve", "rids_improve", "cell_pass"]),
|
||||||
|
("S3 H2a rule with B4 competitors", "s3_h2a", ["regime", "c", "n_train", "best", "runner_up", "ratio", "ratio_lo", "ratio_hi", "dpcc", "seeds_improve", "rids_improve", "cell_pass", "flag"]),
|
||||||
|
("S3 benchmark table (band RMSE)", "s3_table", None),
|
||||||
|
("S3 control bank across the P2r grid (T2-1, disclosed)", "s3_control", ["regime", "c", "n_train", "ctl_pm_ratio", "ctl_pm_ratio_lo", "ctl_pm_ratio_hi", "ctl_pm_better", "m2_ctl_ratio", "m2_ctl_ratio_lo", "m2_ctl_ratio_hi", "m2_ctl_better", "m2_pm_ratio", "flag", "n_rid"]),
|
||||||
|
("S4 cells (TCN)", "s4_cells", None), ("S4 H2a rule (TCN)", "s4_h2a", ["regime", "c", "n_train", "best", "ratio", "ratio_lo", "ratio_hi", "dpcc", "seeds_improve", "rids_improve", "cell_pass"]),
|
||||||
|
("S8 cells", "s8_cells", ["regime", "delta_ms", "n_train", "pm_or_ratio", "bk_pm_ratio", "bk_pm_ratio_lo", "bk_pm_ratio_hi", "bk_pm_better", "hm_pm_ratio", "meanH_flip_PM2", "meanH_flip_BK2", "n_rid"]),
|
||||||
|
("S8 transfer", "s8_transfer", ["regime", "delta_ms", "n_train", "method", "n_freq_flip", "mean_H_flip_band", "mean_cos_flip_band", "first_zero_crossing_hz", "theory_zero_hz"]),
|
||||||
|
("Equal-budget arm, 500 iterations for every method (disclosed, T2 v; no rule uses it)", "equal_budget", None)]
|
||||||
|
for title, key, cols in sections:
|
||||||
|
L += [f"## {title}", "", _md(tables.get(key), cols), ""]
|
||||||
|
L += ["## Verdicts (json)", "", "```", json.dumps({k: v for k, v in verdict.items() if k.startswith("S")}, indent=1, default=float), "```", ""]
|
||||||
|
(out / "summary.md").write_text("\n".join(L))
|
||||||
|
print("\n".join(L[:14]))
|
||||||
|
return verdict
|
||||||
296
ml_porosity/benchmark/training.py
Normal file
296
ml_porosity/benchmark/training.py
Normal file
@@ -0,0 +1,296 @@
|
|||||||
|
"""Training of one protocol_bench cell: scripts/15_diag_train.py run_cell (variant "a": estR wavelet, γ = 1/κ) with
|
||||||
|
three additions. (1) B4a–d from the protocol_p2 label banks (S3). (2) The S8 two-mode banks built from the true
|
||||||
|
warp: per training well a side s = ±1 is drawn from a declared stream, the two modes are t_true and t_true + sΔ,
|
||||||
|
PM2 labels sit at the posterior-mean warp t_true + sΔ/2, BK2 is the two-member bank with uniform π and the
|
||||||
|
protocol λ, HM2 the same bank with the hard-min loss. (3) A second backbone (TCNHetero of ml_porosity/f3/training.py)
|
||||||
|
trained with the same loop as bank_train.train_predict; the CNN-GRU path delegates to bank_train unchanged.
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import json
|
||||||
|
import time
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
import numpy as np
|
||||||
|
import torch
|
||||||
|
import torch.nn as nn
|
||||||
|
|
||||||
|
from ml_porosity.benchmark.cells import Cell
|
||||||
|
from ml_porosity.benchmark.data import Inputs, load_script
|
||||||
|
|
||||||
|
REGISTER_METHODS = ("Oracle", "B3a", "B3b", "B3c", "B3d", "B4a", "B4b", "B4c", "B4d", "M1", "M2")
|
||||||
|
POSTERIOR_METHODS = ("B3c-R", "B3d-Sa", "M2-Sa")
|
||||||
|
TWO_MODE_METHODS = ("PM2", "BK2", "HM2")
|
||||||
|
CONTROL_METHODS = ("Ctl-GP",)
|
||||||
|
SIDE_STREAM = 20261030 # S8: rng [rid, SIDE_STREAM, 8, i] → side s_i = ±1 of training well i
|
||||||
|
MIN_SLOPE_MS, MAX_ATTEMPTS = 0.05, 1280 # Ctl-GP: monotonicity guard and draw budget, as T2 (scripts/32)
|
||||||
|
|
||||||
|
|
||||||
|
def budget_list(p: dict, method: str, backbone: str) -> list[int]:
|
||||||
|
"""Registered budget plus, if declared, the equal-budget arm (one trajectory; predictions at both steps)."""
|
||||||
|
b = {budget_of(p, method, backbone)}
|
||||||
|
arm = p["training"].get("equal_budget_arm")
|
||||||
|
if arm:
|
||||||
|
b.add(int(arm))
|
||||||
|
return sorted(b)
|
||||||
|
|
||||||
|
|
||||||
|
def base_name(method: str) -> str:
|
||||||
|
return method.removesuffix("-TCN")
|
||||||
|
|
||||||
|
|
||||||
|
def budget_of(p: dict, method: str, backbone: str) -> int:
|
||||||
|
b = base_name(method)
|
||||||
|
if backbone != "cnngru":
|
||||||
|
alt = p["training"].get(f"budgets_{backbone}") or {}
|
||||||
|
if alt.get(b) is not None:
|
||||||
|
return int(alt[b])
|
||||||
|
return int(p["training"]["budgets"][b])
|
||||||
|
|
||||||
|
|
||||||
|
def train_predict_tcn(X, Xte, spec: dict, cfg: dict, seed: int, budgets: list[int], device: str) -> dict:
|
||||||
|
"""bank_train.train_predict with TCNHetero (f3.training) in place of CNNGRUHetero; cudnn deterministic as f3."""
|
||||||
|
from ml_porosity.f3.training import TCNHetero
|
||||||
|
from ml_porosity.losses.rml import bank_loss, gather_windows
|
||||||
|
from ml_porosity.losses.softdtw import dilate_loss_fast, softdtw_loss_fast
|
||||||
|
from ml_porosity.models.bank_train import WIN, window_starts_fixed
|
||||||
|
from ml_porosity.models.train import predict
|
||||||
|
|
||||||
|
torch.backends.cudnn.benchmark = False
|
||||||
|
torch.backends.cudnn.deterministic = True
|
||||||
|
torch.default_generator.manual_seed(seed)
|
||||||
|
if torch.device(device).type == "cuda":
|
||||||
|
torch.cuda.set_device(device)
|
||||||
|
torch.cuda.manual_seed(seed)
|
||||||
|
np.random.seed(seed)
|
||||||
|
T = lambda a: torch.as_tensor(np.asarray(a), dtype=torch.float32, device=device)
|
||||||
|
x = T(X)
|
||||||
|
N, _, L = X.shape
|
||||||
|
starts = torch.as_tensor(np.tile(window_starts_fixed(L), (N, 1)), device=device)
|
||||||
|
kind = spec["kind"]
|
||||||
|
if kind == "bank":
|
||||||
|
Y, logpi, lam = T(spec["Y"]), T(spec["logpi"]), spec["lam"]
|
||||||
|
loss_fn = lambda mu, s: bank_loss(mu, s, Y, logpi, starts, WIN, lam)
|
||||||
|
elif kind in ("softdtw", "dilate"):
|
||||||
|
yw = gather_windows(T(spec["Y"]).reshape(N, L), starts, WIN).reshape(-1, WIN)
|
||||||
|
f = softdtw_loss_fast if kind == "softdtw" else dilate_loss_fast
|
||||||
|
kw = {k: spec[k] for k in ("gamma", "band", "alpha") if k in spec}
|
||||||
|
loss_fn = lambda mu, s: f(gather_windows(mu, starts, WIN).reshape(-1, WIN),
|
||||||
|
gather_windows(s, starts, WIN).reshape(-1, WIN), yw, **kw)
|
||||||
|
else:
|
||||||
|
raise ValueError(kind)
|
||||||
|
model = TCNHetero(X.shape[1], cfg["d_channels"], cfg["p_dropout"]).to(device)
|
||||||
|
opt = torch.optim.Adam(model.parameters(), lr=cfg["lr"])
|
||||||
|
out = {}
|
||||||
|
for step in range(1, max(budgets) + 1):
|
||||||
|
model.train()
|
||||||
|
opt.zero_grad()
|
||||||
|
mu, s = model(x)
|
||||||
|
loss = loss_fn(mu[:, 0], s[:, 0])
|
||||||
|
if not torch.isfinite(loss):
|
||||||
|
raise FloatingPointError(f"non-finite loss at step {step}")
|
||||||
|
loss.backward()
|
||||||
|
nn.utils.clip_grad_norm_(model.parameters(), cfg["grad_clip"])
|
||||||
|
opt.step()
|
||||||
|
if step in budgets:
|
||||||
|
out[step] = predict(model, Xte, device)
|
||||||
|
return out
|
||||||
|
|
||||||
|
|
||||||
|
def train_predict_any(X, Xte, spec, cfg, seed, budgets, device, backbone: str) -> dict:
|
||||||
|
if backbone == "cnngru":
|
||||||
|
from ml_porosity.models.bank_train import train_predict
|
||||||
|
return train_predict(X, Xte, spec, cfg, seed, budgets, device)
|
||||||
|
if backbone == "tcn":
|
||||||
|
return train_predict_tcn(X, Xte, spec, cfg, seed, budgets, device)
|
||||||
|
raise ValueError(backbone)
|
||||||
|
|
||||||
|
|
||||||
|
def posterior_banks(R, obs: list[dict], out: dict, reg: dict, ph: dict, smc, reg_seed: int, diag: list[dict]) -> tuple[dict, list]:
|
||||||
|
"""B3c-R, B3d-Sa (mean of all particles) and M2-Sa (S particles without replacement, rng [reg_seed, i, 29],
|
||||||
|
uniform π) exactly as scripts/15 (variant a: estR, g_acf). Appends per-well diagnostics to `diag`."""
|
||||||
|
from ml_porosity.data.wavelet import statistical_wavelet
|
||||||
|
from ml_porosity.registration.labels import antialias, labels_for_warps
|
||||||
|
from ml_porosity.registration.smc import phase_basis, phase_wavelet
|
||||||
|
from ml_porosity.registration.tie_likelihood import synth_for_warps
|
||||||
|
from ml_porosity.registration.ties import tie_b3b, tie_b3c, warp_errors, warp_mean
|
||||||
|
|
||||||
|
cfg = R.cfg
|
||||||
|
f, fac = cfg["fine_dt_ms"], int(round(R.dt / cfg["fine_dt_ms"]))
|
||||||
|
seis = [o["seis"][o["seis"].shape[0] // 2].astype(float) for o in obs]
|
||||||
|
wR = phase_wavelet(phase_basis(statistical_wavelet(np.stack(seis), R.dt, reg["wavelet_ms"]), fac), ph["phase_R"])
|
||||||
|
lab = lambda y, T: labels_for_warps(R.tau_fine, y, np.atleast_2d(T), R.t_main)
|
||||||
|
err = lambda t, o: warp_errors(t[None], R.tau_fine, o["t_of_tau_true"], R.t_main)["warp_rmse_ms"]
|
||||||
|
banks, logpi = {"B3c-R": [], "B3d-Sa": [], "M2-Sa": []}, []
|
||||||
|
for i, o in enumerate(obs):
|
||||||
|
y_aa = antialias(o["phi_log"], f, R.dt)
|
||||||
|
t_b3b = tie_b3b(o["tau_k"], o["t_k"], R.tau_fine)
|
||||||
|
syn_b = synth_for_warps(R.tau_fine, o["ai_log"], t_b3b, R.t_fine, R.t_ext, wR)[0]
|
||||||
|
t3c = tie_b3c(t_b3b, R.tau_fine, syn_b, seis[i], R.t_ext, R.dt)
|
||||||
|
banks["B3c-R"].append(lab(y_aa, t3c))
|
||||||
|
U = smc[f"{o['name']}/estR/g_acf"].astype(float)
|
||||||
|
Tf = R.grid.t_of_tau(U[:, 0], U[:, 1:], tau=R.tau_fine)
|
||||||
|
tm = warp_mean(Tf, np.zeros(len(Tf)))
|
||||||
|
banks["B3d-Sa"].append(lab(y_aa, tm))
|
||||||
|
sub = np.random.default_rng([reg_seed, i, 29]).choice(len(Tf), reg["S"], replace=False)
|
||||||
|
Y = lab(y_aa, Tf[sub])
|
||||||
|
ok = np.all(np.isfinite(Y), 1)
|
||||||
|
Y[~ok] = Y[ok][0]
|
||||||
|
banks["M2-Sa"].append(Y)
|
||||||
|
logpi.append(np.where(ok, 0.0, -np.inf) - np.log(ok.sum()))
|
||||||
|
diag[i] |= {"phase_R": ph["phase_R"], "B3c-R_warp_rmse_ms": err(t3c, o), "B3d-Sa_warp_rmse_ms": err(tm, o),
|
||||||
|
"M2-Sa_n_valid": int(ok.sum()),
|
||||||
|
"sigma_post_ms": warp_errors(Tf, R.tau_fine, o["t_of_tau_true"], R.t_main)["warp_width90_ms"] / 3.29}
|
||||||
|
return banks, logpi
|
||||||
|
|
||||||
|
|
||||||
|
def control_gp_bank(R, obs: list[dict], smc: dict, reg: dict, reg_seed: int, diag: list[dict]) -> tuple[list, list]:
|
||||||
|
"""Ctl-GP (T2 test ii, scripts/32 control_bank): S warps T̄ + η_s, η_s Gaussian with the empirical mean and
|
||||||
|
covariance of the SMC particles on the warp grid (no information beyond the first two moments; no link between
|
||||||
|
a member and the seismic). rng [reg_seed, i, 2029]; a draw is kept if t(τ) is strictly increasing (slope >
|
||||||
|
MIN_SLOPE_MS per node), else redrawn (≤ MAX_ATTEMPTS); fallback: Gaussian in u = [b, g] (monotone by
|
||||||
|
construction), flagged. Labels and invalid members as the SMC bank."""
|
||||||
|
from ml_porosity.registration.labels import antialias, labels_for_warps
|
||||||
|
|
||||||
|
f = R.cfg["fine_dt_ms"]
|
||||||
|
lab = lambda y, T: labels_for_warps(R.tau_fine, y, np.atleast_2d(T), R.t_main)
|
||||||
|
banks, logpi = [], []
|
||||||
|
for i, o in enumerate(obs):
|
||||||
|
U = smc[f"{o['name']}/estR/g_acf"].astype(float)
|
||||||
|
Tg = R.grid.t_of_tau(U[:, 0], U[:, 1:])
|
||||||
|
Tbar = Tg.mean(0)
|
||||||
|
lam, V = np.linalg.eigh(np.cov(Tg.T, ddof=0))
|
||||||
|
Lm = V * np.sqrt(np.clip(lam, 0.0, None))[None, :]
|
||||||
|
rng = np.random.default_rng([reg_seed, i, 2029])
|
||||||
|
members, n_rej, attempts = [], 0, 0
|
||||||
|
while len(members) < reg["S"] and attempts < MAX_ATTEMPTS:
|
||||||
|
t = Tbar + Lm @ rng.standard_normal(len(Tbar))
|
||||||
|
attempts += 1
|
||||||
|
if np.all(np.diff(t) > MIN_SLOPE_MS):
|
||||||
|
members.append(t)
|
||||||
|
else:
|
||||||
|
n_rej += 1
|
||||||
|
fallback = len(members) < reg["S"]
|
||||||
|
if fallback:
|
||||||
|
lu, Vu = np.linalg.eigh(np.cov(U.T, ddof=0))
|
||||||
|
Lu = Vu * np.sqrt(np.clip(lu, 0.0, None))[None, :]
|
||||||
|
ubar = U.mean(0)
|
||||||
|
while len(members) < reg["S"]:
|
||||||
|
u = ubar + Lu @ rng.standard_normal(len(ubar))
|
||||||
|
members.append(R.grid.t_of_tau(u[0], u[1:])[0])
|
||||||
|
Tc_grid = np.stack(members)
|
||||||
|
Tc = np.stack([np.interp(R.tau_fine, R.grid.tau, t) for t in Tc_grid])
|
||||||
|
Y = lab(antialias(o["phi_log"], f, R.dt), Tc)
|
||||||
|
ok = np.all(np.isfinite(Y), 1)
|
||||||
|
Y[~ok] = Y[ok][0]
|
||||||
|
banks.append(Y)
|
||||||
|
logpi.append(np.where(ok, 0.0, -np.inf) - np.log(ok.sum()))
|
||||||
|
diag[i] |= {"Ctl-GP_n_valid": int(ok.sum()), "Ctl-GP_n_rejected": n_rej, "Ctl-GP_fallback_u": bool(fallback),
|
||||||
|
"Ctl-GP_sd_ratio": float(Tc_grid.std(0).mean() / Tg.std(0).mean())}
|
||||||
|
return banks, logpi
|
||||||
|
|
||||||
|
|
||||||
|
def two_mode_banks(R, obs: list[dict], delta_ms: float, diag: list[dict]) -> dict:
|
||||||
|
"""S8 controlled cycle skip: modes t_true and t_true + s·Δ (s = ±1 per training well from rng
|
||||||
|
[rid, SIDE_STREAM, 8, i]); PM2 at the mean warp t_true + sΔ/2; BK2/HM2 the two-member bank."""
|
||||||
|
from ml_porosity.registration.labels import antialias, labels_for_warps
|
||||||
|
from ml_porosity.registration.ties import warp_errors
|
||||||
|
|
||||||
|
f = R.cfg["fine_dt_ms"]
|
||||||
|
lab = lambda y, T: labels_for_warps(R.tau_fine, y, np.atleast_2d(T), R.t_main)
|
||||||
|
banks = {"PM2": [], "BK2": []}
|
||||||
|
for i, o in enumerate(obs):
|
||||||
|
s = int(np.random.default_rng([R.rid, SIDE_STREAM, 8, i]).integers(2)) * 2 - 1
|
||||||
|
y_aa = antialias(o["phi_log"], f, R.dt)
|
||||||
|
t_true = o["t_of_tau_true"]
|
||||||
|
Ypm = lab(y_aa, t_true + s * delta_ms / 2.0)
|
||||||
|
Ybk = lab(y_aa, np.stack([t_true, t_true + s * delta_ms]))
|
||||||
|
if not (np.all(np.isfinite(Ypm)) and np.all(np.isfinite(Ybk))):
|
||||||
|
raise ValueError(f"{o['name']}: two-mode labels leave the label support at Δ = {delta_ms} ms")
|
||||||
|
banks["PM2"].append(Ypm)
|
||||||
|
banks["BK2"].append(Ybk)
|
||||||
|
diag[i] |= {"delta_ms": delta_ms, "side": s,
|
||||||
|
"PM2_warp_rmse_ms": warp_errors((t_true + s * delta_ms / 2.0)[None], R.tau_fine, t_true, R.t_main)["warp_rmse_ms"]}
|
||||||
|
return banks
|
||||||
|
|
||||||
|
|
||||||
|
def train_cell(cell: Cell, p: dict, inp: Inputs, device: str, post: dict[str, Path] | None, save_preds: bool = True,
|
||||||
|
seeds=None, budget_lists: dict[str, list[int]] | None = None) -> tuple[list[dict], list[dict], dict, dict]:
|
||||||
|
"""Returns (rows, diag, preds, meta). rows: one per (seed, method, budget, test well) with the P2r metrics.
|
||||||
|
budget_lists (dev only): {method: [budgets]} evaluated along one trajectory instead of the locked budget."""
|
||||||
|
from ml_porosity.models.bank_train import zscore_patch
|
||||||
|
from ml_porosity.registration.pipeline import register
|
||||||
|
|
||||||
|
run_d2 = load_script("11_run_d2.py")
|
||||||
|
t0 = time.time()
|
||||||
|
P2, reg, tcfg = inp.P2, inp.reg, inp.tcfg
|
||||||
|
reg_seed = int(p["registration"]["reg_seed"])
|
||||||
|
seeds = list(p["grid"]["seeds"] if seeds is None else seeds)
|
||||||
|
R = inp.realization(cell.rid, cell.preset)
|
||||||
|
obs, test = inp.observe(R, cell.c, cell.regime, cell.n_train)
|
||||||
|
X = np.stack([zscore_patch(o["seis"], R.main) for o in obs])
|
||||||
|
Xte = np.stack([zscore_patch(o["seis"], R.main) for o in test])
|
||||||
|
yt = 100 * np.stack([o["y_true"] for o in test])
|
||||||
|
N = len(obs)
|
||||||
|
out = register(R, obs, reg, reg_seed)
|
||||||
|
m0, s0 = out["norm"]
|
||||||
|
key = dict(rid=cell.rid, c=cell.c, n_train=N)
|
||||||
|
diag = [key | {"reg_seed": reg_seed, "phase": out["phase"], "lam": out["lam"], "tau_c": out["tau_c"], "well": o["name"],
|
||||||
|
"preset": cell.preset or "nominal", "backbone": cell.backbone} for o in obs]
|
||||||
|
methods = [base_name(m) for m in cell.methods]
|
||||||
|
specs = {}
|
||||||
|
old = [m for m in methods if m in REGISTER_METHODS]
|
||||||
|
if old:
|
||||||
|
specs |= run_d2.method_specs(out, P2, old)
|
||||||
|
single = lambda Y: {"kind": "bank", "Y": Y, "logpi": np.zeros((N, 1), np.float32), "lam": out["lam"]}
|
||||||
|
nb = lambda v: ((np.stack(v) - m0) / s0).astype(np.float32)
|
||||||
|
meta = {}
|
||||||
|
if any(m in POSTERIOR_METHODS + CONTROL_METHODS for m in methods):
|
||||||
|
if post is None:
|
||||||
|
raise RuntimeError(f"{cell.tag}: posterior methods requested without a posterior directory")
|
||||||
|
ph = json.loads(post["phase"].read_text())
|
||||||
|
if ph["phase0"] != out["phase"]:
|
||||||
|
raise RuntimeError(f"{cell.tag}: register phase ({out['phase']}) differs from the posterior run ({ph['phase0']})")
|
||||||
|
with np.load(post["particles"]) as smc:
|
||||||
|
smc = {k: smc[k] for k in smc.files}
|
||||||
|
banks, logpi = posterior_banks(R, obs, out, reg, ph, smc, reg_seed, diag)
|
||||||
|
specs["B3c-R"] = single(nb(banks["B3c-R"]))
|
||||||
|
specs["B3d-Sa"] = single(nb(banks["B3d-Sa"]))
|
||||||
|
specs["M2-Sa"] = {"kind": "bank", "Y": nb(banks["M2-Sa"]), "logpi": np.stack(logpi).astype(np.float32), "lam": out["lam"]}
|
||||||
|
meta["posterior"] = str(post["particles"])
|
||||||
|
if any(m in CONTROL_METHODS for m in methods):
|
||||||
|
yc, lpc = control_gp_bank(R, obs, smc, reg, reg_seed, diag)
|
||||||
|
specs["Ctl-GP"] = {"kind": "bank", "Y": nb(yc), "logpi": np.stack(lpc).astype(np.float32), "lam": out["lam"]}
|
||||||
|
if any(m in TWO_MODE_METHODS for m in methods):
|
||||||
|
banks = two_mode_banks(R, obs, float(cell.delta_ms), diag)
|
||||||
|
specs["PM2"] = single(nb(banks["PM2"]))
|
||||||
|
Ybk = nb(banks["BK2"])
|
||||||
|
lp = np.full((N, 2), -np.log(2.0), np.float32)
|
||||||
|
specs["BK2"] = {"kind": "bank", "Y": Ybk, "logpi": lp, "lam": out["lam"]}
|
||||||
|
specs["HM2"] = {"kind": "bank", "Y": Ybk, "logpi": lp, "lam": None}
|
||||||
|
missing = [m for m in methods if m not in specs]
|
||||||
|
if missing:
|
||||||
|
raise ValueError(f"no label specification for methods {missing}")
|
||||||
|
rows, preds = [], {}
|
||||||
|
suffix = "" if cell.backbone == "cnngru" else f"-{cell.backbone.upper()}"
|
||||||
|
for seed in seeds:
|
||||||
|
for m in methods:
|
||||||
|
bud = list(budget_lists[m]) if budget_lists else budget_list(p, m, cell.backbone)
|
||||||
|
for b, (mu, sg) in train_predict_any(X, Xte, specs[m], tcfg, seed, bud, device, cell.backbone).items():
|
||||||
|
mu_p, sg_p = 100 * (mu * s0 + m0), 100 * sg * s0
|
||||||
|
name = m + suffix
|
||||||
|
for w, r in zip(R.test, run_d2.evaluate(yt, mu_p, sg_p, inp.f_c)):
|
||||||
|
rows.append(key | {"seed": seed, "method": name, "budget": b, "test_well": w.name,
|
||||||
|
"regime": cell.regime, "preset": cell.preset or "nominal", "study": cell.study,
|
||||||
|
"delta_ms": cell.delta_ms} | r)
|
||||||
|
if save_preds:
|
||||||
|
preds[f"{name}/s{seed}/b{b}/mu"] = mu_p.astype(np.float32)
|
||||||
|
preds[f"{name}/s{seed}/b{b}/sigma"] = sg_p.astype(np.float32)
|
||||||
|
preds = {"y_true": yt.astype(np.float32), "test_wells": np.array([w.name for w in R.test])} | preds
|
||||||
|
meta |= {"wall_seconds": time.time() - t0, "device": device, "seeds": seeds, "methods": [m + suffix for m in methods],
|
||||||
|
"budgets": {m + suffix: (list(budget_lists[m]) if budget_lists else budget_list(p, m, cell.backbone)) for m in methods},
|
||||||
|
"registered_budgets": {m + suffix: budget_of(p, m, cell.backbone) for m in methods},
|
||||||
|
"phase": out["phase"],
|
||||||
|
"lam": out["lam"], "misspec_active": R.misspec_active, "n_train": N, "backbone": cell.backbone}
|
||||||
|
return rows, diag, preds, meta
|
||||||
@@ -16,6 +16,24 @@ Registration: logs lie on the τ axis (sonic time). True warp t(τ) = τ + b +
|
|||||||
g = c·(m_g + L z), b = c·σ_b·z_b, where (m_g, σ_g, ℓ, σ_b) come from the GP fit to the F3 anchors (scripts/09);
|
g = c·(m_g + L z), b = c·σ_b·z_b, where (m_g, σ_g, ℓ, σ_b) come from the GP fit to the F3 anchors (scripts/09);
|
||||||
z is shared across all drift factors c. Anchors: unit boundaries within the extended window, τ_k = t⁻¹(t_b),
|
z is shared across all drift factors c. Anchors: unit boundaries within the extended window, τ_k = t⁻¹(t_b),
|
||||||
t_k = t_b + ε_k, with ε_k ~ N(0, σ_a²) shared across all c.
|
t_k = t_b + ε_k, with ε_k ~ N(0, σ_a²) shared across all c.
|
||||||
|
|
||||||
|
Misspecification (phase P6, S2; docs/research/bench-generator.md). `D2Realization(..., misspec=...)` lets the
|
||||||
|
data violate the assumptions of the registration (nominal rock physics in obs["ai_log"], a stationary wavelet with
|
||||||
|
a constant phase, the F3 Matérn-3/2 warp prior) in controlled ways, on three axes:
|
||||||
|
|
||||||
|
rock_physics the earth maps φ → AI with perturbed coefficients (uniform factors; optionally a per-unit
|
||||||
|
shift of the φ–DT intercept, i.e. lithology-dependent matrix slowness) while obs["ai_log"]
|
||||||
|
keeps the nominal relation;
|
||||||
|
wavelet the true wavelet is a transformed version of the nominal one (constant phase, fractional
|
||||||
|
minimum-phase dispersion, peak-frequency factor, bulk delay) and/or a constant-Q time-variant
|
||||||
|
filter is applied in the forward model;
|
||||||
|
drift the true warp is drawn with scaled (σ_b, σ_g, ℓ), plus non-GP components: a jump of the
|
||||||
|
warp just below a horizon (a local log-slowness anomaly) and short-correlation jitter.
|
||||||
|
|
||||||
|
Common random numbers: the misspecified realization uses the same z_g, z_b, ε_a, GRF and noise draws as the
|
||||||
|
nominal one; additional draws (per-unit shifts, jitter) come from separate, rid-seeded streams, so the nominal
|
||||||
|
path consumes its random stream exactly as before. `misspec=None` (or all-nominal values) reproduces the
|
||||||
|
protocol_p2/p2r generator bit for bit (tests/test_d2_misspec.py).
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
@@ -23,13 +41,16 @@ from __future__ import annotations
|
|||||||
from dataclasses import dataclass, field
|
from dataclasses import dataclass, field
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
from scipy import signal
|
||||||
|
|
||||||
from ml_porosity.baselines.inversion import strat_map
|
from ml_porosity.baselines.inversion import strat_map
|
||||||
|
from ml_porosity.data.wavelet import rotate_phase
|
||||||
from ml_porosity.registration.labels import antialias, invert_warps
|
from ml_porosity.registration.labels import antialias, invert_warps
|
||||||
from ml_porosity.registration.tie_likelihood import fine_wavelet, forward_fine
|
from ml_porosity.registration.tie_likelihood import fine_wavelet, forward_fine
|
||||||
from ml_porosity.registration.warp_prior import WarpGrid, WarpHyper, kernel_matrix
|
from ml_porosity.registration.warp_prior import WarpGrid, WarpHyper, kernel_matrix
|
||||||
|
|
||||||
PHI_DT_A, PHI_DT_B = -0.2018, 0.0011
|
PHI_DT_A, PHI_DT_B = -0.2018, 0.0011 # φ = A + B·DT (DT in µs/m)
|
||||||
|
RHO_0, RHO_1 = 2650.0, 1600.0 # RHOB = ρ0 − ρ1·φ (kg/m³)
|
||||||
|
|
||||||
|
|
||||||
def phi_to_ai(phi: np.ndarray) -> np.ndarray:
|
def phi_to_ai(phi: np.ndarray) -> np.ndarray:
|
||||||
@@ -37,6 +58,203 @@ def phi_to_ai(phi: np.ndarray) -> np.ndarray:
|
|||||||
return (2650.0 - 1600.0 * phi) * 1e6 / dt
|
return (2650.0 - 1600.0 * phi) * 1e6 / dt
|
||||||
|
|
||||||
|
|
||||||
|
def phi_to_ai_coef(phi: np.ndarray, a: np.ndarray | float, b: float, rho0: float, rho1: float) -> np.ndarray:
|
||||||
|
"""AI for the perturbed relations φ = a + b·DT, RHOB = rho0 − rho1·φ (a may vary per sample)."""
|
||||||
|
dt = (phi - a) / b
|
||||||
|
return (rho0 - rho1 * phi) * 1e6 / dt
|
||||||
|
|
||||||
|
|
||||||
|
# ------------------------------------------------------------------ misspecification parameters
|
||||||
|
|
||||||
|
MISSPEC_DEFAULTS = {
|
||||||
|
"rock_physics": {
|
||||||
|
"dt_slope_factor": 1.0, # B → B·f (φ = A + B·DT; nominal B = 0.0011 per µs/m)
|
||||||
|
"dt_intercept_factor": 1.0, # A → A·f (nominal A = −0.2018; DT_matrix = −A/B)
|
||||||
|
"rho_slope_factor": 1.0, # ρ1 → ρ1·f (nominal 1600)
|
||||||
|
"rho_intercept_factor": 1.0, # ρ0 → ρ0·f (nominal 2650)
|
||||||
|
"unit_dt_intercept_sd": 0.0, # A → A·(1 + sd·ζ_u) per stratigraphic unit, ζ_u ~ N(0, 1) per realization
|
||||||
|
"region": "all", # wells affected: all | test | pool
|
||||||
|
},
|
||||||
|
"wavelet": {
|
||||||
|
"phase_deg": 0.0, # constant phase rotation (inside the registration's family)
|
||||||
|
"minphase_frac": 0.0, # s ∈ [0, 1]: phase spectrum s·θ_min(f) of the nominal amplitude spectrum
|
||||||
|
"peak_freq_factor": 1.0, # w(t) → w(p·t): spectrum stretched by p
|
||||||
|
"delay_ms": 0.0, # bulk timing error of the wavelet (events shifted relative to the anchors)
|
||||||
|
"Q": None, # constant-Q time-variant attenuation relative to Q_t_ref_ms (None: off)
|
||||||
|
"Q_t_ref_ms": 400.0,
|
||||||
|
"Q_dispersion": True, # Kolsky–Futterman phase (reference frequency = peak of the true wavelet)
|
||||||
|
},
|
||||||
|
"drift": {
|
||||||
|
"sigma_b_factor": 1.0,
|
||||||
|
"sigma_g_factor": 1.0,
|
||||||
|
"ell_factor": 1.0,
|
||||||
|
"step_ms": 0.0, # jump J of t(τ) just below step_horizon, independent of c
|
||||||
|
"step_width_ms": 12.0, # τ extent of the log-slowness anomaly that realises the jump
|
||||||
|
"step_horizon": "Truncation",
|
||||||
|
"jitter_sd_ms": 0.0, # Matérn-3/2 jitter of t(τ) on the warp grid (own random stream per well)
|
||||||
|
"jitter_ell_ms": 8.0,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
_STRENGTH_KEYS = {
|
||||||
|
"rock_physics": ("dt_slope_factor", "dt_intercept_factor", "rho_slope_factor", "rho_intercept_factor",
|
||||||
|
"unit_dt_intercept_sd"),
|
||||||
|
"wavelet": ("phase_deg", "minphase_frac", "peak_freq_factor", "delay_ms", "Q"),
|
||||||
|
"drift": ("sigma_b_factor", "sigma_g_factor", "ell_factor", "step_ms", "jitter_sd_ms"),
|
||||||
|
}
|
||||||
|
_RP_UNIFORM = ("dt_slope_factor", "dt_intercept_factor", "rho_slope_factor", "rho_intercept_factor")
|
||||||
|
_WV_STATIONARY = ("phase_deg", "minphase_frac", "peak_freq_factor", "delay_ms")
|
||||||
|
|
||||||
|
|
||||||
|
def normalize_misspec(spec: dict | None) -> dict:
|
||||||
|
"""Fill defaults. Unknown axes or keys raise, so a typo in a locked protocol cannot silently mean 'nominal'."""
|
||||||
|
spec = spec or {}
|
||||||
|
if unknown := set(spec) - set(MISSPEC_DEFAULTS):
|
||||||
|
raise ValueError(f"unknown misspec axes {sorted(unknown)}; expected {sorted(MISSPEC_DEFAULTS)}")
|
||||||
|
out = {}
|
||||||
|
for axis, defaults in MISSPEC_DEFAULTS.items():
|
||||||
|
sub = spec.get(axis) or {}
|
||||||
|
if unknown := set(sub) - set(defaults):
|
||||||
|
raise ValueError(f"unknown misspec keys {sorted(unknown)} in '{axis}'; expected {sorted(defaults)}")
|
||||||
|
out[axis] = {k: (sub[k] if k in sub else v) for k, v in defaults.items()}
|
||||||
|
rp = out["rock_physics"]
|
||||||
|
if rp["region"] not in ("all", "test", "pool"):
|
||||||
|
raise ValueError(f"rock_physics.region must be all | test | pool, got {rp['region']!r}")
|
||||||
|
wv = out["wavelet"]
|
||||||
|
if not 0.0 <= wv["minphase_frac"] <= 1.0 or wv["peak_freq_factor"] <= 0 or (wv["Q"] is not None and wv["Q"] <= 0):
|
||||||
|
raise ValueError("wavelet: minphase_frac ∈ [0, 1], peak_freq_factor > 0, Q > 0 or None")
|
||||||
|
dr = out["drift"]
|
||||||
|
if min(dr["sigma_b_factor"], dr["sigma_g_factor"], dr["ell_factor"]) <= 0 or dr["step_width_ms"] <= 0 \
|
||||||
|
or dr["jitter_sd_ms"] < 0 or dr["jitter_ell_ms"] <= 0:
|
||||||
|
raise ValueError("drift: factors, step_width_ms and jitter_ell_ms must be > 0, jitter_sd_ms ≥ 0")
|
||||||
|
return out
|
||||||
|
|
||||||
|
|
||||||
|
def active_axes(ms: dict) -> dict:
|
||||||
|
"""{axis: {key: value}} for the strength keys that differ from nominal (empty dict: nominal generator)."""
|
||||||
|
out = {}
|
||||||
|
for axis, keys in _STRENGTH_KEYS.items():
|
||||||
|
d = {k: ms[axis][k] for k in keys if ms[axis][k] != MISSPEC_DEFAULTS[axis][k]}
|
||||||
|
if d:
|
||||||
|
out[axis] = d
|
||||||
|
return out
|
||||||
|
|
||||||
|
|
||||||
|
def preset_misspec(cfg: dict, name: str | None) -> dict | None:
|
||||||
|
"""Look up cfg["misspec_presets"][name]; None or "nominal" gives the nominal generator."""
|
||||||
|
if name in (None, "nominal"):
|
||||||
|
return None
|
||||||
|
presets = cfg.get("misspec_presets") or {}
|
||||||
|
if name not in presets:
|
||||||
|
raise KeyError(f"misspec preset {name!r} not in config (have {sorted(presets)})")
|
||||||
|
return {k: v for k, v in presets[name].items() if k != "note"}
|
||||||
|
|
||||||
|
|
||||||
|
# ------------------------------------------------------------------ wavelet transforms (fine grid)
|
||||||
|
|
||||||
|
|
||||||
|
def _spectrum_buffer(w: np.ndarray, nfft: int) -> np.ndarray:
|
||||||
|
"""Centred odd-length wavelet → length-nfft buffer with time zero at index 0."""
|
||||||
|
return np.roll(np.concatenate([w, np.zeros(nfft - len(w))]), -(len(w) // 2))
|
||||||
|
|
||||||
|
|
||||||
|
def _extract_centred(buf: np.ndarray, n: int) -> np.ndarray:
|
||||||
|
m = n // 2
|
||||||
|
return np.concatenate([buf[-m:], buf[: m + 1]])
|
||||||
|
|
||||||
|
|
||||||
|
def peak_frequency_hz(w: np.ndarray, dt_ms: float, nfft: int = 4096) -> float:
|
||||||
|
f = np.fft.rfftfreq(nfft, dt_ms / 1000.0)
|
||||||
|
return float(f[np.argmax(np.abs(np.fft.rfft(w, nfft)))])
|
||||||
|
|
||||||
|
|
||||||
|
def fractional_minimum_phase(w: np.ndarray, frac: float, floor_db: float = -80.0) -> np.ndarray:
|
||||||
|
"""Same amplitude spectrum, phase spectrum frac·θ_min(f) (cepstral minimum-phase construction), re-centred at
|
||||||
|
the lag of maximum cross-correlation with the input so that the bulk delay is removed and only the
|
||||||
|
frequency-dependent part of the phase remains. frac = 0 returns the input (up to FFT round-off)."""
|
||||||
|
n = len(w)
|
||||||
|
nfft = 1 << int(np.ceil(np.log2(8 * n)))
|
||||||
|
x = _spectrum_buffer(w, nfft)
|
||||||
|
W = np.fft.rfft(x)
|
||||||
|
A = np.maximum(np.abs(W), 10 ** (floor_db / 20) * np.abs(W).max())
|
||||||
|
c = np.fft.irfft(np.log(A), nfft) # real cepstrum
|
||||||
|
fold = np.zeros(nfft)
|
||||||
|
fold[0], fold[nfft // 2] = c[0], c[nfft // 2]
|
||||||
|
fold[1: nfft // 2] = 2.0 * c[1: nfft // 2]
|
||||||
|
theta_min = np.imag(np.fft.rfft(fold)) # log W_min = ln A + i θ_min
|
||||||
|
y = np.fft.irfft(W * np.exp(1j * frac * theta_min), nfft)
|
||||||
|
xc = np.fft.irfft(np.fft.rfft(y) * np.conj(np.fft.rfft(x)), nfft)
|
||||||
|
lag = int(np.argmax(xc))
|
||||||
|
lag = lag - nfft if lag > nfft // 2 else lag
|
||||||
|
return _extract_centred(np.roll(y, -lag), n)
|
||||||
|
|
||||||
|
|
||||||
|
def true_stationary_wavelet(w_fine: np.ndarray, dt_ms: float, wv: dict) -> np.ndarray:
|
||||||
|
"""Stationary part of the true wavelet on the fine grid: peak-frequency scaling, fractional minimum phase,
|
||||||
|
constant phase rotation, bulk delay, then a Tukey taper (outer 1/8 of each side) and unit peak."""
|
||||||
|
n = len(w_fine)
|
||||||
|
tf = (np.arange(n) - n // 2) * dt_ms
|
||||||
|
w = w_fine.astype(float)
|
||||||
|
if wv["peak_freq_factor"] != 1.0:
|
||||||
|
w = np.interp(wv["peak_freq_factor"] * tf, tf, w, left=0.0, right=0.0)
|
||||||
|
if wv["minphase_frac"] != 0.0:
|
||||||
|
w = fractional_minimum_phase(w, wv["minphase_frac"])
|
||||||
|
if wv["phase_deg"] != 0.0:
|
||||||
|
w = rotate_phase(w, wv["phase_deg"])
|
||||||
|
if wv["delay_ms"] != 0.0:
|
||||||
|
k = int(round(wv["delay_ms"] / dt_ms))
|
||||||
|
w = np.roll(w, k)
|
||||||
|
if k > 0:
|
||||||
|
w[:k] = 0.0
|
||||||
|
elif k < 0:
|
||||||
|
w[k:] = 0.0
|
||||||
|
w = w * signal.windows.tukey(n, 0.25)
|
||||||
|
return w / np.max(np.abs(w))
|
||||||
|
|
||||||
|
|
||||||
|
def q_kernel(w_fine: np.ndarray, dt_ms: float, Q: float, delta_t_ms: float, dispersion: bool, f_ref_hz: float,
|
||||||
|
half_len: int = 256) -> np.ndarray:
|
||||||
|
"""Wavelet after constant-Q propagation over delta_t_ms relative to the reference time: amplitude
|
||||||
|
exp(−π f Δt/Q), Kolsky–Futterman phase (2 f Δt/Q)·ln(f/f_ref) (slower below f_ref, faster above). Returns a
|
||||||
|
centred kernel of length 2·half_len + 1 on the fine grid."""
|
||||||
|
n = len(w_fine)
|
||||||
|
nfft = 1 << int(np.ceil(np.log2(4 * max(n, 2 * half_len + 1))))
|
||||||
|
f = np.fft.rfftfreq(nfft, dt_ms / 1000.0)
|
||||||
|
W = np.fft.rfft(_spectrum_buffer(w_fine, nfft))
|
||||||
|
dts = delta_t_ms / 1000.0
|
||||||
|
H = np.exp(-np.pi * f * dts / Q)
|
||||||
|
if dispersion:
|
||||||
|
with np.errstate(divide="ignore"):
|
||||||
|
ph = np.where(f > 0, 2.0 * f * dts / Q * np.log(np.maximum(f, 1e-12) / f_ref_hz), 0.0)
|
||||||
|
H = H * np.exp(1j * ph)
|
||||||
|
return _extract_centred(np.fft.irfft(W * H, nfft), 2 * half_len + 1)
|
||||||
|
|
||||||
|
|
||||||
|
def forward_fine_q(ai: np.ndarray, t_fine: np.ndarray, t_out: np.ndarray, w_fine: np.ndarray, Q: float,
|
||||||
|
t_ref_ms: float, dispersion: bool, f_ref_hz: float, bank_dt_ms: float = 50.0) -> np.ndarray:
|
||||||
|
"""forward_fine with a constant-Q time-variant wavelet: the reflectivity at time t′ is convolved with the
|
||||||
|
kernel q_kernel(t′ − t_ref). Kernels are tabulated every bank_dt_ms and interpolated linearly in t′ (the
|
||||||
|
operator varies as exp(−π f Δt/Q), so the interpolation error is second order in bank_dt/Q)."""
|
||||||
|
ai = np.atleast_2d(ai)
|
||||||
|
r = (ai[:, 1:] - ai[:, :-1]) / (ai[:, 1:] + ai[:, :-1])
|
||||||
|
tm = 0.5 * (t_fine[1:] + t_fine[:-1])
|
||||||
|
d = t_fine[1] - t_fine[0]
|
||||||
|
half = 256
|
||||||
|
pad = half * d + bank_dt_ms
|
||||||
|
tb = np.arange(t_out[0] - pad, t_out[-1] + pad + bank_dt_ms / 2, bank_dt_ms)
|
||||||
|
idx = np.clip(np.searchsorted(tb, tm) - 1, 0, len(tb) - 2)
|
||||||
|
lam = np.clip((tm - tb[idx]) / bank_dt_ms, 0.0, 1.0)
|
||||||
|
s = np.zeros_like(r)
|
||||||
|
for k, t_k in enumerate(tb):
|
||||||
|
wk = np.where(idx == k, 1.0 - lam, 0.0) + np.where(idx == k - 1, lam, 0.0)
|
||||||
|
if np.any(wk > 0):
|
||||||
|
ker = q_kernel(w_fine, d, Q, t_k - t_ref_ms, dispersion, f_ref_hz, half)
|
||||||
|
s += signal.fftconvolve(r * wk[None, :], ker[None, :], mode="same", axes=1)
|
||||||
|
return np.stack([np.interp(t_out, tm, si) for si in s])
|
||||||
|
|
||||||
|
|
||||||
|
# ------------------------------------------------------------------ earth model primitives
|
||||||
|
|
||||||
|
|
||||||
def ou_process(n: int, d: float, sd: float, ell: float, rng) -> np.ndarray:
|
def ou_process(n: int, d: float, sd: float, ell: float, rng) -> np.ndarray:
|
||||||
rho = np.exp(-d / ell)
|
rho = np.exp(-d / ell)
|
||||||
e = rng.standard_normal(n) * sd * np.sqrt(1 - rho**2)
|
e = rng.standard_normal(n) * sd * np.sqrt(1 - rho**2)
|
||||||
@@ -86,10 +304,20 @@ class D2Well:
|
|||||||
|
|
||||||
|
|
||||||
class D2Realization:
|
class D2Realization:
|
||||||
"""A single realization: earth model, pseudo-well locations, noise, and standard normal draws for drift/picks."""
|
"""A single realization: earth model, pseudo-well locations, noise, and standard normal draws for drift/picks.
|
||||||
|
|
||||||
def __init__(self, cfg: dict, rid: int, hg: HorizonGrid, drift: WarpHyper, wavelet: np.ndarray):
|
misspec: None (nominal) or {"rock_physics": {...}, "wavelet": {...}, "drift": {...}} with the keys of
|
||||||
|
MISSPEC_DEFAULTS. The normalised parameters are stored in `misspec`, the non-nominal ones in `misspec_active`.
|
||||||
|
`wavelet`/`w_fine` are the stationary true wavelet (the nominal objects when the wavelet axis is nominal);
|
||||||
|
`wavelet_nominal`/`w_fine_nominal` the analyst's reference; `drift_true` the hyperparameters the truth is
|
||||||
|
drawn from (`drift` when nominal)."""
|
||||||
|
|
||||||
|
def __init__(self, cfg: dict, rid: int, hg: HorizonGrid, drift: WarpHyper, wavelet: np.ndarray,
|
||||||
|
misspec: dict | None = None):
|
||||||
self.cfg, self.rid, self.drift = cfg, rid, drift
|
self.cfg, self.rid, self.drift = cfg, rid, drift
|
||||||
|
self.misspec = normalize_misspec(misspec)
|
||||||
|
self.misspec_active = active_axes(self.misspec)
|
||||||
|
self.misspec_info = {"monotone_repairs": 0}
|
||||||
rng = np.random.default_rng([int(rid), 20261026])
|
rng = np.random.default_rng([int(rid), 20261026])
|
||||||
f = cfg["fine_dt_ms"]
|
f = cfg["fine_dt_ms"]
|
||||||
self.dt = cfg["dt_ms"]
|
self.dt = cfg["dt_ms"]
|
||||||
@@ -101,8 +329,10 @@ class D2Realization:
|
|||||||
self.t_ext = np.arange(e0, e1 + self.dt / 2, self.dt)
|
self.t_ext = np.arange(e0, e1 + self.dt / 2, self.dt)
|
||||||
self.main = (self.t_ext >= m0) & (self.t_ext <= m1)
|
self.main = (self.t_ext >= m0) & (self.t_ext <= m1)
|
||||||
self.t_main = self.t_ext[self.main]
|
self.t_main = self.t_ext[self.main]
|
||||||
self.wavelet = wavelet
|
self.wavelet_nominal = wavelet
|
||||||
self.w_fine = fine_wavelet(wavelet, int(round(self.dt / f)))
|
self.w_fine_nominal = fine_wavelet(wavelet, int(round(self.dt / f)))
|
||||||
|
self.wavelet, self.w_fine = self._true_wavelet()
|
||||||
|
self.f_ref_hz = peak_frequency_hz(self.w_fine, f)
|
||||||
|
|
||||||
# Stratigraphic framework
|
# Stratigraphic framework
|
||||||
valid = hg.valid_mask(cfg["min_gap_ms"], cfg["patch_radius"])
|
valid = hg.valid_mask(cfg["min_gap_ms"], cfg["patch_radius"])
|
||||||
@@ -142,6 +372,18 @@ class D2Realization:
|
|||||||
self.xy_c, self.xy_s = xy_all.mean(0), np.ptp(xy_all, 0) / 2
|
self.xy_c, self.xy_s = xy_all.mean(0), np.ptp(xy_all, 0) / 2
|
||||||
Kg = kernel_matrix(self.grid.tau, self.grid.tau, 1.0, drift.ell_ms, drift.kernel)
|
Kg = kernel_matrix(self.grid.tau, self.grid.tau, 1.0, drift.ell_ms, drift.kernel)
|
||||||
self.Lg = np.linalg.cholesky(Kg + 1e-8 * np.eye(self.grid.n))
|
self.Lg = np.linalg.cholesky(Kg + 1e-8 * np.eye(self.grid.n))
|
||||||
|
self.drift_true, self.Lg_true = self._true_drift()
|
||||||
|
|
||||||
|
# Misspecification draws from separate streams (the nominal stream `rng` is consumed exactly as before)
|
||||||
|
rp = self.misspec["rock_physics"]
|
||||||
|
self.unit_dt_shift = None
|
||||||
|
if rp["unit_dt_intercept_sd"] > 0:
|
||||||
|
self.unit_dt_shift = rp["unit_dt_intercept_sd"] * np.random.default_rng([int(rid), 20261029, 1]).standard_normal(nu)
|
||||||
|
dr = self.misspec["drift"]
|
||||||
|
self.Lj = None
|
||||||
|
if dr["jitter_sd_ms"] > 0:
|
||||||
|
Kj = kernel_matrix(self.grid.tau, self.grid.tau, 1.0, dr["jitter_ell_ms"], "matern32")
|
||||||
|
self.Lj = np.linalg.cholesky(Kj + 1e-8 * np.eye(self.grid.n))
|
||||||
|
|
||||||
self.wells: list[D2Well] = []
|
self.wells: list[D2Well] = []
|
||||||
for tag, idx in [("T", test), ("P", train)]:
|
for tag, idx in [("T", test), ("P", train)]:
|
||||||
@@ -149,6 +391,83 @@ class D2Realization:
|
|||||||
self.wells.append(self._make_well(f"{tag}{n:02d}", int(il_all[k]), int(xl_all[k]), rng))
|
self.wells.append(self._make_well(f"{tag}{n:02d}", int(il_all[k]), int(xl_all[k]), rng))
|
||||||
self.test = self.wells[: W["n_test"]]
|
self.test = self.wells[: W["n_test"]]
|
||||||
self.pool = self.wells[W["n_test"]:]
|
self.pool = self.wells[W["n_test"]:]
|
||||||
|
if self.Lj is not None:
|
||||||
|
for k, w in enumerate(self.wells):
|
||||||
|
w.extra["z_jitter"] = np.random.default_rng([int(rid), 20261029, 2, k]).standard_normal(self.grid.n)
|
||||||
|
|
||||||
|
# ------------------------------------------------------------ misspecified truth
|
||||||
|
|
||||||
|
def _true_wavelet(self) -> tuple[np.ndarray, np.ndarray]:
|
||||||
|
wv = self.misspec["wavelet"]
|
||||||
|
if all(wv[k] == MISSPEC_DEFAULTS["wavelet"][k] for k in _WV_STATIONARY):
|
||||||
|
return self.wavelet_nominal, self.w_fine_nominal
|
||||||
|
fac = int(round(self.dt / self.cfg["fine_dt_ms"]))
|
||||||
|
w_fine = true_stationary_wavelet(self.w_fine_nominal, self.cfg["fine_dt_ms"], wv)
|
||||||
|
return w_fine[::fac].copy(), w_fine
|
||||||
|
|
||||||
|
def _true_drift(self) -> tuple[WarpHyper, np.ndarray]:
|
||||||
|
dr, d = self.misspec["drift"], self.drift
|
||||||
|
if dr["sigma_b_factor"] == 1.0 and dr["sigma_g_factor"] == 1.0 and dr["ell_factor"] == 1.0:
|
||||||
|
return d, self.Lg
|
||||||
|
h = WarpHyper(d.m_g, d.sigma_g * dr["sigma_g_factor"], d.ell_ms * dr["ell_factor"],
|
||||||
|
d.sigma_b_ms * dr["sigma_b_factor"], d.sigma_a_ms, d.kernel)
|
||||||
|
Lg = self.Lg
|
||||||
|
if dr["ell_factor"] != 1.0:
|
||||||
|
Kg = kernel_matrix(self.grid.tau, self.grid.tau, 1.0, h.ell_ms, h.kernel)
|
||||||
|
Lg = np.linalg.cholesky(Kg + 1e-8 * np.eye(self.grid.n))
|
||||||
|
return h, Lg
|
||||||
|
|
||||||
|
def rp_applies(self, name: str) -> bool:
|
||||||
|
"""Whether the rock-physics misspecification acts on the well `name` (region all | test | pool)."""
|
||||||
|
rp = self.misspec["rock_physics"]
|
||||||
|
if "rock_physics" not in self.misspec_active:
|
||||||
|
return False
|
||||||
|
return rp["region"] == "all" or (rp["region"] == "test") == name.startswith("T")
|
||||||
|
|
||||||
|
def phi_to_ai_true(self, phi: np.ndarray, unit: np.ndarray | None = None) -> np.ndarray:
|
||||||
|
"""The earth's φ → AI mapping under the rock-physics misspecification (nominal relations when the axis is
|
||||||
|
nominal). `unit`: stratigraphic unit index per sample, required when unit_dt_intercept_sd > 0."""
|
||||||
|
if "rock_physics" not in self.misspec_active:
|
||||||
|
return phi_to_ai(phi)
|
||||||
|
rp = self.misspec["rock_physics"]
|
||||||
|
a = PHI_DT_A * rp["dt_intercept_factor"]
|
||||||
|
if self.unit_dt_shift is not None:
|
||||||
|
if unit is None:
|
||||||
|
raise ValueError("unit index required for the per-unit intercept shift")
|
||||||
|
a = a * (1.0 + self.unit_dt_shift[np.asarray(unit)])
|
||||||
|
return phi_to_ai_coef(phi, a, PHI_DT_B * rp["dt_slope_factor"], RHO_0 * rp["rho_intercept_factor"],
|
||||||
|
RHO_1 * rp["rho_slope_factor"])
|
||||||
|
|
||||||
|
def ai_log_true(self, w: D2Well, obs: dict) -> np.ndarray:
|
||||||
|
"""True AI on the τ axis of the log (what a forward model with the true rock physics would use); equals
|
||||||
|
obs["ai_log"] when the rock physics is nominal for this well."""
|
||||||
|
if not self.rp_applies(w.name):
|
||||||
|
return phi_to_ai(obs["phi_log"])
|
||||||
|
unit = None
|
||||||
|
if self.unit_dt_shift is not None:
|
||||||
|
unit = np.searchsorted(self.S_ref, strat_map(obs["t_of_tau_true"], self.hg.at(w.il, w.xl), self.h_ref))
|
||||||
|
return self.phi_to_ai_true(obs["phi_log"], unit)
|
||||||
|
|
||||||
|
def true_wavelet_at(self, t_ms: float) -> np.ndarray:
|
||||||
|
"""Effective fine wavelet for a reflector at true time t_ms (the stationary wavelet unless Q is set)."""
|
||||||
|
wv = self.misspec["wavelet"]
|
||||||
|
if wv["Q"] is None:
|
||||||
|
return self.w_fine
|
||||||
|
return q_kernel(self.w_fine, self.cfg["fine_dt_ms"], wv["Q"], t_ms - wv["Q_t_ref_ms"], wv["Q_dispersion"],
|
||||||
|
self.f_ref_hz)
|
||||||
|
|
||||||
|
def _ai_true(self, phi: np.ndarray, h_bin: np.ndarray, name: str) -> np.ndarray:
|
||||||
|
if not self.rp_applies(name):
|
||||||
|
return phi_to_ai(phi)
|
||||||
|
unit = self._unit_index(h_bin)[1] if self.unit_dt_shift is not None else None
|
||||||
|
return self.phi_to_ai_true(phi, unit)
|
||||||
|
|
||||||
|
def _forward(self, ai: np.ndarray) -> np.ndarray:
|
||||||
|
wv = self.misspec["wavelet"]
|
||||||
|
if wv["Q"] is None:
|
||||||
|
return forward_fine(ai, self.t_fine, self.t_ext, self.w_fine)
|
||||||
|
return forward_fine_q(ai, self.t_fine, self.t_ext, self.w_fine, wv["Q"], wv["Q_t_ref_ms"], wv["Q_dispersion"],
|
||||||
|
self.f_ref_hz)
|
||||||
|
|
||||||
# ------------------------------------------------------------ earth model
|
# ------------------------------------------------------------ earth model
|
||||||
|
|
||||||
@@ -161,9 +480,13 @@ class D2Realization:
|
|||||||
s += [h_ref[-1] + k * sub_ms for k in range(0, int((t1 - h_ref[-1]) // sub_ms) + 1)]
|
s += [h_ref[-1] + k * sub_ms for k in range(0, int((t1 - h_ref[-1]) // sub_ms) + 1)]
|
||||||
return np.array(s)
|
return np.array(s)
|
||||||
|
|
||||||
def _phi_trace(self, h_bin, xy, grf_s, s_axis):
|
def _unit_index(self, h_bin) -> tuple[np.ndarray, np.ndarray]:
|
||||||
|
"""Stratigraphic coordinate and unit index of t_fine at a bin with horizon times h_bin."""
|
||||||
s = strat_map(self.t_fine, h_bin, self.h_ref)
|
s = strat_map(self.t_fine, h_bin, self.h_ref)
|
||||||
unit = np.searchsorted(self.S_ref, s)
|
return s, np.searchsorted(self.S_ref, s)
|
||||||
|
|
||||||
|
def _phi_trace(self, h_bin, xy, grf_s, s_axis):
|
||||||
|
s, unit = self._unit_index(h_bin)
|
||||||
u = (np.asarray(xy) - self.xy_c) / self.xy_s
|
u = (np.asarray(xy) - self.xy_c) / self.xy_s
|
||||||
off = self.unit_off[unit] + self.unit_grad[unit] @ u
|
off = self.unit_off[unit] + self.unit_grad[unit] @ u
|
||||||
phi = self.phi0 + self.cfg["property"]["slope_per_100ms"] * (self.t_fine - 850.0) / 100.0 + off
|
phi = self.phi0 + self.cfg["property"]["slope_per_100ms"] * (self.t_fine - 850.0) / 100.0 + off
|
||||||
@@ -183,10 +506,11 @@ class D2Realization:
|
|||||||
phi = self._phi_trace(h, xy, grf, s_axis)
|
phi = self._phi_trace(h, xy, grf, s_axis)
|
||||||
if di == 0 and dj == 0:
|
if di == 0 and dj == 0:
|
||||||
phi_c = phi
|
phi_c = phi
|
||||||
traces.append(phi_to_ai(phi))
|
traces.append(self._ai_true(phi, h, name))
|
||||||
seis = forward_fine(np.stack(traces), self.t_fine, self.t_ext, self.w_fine)
|
seis = self._forward(np.stack(traces))
|
||||||
white = rng.standard_normal((len(traces), len(self.t_ext) + len(self.wavelet)))
|
wn_len = len(self.wavelet_nominal)
|
||||||
noise = np.stack([np.convolve(wn, self.wavelet, "same")[len(self.wavelet) // 2: len(self.wavelet) // 2 + len(self.t_ext)]
|
white = rng.standard_normal((len(traces), len(self.t_ext) + wn_len))
|
||||||
|
noise = np.stack([np.convolve(wn, self.wavelet_nominal, "same")[wn_len // 2: wn_len // 2 + len(self.t_ext)]
|
||||||
for wn in white])
|
for wn in white])
|
||||||
noise /= noise[len(traces) // 2].std()
|
noise /= noise[len(traces) // 2].std()
|
||||||
h0 = self.hg.at(il, xl)
|
h0 = self.hg.at(il, xl)
|
||||||
@@ -199,15 +523,56 @@ class D2Realization:
|
|||||||
# ------------------------------------------------------------ observations per cell configuration
|
# ------------------------------------------------------------ observations per cell configuration
|
||||||
|
|
||||||
def true_warp(self, w: D2Well, c: float) -> tuple[float, np.ndarray]:
|
def true_warp(self, w: D2Well, c: float) -> tuple[float, np.ndarray]:
|
||||||
d = self.drift
|
"""(b, g) of the true warp on the warp grid: the GP part scaled by c, plus the step anomaly (drift
|
||||||
g = c * (d.m_g + d.sigma_g * (self.Lg @ w.z_g))
|
misspecification) folded into g. The jitter component is not representable by g; see true_warp_grid."""
|
||||||
return c * d.sigma_b_ms * w.z_b, g
|
d = self.drift_true
|
||||||
|
g = c * (d.m_g + d.sigma_g * (self.Lg_true @ w.z_g))
|
||||||
|
b = c * d.sigma_b_ms * w.z_b
|
||||||
|
if self.misspec["drift"]["step_ms"] != 0.0:
|
||||||
|
g = self._add_step(w, b, g)
|
||||||
|
return b, g
|
||||||
|
|
||||||
|
def _add_step(self, w: D2Well, b: float, g: np.ndarray) -> np.ndarray:
|
||||||
|
"""Jump J of t(τ) just below the step horizon: g += a on the first n_w grid nodes after τ_h = t⁻¹(t_h),
|
||||||
|
with a = ln(1 + J / (Δτ Σ e^{g_i})) so that the trapezoid integral gives exactly J below the anomaly."""
|
||||||
|
dr = self.misspec["drift"]
|
||||||
|
t_h = float(self.hg.at(w.il, w.xl)[self.cfg["horizons"].index(dr["step_horizon"])])
|
||||||
|
t_grid = self.grid.t_of_tau(b, g)[0]
|
||||||
|
tau_h = np.interp(t_h, t_grid, self.grid.tau)
|
||||||
|
n_w = max(1, int(round(dr["step_width_ms"] / self.grid.dtau)))
|
||||||
|
i0 = int(np.searchsorted(self.grid.tau, tau_h, side="right"))
|
||||||
|
nodes = np.arange(max(i0, 1), min(i0 + n_w, self.grid.n - 1))
|
||||||
|
if len(nodes) == 0:
|
||||||
|
raise ValueError(f"{w.name}: step horizon {dr['step_horizon']} at t = {t_h} ms lies outside the warp grid")
|
||||||
|
s = self.grid.dtau * np.exp(g[nodes]).sum()
|
||||||
|
if dr["step_ms"] <= -s:
|
||||||
|
raise ValueError(f"{w.name}: step_ms = {dr['step_ms']} would make the warp non-monotone (min {-s:.2f} ms)")
|
||||||
|
g = g.copy()
|
||||||
|
g[nodes] += np.log1p(dr["step_ms"] / s)
|
||||||
|
return g
|
||||||
|
|
||||||
|
def true_warp_grid(self, w: D2Well, c: float) -> np.ndarray:
|
||||||
|
"""t(τ) on the warp grid including every misspecified component (identical to grid.t_of_tau(b, g) unless
|
||||||
|
jitter is set)."""
|
||||||
|
b, g = self.true_warp(w, c)
|
||||||
|
return self._warp_grid(w, b, g)
|
||||||
|
|
||||||
|
def _warp_grid(self, w: D2Well, b: float, g: np.ndarray) -> np.ndarray:
|
||||||
|
t = self.grid.t_of_tau(b, g)[0]
|
||||||
|
if self.Lj is not None:
|
||||||
|
t = t + self.misspec["drift"]["jitter_sd_ms"] * (self.Lj @ w.extra["z_jitter"])
|
||||||
|
dmin = 0.1 * self.grid.dtau
|
||||||
|
dt = np.diff(t)
|
||||||
|
if np.any(dt < dmin): # safeguard: keep t(τ) strictly increasing (counted)
|
||||||
|
self.misspec_info["monotone_repairs"] += int(np.sum(dt < dmin))
|
||||||
|
t = t[0] + np.concatenate([[0.0], np.cumsum(np.maximum(dt, dmin))])
|
||||||
|
return t
|
||||||
|
|
||||||
def observe(self, w: D2Well, c: float, snr_db: float | None, sigma_a_ms: float,
|
def observe(self, w: D2Well, c: float, snr_db: float | None, sigma_a_ms: float,
|
||||||
anchor_density: str = "full") -> dict:
|
anchor_density: str = "full") -> dict:
|
||||||
"""Data for one well at drift factor c: noisy seismic, logs on τ, anchors and the true warp."""
|
"""Data for one well at drift factor c: noisy seismic, logs on τ, anchors and the true warp."""
|
||||||
b, g = self.true_warp(w, c)
|
b, g = self.true_warp(w, c)
|
||||||
t_tau_grid = self.grid.t_of_tau(b, g)[0]
|
t_tau_grid = self._warp_grid(w, b, g)
|
||||||
t_tau = np.interp(self.tau_fine, self.grid.tau, t_tau_grid)
|
t_tau = np.interp(self.tau_fine, self.grid.tau, t_tau_grid)
|
||||||
if t_tau[0] < self.t_fine[0] or t_tau[-1] > self.t_fine[-1]:
|
if t_tau[0] < self.t_fine[0] or t_tau[-1] > self.t_fine[-1]:
|
||||||
raise ValueError(f"{w.name}: warp extends outside the earth-model domain (c = {c})")
|
raise ValueError(f"{w.name}: warp extends outside the earth-model domain (c = {c})")
|
||||||
|
|||||||
@@ -52,6 +52,12 @@ def bank_loss(mu, sigma, Y, logpi, starts, win: int, lam: float | None):
|
|||||||
return -(v / (lam * win)).mean()
|
return -(v / (lam * win)).mean()
|
||||||
|
|
||||||
|
|
||||||
|
def responsibilities(mu, sigma, Y, logpi, starts, win: int, lam: float):
|
||||||
|
"""r (B, J, S) = softmax_s(log π_s + λ ℓ_wjs): the weights of Lemma 3 (∇ RML = −(1/n) Σ_s r_s ∇ℓ_s)."""
|
||||||
|
ll = window_loglik(mu, sigma, Y, starts, win)
|
||||||
|
return torch.softmax(logpi[:, None, :] + lam * ll, dim=-1)
|
||||||
|
|
||||||
|
|
||||||
def mse_bank_loss(mu, Y, starts, win: int):
|
def mse_bank_loss(mu, Y, starts, win: int):
|
||||||
"""Mean MSE over the labels of the bank (H1: the optimum is the label blurred by p_δ)."""
|
"""Mean MSE over the labels of the bank (H1: the optimum is the label blurred by p_δ)."""
|
||||||
m = gather_windows(mu, starts, win)[:, :, None, :]
|
m = gather_windows(mu, starts, win)[:, :, None, :]
|
||||||
|
|||||||
@@ -37,9 +37,10 @@ def zscore_patch(seis: np.ndarray, sel: np.ndarray) -> np.ndarray:
|
|||||||
|
|
||||||
|
|
||||||
def train_predict(X: np.ndarray, Xte: np.ndarray, spec: dict, cfg: dict, seed: int, budgets: list[int],
|
def train_predict(X: np.ndarray, Xte: np.ndarray, spec: dict, cfg: dict, seed: int, budgets: list[int],
|
||||||
device: str) -> dict[int, tuple[np.ndarray, np.ndarray]]:
|
device: str, on_budget=None) -> dict[int, tuple[np.ndarray, np.ndarray]]:
|
||||||
"""X (N, C, L), Xte (M, C, L); labels in spec are already standardised. Returns {budget: (μ, σ)} for
|
"""X (N, C, L), Xte (M, C, L); labels in spec are already standardised. Returns {budget: (μ, σ)} for
|
||||||
Xte (M, L), on the standardised scale."""
|
Xte (M, L), on the standardised scale. on_budget (optional): callback on_budget(step, model) invoked right
|
||||||
|
after the predictions at each budget step (model in eval mode); the default None leaves the loop unchanged."""
|
||||||
# Same RNG stream as torch.manual_seed, but only touches the selected device: manual_seed_all opens a CUDA
|
# Same RNG stream as torch.manual_seed, but only touches the selected device: manual_seed_all opens a CUDA
|
||||||
# context on every visible GPU (shared machine).
|
# context on every visible GPU (shared machine).
|
||||||
torch.default_generator.manual_seed(seed)
|
torch.default_generator.manual_seed(seed)
|
||||||
@@ -80,4 +81,6 @@ def train_predict(X: np.ndarray, Xte: np.ndarray, spec: dict, cfg: dict, seed: i
|
|||||||
opt.step()
|
opt.step()
|
||||||
if step in budgets:
|
if step in budgets:
|
||||||
out[step] = predict(model, Xte, device)
|
out[step] = predict(model, Xte, device)
|
||||||
|
if on_budget is not None:
|
||||||
|
on_budget(step, model)
|
||||||
return out
|
return out
|
||||||
|
|||||||
27
operations/p6_s1_watcher.sh
Executable file
27
operations/p6_s1_watcher.sh
Executable file
@@ -0,0 +1,27 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# P6 S1 launcher: waits for GPU headroom on the shared H200s, then starts the S1 drivers in tmux.
|
||||||
|
# Two disjoint regime groups (the runner does not claim jobs, so drivers must not overlap):
|
||||||
|
# A = R10 Rm5 R0 (protocol priority), B = R0h R10tb (cut first if late).
|
||||||
|
# A slot starts on a card only when free memory stays >= 2500 MiB + 2 workers x 1600 MiB on two
|
||||||
|
# readings one minute apart; workers = min(4, (free - 2500) / 1600). Never touches other jobs.
|
||||||
|
set -u
|
||||||
|
cd "$(dirname "$0")/.."
|
||||||
|
groups=("R10 Rm5 R0" "R0h R10tb"); names=(p6_s1a p6_s1b); next=0
|
||||||
|
log() { echo "$(date -u +%FT%TZ) $*"; }
|
||||||
|
free_mib() { nvidia-smi --query-gpu=memory.free --format=csv,noheader,nounits -i "$1" | tr -d ' '; }
|
||||||
|
log "watcher start"
|
||||||
|
while (( next < ${#groups[@]} )); do
|
||||||
|
for g in 0 1; do
|
||||||
|
(( next < ${#groups[@]} )) || break
|
||||||
|
f1=$(free_mib $g); (( f1 >= 5700 )) || continue
|
||||||
|
sleep 60; f2=$(free_mib $g); f=$(( f1 < f2 ? f1 : f2 )); (( f >= 5700 )) || continue
|
||||||
|
w=$(( (f - 2500) / 1600 )); (( w > 4 )) && w=4
|
||||||
|
n=${names[$next]}; r=${groups[$next]}
|
||||||
|
tmux new-session -d -s "$n" -c "$PWD" \
|
||||||
|
"env STUDIES=S1 REGIMES='$r' DEVICE=cuda:$g WORKERS=$w MEM_GB=2 scripts/run_bench.sh posterior train >> logs/bench_${n}_cuda$g.out 2>&1"
|
||||||
|
log "launched $n regimes=[$r] cuda:$g workers=$w (free ${f1}/${f2} MiB)"
|
||||||
|
next=$(( next + 1 )); sleep 300 # let the new workers allocate before the next reading
|
||||||
|
done
|
||||||
|
sleep 300
|
||||||
|
done
|
||||||
|
log "all S1 groups launched; watcher exits"
|
||||||
176
operations/p6_supervisor.py
Normal file
176
operations/p6_supervisor.py
Normal file
@@ -0,0 +1,176 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
"""P6 run supervisor (outside the protocol_bench lock; launches only scripts/run_bench.sh).
|
||||||
|
|
||||||
|
Every CYCLE seconds it logs a GPU snapshot and, for each driver spec:
|
||||||
|
* a dead, unfinished driver is relaunched in the user's tmux server on the card with the most free
|
||||||
|
memory, workers = min(target, (free - RESERVE) / PER_WORKER); it waits if neither card has room;
|
||||||
|
* when a driver finishes, its workers go to the unfinished driver with the most remaining jobs
|
||||||
|
(restart with more workers, at most CAP_DRIVER; in-flight jobs of that driver are lost and redone).
|
||||||
|
Drivers resume by fingerprint, so restarts never change results. Other users' processes are never touched.
|
||||||
|
"""
|
||||||
|
import json, os, re, signal, subprocess, time
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
REPO = Path(__file__).resolve().parents[1]
|
||||||
|
STATE = REPO / "logs" / "p6_supervisor_state.json"
|
||||||
|
CYCLE, RESERVE, PER_WORKER = 300, 2500, 1700 # s, MiB kept free for others, MiB per SMC worker (measured 1556)
|
||||||
|
W_TOTAL, CAP_DRIVER, CAP_CARD, MAX_RESTARTS, MIN_BOOST_JOBS = 36, 16, 24, 5, 10
|
||||||
|
|
||||||
|
SPECS = { # adopted drivers launched at 16:07 UTC 29/10
|
||||||
|
"p6_s2": dict(studies="S2", regimes="", stages="posterior train", device="cuda:1", workers=6, log="logs/bench_s2_cuda1.out"),
|
||||||
|
"p6_s1a": dict(studies="S1", regimes="R10 Rm5 R0", stages="posterior train", device="cuda:0", workers=5, log="logs/bench_s1a_cuda0.out"),
|
||||||
|
"p6_s1b": dict(studies="S1", regimes="R0h R10tb", stages="posterior train", device="cuda:1", workers=2, log="logs/bench_s1b_cuda1.out"),
|
||||||
|
"p6_s348": dict(studies="S3 S4 S8", regimes="", stages="train", device="cuda:0", workers=4, log="logs/bench_s348_cuda0.out"),
|
||||||
|
# 30/10 01:05 UTC: p6_s1b split into two disjoint regime drivers to use the freed CPUs/GPUs
|
||||||
|
"p6_s1b_r0h": dict(studies="S1", regimes="R0h", stages="posterior train", device="cuda:0", workers=14, log="logs/bench_s1b_r0h_cuda0.out"),
|
||||||
|
"p6_s1b_r10tb": dict(studies="S1", regimes="R10tb", stages="posterior train", device="cuda:1", workers=14, log="logs/bench_s1b_r10tb_cuda1.out"),
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def log(msg):
|
||||||
|
print(time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime()), msg, flush=True)
|
||||||
|
|
||||||
|
|
||||||
|
def sh(cmd):
|
||||||
|
return subprocess.run(cmd, shell=True, capture_output=True, text=True).stdout.strip()
|
||||||
|
|
||||||
|
|
||||||
|
def gpus():
|
||||||
|
out = sh("nvidia-smi --query-gpu=index,memory.free,memory.used,utilization.gpu --format=csv,noheader,nounits")
|
||||||
|
return {f"cuda:{r[0]}": dict(free=int(r[1]), used=int(r[2]), util=int(r[3]))
|
||||||
|
for r in (list(map(str.strip, l.split(","))) for l in out.splitlines())}
|
||||||
|
|
||||||
|
|
||||||
|
def alive(name):
|
||||||
|
return subprocess.run(["tmux", "has-session", "-t", name], capture_output=True).returncode == 0
|
||||||
|
|
||||||
|
|
||||||
|
def tail_info(path):
|
||||||
|
"""(last runlog line, last progress (stage, k, n)) of a driver log."""
|
||||||
|
try:
|
||||||
|
lines = (REPO / path).read_text(errors="replace").splitlines()[-4000:]
|
||||||
|
except FileNotFoundError:
|
||||||
|
return None, None
|
||||||
|
rl = next((l for l in reversed(lines) if l.startswith("[runlog]")), None)
|
||||||
|
pr = None
|
||||||
|
for l in reversed(lines):
|
||||||
|
m = re.match(r"\[(posterior|train):[^ ]+ (\d+)/(\d+)\]", l)
|
||||||
|
if m:
|
||||||
|
pr = (m.group(1), int(m.group(2)), int(m.group(3)))
|
||||||
|
break
|
||||||
|
return rl, pr
|
||||||
|
|
||||||
|
|
||||||
|
def finished(name, s):
|
||||||
|
if (REPO / "logs" / f"p6_done_{name}").exists():
|
||||||
|
return True
|
||||||
|
rl, _ = tail_info(s["log"])
|
||||||
|
return bool(rl and " ok exit 0 " in rl and "_bench_train_" in rl)
|
||||||
|
|
||||||
|
|
||||||
|
def remaining(s):
|
||||||
|
_, pr = tail_info(s["log"])
|
||||||
|
if pr is None:
|
||||||
|
return 10 ** 6
|
||||||
|
stage, k, n = pr
|
||||||
|
return (n - k) + (n if stage == "posterior" and "train" in s["stages"] else 0)
|
||||||
|
|
||||||
|
|
||||||
|
def descendants(pid):
|
||||||
|
kids = sh(f"pgrep -P {pid}").split()
|
||||||
|
return [int(k) for k in kids] + [d for k in kids for d in descendants(int(k))]
|
||||||
|
|
||||||
|
|
||||||
|
def stop(name):
|
||||||
|
pane = sh(f"tmux list-panes -t {name} -F '#{{pane_pid}}'")
|
||||||
|
pids = descendants(int(pane)) if pane.isdigit() else []
|
||||||
|
for p in pids:
|
||||||
|
try:
|
||||||
|
os.kill(p, signal.SIGTERM)
|
||||||
|
except ProcessLookupError:
|
||||||
|
pass
|
||||||
|
time.sleep(20)
|
||||||
|
for p in pids:
|
||||||
|
try:
|
||||||
|
os.kill(p, signal.SIGKILL)
|
||||||
|
except ProcessLookupError:
|
||||||
|
pass
|
||||||
|
subprocess.run(["tmux", "kill-session", "-t", name], capture_output=True)
|
||||||
|
|
||||||
|
|
||||||
|
def card_load(state, exclude=None):
|
||||||
|
load = {"cuda:0": 0, "cuda:1": 0}
|
||||||
|
for n, s in state.items():
|
||||||
|
if n != exclude and s.get("status") == "running":
|
||||||
|
load[s["device"]] += s["workers"]
|
||||||
|
return load
|
||||||
|
|
||||||
|
|
||||||
|
def launch(name, s, state, target):
|
||||||
|
g, load = gpus(), card_load(state, exclude=name)
|
||||||
|
best = None
|
||||||
|
for dev in sorted(g, key=lambda d: (load[d], -g[d]["free"])):
|
||||||
|
w = min(target, (g[dev]["free"] - RESERVE) // PER_WORKER, CAP_CARD - load[dev])
|
||||||
|
if w >= 1:
|
||||||
|
best = (dev, int(w))
|
||||||
|
break
|
||||||
|
if best is None:
|
||||||
|
log(f"{name}: no room (free {[g[d]['free'] for d in sorted(g)]} MiB); waiting")
|
||||||
|
s["status"] = "waiting"
|
||||||
|
return
|
||||||
|
dev, w = best
|
||||||
|
s["log"] = f"logs/bench_{name.replace('p6_', '')}_{dev.replace(':', '')}.out"
|
||||||
|
env = f"STUDIES='{s['studies']}' DEVICE={dev} WORKERS={w} MEM_GB=2" + (f" REGIMES='{s['regimes']}'" if s["regimes"] else "")
|
||||||
|
cmd = f"env {env} scripts/run_bench.sh {s['stages']} >> {s['log']} 2>&1 && touch logs/p6_done_{name}"
|
||||||
|
subprocess.run(["tmux", "new-session", "-d", "-s", name, "-c", str(REPO), cmd], check=True)
|
||||||
|
s.update(device=dev, workers=w, status="running")
|
||||||
|
log(f"{name}: launched on {dev} with {w} workers ({s['studies']} {s['regimes']}; log {s['log']})")
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
state = json.loads(STATE.read_text()) if STATE.exists() else {n: dict(s, status="running", restarts=0) for n, s in SPECS.items()}
|
||||||
|
log(f"supervisor start; specs {list(state)}")
|
||||||
|
while True:
|
||||||
|
g = gpus()
|
||||||
|
log("gpu " + " ".join(f"{d}: free {v['free']} used {v['used']} util {v['util']}%" for d, v in sorted(g.items()))
|
||||||
|
+ " | " + " ".join(f"{n}={s['status']}/{s['device']}x{s['workers']}/rem {remaining(s) if s['status'] != 'done' else 0}"
|
||||||
|
for n, s in state.items()))
|
||||||
|
newly_done = False
|
||||||
|
for n, s in state.items():
|
||||||
|
if s["status"] in ("done", "failed", "replaced"):
|
||||||
|
continue
|
||||||
|
if alive(n):
|
||||||
|
continue
|
||||||
|
if finished(n, s):
|
||||||
|
s["status"] = "done"
|
||||||
|
newly_done = True
|
||||||
|
log(f"{n}: finished")
|
||||||
|
elif s["restarts"] >= MAX_RESTARTS:
|
||||||
|
s["status"] = "failed"
|
||||||
|
log(f"{n}: dead after {MAX_RESTARTS} restarts; giving up (see {s['log']})")
|
||||||
|
else:
|
||||||
|
if s["status"] == "running":
|
||||||
|
s["restarts"] += 1
|
||||||
|
log(f"{n}: driver dead and unfinished (last runlog: {tail_info(s['log'])[0]}); restart {s['restarts']}")
|
||||||
|
launch(n, s, state, s["workers"] if s["status"] != "waiting" else SPECS[n]["workers"])
|
||||||
|
if newly_done:
|
||||||
|
running = {n: s for n, s in state.items() if s["status"] == "running" and alive(n)}
|
||||||
|
free = W_TOTAL - sum(s["workers"] for s in running.values())
|
||||||
|
cand = sorted(running, key=lambda n: -remaining(running[n]))
|
||||||
|
if free >= 2 and cand and remaining(running[cand[0]]) >= MIN_BOOST_JOBS:
|
||||||
|
n = cand[0]
|
||||||
|
s = running[n]
|
||||||
|
target = min(CAP_DRIVER, s["workers"] + free)
|
||||||
|
log(f"{n}: boosting {s['workers']} -> {target} workers ({remaining(s)} jobs remaining)")
|
||||||
|
stop(n)
|
||||||
|
s["status"] = "restarting"
|
||||||
|
launch(n, s, state, target)
|
||||||
|
STATE.write_text(json.dumps(state, indent=1))
|
||||||
|
if all(s["status"] in ("done", "failed", "replaced") for s in state.values()):
|
||||||
|
log("all drivers finished or failed; supervisor exits")
|
||||||
|
return
|
||||||
|
time.sleep(CYCLE)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
@@ -10,32 +10,46 @@ Red text (`\todo`, `\todoblock`, `\figplaceholder`) marks parts that are not rea
|
|||||||
Search for them with `grep -n 'todo\|figplaceholder' sections/*.tex`.
|
Search for them with `grep -n 'todo\|figplaceholder' sections/*.tex`.
|
||||||
|
|
||||||
All figures in `figures/` are produced by `python scripts/22_paper_figures.py` (from the repo root,
|
All figures in `figures/` are produced by `python scripts/22_paper_figures.py` (from the repo root,
|
||||||
with the `.venv`); it reads only the locked summaries listed below.
|
with the `.venv`), except `bench_s1.pdf` and `bench_s8.pdf` (Experiment 3), which come from
|
||||||
|
`python scripts/38_bench_figures.py`; both read only the locked summaries listed below.
|
||||||
|
|
||||||
## Where the numbers come from
|
## Where the numbers come from
|
||||||
|
|
||||||
| Paper element | Source |
|
| Paper element | Source |
|
||||||
|---|---|
|
|---|---|
|
||||||
| Abstract, Sec. 1 (findings paragraph), Sec. 8, `highlights.txt` | Rows below: H2a and σ_a from `tab:h2a`/`tab:sigmaa`; bank gain and bounds (registered (a), post hoc (b)) from `tab:h2b` and `outputs/p2r/posthoc/{bound.csv,meta.json}`; wells needed from `outputs/t3/nstar.csv`; field results from App. B; Teapot counts from Sec. 6.6 sources |
|
| Abstract, Sec. 1 (findings paragraph), Sec. 8, `highlights.txt` | Rows below: H2a and σ_a from `tab:h2a`/`tab:sigmaa`; bank gain and bounds (registered (a), post hoc (b)) from `tab:h2b` and `outputs/p2r/posthoc/{bound.csv,meta.json}`; wells needed from `outputs/t3/nstar.csv`; field results from App. B; Teapot counts from Sec. 6.7 sources; Experiment 3 (9/11 verdicts, failures, two-mode reversal) from the Sec. 6.5 rows |
|
||||||
| Sec. 1 (F3 drift 14–66 ms, 46 ms, 36 ms; dominant period 17–20 ms) | `outputs/td_qc.csv`, `outputs/tie_qc.csv`, `docs/plan.md` §1.2 |
|
| Sec. 1 (F3 drift 14–66 ms, 46 ms, 36 ms; dominant period 17–20 ms) | `outputs/td_qc.csv`, `outputs/tie_qc.csv`, `docs/plan.md` §1.2 |
|
||||||
| Sec. 2 (label noise and errors in variables; Table `tab:positioning`) | `refs.bib` `annote` fields: Mnih & Hinton (2012) read in full on 2026-10-29 (Secs. 5, 6.1, 6.3); Balakrishnan (1962) metadata from Crossref only, cited for the general statement; abstract-only entries flagged in the table |
|
| Sec. 2 (label noise and errors in variables; Table `tab:positioning`) | `refs.bib` `annote` fields: Mnih & Hinton (2012) read in full on 2026-10-29 (Secs. 5, 6.1, 6.3); Balakrishnan (1962) metadata from Crossref only, cited for the general statement; abstract-only entries flagged in the table. Preliminary novelty scan of 2026-11-02 (`docs/plan.md` §12 item 31): Herrera & van der Baan (2014), da Costa Silva et al. (2026, Autotie) and Castagna et al. (2026) from their abstracts (OpenAlex), metadata from Crossref (Castagna et al. later read in full, 2026-11-02: timing-error remarks in their Discussion, `docs/plan.md` §12 item 33); the label source of Sukar et al. (2026) from the full text in `refs/` (Sec. 3, "Data preparation"). Full texts obtained on 2026-11-02 (`docs/plan.md` §12 item 33): Lim et al. (2025, AWSM; 44 wells, median/minimum-misfit models, TD posterior not used downstream), Lim & Cardona (2025, BootNet), Li, Grana & Liu (2024, P05; deterministic tie in the field case), Guillon et al. (2020; tolerance in evaluation only) and Rizzuti et al. (2024, 2025; wavelet treated as known, future-work statement); their ᵃ markers were removed |
|
||||||
| Sec. 3, Table `tab:audit` (TD drift, label audit) | `outputs/td_qc.csv`, `outputs/tie_qc.csv`, `outputs/marker_vs_horizon.csv`, `docs/plan.md` |
|
| Sec. 3, Table `tab:audit` (TD drift, label audit; max \|Δt_wlt\| column from `td_qc.csv` since the 04/11 audit) | `outputs/td_qc.csv`, `outputs/tie_qc.csv`, `outputs/marker_vs_horizon.csv`, `docs/plan.md` |
|
||||||
| Sec. 3.3 (Volve data: licence, label check, deviated wells, cube, time–depth, anchors, labels) | `outputs/volve/volve_wells_summary.json`, `outputs/volve/{summary.json,anchors.csv,pick_vs_horizon.csv,pick_vs_checkshot.csv,horizon_lag.csv}`, `docs/research/volve-inventory.md`, `docs/plan.md` §12 items 7 and 18 |
|
| Sec. 3.2, paragraph "Misspecified simulators" and App. C (presets, scale factors, Q 80 peak shift, model error 0.23 nominal and 1.08–1.93 for the presets, L1 levels above the declared band, minphase 0.25 candidate, Rm5 null 1.78× and 0.22–0.34) | Presets: `configs/protocol_bench.yaml` (`studies.S2.presets`) and the `misspec_presets` block of `configs/d2_synth_bench.yaml`; generator `ml_porosity/data/synth_d2.py` (`misspec=`); level choice on dev 902–905 and the model-error table: `docs/research/bench-protocol.md` (S2 level table and decisions) and `docs/research/bench-generator.md`, QC from `scripts/33_bench_generator_qc.py` |
|
||||||
| Sec. 4, Table `tab:h1`, Fig. `fig:h1` | `outputs/p2/summary/main/h1.csv`, `docs/theory.md` |
|
| App. B.2, paragraph "Data" (Volve data: licence, label check, deviated wells, cube, time–depth, anchors, labels; Sec. 3.3 until 09/11/2026) | `outputs/volve/volve_wells_summary.json`, `outputs/volve/{summary.json,anchors.csv,pick_vs_horizon.csv,pick_vs_checkshot.csv,horizon_lag.csv}`, `docs/research/volve-inventory.md`, `docs/plan.md` §12 items 7 and 18 |
|
||||||
| Sec. 4.3–4.5 (Propositions 3–6, Corollaries 3–4, Remark 1, ρ*) | Analytic; proofs in App. A; Vietnamese statements in `docs/theory.md` §6. The factors 1.10 and 1.77 are e^{4π²σ²f²} at σ = 2 ms, f = 25 and 60 Hz (`meta.json` `transfer_ratio_exp_4pi2s2f2`); 71–73% coherent power below 25 Hz, the 67–72 Hz f⁴-weighted median and the (b)/(a) integral ratios 1.5–1.7, 2.1–2.6 and 3.3–4.6 are from `outputs/p2r/posthoc/meta.json` `n16_spectra` (coherent part: `coherent_share_below_25hz`, `f4_weighted_median_hz.coherent`; integral ratios span the Oracle and coherent spectra over the five regimes); 30–90 Hz uses the ~60 Hz F3 peak of Sec. 3.1 |
|
| Sec. 5 (Theory; Sec. 4 until 09/11/2026), Table `tab:h1`, Fig. `fig:h1` | `outputs/p2/summary/main/h1.csv`, `docs/theory.md` |
|
||||||
| Sec. 5 (prior fit on F3, LOAO, type-II σ_a) | `docs/plan.md` §12, `docs/theory.md` |
|
| Sec. 5.3–5.5 and App. A (Propositions 3–6, Corollaries 3–4, Remark 1, ρ*) | Analytic; proofs in App. A; Vietnamese statements in `docs/theory.md` §6. The factors 1.10 and 1.77 are e^{4π²σ²f²} at σ = 2 ms, f = 25 and 60 Hz (`meta.json` `transfer_ratio_exp_4pi2s2f2`); 71–73% coherent power below 25 Hz, the 67–72 Hz f⁴-weighted median and the (b)/(a) integral ratios 1.5–1.7, 2.1–2.6 and 3.3–4.6 are from `outputs/p2r/posthoc/meta.json` `n16_spectra` (coherent part: `coherent_share_below_25hz`, `f4_weighted_median_hz.coherent`; integral ratios span the Oracle and coherent spectra over the five regimes); 30–90 Hz uses the ~60 Hz F3 peak of Sec. 3.1 |
|
||||||
|
| Sec. 4 (Methods; Sec. 5 until 09/11/2026: prior fit on F3, LOAO, type-II σ_a) | `docs/plan.md` §12, `docs/theory.md` |
|
||||||
|
| Sec. 4.6 (TCN backbone, budget 125 on dev 902–905), Table `tab:methods` (benchmark additions Ctl-GP, PM2, BK2, HM2, -TCN) | `configs/protocol_bench.yaml` (`methods`, `training.budgets`, `training.budgets_tcn`, `training.budget_candidates`), `ml_porosity/benchmark/`, `docs/research/bench-protocol.md` (TCN budget selection; log `logs/bench_dev_budgets_tcn.out`) |
|
||||||
| Sec. 6.1, Table `tab:p2`, Fig. `fig:p2phase` | `outputs/p2/summary/main/{summary.md,methods.csv}` |
|
| Sec. 6.1, Table `tab:p2`, Fig. `fig:p2phase` | `outputs/p2/summary/main/{summary.md,methods.csv}` |
|
||||||
| Sec. 6.2 (diagnosis, deviation) | `docs/plan.md` §12 items 11–14 |
|
| Sec. 6.2 (diagnosis, deviation) | `docs/plan.md` §12 items 11–14 |
|
||||||
| Sec. 6.3, Tables `tab:h2a`, `tab:sigmaa`, `tab:h2b`; Figs. `fig:h2b`, `fig:p2rgrid` | `outputs/p2r/summary/{summary.md,verdict.json}`; σ_post and warp RMSE from `outputs/p2r/summary/sigma_post.csv` |
|
| Sec. 6.3, Tables `tab:h2a`, `tab:sigmaa`, `tab:h2b`; Figs. `fig:h2b`, `fig:p2rgrid` | `outputs/p2r/summary/{summary.md,verdict.json}`; σ_post and warp RMSE from `outputs/p2r/summary/sigma_post.csv` |
|
||||||
| Sec. 6.3, column 1/B_b of `tab:h2b` (Berkson bound at σ_post; bounds at the warp error; 60 Hz and cross-spectral variants; exact (a) bound 0.481 at σ_post for R10tb c = 2; Oracle/B3d-Sa ratios; share of the gap closed; 6 ms grid edge; post hoc) | `outputs/p2r/posthoc/{bound.csv,blur_ab.csv,meta.json}` (counts in `meta.json` `n16_wide`), written by `python scripts/31_p2r_posthoc.py` (about 6 min) from the registered summaries and the Oracle test predictions in `outputs/p2r/train/<regime>/cells/*.npz` |
|
| Sec. 6.3, column 1/B_b of `tab:h2b` (Berkson bound at σ_post; bounds at the warp error; 60 Hz and cross-spectral variants; exact (a) bound 0.481 at σ_post for R10tb c = 2; Oracle/B3d-Sa ratios; share of the gap closed; 6 ms grid edge; post hoc) | `outputs/p2r/posthoc/{bound.csv,blur_ab.csv,meta.json}` (counts in `meta.json` `n16_wide`), written by `python scripts/31_p2r_posthoc.py` (about 6 min) from the registered summaries and the Oracle test predictions in `outputs/p2r/train/<regime>/cells/*.npz` |
|
||||||
| Sec. 6.3, Table `tab:t4` (dispersion ratio ξ, coverage, training length; post hoc) | `outputs/t4/{summary.csv,cells.csv,budget_dev.csv,meta.json}` (column `kappa` = ξ), written by `python scripts/30_t4_coverage.py` |
|
| Sec. 6.3, Table `tab:t4` (dispersion ratio ξ, coverage, training length; post hoc) | `outputs/t4/{summary.csv,cells.csv,budget_dev.csv,meta.json}` (column `kappa` = ξ), written by `python scripts/30_t4_coverage.py` |
|
||||||
| Sec. 6.4 (mechanism) | Not run yet: T2, to be declared in `docs/research/t2-mechanism.md` |
|
| Sec. 6.4 (mechanism; exploratory), Sec. 7 (bank-gain paragraphs) | `outputs/t2/summary.md` and the tables beside it; declaration `docs/research/t2-mechanism.md` (hashed before computing), results `docs/research/t2-results.md` |
|
||||||
| Sec. 6.5, Table `tab:t3` (detectability; exploratory) | `outputs/t3/{cells.csv,nstar.csv,power.csv,meta.json}`, written by `python scripts/27_t3_power.py`; declaration and Deviation 1 (σ_ref grid) in `docs/research/applicability-teapot.md` |
|
| Sec. 6.5, Tables `tab:benchdesign`, `tab:benchverdicts` (as worded); App. C (as run) | Design: `configs/protocol_bench.yaml` (locked 2026-10-29 14:39:20 UTC, sha256 in `.sha256`, time stamp in `.lock.json`), `docs/research/bench-protocol.md`; verdicts as worded: `outputs/bench/summary/verdict_final.{json,md}` and `s3_h2a_stated.csv` (`scripts/36_bench_verdicts.py`); as run by the locked code: `outputs/bench/summary/{verdict.json,summary.md}` (`scripts/34_run_bench.py summarize`); deviation D-13 in `docs/plan.md` §12 item 28; bitwise reproduction check: `logs/bench_repro_r8.out` |
|
||||||
| Sec. 6.6 (gate results) | App. B sources below |
|
| Sec. 6.5 S1, Fig. `fig:bench_s1` (phase diagram, families, additivity fit β and R²) | `outputs/bench/summary/{s1_cells,s1_h2a,s1_families,s1_additivity}.csv`; figure from `scripts/38_bench_figures.py --only bench_s1` |
|
||||||
| Sec. 6.6 (conditions C1–C4) | `outputs/applicability/{verdict.json,c1_pairs.csv,c2_sigma_post.csv,d2_threshold_cells.csv}`, written by `python scripts/26_applicability.py`; `docs/research/applicability-results.md` |
|
| Sec. 6.5 S2, Table `tab:s2` (ratios, cov90, warp RMSE, degradation, Ctl-GP) | `outputs/bench/summary/{s2_cells,s2_h2a,s2_smc,s2_degradation}.csv`; model-error column from `docs/research/bench-protocol.md` (dev 902–905) |
|
||||||
| Sec. 6.6 (Teapot: 152 wells, time–depth tables, horizon–top reference, σ̂_knot 6.75 ms) | `outputs/teapot/inventory/` (`python -P scripts/28_teapot_inventory.py`), `outputs/teapot/pilot_pa/verdict.json` and `knots_dev.csv` (`python -P scripts/29_teapot_pilot.py`), `docs/research/applicability-results.md`, `docs/plan.md` §12 item 23 |
|
| Sec. 6.5 S3 (as worded vs as run; Ctl-GP 16/30) | `outputs/bench/summary/{s3_h2a_stated,s3_h2a,s3_control,s3_table}.csv` |
|
||||||
|
| Sec. 6.5 S4 (TCN) | `outputs/bench/summary/{s4_cells,s4_h2a}.csv` |
|
||||||
|
| Sec. 6.5 S8, Table `tab:s8`, Fig. `fig:bench_s8` (two-mode reversal; flip-band means of PM2/BK2/HM2 against cos and cos²) | `outputs/bench/summary/{s8_cells,s8_transfer}.csv`, `s8_transfer_curves.json`; figure from `scripts/38_bench_figures.py --only bench_s8`; flip-band table (usable frequencies in 1/(2Δ) < f < 3/(2Δ)) printed by `scripts/38_bench_figures.py --flipband` (post hoc, not a verdict) |
|
||||||
|
| App. C, "Equal training budgets" | `outputs/bench/summary/equal_budget.csv` |
|
||||||
|
| Sec. 8 (availability: 630 tasks, 21 methods, scorer) | `benchmark/README.md`, `benchmark/MANIFEST.json`, `benchmark/reference/{cells.csv,main_table.md}` (`scripts/37_bench_package.py`); package `outputs/bench/package/` (Zenodo payload, not yet deposited) |
|
||||||
|
| Sec. 8 (availability: derived-data archives, licences, clean-room check) | `repro/README.md`, `repro/MANIFEST.json` (five archives, 11,112 files; `scripts/39_repro_package.py build`), `repro/verify_report.md` (`scripts/39_repro_package.py verify`); archives in `outputs/repro/` (not yet deposited) |
|
||||||
|
| App. A, Sec. 5 (proof review of 02/11/2026) | `docs/plan.md` §12 item 32; Vietnamese statements synced in `docs/theory.md` |
|
||||||
|
| Sec. 6.6, Table `tab:t3` (detectability; exploratory) | `outputs/t3/{cells.csv,nstar.csv,power.csv,meta.json}`, written by `python scripts/27_t3_power.py`; declaration and Deviation 1 (σ_ref grid) in `docs/research/applicability-teapot.md`. Crossings 3.6, 3.8 and 4.3 ms (R10, R0, Rm5): σ_ref at which `median_ratio` of the N = 16 rows of `cells.csv` reaches 1, by linear interpolation between grid points (`p_better` = 0.5 gives 3.5, 3.8, 4.2 ms); compared with σ/√2 = 3.0, 4.1, 5.1 ms of Corollary 4 |
|
||||||
|
| Sec. 6.7 (gate results) | App. B sources below |
|
||||||
|
| Sec. 6.7 (conditions C1–C4) | `outputs/applicability/{verdict.json,c1_pairs.csv,c2_sigma_post.csv,d2_threshold_cells.csv}`, written by `python scripts/26_applicability.py`; `docs/research/applicability-results.md` |
|
||||||
|
| Sec. 6.7, App. B.3 (Teapot: 152 wells, time–depth tables, horizon–top reference, σ̂_knot 6.75 ms) | `outputs/teapot/inventory/` (`python -P scripts/28_teapot_inventory.py`), `outputs/teapot/pilot_pa/verdict.json` and `knots_dev.csv` (`python -P scripts/29_teapot_pilot.py`), `docs/research/applicability-results.md`, `docs/plan.md` §12 item 23 |
|
||||||
| Sec. 7 (F3 and Volve paragraphs, σ_a, limitations) | same sources as App. B |
|
| Sec. 7 (F3 and Volve paragraphs, σ_a, limitations) | same sources as App. B |
|
||||||
| App. B.1, Table `tab:p1` | `outputs/p1/summary.md` |
|
| Sec. 7 ("Where the posterior-mean advantage stops", "When to use a bank", limitations on Experiment 3) | Sec. 6.5 rows above |
|
||||||
|
| App. B.1 (the 2.82 p.u. three-well figure; Table `tab:p1` removed 09/11/2026) | `outputs/p1/summary.md` |
|
||||||
| App. B.1, Table `tab:f3gc` (G-C), macro band RMSE | `outputs/p3/summary/gate_gc.json`, `docs/plan.md` §12 item 16 |
|
| App. B.1, Table `tab:f3gc` (G-C), macro band RMSE | `outputs/p3/summary/gate_gc.json`, `docs/plan.md` §12 item 16 |
|
||||||
| App. B.1, Table `tab:f3gc` coverage, seed-by-seed spread | `outputs/p3/summary/{metrics.csv,selection.csv}` (rows with `seed` = ensemble and per seed) |
|
| App. B.1, Table `tab:f3gc` coverage, seed-by-seed spread | `outputs/p3/summary/{metrics.csv,selection.csv}` (rows with `seed` = ensemble and per seed) |
|
||||||
| App. B.1, Tables `tab:f3all`, `tab:f3abl` | `outputs/p3/summary/macro.csv` (label `PHIE_DT`, σ_a = 7 ms); ablation descriptions from `configs/protocol_f3.yaml` and `ml_porosity/f3/{training,registration,runner}.py` |
|
| App. B.1, Tables `tab:f3all`, `tab:f3abl` | `outputs/p3/summary/macro.csv` (label `PHIE_DT`, σ_a = 7 ms); ablation descriptions from `configs/protocol_f3.yaml` and `ml_porosity/f3/{training,registration,runner}.py` |
|
||||||
@@ -43,7 +57,7 @@ with the `.venv`); it reads only the locked summaries listed below.
|
|||||||
| App. B.1, Table `tab:f3sens` | `metrics.csv` (`M2-Sa` vs `B3d-Sa`; σ_a arms vs `B3c-R` at the same σ_a; reference `wlt`; label `PHIE`), `band_sensitivity.csv` (f_c = 5, 8 Hz), `posterior_reference_sensitivity.csv` (5–95 % range over 64 reference warps) |
|
| App. B.1, Table `tab:f3sens` | `metrics.csv` (`M2-Sa` vs `B3d-Sa`; σ_a arms vs `B3c-R` at the same σ_a; reference `wlt`; label `PHIE`), `band_sensitivity.csv` (f_c = 5, 8 Hz), `posterior_reference_sensitivity.csv` (5–95 % range over 64 reference warps) |
|
||||||
| App. B.1 (posterior width, phase) | `outputs/p3/registration/*_sa{3.5,7,14}{,_noanchors}.json` (`diagnostics[].sigma_post_ms`, `phase_R`, `phase_info.logZ` summed over wells) |
|
| App. B.1 (posterior width, phase) | `outputs/p3/registration/*_sa{3.5,7,14}{,_noanchors}.json` (`diagnostics[].sigma_post_ms`, `phase_R`, `phase_info.logZ` summed over wells) |
|
||||||
| App. B.1 (leave-one-anchor-out) | `outputs/p3/diagnostics/loao.csv` |
|
| App. B.1 (leave-one-anchor-out) | `outputs/p3/diagnostics/loao.csv` |
|
||||||
| App. B.1 (volume statistics), Fig. `fig:f3vol` | `outputs/p3/volume/{metadata.json,mean.npy,sigma.npy}`; figure from `python scripts/22_paper_figures.py --only f3_volume` (inline 442 through F03-4) |
|
| App. B.1 (predicted volume; Fig. `fig:f3vol` removed 09/11/2026, script `--only f3_volume` still works) | `outputs/p3/volume/{metadata.json,mean.npy,sigma.npy}`; figure from `python scripts/22_paper_figures.py --only f3_volume` (inline 442 through F03-4) |
|
||||||
| App. B.2, Table `tab:volvegd` (G-D) | `outputs/p4/summary/gate_gd.json` (`schemes.<scheme>.per_well`: competitor, n, ratio, coverage; macro counts and coverage) |
|
| App. B.2, Table `tab:volvegd` (G-D) | `outputs/p4/summary/gate_gd.json` (`schemes.<scheme>.per_well`: competitor, n, ratio, coverage; macro counts and coverage) |
|
||||||
| App. B.2, Table `tab:volveall` | `outputs/p4/summary/macro.csv` (reference calibrated, σ_a = 7 ms, ensemble); last row ("Constant", post hoc) from `outputs/p4/posthoc/macro.csv` (`const_rmse`), written by `python scripts/25_p4_posthoc.py` after G-D, scale only |
|
| App. B.2, Table `tab:volveall` | `outputs/p4/summary/macro.csv` (reference calibrated, σ_a = 7 ms, ensemble); last row ("Constant", post hoc) from `outputs/p4/posthoc/macro.csv` (`const_rmse`), written by `python scripts/25_p4_posthoc.py` after G-D, scale only |
|
||||||
| App. B.2, Table `tab:volvesens` | `outputs/p4/summary/{metrics.csv,macro.csv}` (σ_a arms; `M2-Sa` vs `B3c-R` at the same σ_a) |
|
| App. B.2, Table `tab:volvesens` | `outputs/p4/summary/{metrics.csv,macro.csv}` (σ_a arms; `M2-Sa` vs `B3c-R` at the same σ_a) |
|
||||||
@@ -51,11 +65,37 @@ with the `.venv`); it reads only the locked summaries listed below.
|
|||||||
| App. B.2 (best-shift diagnostic) | `outputs/p4/summary/best_shift_DIAGNOSTIC_ONLY.csv` (never alters a score; search limit `best_shift_max_samples` = 16 in the protocol) |
|
| App. B.2 (best-shift diagnostic) | `outputs/p4/summary/best_shift_DIAGNOSTIC_ONLY.csv` (never alters a score; search limit `best_shift_max_samples` = 16 in the protocol) |
|
||||||
| App. B.2 (posterior width, phase) | `outputs/p4/summary/registration.csv` |
|
| App. B.2 (posterior width, phase) | `outputs/p4/summary/registration.csv` |
|
||||||
| App. B.2 (deviations), Sec. 7 (Volve paragraphs) | `configs/protocol_volve.yaml` (`deviations`), `configs/protocol_volve.lock.json`, `docs/plan.md` §12 items 19–21 |
|
| App. B.2 (deviations), Sec. 7 (Volve paragraphs) | `configs/protocol_volve.yaml` (`deviations`), `configs/protocol_volve.lock.json`, `docs/plan.md` §12 items 19–21 |
|
||||||
| Pass rules, thresholds | `configs/protocol_p2.yaml`, `configs/protocol_p2r.yaml`, `configs/protocol_f3.yaml` (locked; tag `protocol-f3`), `configs/protocol_volve.yaml` (locked 2026-10-29 01:17:42 UTC; committed on 2026-10-29 after the run, tag `protocol-volve`) |
|
| Pass rules, thresholds | `configs/protocol_p2.yaml`, `configs/protocol_p2r.yaml`, `configs/protocol_f3.yaml` (locked; tag `protocol-f3`), `configs/protocol_volve.yaml` (locked 2026-10-29 01:17:42 UTC; committed on 2026-10-29 after the run, tag `protocol-volve`), `configs/protocol_bench.yaml` (locked 2026-10-29 14:39:20 UTC; committed in 381b5ff while the main runs were in progress; no tag) |
|
||||||
|
|
||||||
|
## Names in the paper and codes in the repository
|
||||||
|
|
||||||
|
Since 09/11/2026 the paper uses descriptive names (`docs/research/paper-style-survey.md`). Configs, outputs and code keep the codes below; when tracing a number to its source, translate with this table.
|
||||||
|
|
||||||
|
| Paper | Repository |
|
||||||
|
|---|---|
|
||||||
|
| 10 dB, 0 dB, −5 dB (full anchors) | R10, R0, Rm5 |
|
||||||
|
| half-anchor (0 dB) / two-anchor (10 dB) | R0h / R10tb |
|
||||||
|
| SMC mean / SMC bank | B3d-Sa / M2-Sa |
|
||||||
|
| anchor mean / anchor bank / reweighted anchor bank | B3d / M1 / M2 |
|
||||||
|
| sonic tie / calibrated sonic / correlation tie / phase-estimated correlation | B3a / B3b / B3c / B3c-R |
|
||||||
|
| hard-min shift / soft-min shift / soft-DTW / DILATE | B4a / B4b / B4c / B4d |
|
||||||
|
| calibrated-sonic ensemble | B5 |
|
||||||
|
| depth–time trend / attribute models / impedance inversion / composite loss | B0a / B0b / B1 / B2 |
|
||||||
|
| Gaussian bank / midpoint label / two-member bank / two-member hard-min | Ctl-GP / PM2 / BK2 / HM2 |
|
||||||
|
| blur test / anchor removal / calibration hypothesis | H1 / H4 / H3 |
|
||||||
|
| posterior-mean claim / bank claim | H2a / H2b |
|
||||||
|
| drift–well-count grid / misspecification / alignment losses / backbone / two-mode | S1 / S2 / S3 / S4 / S8 |
|
||||||
|
| rock physics mild, strong / wavelet phase mild, strong / attenuation / scaled warp prior / out-of-family warp | rp_L1, rp_L2 / wv_L1, wv_L2 / wv_Q / dr_L1 / dr_L2 |
|
||||||
|
| Experiment 1, F3, Volve pass rules | G-B, G-C, G-D |
|
||||||
|
| skill, width, anchor-uncertainty, well-count conditions (Sec. 6.7) | C1, C2, C3, C4 |
|
||||||
|
| bounds ρ*_cl, ρ*_Bk | 1/B_a, 1/B_b |
|
||||||
|
| assumption (A3); N_p particles; n* blind wells; tie tempering ω = 1/ν | (B); P; N*; γ = 1/κ |
|
||||||
|
|
||||||
|
**Figures.** `scripts/22_paper_figures.py` and `scripts/38_bench_figures.py` now draw these names, but they need `outputs/*/summary`, which is not on the machine where the rewrite was done. Until `python scripts/22_paper_figures.py && python scripts/38_bench_figures.py` is run on a machine with the outputs, the PDFs in `figures/` still show codes, and the red `\figcodes` notes in the captions say so; delete those notes after regenerating. The clean-room check of `scripts/39_repro_package.py` compares figures pixel by pixel, so rerun it after the regeneration.
|
||||||
|
|
||||||
Do not copy numbers from `code_thesis/` (thesis archive) into the paper. P4x was dropped on 29/10/2026 (Pivot 1, `docs/plan.md` §12 item 22): nothing from `outputs/p4x/` or `docs/research/p4-exploratory.md` enters the paper.
|
Do not copy numbers from `code_thesis/` (thesis archive) into the paper. P4x was dropped on 29/10/2026 (Pivot 1, `docs/plan.md` §12 item 22): nothing from `outputs/p4x/` or `docs/research/p4-exploratory.md` enters the paper.
|
||||||
Wording must respect `docs/plan.md` §10 (forbidden claims).
|
Wording must respect `docs/plan.md` §10 (forbidden claims).
|
||||||
|
|
||||||
Length: Computers & Geosciences limits a Research Article to about 5,500 words excluding abstract, keywords, highlights,
|
Length: Computers & Geosciences limits a Research Article to about 5,500 words excluding abstract, keywords, highlights,
|
||||||
references and captions (secondary source; the official Guide for Authors page could not be fetched on 2026-10-29).
|
references and captions (secondary source; the official Guide for Authors page could not be fetched on 2026-10-29).
|
||||||
The main text (Secs. 1–8) is about 14,750 words (crude count), and exceeds that limit. The length pass was dropped by the user on 2026-10-29 (`docs/plan.md` §12 item 25).
|
The main text (Secs. 1–8) is about 18,100 words (crude count after the 02/11 writing pass, which added about 3,100 words for Experiment 3, the mechanism study and the discussion; the proof review of the same day added about 350 more and the full-text pass of Sec. 2 about 130, estimated; the hallucination audit of 04/11 added about 600 more, crude count; 69 pages), and exceeds that limit. The length pass was dropped by the user on 2026-10-29 (`docs/plan.md` §12 item 25). After the rewrite of 09/11/2026 (`docs/plan.md` §12 item 38) the main text is about 15,400 words, against 20,600 before, by one counter that excludes tables and equations; the page count is 69. The worked example of Sec. 6.6 uses only the numbers of Table `tab:t3`, the warp errors of Sec. 6.6 and the Teapot residual of App. B.3.
|
||||||
|
|||||||
BIN
paper/figures/bench_s1.pdf
Normal file
BIN
paper/figures/bench_s1.pdf
Normal file
Binary file not shown.
BIN
paper/figures/bench_s8.pdf
Normal file
BIN
paper/figures/bench_s8.pdf
Normal file
Binary file not shown.
@@ -1,5 +1,5 @@
|
|||||||
Well-tie error in training labels is an error in the time index of the label
|
Well-tie error in training labels is an error in the time index of the label
|
||||||
Misregistered labels blur the learned predictor; Berkson-type tie error sharpens it
|
Misregistered labels blur the learned predictor; Berkson-type tie error sharpens it
|
||||||
A calibrated posterior bank recovers the oracle optimum; its gain is fourth order
|
A calibrated posterior bank recovers the oracle optimum; its gain is fourth order
|
||||||
Tie-posterior label gains on the benchmark fail if anchor error is misset twofold
|
In one tested regime, tie-posterior label gains fail if anchor error is off twofold
|
||||||
Blind-well tests need references accurate to ~1 ms; tested public datasets lack them
|
In simulation, blind-well tests need ~1 ms references; tested field data lack them
|
||||||
|
|||||||
@@ -45,9 +45,13 @@
|
|||||||
\newcommand{\aaf}{\mathcal{A}} % anti-alias filter
|
\newcommand{\aaf}{\mathcal{A}} % anti-alias filter
|
||||||
\newcommand{\sigpost}{\sigma_{\mathrm{post}}}
|
\newcommand{\sigpost}{\sigma_{\mathrm{post}}}
|
||||||
|
|
||||||
% Method names (repository codes); change here to rename everywhere
|
% Method names; change here to rename everywhere (repository codes: paper/README.md)
|
||||||
\newcommand{\mPM}{B3d-Sa} % labels at the SMC posterior-mean warp
|
\newcommand{\mPM}{SMC mean} % labels at the SMC posterior-mean warp (repository code B3d-Sa)
|
||||||
\newcommand{\mRML}{M2-Sa} % RML on the SMC particle bank
|
\newcommand{\mRML}{SMC bank} % RML on the SMC particle bank (repository code M2-Sa)
|
||||||
|
\newcommand{\rhoCl}{\rho^\star_{\mathrm{cl}}} % population bound for classical tie error (1/B_a in the protocol)
|
||||||
|
\newcommand{\rhoBk}{\rho^\star_{\mathrm{Bk}}} % population bound for Berkson tie error (1/B_b in the scripts)
|
||||||
|
% Remove once the figures are regenerated with the word labels in scripts/22 and scripts/38
|
||||||
|
\newcommand{\figcodes}[1]{\todo{Panel labels still show run codes (#1); regenerate the figure.}}
|
||||||
|
|
||||||
\theoremstyle{plain}
|
\theoremstyle{plain}
|
||||||
\newtheorem{proposition}{Proposition}
|
\newtheorem{proposition}{Proposition}
|
||||||
@@ -56,8 +60,7 @@
|
|||||||
\theoremstyle{remark}
|
\theoremstyle{remark}
|
||||||
\newtheorem{remark}{Remark}
|
\newtheorem{remark}{Remark}
|
||||||
|
|
||||||
\title{Label registration error in sparse-well seismic property learning: theory, a registration-aware benchmark, and the limits of field validation\\[4pt]
|
\title{Label registration error in sparse-well seismic property learning: theory, a registration-aware benchmark, and the limits of field validation}
|
||||||
\normalsize\todo{If S2 of \texttt{protocol\_bench} is not locked and run before submission, replace ``a registration-aware benchmark'' with ``a controlled synthetic study'' in the title, abstract and text.}}
|
|
||||||
\author{\todo{author list, affiliations, ORCID, corresponding author}}
|
\author{\todo{author list, affiliations, ORCID, corresponding author}}
|
||||||
\date{Draft, \today}
|
\date{Draft, \today}
|
||||||
|
|
||||||
@@ -68,8 +71,8 @@
|
|||||||
\input{sections/01_introduction}
|
\input{sections/01_introduction}
|
||||||
\input{sections/02_related}
|
\input{sections/02_related}
|
||||||
\input{sections/03_data}
|
\input{sections/03_data}
|
||||||
\input{sections/04_theory}
|
\input{sections/04_method}
|
||||||
\input{sections/05_method}
|
\input{sections/05_theory}
|
||||||
\input{sections/06_experiments}
|
\input{sections/06_experiments}
|
||||||
\input{sections/07_discussion}
|
\input{sections/07_discussion}
|
||||||
\input{sections/08_conclusion}
|
\input{sections/08_conclusion}
|
||||||
@@ -80,5 +83,6 @@
|
|||||||
\appendix
|
\appendix
|
||||||
\input{sections/A_proofs}
|
\input{sections/A_proofs}
|
||||||
\input{sections/B_field}
|
\input{sections/B_field}
|
||||||
|
\input{sections/C_record}
|
||||||
|
|
||||||
\end{document}
|
\end{document}
|
||||||
|
|||||||
@@ -62,7 +62,7 @@
|
|||||||
pages = {M185--M196},
|
pages = {M185--M196},
|
||||||
doi = {10.1190/geo2023-0737.1},
|
doi = {10.1190/geo2023-0737.1},
|
||||||
url = {https://doi.org/10.1190/geo2023-0737.1},
|
url = {https://doi.org/10.1190/geo2023-0737.1},
|
||||||
annote = {P05; survey evidence level A; accessed 2026-10-23; full text not obtainable (confirmed 2026-10-28): cite as abstract-only}
|
annote = {P05; survey evidence level A; accessed 2026-10-23; full text read 2026-11-02 (refs/li2024bpinn.pdf). BNN-VI and BPINN-VI with uncertainty over network weights; synthetic test with 12/3 pseudowells extracted from the true sections; North Sea field case with the forward model calibrated by a deterministic well-to-seismic tie. No tie uncertainty}
|
||||||
}
|
}
|
||||||
|
|
||||||
@article{ntibahanana2024ensemble,
|
@article{ntibahanana2024ensemble,
|
||||||
@@ -191,7 +191,7 @@
|
|||||||
% --- Added 2026-10-26 from docs/plan.md section 11. Full text is in refs/ for every entry below.
|
% --- Added 2026-10-26 from docs/plan.md section 11. Full text is in refs/ for every entry below.
|
||||||
% DOI, volume and pages from Crossref (journal articles) or the arXiv/PMLR record (ML papers).
|
% DOI, volume and pages from Crossref (journal articles) or the arXiv/PMLR record (ML papers).
|
||||||
% Not included (no full text, or no verifiable record): White & Simm 2003,
|
% Not included (no full text, or no verifiable record): White & Simm 2003,
|
||||||
% Herrera & van der Baan 2014 (journal version), Munoz & Hale 2015, RING 2025, EAGE 2023 (skipped: not found or not obtainable).
|
% Herrera & van der Baan 2014 (journal version; added 2026-11-02 as abstract-only, see below), Munoz & Hale 2015, RING 2025, EAGE 2023 (skipped: not found or not obtainable).
|
||||||
|
|
||||||
@article{buland2003bayesianwavelet,
|
@article{buland2003bayesianwavelet,
|
||||||
author = {Buland, Arild and Omre, Henning},
|
author = {Buland, Arild and Omre, Henning},
|
||||||
@@ -264,7 +264,7 @@
|
|||||||
archivePrefix = {arXiv},
|
archivePrefix = {arXiv},
|
||||||
primaryClass = {physics.geo-ph},
|
primaryClass = {physics.geo-ph},
|
||||||
url = {https://arxiv.org/abs/1209.0201},
|
url = {https://arxiv.org/abs/1209.0201},
|
||||||
annote = {Early preprint of the DTW well-tie method; the Geophysics 2014 paper (79(3), V47--V54, 10.1190/GEO2013-0248.1) was not available, cite the version actually read}
|
annote = {Early preprint of the DTW well-tie method, read in full (refs/). The Geophysics 2014 version is cited alongside as abstract-only (herrera2014semiautomatic); statements about the constraint and the advice against blind use rest on that abstract}
|
||||||
}
|
}
|
||||||
|
|
||||||
@inproceedings{cuturi2017softdtw,
|
@inproceedings{cuturi2017softdtw,
|
||||||
@@ -426,7 +426,7 @@
|
|||||||
pages = {16--20},
|
pages = {16--20},
|
||||||
doi = {10.1190/image2025-4304877.1},
|
doi = {10.1190/image2025-4304877.1},
|
||||||
url = {https://doi.org/10.1190/image2025-4304877.1},
|
url = {https://doi.org/10.1190/image2025-4304877.1},
|
||||||
annote = {Abstract only (OpenAlex). Joint Bayesian inversion of time-depth transform parameters and wavelet(s) by PT-MCMC with uncertainty estimates; pre-stack wavelets for AVO/AVA. No learned property prediction mentioned}
|
annote = {Full text read 2026-11-02 (refs/lim2025awsm.pdf). PT-MCMC over stretch/shift/pinch-point parameters of a TD model anchored to a horizon and a well top, jointly with wavelets; 44 Midland Basin wells in about 50 min; median- and minimum-misfit models kept; angle-consistent wavelets for AVO/AVA. The TD posterior is reported but not used by any later step; no learned property prediction}
|
||||||
}
|
}
|
||||||
|
|
||||||
@inproceedings{lim2025bootnet,
|
@inproceedings{lim2025bootnet,
|
||||||
@@ -438,7 +438,7 @@
|
|||||||
pages = {56--60},
|
pages = {56--60},
|
||||||
doi = {10.1190/image2025-4304887.1},
|
doi = {10.1190/image2025-4304887.1},
|
||||||
url = {https://doi.org/10.1190/image2025-4304887.1},
|
url = {https://doi.org/10.1190/image2025-4304887.1},
|
||||||
annote = {Abstract only (OpenAlex). Bootstrapped ensemble of DNNs trained on Zoeppritz synthetics; impedance, velocity ratio and density with an uncertainty map; Midland Basin}
|
annote = {Full text read 2026-11-02 (refs/lim2025bootnet.pdf). Bootstrapped ensemble (B = 100) of DNNs trained on rock-physics logs with Zoeppritz synthetics; impedance, velocity ratio and density with an uncertainty map; Midland Basin. Training pairs are synthetic; no well tie or tie uncertainty}
|
||||||
}
|
}
|
||||||
|
|
||||||
@inproceedings{quesada2024faultlabels,
|
@inproceedings{quesada2024faultlabels,
|
||||||
@@ -448,7 +448,7 @@
|
|||||||
publisher = {Society of Exploration Geophysicists},
|
publisher = {Society of Exploration Geophysicists},
|
||||||
year = {2024},
|
year = {2024},
|
||||||
url = {https://alregib.ece.gatech.edu/image-2024-papers/jorge-image-2024/},
|
url = {https://alregib.ece.gatech.edu/image-2024-papers/jorge-image-2024/},
|
||||||
annote = {Abstract only (authors' lab page). DOI and pages not found in Crossref/OpenAlex on 2026-10-28: add before submission. 400 F3 images, 38 annotators (29 novices, 8 practitioners, 1 expert), three confidence levels}
|
annote = {Abstract only (authors' lab page). DOI and pages not found in Crossref/OpenAlex on 2026-10-28, nor on 2026-11-02 (Crossref title/author queries; none of the 555 OpenAlex records with prefix 10.1190/image2024 matches; the lab page gives no DOI): retry on the submission day, otherwise cite with the lab-page URL. 400 F3 images, 38 annotators (29 novices, 8 practitioners, 1 expert), three confidence levels}
|
||||||
}
|
}
|
||||||
|
|
||||||
@inproceedings{huff2024anglestack,
|
@inproceedings{huff2024anglestack,
|
||||||
@@ -484,7 +484,7 @@
|
|||||||
pages = {1--5},
|
pages = {1--5},
|
||||||
doi = {10.3997/2214-4609.202410525},
|
doi = {10.3997/2214-4609.202410525},
|
||||||
url = {https://doi.org/10.3997/2214-4609.202410525},
|
url = {https://doi.org/10.3997/2214-4609.202410525},
|
||||||
annote = {Abstract only (OpenAlex). Variational inference with a multiscale (wavelet-based) normalizing flow for the post-stack inversion posterior}
|
annote = {Full text read 2026-11-02 (refs/rizzuti2024waveletflows.pdf). Variational inference with a multiscale (wavelet-based) normalizing flow for the post-stack inversion posterior; Volve 2D section; no training labels, no tie uncertainty}
|
||||||
}
|
}
|
||||||
|
|
||||||
@inproceedings{cordoba2025porosity,
|
@inproceedings{cordoba2025porosity,
|
||||||
@@ -520,7 +520,7 @@
|
|||||||
pages = {1--5},
|
pages = {1--5},
|
||||||
doi = {10.3997/2214-4609.202510205},
|
doi = {10.3997/2214-4609.202510205},
|
||||||
url = {https://doi.org/10.3997/2214-4609.202510205},
|
url = {https://doi.org/10.3997/2214-4609.202510205},
|
||||||
annote = {Abstract only (OpenAlex). Variational Bayesian UHR post-stack inversion with normalizing flows; acoustic-impedance credible intervals; offshore wind site}
|
annote = {Full text read 2026-11-02 (refs/rizzuti2025uhr.pdf). Variational Bayesian UHR post-stack inversion with normalizing flows; acoustic-impedance credible intervals; offshore wind site. Known wavelet estimated at the trace nearest a projected CPT site; integrating CPT logs and wavelet effects into the UQ framework named as future work}
|
||||||
}
|
}
|
||||||
|
|
||||||
@article{guillon2020gtmetrics,
|
@article{guillon2020gtmetrics,
|
||||||
@@ -533,7 +533,7 @@
|
|||||||
pages = {734--741},
|
pages = {734--741},
|
||||||
doi = {10.1190/tle39100734.1},
|
doi = {10.1190/tle39100734.1},
|
||||||
url = {https://doi.org/10.1190/tle39100734.1},
|
url = {https://doi.org/10.1190/tle39100734.1},
|
||||||
annote = {Abstract only (OpenAlex). Precision/recall/IoU with a tolerance distance between prediction and ground truth for thin faults and horizons}
|
annote = {Full text read 2026-11-02 (refs/guillon2020gtmetrics.pdf). Precision/recall/IoU with a Gaussian tolerance function of the distance between prediction and ground truth for thin faults and horizons; motivated by interpreter pick differences of a few pixels. Tolerance in evaluation only; tolerance-aware loss named as future work}
|
||||||
}
|
}
|
||||||
|
|
||||||
@article{berkson1950two,
|
@article{berkson1950two,
|
||||||
@@ -627,3 +627,65 @@
|
|||||||
url = {https://doi.org/10.1109/TIT.1962.1057717},
|
url = {https://doi.org/10.1109/TIT.1962.1057717},
|
||||||
annote = {Metadata verified via Crossref 2026-10-29 (Crossref lists the successor name IEEE Transactions on Information Theory). Abstract and full text not obtained. Cited only for the general statement that the spectral effect of random timing errors has been studied for sampling jitter; Schwarzmann and Kaeser (arXiv:2509.04199, Sec. II) cite it for "spectral distortion under random timing perturbations".}
|
annote = {Metadata verified via Crossref 2026-10-29 (Crossref lists the successor name IEEE Transactions on Information Theory). Abstract and full text not obtained. Cited only for the general statement that the spectral effect of random timing errors has been studied for sampling jitter; Schwarzmann and Kaeser (arXiv:2509.04199, Sec. II) cite it for "spectral distortion under random timing perturbations".}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
% ---- Added 2026-11-02: preliminary novelty scan (Crossref, OpenAlex 2025--2026, web search; plan section 12 item 31).
|
||||||
|
% Metadata from Crossref on 2026-11-02; abstracts read via OpenAlex. No full text for any of these: cite as abstract-only.
|
||||||
|
@article{herrera2014semiautomatic,
|
||||||
|
author = {Herrera, Roberto H. and van der Baan, Mirko},
|
||||||
|
title = {{A semiautomatic method to tie well logs to seismic data}},
|
||||||
|
journal = {Geophysics},
|
||||||
|
year = {2014},
|
||||||
|
volume = {79},
|
||||||
|
number = {3},
|
||||||
|
pages = {V47--V54},
|
||||||
|
doi = {10.1190/geo2013-0248.1},
|
||||||
|
url = {https://doi.org/10.1190/geo2013-0248.1},
|
||||||
|
annote = {Abstract only (OpenAlex, 2026-11-02; not open access). Published version of herrera2012automatedtie. Constrained DTW replaces the manual stretch-and-squeeze step; bounds set by the interpreter; authors advise against unsupervised use (a guide, not a blind method). No tie uncertainty mentioned}
|
||||||
|
}
|
||||||
|
|
||||||
|
@article{dacostasilva2026autotie,
|
||||||
|
author = {da Costa Silva, Rafael and de Souza Ara{\'u}jo, Marcelus Glaucus and Rozendo, Luiz Antonio and Furtado Silva, Diego},
|
||||||
|
title = {{Autotie: A partial automation of the seismic-to-well tie with matching region estimation}},
|
||||||
|
journal = {Geophysics},
|
||||||
|
year = {2026},
|
||||||
|
volume = {91},
|
||||||
|
number = {5},
|
||||||
|
pages = {IM87--IM100},
|
||||||
|
doi = {10.1190/geo-2024-0011},
|
||||||
|
url = {https://doi.org/10.1190/geo-2024-0011},
|
||||||
|
annote = {Abstract only (OpenAlex, 2026-11-02). Time-weighted DTW for the matching position, global Bayesian optimizer for the tie parameters, segment-wise constrained DTW for velocity perturbation and wavelet phase within a tolerance; correlation improved at all six wells (four above 70%). Output is a single tie; no tie uncertainty and no learned property prediction mentioned}
|
||||||
|
}
|
||||||
|
|
||||||
|
@article{castagna2026quality,
|
||||||
|
author = {Castagna, John and Kronberg, V{\`i} and Gil, Gabriel},
|
||||||
|
title = {{How should the ``quality'' of seismic well ties and predictions of rock properties using machine learning be assessed?}},
|
||||||
|
journal = {The Leading Edge},
|
||||||
|
year = {2026},
|
||||||
|
volume = {45},
|
||||||
|
number = {5},
|
||||||
|
pages = {378--390},
|
||||||
|
doi = {10.1190/tle-2025-1058},
|
||||||
|
url = {https://doi.org/10.1190/tle-2025-1058},
|
||||||
|
annote = {Full text read 2026-11-02 (refs/castagna2026quality.pdf, CC BY). The correlation coefficient is inadequate for comparing seismic or predictions with presumed truth (synthetics or well logs); information-theoretic measures (cross entropy, variation of information, channel capacity) proposed, also as ML losses; DaQing and Permian Basin examples (porosity from five wells by sparse nonlinear regression). Discussion: time-depth functions are never exact, time shifts degrade mainly higher frequencies; the distribution-based measures are insensitive to small shifts. Timing error is not modelled and not used in training; the tie of the five Permian wells is not described}
|
||||||
|
}
|
||||||
|
|
||||||
|
% ---- Datasets (added 2026-11-02; metadata read from the providers' pages on 2026-11-02) ----
|
||||||
|
@misc{dgb2023f3demo,
|
||||||
|
author = {{dGB Earth Sciences}},
|
||||||
|
title = {{F3 Demo 2023}: {OpendTect} project of the {F3} block, {Dutch} sector of the {North Sea}},
|
||||||
|
howpublished = {TerraNubis data portal, dataset. Original seismic: NAM; original source: NLOG},
|
||||||
|
year = {2023},
|
||||||
|
url = {https://terranubis.com/datainfo/F3-Demo-2023},
|
||||||
|
note = {Licence: Creative Commons BY-SA 3.0. Accessed 26 October 2026},
|
||||||
|
annote = {Page title "Project F3 Demo 2023"; no release date or DOI on the page ("Value added Products: 2023"; acquisition and processing 1987). Licence link points to creativecommons.org/licenses/by-sa/3.0. Requested acknowledgement: "We thank dGB Earth Sciences for making the data available as an OpendTect project via their TerraNubis portal (terranubis.com)." Downloaded 2026-10-26 (data_manifest/f3_demo_2023.json).}
|
||||||
|
}
|
||||||
|
|
||||||
|
@misc{equinor2018volve,
|
||||||
|
author = {{Equinor}},
|
||||||
|
title = {{Volve} field data set},
|
||||||
|
howpublished = {Equinor ASA, dataset. Data owners: Equinor, ExxonMobil, Bayerngas and the Norwegian Petroleum Directorate},
|
||||||
|
year = {2018},
|
||||||
|
url = {https://www.equinor.com/energy/volve-data-sharing},
|
||||||
|
note = {Released 14 June 2018. Accessed 26 October 2026},
|
||||||
|
annote = {The web page grants use under the "Equinor Open Data Licence"; the license.txt files of the release name "Creative Commons Attribution 4.0 International license (CC BY NC SA)" with a link to CC BY-NC-SA 4.0, forbid resale and require attribution of the data owners (Equinor, ExxonMobil, Bayerngas, NPD). Downloaded 2026-10-26 (data_manifest/volve.json).}
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
\begin{abstract}
|
\begin{abstract}
|
||||||
Seismic reservoir-property predictors are trained on well logs that a well tie places in two-way time, and the tie is uncertain. We analyse its error as an error in the time index of the label. Under an independence assumption, misregistered labels convolve the optimal predictor with the error distribution and blur the seismic band, as a controlled experiment confirmed to within 1\%. Without time anchors, absolute timing is not identified. A tie computed as a posterior mean has the opposite, Berkson, error structure and sharpens the predictor instead. A calibrated bank of posterior labels attains the oracle's population optimum, but its population gain over a point label is of fourth order in the tie error. On a registration-aware synthetic benchmark calibrated to F3, we compared point ties, posterior-mean labels and a tempered likelihood over a posterior bank under pre-registered rules. The first comparison failed, and the second was designed after that failure. There, posterior-mean labels had 8--22\% lower seismic-band RMSE than the best point tie, but failed when the anchor uncertainty was set at half or twice its true value. The bank gained further in all eight cells with a wide posterior. This gain exceeded the registered population bound for classical tie error in seven cells, but a post hoc bound for Berkson error in only three. Detecting such gains at blind wells requires an accurate reference: with exact ties, 5--18 wells gave a power of 0.8 in most cells; with reference errors of 3\,ms or more, 40 wells did not. The F3 and Volve field tests (four and six wells) failed, and neither could have detected such gains. Teapot Dome has independent time--depth references at no more than two of its 152 wells. We make no field or calibration claim.
|
Seismic reservoir-property predictors are trained on well logs placed in two-way time by uncertain well ties. This study investigates how timing errors in these training labels affect the learned predictor. We show that errors independent of the data blur the optimal predictor and attenuate the seismic band, whereas, in a linear-Gaussian model, the error of a tie computed as a posterior mean sharpens it. In addition, training on labels sampled from a calibrated tie posterior has the same population optimum as training on true labels, but its population gain over a single tie is only of fourth order in the tie error. A controlled experiment matched the predicted blur to within 1\% for errors of 4--16\,ms at frequencies below about 23\,Hz. We then compared ways of placing the labels on synthetic data calibrated to the F3 block, where the true timing is known. When the tie model is correctly specified and dense time--depth anchors have known uncertainty, posterior-mean labels met the pre-registered improvement criterion at signal-to-noise ratios of 10, 0 and $-5$\,dB, reducing seismic-band RMSE by 8--22\% relative to the best deterministic tie. Field validation remains open: F3 and Volve, where we found no consistent improvement, have too few wells with independent, accurate time--depth references to detect such gains. An exploratory simulation indicates that detection requires 5--18 blind wells with an exact reference in most cases, and more than 40 when the reference error reaches 3\,ms.
|
||||||
\end{abstract}
|
\end{abstract}
|
||||||
|
|
||||||
\noindent\textbf{Keywords:} well tie; registration error; errors-in-variables; seismic porosity prediction; synthetic benchmark; blind-well validation; statistical power
|
\noindent\textbf{Keywords:} well tie; registration error; errors-in-variables; seismic porosity prediction; synthetic benchmark; blind-well validation; statistical power
|
||||||
|
|||||||
@@ -1,18 +1,20 @@
|
|||||||
\section{Introduction}
|
\section{Introduction}
|
||||||
\label{sec:intro}
|
\label{sec:intro}
|
||||||
|
|
||||||
Deep networks are widely used to map seismic amplitudes to reservoir properties such as porosity. The common workflow has four steps: tie each well to the seismic, resample the depth logs to two-way time (TWT), train a regressor from seismic to the time-domain labels, and score blind wells against labels produced by the same tie \citep[e.g.][]{xu2024sts,prabowo2025f3,tao2025structural,liu2023lowfrequency}. In this workflow the well tie is a preprocessing step. Its output, a single time--depth curve per well, is treated as exact.
|
Deep networks are widely used to map seismic amplitudes to reservoir properties such as porosity. The common workflow ties each well to the seismic, resamples the depth logs to two-way time (TWT), trains a regressor on the time-domain labels, and scores blind wells against labels produced by the same tie \citep[e.g.][]{xu2024sts,liu2023lowfrequency}. The workflow treats the resulting time--depth curve as exact. It is not exact: a well tie is an inverse problem with a posterior distribution. Bayesian treatments of that problem have existed for two decades and are still being developed \citep{buland2003bayesianwavelet,gunning2006waveletextractor,lim2025awsm}, but in those treatments the posterior is the end product and no learning step uses it.
|
||||||
|
|
||||||
The tie is not exact. It is an inverse problem with a posterior distribution, and Bayesian treatments of it have existed for two decades and are still being developed \citep{buland2003bayesianwavelet,gunning2006waveletextractor,lim2025awsm}. In those treatments the posterior is the end product: no learning step uses it. The size of the problem is easy to underestimate. At the four public wells of the F3 block, sonic-integrated TWT differs from the interpreted time--depth markers by up to 14--66\,ms, and the difference changes by up to 46\,ms inside a 500\,ms target window (Section~\ref{sec:data}). Two time--depth models distributed with the data disagree with the markers by up to 36\,ms. The dominant period of the seismic is 17--20\,ms. Label timing errors of one to several periods are therefore realistic, and they vary with depth, so a bulk lag cannot absorb them.
|
The timing error is large enough to matter. At the four public wells of the F3 block, sonic-integrated TWT differs from the interpreted time--depth markers by up to 14--66\,ms, and the difference changes by up to 46\,ms inside a 500\,ms target window (Section~\ref{sec:data}). The OpendTect time--depth model distributed with the data deviates from the markers by up to 36\,ms, and a second set of model files is offset from them by $-15$ to $+41$\,ms on average. The dominant period of the seismic is 17--20\,ms. Label timing errors of one to several periods are therefore realistic, and because they vary with depth, a bulk lag cannot absorb them.
|
||||||
|
|
||||||
This is a label error of a particular kind. The label values are measured, but they are placed at the wrong times. Work on noisy labels and on errors in variables mostly concerns errors in the values (Section~\ref{sec:related}). A registration error acts on the time index instead: it is correlated along the well, its effect depends on frequency, and it affects the reference against which blind wells are scored as well as the training labels. We ask what such an error does to a learned predictor, whether training on a tie posterior rather than a point tie removes its effect, and whether a field test can detect the difference. We make four contributions.
|
This error differs from the label errors usually studied. The label values are measured, but they are placed at the wrong times. Work on noisy labels and on errors in variables mostly concerns errors in the values (Section~\ref{sec:related}). A registration error acts on the time index instead. It is correlated along the well, its effect depends on frequency, and it affects the reference used to score blind wells as well as the training labels.
|
||||||
|
|
||||||
|
This study asks what such an error does to a learned predictor, whether training on a tie posterior removes its effect, and whether a field test can detect the difference. It makes four contributions.
|
||||||
\begin{enumerate}
|
\begin{enumerate}
|
||||||
\item[C1] \textbf{Theory.} Under an independence assumption, the MSE-optimal predictor trained on misregistered labels is the correctly registered predictor convolved with the distribution of the timing error, so the seismic band is attenuated by the characteristic function of the error (Proposition~\ref{prop:blur}). A controlled experiment matches this transfer to within 1\%. Without time anchors, a shared network and its label alignment can drift together without changing the loss (Proposition~\ref{prop:ident}), so losses that learn the alignment from the network's own predictions, such as soft-DTW \citep{cuturi2017softdtw} and DILATE \citep{leguen2019dilate}, cannot fix absolute timing. The error of an estimated tie can have the classical structure, which blurs the learned predictor, or the Berkson structure, which sharpens it (Proposition~\ref{prop:tie}). A calibrated bank of posterior labels has the population minimizer of training on the true labels, but its population gain over a point label is of fourth order in the tie error (Proposition~\ref{prop:bank}). We also relate the coverage of predictive intervals to the error structure (Proposition~\ref{prop:coverage}) and give the bias of scoring against a misregistered reference (Proposition~\ref{prop:reference}).
|
\item \textbf{Theory.} When timing errors are independent of the data, the predictor that minimizes the mean squared error (MSE) is the correctly registered predictor convolved with the error distribution, so the seismic band is attenuated (Proposition~\ref{prop:blur}). A controlled experiment matches this attenuation to within 1\% for errors of 4--16\,ms, in the band where the predictor has coherent power. The error of an estimated tie can instead have the Berkson structure, which sharpens the predictor (Proposition~\ref{prop:tie}). Without time anchors, a shared network and its label alignment can drift together without changing the loss (Proposition~\ref{prop:ident}), so losses that learn the alignment from the network's own predictions, such as soft-DTW \citep{cuturi2017softdtw}, cannot fix absolute timing. Training on a calibrated bank of posterior labels has the population optimum of training on true labels, but its population gain over a single label is only of fourth order in the tie error (Proposition~\ref{prop:bank}). We also relate the coverage of predictive intervals to the error structure (Proposition~\ref{prop:coverage}) and give the bias of scoring against a misregistered reference (Proposition~\ref{prop:reference}).
|
||||||
\item[C2] \textbf{A registration-aware benchmark.} We build synthetic data with known true warps from F3 geometry, rock physics and time--depth statistics. We vary drift, seismic signal-to-noise ratio and anchor density, and evaluate under locked, pre-registered pass rules. We report both comparisons that we registered: the first failed, and the second, designed after that failure, passed, with an explicit dependence on correctly specified anchor uncertainty. \todo{S1, S2, S3, S4 and S8 of \texttt{protocol\_bench}: grid fill, misspecification axes, B4 under the SMC posterior, second backbone, controlled cycle skipping.}
|
\item \textbf{A registration-aware benchmark.} Synthetic data built from F3 geometry, rock physics and time--depth statistics have known true warps. We vary drift, seismic signal-to-noise ratio and anchor density, misspecify the simulator along three axes, and evaluate under locked pass rules. The benchmark is released as a task package with hidden truth and a scorer that applies those rules.
|
||||||
\item[C3] \textbf{A family of baselines.} Registration-marginalized learning (RML$_\lambda$), a tempered log-likelihood over a bank of labels, contains point-tie training, hard-min and soft-min shift losses and soft-DTW as special cases (Lemmas~\ref{lem:s1}--\ref{lem:sdtw}). We use this family to define the methods compared on the benchmark, not as a proposed method that wins.
|
\item \textbf{A common loss family.} Registration-marginalized learning (RML$_\lambda$), a tempered log-likelihood over a bank of labels, contains point-tie training, hard-min and soft-min shift losses and soft-DTW as special cases (Lemmas~\ref{lem:s1}--\ref{lem:sdtw}). We use it to define the compared methods on one footing, not as a proposed method that wins.
|
||||||
\item[C4] \textbf{Detectability and the scope of field tests.} We derive how accurately the reference at blind wells must be tied, and how many blind wells are needed, for a comparison of tie methods to detect the effects of C1 (Corollary~\ref{cor:tolerance}, Section~\ref{sec:exp:detect}). We audit the public F3 well data: the porosity labels at three of the four wells are a linear function of the sonic log, and the time--depth markers are horizon-tie picks, not check shots. Pre-registered field tests on F3 and Volve failed, and an inventory of Teapot Dome found an independent time--depth reference at no more than two of its wells. These cases bound the scope of the paper.
|
\item \textbf{Requirements for a field test.} We derive how accurately the reference at blind wells must be tied, and how many blind wells are needed, for a comparison of tie methods to detect these effects (Corollary~\ref{cor:tolerance}, Section~\ref{sec:exp:detect}). We also audit the public F3 well data: the porosity labels at three of the four wells are a linear function of the sonic log, and the time--depth markers are horizon-tie picks, not check shots.
|
||||||
\end{enumerate}
|
\end{enumerate}
|
||||||
|
|
||||||
On the benchmark, labels at the posterior-mean warp of a sequential Monte Carlo tie beat the best point tie by 8--22\% in seismic-band RMSE at F3-like drift in all three full-anchor regimes. With the anchor uncertainty set at half or twice its true value, this advantage no longer passed the registered rule. A bank of posterior samples gained further when the posterior was wide. In seven of eight cells this gain exceeded the population bound that we registered, which assumes classical tie error, but in only three did it exceed the bound for the Berkson error of a posterior-mean tie, which we computed post hoc. With an exact reference, a sign test at blind wells needed 5--18 wells to detect these gains in most cells, and with reference errors of 3\,ms or more, 40 wells did not suffice. Neither public field dataset that we tested meets these conditions.
|
The benchmark results assume a correctly specified tie model and dense anchors of known uncertainty. Under these conditions, labels at the mean of a sequential Monte Carlo (SMC) tie posterior reduced seismic-band root-mean-square error (RMSE) by 8--22\% relative to the best deterministic tie at F3-like drift. Against the mean of an anchor-only posterior, the advantage held fully only at the highest signal-to-noise ratio. Training on a bank of samples from the same posterior added a gain of 2--11\% when the posterior was wide. Several tests failed, and each failure identifies something a tie posterior needs. A posterior that does not contract gives no gain, a wrong anchor uncertainty or wavelet phase removes the advantage, and seed ensembles do not carry tie uncertainty to new wells. Field tests on F3 and Volve showed no consistent improvement and could not have detected one, because they lack the blind wells and the independent references that a power analysis requires.
|
||||||
|
|
||||||
Section~\ref{sec:related} positions the work. Section~\ref{sec:data} describes the data and the audit, Section~\ref{sec:theory} the theory, and Section~\ref{sec:method} the tie posterior and the methods. Section~\ref{sec:experiments} reports the benchmark, the detectability analysis and the field cases. Section~\ref{sec:discussion} discusses what the results imply for field studies, and the limitations. Proofs are in Appendix~\ref{app:proofs}, and the field tests in Appendix~\ref{app:field}.
|
Section~\ref{sec:related} positions the work, Section~\ref{sec:data} describes the data, and Sections~\ref{sec:method} and~\ref{sec:theory} give the methods and the theory. Section~\ref{sec:experiments} reports the experiments, and Section~\ref{sec:discussion} draws out what held, what failed and what a field test requires. Appendices give the proofs (\ref{app:proofs}), the field tests (\ref{app:field}) and the protocol record (\ref{app:record}).
|
||||||
|
|||||||
@@ -1,25 +1,31 @@
|
|||||||
\section{Related work}
|
\section{Related work}
|
||||||
\label{sec:related}
|
\label{sec:related}
|
||||||
|
|
||||||
Three bodies of work meet in this problem, and they have so far been developed separately. Two others study uncertain labels: in statistics and machine learning in general, and in learned seismic interpretation.
|
Three bodies of work meet in this problem and have so far developed separately: well ties with uncertainty, learned property prediction from few wells, and losses that tolerate temporal misalignment. Two others study uncertain labels, in statistics and machine learning in general and in learned seismic interpretation.
|
||||||
|
|
||||||
\paragraph{Well ties and their uncertainty.}
|
\paragraph{Well ties have posteriors, but no learning step uses them.}
|
||||||
\citet{buland2003bayesianwavelet} model the mistie between seismic time and log time as latent marker shifts with a triangular prior. They estimate these shifts jointly with the wavelet by MCMC and report their posterior. \citet{gunning2006waveletextractor} estimate the wavelet jointly with check-shot and marker times (Gaussian priors, monotonicity enforced), a registration shift and a lateral positioning error per well. They obtain uncertainty from a Laplace approximation and choose the wavelet length by marginal likelihood. \citet{lim2025awsm} infer time--depth transform parameters and wavelets jointly with parallel-tempering MCMC and report uncertainty estimates for a Midland Basin case study. Neither prior over time shifts nor a posterior over the time--depth relation is therefore new. In these works, however, the posterior is the end product. \citet{lim2025awsm} pass the estimated wavelets on to AVO/AVA inversion; their abstract does not describe passing the time--depth uncertainty on to a later step. \citet{wu2017multiwelltie} tie several wells at once with smooth depth-variable shifts and give no tie uncertainty. \citet{herrera2012automatedtie} use dynamic time warping for the tie. Among learning-based methods, \citet{tschannen2022partialtie} estimate the wavelet with a variational network: their uncertainty is mainly in wavelet phase, and the bulk shift is found by Bayesian optimization within user-set bounds. \citet{di2023welltie} and \citet{li2025cascadedtie} automate the tie with self-supervised learning and cascaded matching. All these methods output a tie, sometimes with wavelet or shift uncertainty, and stop there.
|
\citet{buland2003bayesianwavelet} model the mistie between seismic time and log time as latent marker shifts with a triangular prior, and estimate them jointly with the wavelet by Markov chain Monte Carlo (MCMC). \citet{gunning2006waveletextractor} estimate the wavelet jointly with check-shot and marker times, a registration shift and a lateral positioning error per well, using a Laplace approximation for uncertainty. \citet{lim2025awsm} sample the stretch, shift and pinch-point parameters of a time--depth model jointly with the wavelet by parallel-tempering MCMC, and report time--depth uncertainty for 44 wells in the Midland Basin. They keep the median-misfit and minimum-misfit models to estimate angle-consistent wavelets, and no later step uses the posterior.
|
||||||
|
|
||||||
\paragraph{Learning reservoir properties from seismic with few wells.}
|
Other methods output a single tie. \citet{wu2017multiwelltie} tie several wells at once with smooth depth-variable shifts. \citet{herrera2012automatedtie} use dynamic time warping; in the published version \citep{herrera2014semiautomatic}, the warping replaces manual stretch-and-squeeze within bounds set by the interpreter and is meant as a guide. \citet{dacostasilva2026autotie} combine time-weighted dynamic time warping, Bayesian optimization of the tie parameters and segment-wise alignment; their abstract reports higher correlations at six wells and no tie uncertainty. \citet{tschannen2022partialtie} estimate the wavelet with a variational network, with uncertainty mainly in the wavelet phase and the bulk shift found by Bayesian optimization within user-set bounds. \citet{di2023welltie} automate the tie with self-supervised learning, and \citet{li2025cascadedtie} without learning, by a local-similarity scan followed by refinement of residual shifts. All these methods output a tie, sometimes with wavelet or shift uncertainty, and stop there.
|
||||||
Recent studies predict porosity or impedance with convolutional, recurrent or transformer networks, sometimes with physics constraints or uncertainty estimates \citep{alfarraj2019semisupervised,vashisth2022rwpinn,liu2023lowfrequency,xu2024sts,chen2024multidimensional,li2024bpinn,ntibahanana2024ensemble,corrales2024seis2rock,dou2024seismae,tao2025structural,prabowo2025f3,cordoba2025porosity,rezaei2026krigingrf,sukar2026uncertainty}. In the studies we read in full, the labels are placed on the seismic time axis by a tie that is taken as given. \citet{xu2024sts} say so explicitly, and their augmentation shifts windows laterally, not in time. \citet{ali2025syntheticpseudowells} name the seismic-to-well tie discrepancy as a challenge and avoid it by training on synthetic pseudo-wells. Where uncertainty is estimated, it is the uncertainty of the network or of the data noise. It does not include the uncertainty of the label timing. \citet{cordoba2025porosity} report noise-sensitivity tests, but their abstract does not mention the tie or misregistered labels. Bayesian and variational inversions give posteriors or credible intervals for porosity or impedance \citep{thiebaud2024lfc,rizzuti2024waveletflows,rizzuti2025uhr}, and a bootstrapped network ensemble gives a spread of elastic-property predictions \citep{lim2025bootnet}. None of these abstracts names the well tie as a source of uncertainty.
|
|
||||||
|
|
||||||
\paragraph{Losses that tolerate temporal misalignment.}
|
\paragraph{Learned property prediction takes the tie as given.}
|
||||||
Soft-DTW \citep{cuturi2017softdtw} and DILATE \citep{leguen2019dilate} replace the pointwise loss with a smoothed minimum over monotone alignments. Shift-tolerant losses that take the minimum over a set of bulk lags are a simpler variant. These losses use no time anchors, no physical tie model and no prior over warps. Proposition~\ref{prop:ident} shows that, without anchors, the absolute timing they learn is not identified. Learned alignment has also been applied to seismic inputs. \citet{huff2024anglestack} train a CNN on synthetic angle stacks moveout-corrected with true and perturbed velocities and use it to align field angle stacks. There the misaligned quantities are the inputs, and the synthetic targets are aligned by construction.
|
Recent studies predict porosity or impedance with neural networks or tree ensembles, sometimes with physics constraints or uncertainty estimates \citep{alfarraj2019semisupervised,vashisth2022rwpinn,liu2023lowfrequency,xu2024sts,chen2024multidimensional,li2024bpinn,ntibahanana2024ensemble,corrales2024seis2rock,dou2024seismae,tao2025structural,prabowo2025f3,cordoba2025porosity,rezaei2026krigingrf,sukar2026uncertainty}. In the field studies we read in full that work in time, a tie that is taken as given places the labels on the seismic axis. \citet{xu2024sts} say so explicitly, and their augmentation shifts windows laterally, not in time. \citet{li2024bpinn} calibrate the forward model of a Bayesian physics-informed network with a tie that is then fixed; their posterior is over network weights. Other studies avoid the tie. \citet{alfarraj2019semisupervised} and \citet{vashisth2022rwpinn} use synthetic data only, \citet{rezaei2026krigingrf} work on a depth-converted cube whose conversion is taken as given, and \citet{ali2025syntheticpseudowells} name the seismic-to-well discrepancy as a challenge and train on synthetic pseudo-wells. In \citet{sukar2026uncertainty} the labels are simulated property changes paired with synthetic 4D attribute maps, so no well tie places them.
|
||||||
|
|
||||||
\paragraph{Label noise and errors in variables.}
|
Where these studies estimate uncertainty, it is that of the network or of the data noise, not of the label timing. \citet{cordoba2025porosity} report noise-sensitivity tests, but their abstract does not mention the tie or misregistered labels. Bayesian and variational inversions give posteriors or credible intervals for porosity or impedance \citep{thiebaud2024lfc,rizzuti2024waveletflows,rizzuti2025uhr}, and a bootstrapped ensemble trained on rock-physics synthetics gives a spread of elastic-property predictions \citep{lim2025bootnet}. None treats the tie as a source of uncertainty (for \citet{thiebaud2024lfc} we read the abstract only). \citet{rizzuti2025uhr} treat the wavelet as known, estimated at the trace nearest a projected cone-penetration-test site, and list bringing these effects into the uncertainty framework as future work. \citet{castagna2026quality} argue that the correlation coefficient does not measure the information a prediction shares with the presumed truth, and propose information-theoretic measures, also as training losses. They note that time--depth functions are never exact and that time shifts degrade mainly the higher frequencies. Their measures depend only on value distributions and are insensitive to small shifts, but they neither model the timing error nor carry it into training, and their porosity example with five training wells does not describe the tie.
|
||||||
Measurement-error models distinguish classical error, which is independent of the true value, from Berkson error, which is independent of the assigned value \citep{berkson1950two,fuller1987measurement,carroll2006measurement}. In linear regression, classical error in a covariate attenuates the fitted slope, while Berkson error leaves it unbiased and adds variance. Work on noisy labels in machine learning mostly treats corrupted class labels, with robust losses, sample selection or models of the corruption process \citep{frenay2014label,song2023noisy}. Closest to our setting, \citet{mnih2012aerial} train a network to label roads in aerial images from maps whose objects are misplaced. They model the observed map as a translated crop of the true map, marginalize the likelihood over a small set of translations whose prior is set on validation data, and fit it by expectation--maximization. Without its omission term, this is a bank of shifted labels with $\lambda = 1$ and no anchors (Section~\ref{sec:method:rml}). They also score predictions with a tolerance of three pixels, because the ground truth is itself misregistered, and suggest that their noise-robust models lost precision at low recall on one test set because that set was poorly registered. Proposition~\ref{prop:reference} states the analogous effect for band MSE. The spectral effect of random timing errors has long been studied for sampling jitter \citep{balakrishnan1962jitter}. A misregistered well label differs from these cases in where the error enters. Its values are correct, but they are placed at the wrong times. The error acts on the time index, it is correlated along the well, and its effect depends on frequency: it leaves the low frequencies nearly unchanged and blurs the seismic band (Proposition~\ref{prop:blur}). The classical and Berkson structures carry over to the time index, where they bias the learned predictor in opposite directions (Proposition~\ref{prop:tie}).
|
|
||||||
|
|
||||||
\paragraph{Label uncertainty in learned seismic interpretation.}
|
\paragraph{Alignment losses use no anchors and no physical tie.}
|
||||||
\citet{quesada2024faultlabels} collected fault labels on 400 F3 images from 38 annotators with different expertise and confidence. \citet{mirza2025labelquality} assess the variability of manual salt interpretations together with seismic image quality. \citet{guillon2020gtmetrics} add a tolerance distance to fault and horizon metrics, because thin boundaries cannot be placed exactly. In these works the label is an interpretation of the seismic image itself, the task is classification or segmentation, and the uncertainty is described by annotator disagreement or a spatial tolerance. In our problem the label values come from well logs, and their position on the seismic time axis is what is uncertain. A physical tie model conditioned on anchors gives a posterior for that position.
|
Soft-DTW \citep{cuturi2017softdtw} and DILATE \citep{leguen2019dilate} replace the pointwise loss with a smoothed minimum over monotone alignments, and shift-tolerant losses take the minimum over a set of bulk lags. Apart from DILATE's penalty on departure from the label time axis, these losses have no prior over warps. Proposition~\ref{prop:ident} shows that, without anchors, the absolute timing they learn is not identified. Learned alignment has also been applied to seismic inputs: \citet{huff2024anglestack} train a CNN on synthetic angle stacks moveout-corrected with true and perturbed velocities and use it to align field angle stacks. There the misaligned quantities are the inputs, and the synthetic targets are aligned by construction.
|
||||||
|
|
||||||
|
\paragraph{Error models for labels mostly concern values, not positions.}
|
||||||
|
Measurement-error models distinguish classical error, independent of the true value, from Berkson error, independent of the assigned value \citep{berkson1950two,fuller1987measurement,carroll2006measurement}. In linear regression, classical error in a covariate attenuates the fitted slope, while Berkson error leaves it unbiased and adds variance. Work on noisy labels in machine learning mostly treats corrupted class labels \citep{frenay2014label,song2023noisy}. Closest to our setting, \citet{mnih2012aerial} train a network to label roads in aerial images from maps whose objects are misplaced. They marginalize the likelihood over a small set of label translations, with a prior set on validation data, and fit it by expectation--maximization. Without its omission term this is a bank of shifted labels with $\lambda = 1$ and no anchors (Section~\ref{sec:method:rml}). They also score with a tolerance of three pixels because the ground truth is itself misregistered, and suggest that poor registration of one test set cost their noise-robust models precision at low recall. Proposition~\ref{prop:reference} states the analogous effect for band MSE.
|
||||||
|
|
||||||
|
The spectral effect of random timing errors has long been studied for sampling jitter \citep{balakrishnan1962jitter}. A misregistered well label differs in where the error enters. Its values are correct but placed at the wrong times, the error is correlated along the well, and it blurs the seismic band while leaving the low frequencies nearly unchanged (Proposition~\ref{prop:blur}). The classical and Berkson structures carry over to the time index, where they bias the learned predictor in opposite directions (Proposition~\ref{prop:tie}).
|
||||||
|
|
||||||
|
\paragraph{In seismic interpretation, label uncertainty describes the interpreter.}
|
||||||
|
\citet{quesada2024faultlabels} collected fault labels on 400 F3 images from 38 annotators with different expertise and confidence, and \citet{mirza2025labelquality} assess the variability of manual salt interpretations together with image quality. \citet{guillon2020gtmetrics} add a tolerance distance to fault and horizon metrics, because picks of the same boundary by different interpreters differ by a few pixels. The tolerance enters only the evaluation, and they name a tolerance-aware training loss as future work. In these works the label is an interpretation of the seismic image itself. In our problem the label values come from well logs, and a physical tie model conditioned on anchors gives a posterior for their position on the seismic axis.
|
||||||
|
|
||||||
\paragraph{Position of this work.}
|
\paragraph{Position of this work.}
|
||||||
Table~\ref{tab:positioning} summarizes the comparison. The ingredients are not new: tie posteriors \citep{buland2003bayesianwavelet,gunning2006waveletextractor}, the spectral effect of random timing errors \citep{balakrishnan1962jitter}, the classical and Berkson error structures \citep{carroll2006measurement}, and a likelihood marginalized over label translations \citep{mnih2012aerial}. To our knowledge, in the reviewed literature no work combines them for seismic property prediction. None analyses how tie error in the training labels changes the learned predictor, feeds a tie posterior into training and evaluates the result under known registration error, or derives how accurate the reference at blind wells must be for a comparison of tie methods to detect a difference. The tie posterior itself builds directly on \citet{buland2003bayesianwavelet} and \citet{gunning2006waveletextractor}.
|
The ingredients are not new: tie posteriors \citep{buland2003bayesianwavelet,gunning2006waveletextractor}, the spectral effect of random timing errors \citep{balakrishnan1962jitter}, the classical and Berkson structures \citep{carroll2006measurement}, and a likelihood marginalized over label translations \citep{mnih2012aerial}. To our knowledge, no work in the reviewed literature combines them for seismic property prediction (Table~\ref{tab:positioning}). None analyses how tie error in the training labels changes the learned predictor, or feeds a tie posterior into training and evaluates the result under known registration error. None derives how accurate the reference at blind wells must be for a comparison of tie methods to detect a difference.
|
||||||
|
|
||||||
\begin{table}[t]
|
\begin{table}[t]
|
||||||
\centering
|
\centering
|
||||||
@@ -32,21 +38,21 @@ Work & DL & Tie & Tie UQ & UQ$\to$train & Reg.\ eval. \\
|
|||||||
\midrule
|
\midrule
|
||||||
\citet{prabowo2025f3,tao2025structural,xu2024sts,liu2023lowfrequency,corrales2024seis2rock} & \checkmark & -- & -- & -- & -- \\
|
\citet{prabowo2025f3,tao2025structural,xu2024sts,liu2023lowfrequency,corrales2024seis2rock} & \checkmark & -- & -- & -- & -- \\
|
||||||
\citet{cordoba2025porosity}\textsuperscript{a} & \checkmark & -- & -- & -- & -- \\
|
\citet{cordoba2025porosity}\textsuperscript{a} & \checkmark & -- & -- & -- & -- \\
|
||||||
\citet{li2024bpinn}\textsuperscript{a}, \citet{sukar2026uncertainty} & \checkmark & -- & -- & -- & -- \\
|
\citet{li2024bpinn,sukar2026uncertainty} & \checkmark & -- & -- & -- & -- \\
|
||||||
\citet{rizzuti2024waveletflows,rizzuti2025uhr,lim2025bootnet}\textsuperscript{a} & \checkmark & -- & -- & -- & -- \\
|
\citet{rizzuti2024waveletflows,rizzuti2025uhr,lim2025bootnet} & \checkmark & -- & -- & -- & -- \\
|
||||||
\citet{ali2025syntheticpseudowells} & \checkmark & -- & avoided & -- & -- \\
|
\citet{ali2025syntheticpseudowells} & \checkmark & -- & avoided & -- & -- \\
|
||||||
\citet{di2023welltie}\textsuperscript{a}, \citet{li2025cascadedtie} & -- & \checkmark & -- & -- & -- \\
|
\citet{di2023welltie}\textsuperscript{a}, \citet{li2025cascadedtie}, \citet{dacostasilva2026autotie}\textsuperscript{a} & -- & \checkmark & -- & -- & -- \\
|
||||||
\citet{tschannen2022partialtie} & -- & \checkmark & partial & -- & -- \\
|
\citet{tschannen2022partialtie} & -- & \checkmark & partial & -- & -- \\
|
||||||
\citet{wu2017multiwelltie} & -- & \checkmark & -- & -- & -- \\
|
\citet{wu2017multiwelltie,herrera2012automatedtie} & -- & \checkmark & -- & -- & -- \\
|
||||||
\citet{buland2003bayesianwavelet,gunning2006waveletextractor} & -- & \checkmark & \checkmark & -- & -- \\
|
\citet{buland2003bayesianwavelet,gunning2006waveletextractor} & -- & \checkmark & \checkmark & -- & -- \\
|
||||||
\citet{lim2025awsm}\textsuperscript{a} & -- & \checkmark & \checkmark & -- & -- \\
|
\citet{lim2025awsm} & -- & \checkmark & \checkmark & -- & -- \\
|
||||||
Soft-DTW, DILATE & generic & soft & -- & -- & -- \\
|
Soft-DTW, DILATE & generic & soft & -- & -- & -- \\
|
||||||
\citet{mnih2012aerial} & seg. & -- & -- & transl. & tol. \\
|
\citet{mnih2012aerial} & seg. & -- & -- & transl. & tol. \\
|
||||||
\citet{quesada2024faultlabels}\textsuperscript{a}, \citet{mirza2025labelquality}\textsuperscript{a} & seg. & -- & -- & -- & -- \\
|
\citet{quesada2024faultlabels}\textsuperscript{a}, \citet{mirza2025labelquality}\textsuperscript{a} & seg. & -- & -- & -- & -- \\
|
||||||
\citet{guillon2020gtmetrics}\textsuperscript{a} & seg. & -- & -- & -- & tol. \\
|
\citet{guillon2020gtmetrics} & seg. & -- & -- & -- & tol. \\
|
||||||
This work & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark \\
|
This work & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark \\
|
||||||
\bottomrule
|
\bottomrule
|
||||||
\end{tabular}
|
\end{tabular}
|
||||||
\end{table}
|
\end{table}
|
||||||
|
|
||||||
\todoblock{(1) SEG and EAGE expanded abstracts 2024--2026 were scanned on 28/10/2026; the ten entries added then are abstract-only (\texttt{refs.bib}, block dated 2026-10-28). Still open: the IMAGE 2026 abstract by Palavicini Gurria et al.\ on well ties and seismic inversion as quantitative quality controls (in the official program, text not retrieved); the DOI and pages of \citet{quesada2024faultlabels}; rerun the novelty search on the submission day and revise ``to our knowledge'' if needed. (2) The 28/10 SEG/EAGE entries were assessed from abstracts only; read the full texts if obtained, otherwise keep the footnote. (Full texts of \citet{chen2024multidimensional}, \citet{li2024bpinn}, \citet{di2023welltie} and \citet{dou2024seismae} cannot be obtained, confirmed 28/10/2026; every use of them above was checked against the abstracts and the footnote stays.) (3) Decide whether to cite the Geophysics 2014 version of Herrera \& van der Baan (not obtained; the 2012 preprint is cited). (4) Check that the ``UQ$\to$train'' column is fair to \citet{sukar2026uncertainty}.}
|
\todoblock{(1) A preliminary novelty scan was run on 02/11/2026 (Crossref, OpenAlex 2025--2026 and web search; queries and hits in \texttt{docs/plan.md} \S12 item 31). It found no work that feeds tie uncertainty into the training of a property predictor; ``to our knowledge'' stands, and \citet{herrera2014semiautomatic}, \citet{dacostasilva2026autotie} and \citet{castagna2026quality} were added (the first two from abstracts only; \citet{castagna2026quality} read in full on 02/11/2026). Rerun the scan on the submission day (13/11/2026). Still open then: the IMAGE 2026 abstract by Palavicini Gurria et al.\ on well ties and seismic inversion as quantitative quality controls (in the official program; on 02/11/2026 no IMAGE 2026 expanded abstract was indexed in Crossref or OpenAlex), and the DOI and pages of \citet{quesada2024faultlabels} (not found on 28/10 or 02/11; otherwise keep the lab-page URL). (2) Entries marked \textsuperscript{a} in Table~\ref{tab:positioning} were assessed from abstracts only; their full texts cannot be obtained (closed 02/11/2026), so the markers stay. Full texts of \citet{lim2025awsm}, \citet{lim2025bootnet}, \citet{li2024bpinn}, \citet{guillon2020gtmetrics}, \citet{rizzuti2024waveletflows} and \citet{rizzuti2025uhr} were obtained on 02/11/2026; every use above was checked against them, the table classifications did not change, and their markers were removed. (Full texts of \citet{chen2024multidimensional}, \citet{di2023welltie} and \citet{dou2024seismae} cannot be obtained, confirmed 28/10/2026; every use of them above was checked against the abstracts.)}
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
\section{Data and audit}
|
\section{Data and audit}
|
||||||
\label{sec:data}
|
\label{sec:data}
|
||||||
|
|
||||||
|
The theory is tested on a synthetic benchmark whose statistics come from the F3 block, because only synthetic data give the true registration. F3 and the Volve field test the results on real wells (Section~\ref{sec:exp:scope} and Appendix~\ref{app:field}, which also describes Volve).
|
||||||
|
|
||||||
\subsection{F3 block}
|
\subsection{F3 block}
|
||||||
\label{sec:data:f3}
|
\label{sec:data:f3}
|
||||||
|
|
||||||
We use the public F3 Demo 2023 release of the F3 block, Dutch sector of the North Sea \todo{dataset citation (dGB Earth Sciences / TNO); licence CC BY-SA 3.0, verify wording}. The post-stack volume covers inlines 100--750 and crosslines 300--1250 at 4\,ms sampling. Four vertical wells have sonic (DT), density (RHOB) and effective porosity (PHIE) logs: F02-1, F03-2, F03-4 and F06-1. The release also contains seven interpreted horizons and time--depth (TD) markers at each well. All learning experiments use the window 600--1100\,ms TWT (126 samples). Tie likelihoods and anchors use the extended window 400--1300\,ms.
|
We use the public F3 Demo 2023 release of the F3 block, Dutch sector of the North Sea, distributed by dGB Earth Sciences as an OpendTect project under a CC BY-SA 3.0 licence \citep{dgb2023f3demo}. The post-stack volume covers inlines 100--750 and crosslines 300--1250 at 4\,ms sampling. Four vertical wells have sonic (DT), density (RHOB) and effective porosity (PHIE) logs: F02-1, F03-2, F03-4 and F06-1. The release also contains seven interpreted horizons and time--depth (TD) markers at each well. All learning experiments use the window 600--1100\,ms TWT (126 samples), and tie likelihoods and anchors use the extended window 400--1300\,ms. Within the target window the amplitude spectrum of the volume peaks near 60\,Hz (43--62\,Hz around the wells), with a mean frequency of 49\,Hz, so the dominant period is 17--20\,ms. The $-20$\,dB band of the volume spans 4--83\,Hz.
|
||||||
|
|
||||||
Within the target window, the amplitude spectrum around the wells and over the volume peaks near 60\,Hz with a mean frequency of 49\,Hz. The dominant period is therefore 17--20\,ms. The $-20$\,dB band of the volume spans 4--83\,Hz.
|
An audit of the well data before any modelling changed how we use them (Table~\ref{tab:audit}).
|
||||||
|
|
||||||
We audited the well data before any modelling. Table~\ref{tab:audit} summarizes the findings, and the paragraphs below explain them.
|
|
||||||
|
|
||||||
\begin{table}[t]
|
\begin{table}[t]
|
||||||
\centering
|
\centering
|
||||||
@@ -20,53 +20,48 @@ We audited the well data before any modelling. Table~\ref{tab:audit} summarizes
|
|||||||
\toprule
|
\toprule
|
||||||
Well & IL/XL & $\Delta t_{\mathrm{DT}}$ (ms) & change (ms) & $\max|\Delta t_{\mathrm{wlt}}|$ (ms) & $K$ & Label \\
|
Well & IL/XL & $\Delta t_{\mathrm{DT}}$ (ms) & change (ms) & $\max|\Delta t_{\mathrm{wlt}}|$ (ms) & $K$ & Label \\
|
||||||
\midrule
|
\midrule
|
||||||
F02-1 & 362/336 & $+2 \to -44$ & 46 & 28.5 & 11 & from RHOB ($R^2=0.84$) \\
|
F02-1 & 362/336 & $+2 \to -44$ & 46 & 28.6 & 11 & from RHOB ($R^2=0.84$) \\
|
||||||
F03-2 & 722/848 & $-3 \to -14$ & 11 & 10.2 & 9 & $-0.2018+0.0011\,\mathrm{DT}$ \\
|
F03-2 & 722/848 & $-3 \to -14$ & 11 & 9.6 & 9 & $-0.2018+0.0011\,\mathrm{DT}$ \\
|
||||||
F03-4 & 442/1007 & $-42 \to -52$ & 10 & 9.2 & 9 & $-0.2018+0.0011\,\mathrm{DT}$ \\
|
F03-4 & 442/1007 & $-42 \to -52$ & 10 & 8.8 & 9 & $-0.2018+0.0011\,\mathrm{DT}$ \\
|
||||||
F06-1 & 244/387 & $-21 \to -66$ & 45 & 36.4 & 10 & $-0.2018+0.0011\,\mathrm{DT}$ \\
|
F06-1 & 244/387 & $-21 \to -66$ & 45 & 36.5 & 10 & $-0.2018+0.0011\,\mathrm{DT}$ \\
|
||||||
\bottomrule
|
\bottomrule
|
||||||
\end{tabular}
|
\end{tabular}
|
||||||
\end{table}
|
\end{table}
|
||||||
|
|
||||||
\paragraph{Geometry.}
|
\paragraph{Well spacing is uneven.}
|
||||||
We located the wells by applying the survey's bin-to-coordinate transform to the wellhead coordinates. F02-1 and F06-1 are 3.2\,km apart, and the other pairs are 8--17\,km apart. The distance to the nearest training well therefore differs greatly between leave-one-well-out folds.
|
Applying the survey's bin-to-coordinate transform to the wellhead coordinates places F02-1 and F06-1 3.2\,km apart and the other pairs 8--17\,km apart. The distance to the nearest training well therefore differs greatly between leave-one-well-out folds.
|
||||||
|
|
||||||
\paragraph{Time--depth relation.}
|
\paragraph{The time--depth sources disagree, and the markers are not check shots.}
|
||||||
Integrating the sonic from the first log sample, as is common in learning studies, gives TWT that differs from the TD markers in the window by up to 14--66\,ms, depending on the well. The difference changes with depth by 10--46\,ms (Table~\ref{tab:audit}, Fig.~\ref{fig:tddrift}). The sign is negative at depth, so sonic time is early, as expected from velocity dispersion. The two TD models distributed with the data also disagree. The OpendTect model deviates from the markers by up to 36.4\,ms. A second set of model files is offset from the check-shot tables by $+40.5$, $+40.2$, $+25.2$ and $-14.6$\,ms on average. The sign and size of this offset vary by well, and at F06-1 it changes sign with depth. A datum correction does not explain it. The ``check-shot'' tables have exactly the same depths as the markers. They are horizon-tie picks made on this seismic volume, not independent check-shot surveys. We therefore treat them as anchors with a pick uncertainty $\sigma_a$. The robust spread (MAD) of marker--horizon time differences over 18 pairs at the four wells is 6.9\,ms, and we use $\sigma_a = 7$\,ms. Each well has 9--11 anchors in the target window, 8 to about 148\,ms apart.
|
Integrating the sonic from the first log sample, as is common in learning studies, gives TWT that differs from the TD markers in the window by up to 14--66\,ms, depending on the well. The difference changes with depth by 10--46\,ms (Table~\ref{tab:audit}, Fig.~\ref{fig:tddrift}). It is negative at depth, so sonic time is early, as expected from velocity dispersion. The two TD models distributed with the data also disagree. The OpendTect model deviates from the markers by up to 36.5\,ms. A second set of model files is offset from the check-shot tables by $+40.5$, $+40.2$, $+25.2$ and $-14.6$\,ms on average; at F06-1 the offset changes sign with depth, and a datum correction does not explain it.
|
||||||
|
|
||||||
|
The ``check-shot'' tables are these markers, with the same depths and times. They are horizon-tie picks made on this seismic volume, not independent check-shot surveys. We therefore treat them as anchors with a pick uncertainty $\sigma_a$. The median absolute deviation (MAD) of marker--horizon time differences over 18 pairs at the four wells is 6.9\,ms, and we use $\sigma_a = 7$\,ms. Each well has 9--11 anchors in the target window, 8 to about 148\,ms apart.
|
||||||
|
|
||||||
\begin{figure}[t]
|
\begin{figure}[t]
|
||||||
\centering
|
\centering
|
||||||
\includegraphics[width=\linewidth]{td_drift.pdf}
|
\includegraphics[width=\linewidth]{td_drift.pdf}
|
||||||
\caption{Offset of three time--depth sources from the TD markers at the four F3 wells: sonic integrated from a single shallow anchor (integrated DT), the distributed OpendTect time--depth model, and a second distributed model (DT model). The shaded band is the 600--1100\,ms target window.}
|
\caption{Offset of three time--depth sources from the TD markers at the four F3 wells: sonic integrated from a single shallow anchor (integrated DT), the distributed OpendTect time--depth model, and a second set of distributed model files of unknown provenance (DT model). The shaded band is the 600--1100\,ms target window.}
|
||||||
\label{fig:tddrift}
|
\label{fig:tddrift}
|
||||||
\end{figure}
|
\end{figure}
|
||||||
|
|
||||||
\paragraph{Labels.}
|
\paragraph{The F3 ``porosity'' label is a linear transform of sonic slowness.}
|
||||||
At F03-2, F03-4 and F06-1, PHIE is an exact linear function of the sonic log: $\mathrm{PHIE} = -0.2018 + 0.0011\,\mathrm{DT}$ (DT in $\mu$s/m, $R^2 = 1.00000$, maximum error $10^{-4}$). It is equally exactly $(2650 - \mathrm{RHOB})/1600$. The density at these wells is itself derived from sonic: a national well-log archive shows that the density at F03-4 and F06-1 is a predicted log, and the measured density at F03-2 starts below the target window. At F02-1, PHIE follows the measured density ($R^2 = 0.84$) but is not a deterministic function of it. To give all four wells the same label definition, we use $\mathrm{PHIE}_{\mathrm{DT}} = -0.2018 + 0.0011\,\mathrm{DT}$ at all wells and report the original PHIE as a sensitivity check. The F3 ``porosity'' target in this paper is therefore a linear transform of sonic slowness. We call it porosity only in this sense. Density porosity computed from measured density explains 27--59\% of the variance of this label at four wells with measured density in the window (F02-1, F03-4 and two archive wells outside the release). Choosing the label is therefore choosing what is learned. There is one benefit: the rock-physics chain $\phi \to \mathrm{DT} \to \mathrm{RHOB} \to$ acoustic impedance is known exactly, so the physical tie likelihood of Section~\ref{sec:method} is not an approximation on F3.
|
At F03-2, F03-4 and F06-1, PHIE is an exact linear function of the sonic log: $\mathrm{PHIE} = -0.2018 + 0.0011\,\mathrm{DT}$ (DT in $\mu$s/m, $R^2 = 1.00000$, maximum error $10^{-4}$). It is equally exactly $(2650 - \mathrm{RHOB})/1600$, because the density at these wells is itself derived from sonic. A national well-log archive shows that the density in the release at F03-4 and F06-1 is a predicted log (the archive holds a measured log at F03-4), and the measured density at F03-2 starts below the target window. At F02-1, PHIE follows the measured density ($R^2 = 0.84$) but is not a deterministic function of it.
|
||||||
|
|
||||||
\subsection{Synthetic benchmark (D2)}
|
To give all four wells one label definition, we use $\mathrm{PHIE}_{\mathrm{DT}} = -0.2018 + 0.0011\,\mathrm{DT}$ at all wells and report the original PHIE as a sensitivity check. We call this target porosity only in this sense. Density porosity computed from density measured in the national archive explains 27--59\% of its variance at four wells with measured density in the window (F02-1, F03-4 and two archive wells outside the release). Choosing the label is therefore choosing what is learned. There is one benefit: the rock-physics chain $\phi \to \mathrm{DT} \to \mathrm{RHOB} \to$ acoustic impedance is known exactly, so the physical tie likelihood of Section~\ref{sec:method} is not an approximation on F3.
|
||||||
|
|
||||||
|
\subsection{Synthetic benchmark}
|
||||||
\label{sec:data:d2}
|
\label{sec:data:d2}
|
||||||
|
|
||||||
The synthetic benchmark makes the true registration known while keeping the F3 statistics. Five F3 horizons (Shallow, FS8, FS7, Truncation, MFS4) define the stratigraphic frame. Porosity is a trend ($\phi_0 = 0.32$, slope $-0.008$ per 100\,ms) plus unit offsets and a sum of two Ornstein--Uhlenbeck fields in stratigraphic coordinates (standard deviations 0.010 and 0.006, correlation lengths 10 and 2\,ms), clipped to $[0.05, 0.45]$. The F3 rock physics maps porosity to DT, RHOB and impedance. Seismic is the reflectivity convolved with a 128\,ms zero-phase statistical wavelet estimated from F3, plus noise at a prescribed signal-to-noise ratio (SNR).
|
The synthetic benchmark makes the true registration known while keeping the F3 statistics. Five F3 horizons (Shallow, FS8, FS7, Truncation, MFS4) define the stratigraphic frame. Porosity is a trend ($\phi_0 = 0.32$, slope $-0.008$ per 100\,ms) plus unit offsets and a sum of two Ornstein--Uhlenbeck fields in stratigraphic coordinates (standard deviations 0.010 and 0.006, correlation lengths 10 and 2\,ms), clipped to $[0.05, 0.45]$. The F3 rock physics maps porosity to DT, RHOB and impedance. Seismic is the reflectivity convolved with a 128\,ms zero-phase statistical wavelet estimated from F3, plus noise at a prescribed signal-to-noise ratio (SNR). The SNR is a power ratio computed on the clean central trace of the input patch over the extended window. The noise is white noise convolved with the same wavelet, so it occupies the seismic band. It is independent between the nine traces of the patch, so averaging over the patch can raise the effective SNR by up to a factor of nine in power.
|
||||||
|
|
||||||
The true time--depth warp of each well is drawn from the warp prior of Section~\ref{sec:method:prior}, fitted to the F3 anchors, and scaled by a drift factor $c$ ($g \to c\,g$, $b \to c\,b$). $c = 1$ reproduces the F3 drift level, and $c = 0$ is perfect registration. Anchors are the true times at stratigraphic markers plus $\N(0, \sigma_a^2)$ noise with $\sigma_a = 7$\,ms. Each realization has a pool of 16 training wells, from which nested subsets of $N$ wells are drawn, and 8 test wells at least 1\,km from every other well. Labels are scored in the true time of the earth model. We use five observation regimes:
|
The true time--depth warp of each well is drawn from the warp prior of Section~\ref{sec:method:prior}, fitted to the F3 anchors, and scaled by a drift factor $c$ ($g \to c\,g$, $b \to c\,b$). The generating bulk spread is $\sigma_b = 19$\,ms, and the registration uses a wider, fixed $\sigma_b = 50$\,ms. The value $c = 1$ reproduces the F3 drift level, and $c = 0$ is perfect registration. Anchors are the true times at stratigraphic markers plus $\N(0, \sigma_a^2)$ noise with $\sigma_a = 7$\,ms. Each realization has a pool of 16 training wells, from which nested subsets of $N$ wells are drawn, and 8 test wells at least 1\,km from every other well. Labels are scored in the true time of the earth model. Realizations are split into development realizations (numbered from 900), used for every design choice, and test realizations (0--15), used only for results.
|
||||||
|
|
||||||
|
We use five observation settings. Three have the full anchor density, at SNR 10, 0 and $-5$\,dB. The other two thin the anchors: the \emph{half-anchor} setting has SNR 0\,dB with half the anchors, and the \emph{two-anchor} setting has SNR 10\,dB with only the top and bottom anchors. Under the F3 warp prior, the $-5$\,dB setting gives the posterior width closest to F3 (Section~\ref{sec:exp:p2r}). A \emph{cell} is one combination of observation setting, drift factor $c$ and number of training wells $N$.
|
||||||
|
|
||||||
|
\paragraph{Misspecified simulators.}
|
||||||
|
The misspecification study of Experiment~3 generates the data with a simulator that departs from the model used for registration, which keeps the nominal rock physics, a statistical wavelet with a constant phase, and the warp prior of Section~\ref{sec:method:prior}. There are three axes, each with a mild and a strong level (Table~\ref{tab:s2}).
|
||||||
\begin{itemize}
|
\begin{itemize}
|
||||||
\item R10, R0 and Rm5: SNR 10, 0 and $-5$\,dB, full anchor density;
|
\item \emph{Rock physics.} The DT intercept (matrix slowness) is scaled in each stratigraphic unit by $1 + \sigma_{\mathrm{rp}}\zeta_u$, $\zeta_u \sim \N(0, 1)$, with $\sigma_{\mathrm{rp}} = 0.10$ (mild, about $\pm 18\,\mu$s/m) or $0.15$ (strong).
|
||||||
\item R0h: SNR 0\,dB with half the anchors;
|
\item \emph{Wavelet.} The phase spectrum is half (mild) or all (strong) of the minimum-phase spectrum of the nominal amplitude spectrum. A separate preset applies constant-$Q$ attenuation (quality factor $Q = 80$ from 400\,ms, with dispersion), which lowers the peak frequency from 59 to 32\,Hz across the window.
|
||||||
\item R10tb: SNR 10\,dB with only the top and bottom anchors.
|
\item \emph{Warp prior.} The mild level, the \emph{scaled warp prior}, multiplies the bulk-offset standard deviation by 3 (which exceeds the value fixed in the registration), the drift standard deviation by 1.5 and the correlation length by 0.5. The strong level, the \emph{out-of-family warp}, adds components the prior cannot represent: an 8\,ms step just below Truncation, plus jitter with standard deviation 1\,ms and correlation length 8\,ms.
|
||||||
\end{itemize}
|
\end{itemize}
|
||||||
Under the F3 warp prior, Rm5 gives the posterior width closest to F3 (Section~\ref{sec:exp:p2r}).
|
The model error measures the size of a seismic misspecification. It is the RMS residual between the clean seismic and the best synthetic in the registration's model family at the true warp, divided by the RMS of the noise at 10\,dB. It is 0.23 for the nominal simulator and 1.08--1.93 for the five seismic presets. Appendix~\ref{app:record} records how the levels were chosen.
|
||||||
|
|
||||||
\subsection{Volve field}
|
|
||||||
\label{sec:data:volve}
|
|
||||||
|
|
||||||
The second field dataset is Volve (Norwegian North Sea), released by Equinor under a CC BY-NC-SA 4.0 licence \todo{dataset citation (Equinor Volve data village)}. Its role is to break the label structure of F3. The computed effective porosity PHIF of the operator's petrophysical interpretation is driven by density, not by sonic: within each well its correlation with RHOB is $-0.92$ to $-0.99$, RHOB and NPHI explain 84--98\% of its variance, and adding DT raises this by at most 0.9 percentage points. Six wells have DT, RHOB, NPHI and PHIF: F-1, F-1 A, F-1 B, F-11 A, F-11 T2 and F-12. All six are deviated (maximum inclination 30--82$^\circ$; 4--54$^\circ$ over the labelled interval), and they share one platform. F-1 A and F-1 B leave the F-1 borehole at 2587\,m MD, and F-11 A leaves F-11 T2 at about 2580\,m MD, so the wells form three slot groups, \{F-1, F-1 A, F-1 B\}, \{F-11 A, F-11 T2\} and \{F-12\}, whose members share the hole above the kick-off.
|
|
||||||
|
|
||||||
\paragraph{Seismic and geometry.}
|
|
||||||
We use the post-stack ST10010 full-angle stack (3--41$^\circ$), a 2011 depth migration converted to time, at 4\,ms sampling. Its trace headers carry an invalid time scalar that standard readers apply to the start time, which shifts every sample 8\,ms late. We use the start time of the text header (4\,ms) and checked it against five interpreted horizons: the amplitude extremum along each falls at a lag of 0 to $+2$\,ms. Trajectories come from the operator's definitive surveys; recomputing them by minimum curvature reproduces the listed TVD within 0.01\,m. The seismic input of a well is a $3\times3$ patch of traces interpolated bilinearly along the deviated path at the time given by its time--depth relation, because a vertical trace at one bin differs from the path composite by a relative RMS of 0.19--0.61 over the labelled interval. Learning uses the window 2400--2900\,ms (126 samples) and tie likelihoods the extended window 2000--3200\,ms.
|
|
||||||
|
|
||||||
\paragraph{Time--depth and anchors.}
|
|
||||||
Only F-11 T2 has a zero-offset VSP. As anchors we use the operator's well picks with a TWT from the Ty Formation downwards, excluding picks flagged as not logged, not reached or faulted; each well has 4--9 such anchors within its logged sonic interval. Shallower picks are unreliable (picks at the same depth in a shared borehole differ by about 110\,ms). At reservoir level every unflagged pick lies within $\pm 10$\,ms of the corresponding interpreted horizon, and at F-11 T2 the picks lie within $-6.1$ to $+2.3$\,ms of the VSP. The pick times come from the operator's time--depth models, so they are interpretations, not measurements, as on F3. Time is vertical time: DT is integrated over TVD and calibrated to the anchors by stretching between them. At F-11 T2 this marker-calibrated sonic lies within $-2.4$ to $-0.8$\,ms of the VSP over the labelled interval. We keep $\sigma_a = 7$\,ms from F3; it is not estimated on Volve.
|
|
||||||
|
|
||||||
\paragraph{Labels.}
|
|
||||||
PHIF is used only where DT is valid, which leaves 16--37 labelled 4\,ms samples per well (150 in total) at 2509--2819\,ms. The labelled runs lie 25--179\,m below the deepest anchor, so their timing depends on the drift of the sonic below it. They are shorter than one period at 6\,Hz, so the band split used on F3 is undefined here. The well means of PHIF range from 8.5\,p.u.\ at F-1 to 17.0\,p.u.\ at F-12, against standard deviations of 3.3--6.0\,p.u.\ within wells.
|
|
||||||
|
|||||||
163
paper/sections/04_method.tex
Normal file
163
paper/sections/04_method.tex
Normal file
@@ -0,0 +1,163 @@
|
|||||||
|
\section{Tie posteriors and the compared methods}
|
||||||
|
\label{sec:method}
|
||||||
|
|
||||||
|
The compared methods differ in one thing: the labels they train on. Each method first computes a posterior over the time--depth warp of each training well, or a single tie, from anchors and optionally from the seismic. No network is involved at this stage. A network is then trained on labels placed by those warps. At prediction time no warp is needed: the network maps seismic to a property trace on the seismic time axis. A single tempered loss, registration-marginalized learning (RML), contains all the training objectives as special cases. We use it to define the methods on one footing, not as a proposed method expected to win. Section~\ref{sec:theory} analyses these objects.
|
||||||
|
|
||||||
|
\subsection{Warp prior and anchors}
|
||||||
|
\label{sec:method:prior}
|
||||||
|
|
||||||
|
For well $w$ with depth logs $\phi_w(z)$, $\mathrm{DT}_w(z)$ and $\mathrm{RHOB}_w(z)$, the time--depth map is
|
||||||
|
\begin{equation}
|
||||||
|
t_w(z; b_w, g_w) = t_{w,\mathrm{ref}} + b_w + 2\int_{z_{\mathrm{ref}}}^{z} \mathrm{DT}_w(z')\, e^{g_w(z')}\dd z' .
|
||||||
|
\label{eq:warp}
|
||||||
|
\end{equation}
|
||||||
|
Here $(z_{\mathrm{ref}}, t_{w,\mathrm{ref}})$ is a reference depth and its time, and the warp is $u_w = (b_w, g_w)$. The log-slowness correction $g_w$ describes sonic--seismic drift from dispersion, tool effects or washouts. Because $e^{g} > 0$, the map is monotone by construction. The bulk offset is $b_w \sim \N(0, \sigma_b^2)$. The prior on $g_w$ is a Gaussian process with constant mean $m_g$ and a Mat\'ern-3/2 kernel with scale $\sigma_g$ and length $\ell_g$. The hyperparameters $(m_g, \sigma_g, \ell_g)$ are fitted by type-II maximum a posteriori estimation, with log-normal hyperpriors on $\sigma_g$ and $\ell_g$, on the anchors of the training wells only, with $\sigma_a = 7$\,ms and $\sigma_b = 50$\,ms fixed. Anchors are observed as $t_{wk} = t_w(z_{wk}) + \varepsilon_{wk}$ with $\varepsilon_{wk} \sim \N(0, \sigma_a^2)$. On F3 the same sonic log produces both the label and the time axis through \eqref{eq:warp}, so label and registration are coupled. We write $\tau(t)$ for the sonic two-way time of the depth that a warp places at seismic time $t$, so a difference in $\tau$ between two warps is a timing error in milliseconds.
|
||||||
|
|
||||||
|
A separate type-II maximum-likelihood fit of all five hyperparameters to the F3 anchors gives $m_g = 0.014$, $\sigma_g = 0.10$, $\ell_g = 71$\,ms and a bulk spread $\sigma_b = 19$\,ms. In leave-one-anchor-out tests of this fit, 87\% of held-out anchors lie inside the 90\% predictive interval. The synthetic benchmark draws its true warps from this fitted prior (Section~\ref{sec:data:d2}). The same fit gives $\sigma_a = 0.4$\,ms, which is not reliable because it treats the markers as exact, whereas they are picks on the same seismic. We therefore use the empirical spread $\sigma_a = 7$\,ms (Section~\ref{sec:data:f3}). On F3, $\sigma_a$ is not identifiable from the data at hand.
|
||||||
|
|
||||||
|
\subsection{Physical tie likelihood}
|
||||||
|
\label{sec:method:tie}
|
||||||
|
|
||||||
|
For a training well with seismic trace $\mathbf s_w$ at the well location,
|
||||||
|
\begin{equation}
|
||||||
|
p(\mathbf s_w \mid g_w, b_w, \psi) = \N\big(\mathbf s_w;\ \alpha_w \mathbf W_\psi\, \mathbf r_w(b_w, g_w),\ \sigma_n^2 \mathbf I\big),
|
||||||
|
\end{equation}
|
||||||
|
where $\mathbf r_w$ is the reflectivity computed from acoustic impedance $\mathrm{RHOB}_w/\mathrm{DT}_w$ along the warp and blocked to 4\,ms, and $\mathbf W_\psi$ convolves with a 128\,ms statistical wavelet rotated by a constant phase $\psi$. The amplitude $\alpha_w \ge 0$ and the noise level $\sigma_n$ are profiled out, which gives $\log p = -\tfrac n2 \log \mathrm{RSS}$ over the extended window. The residuals are autocorrelated, so this likelihood is overconfident. We temper it by $\omega = 1/\nu$, where $\nu$ is the variance inflation implied by the residual autocorrelation at the best anchor-only sample. The phase $\psi$ is chosen on a $15^\circ$ grid by marginal likelihood on the training wells. Test wells never enter this step.
|
||||||
|
|
||||||
|
\subsection{Two tie posteriors}
|
||||||
|
\label{sec:method:posterior}
|
||||||
|
|
||||||
|
\paragraph{Anchor posterior with importance weights (Experiment~1).}
|
||||||
|
We draw $S = 64$ warps per well from the anchor-conditioned posterior. The proposal is a Laplace (Gauss--Newton) approximation, refined by elliptical slice sampling \citep{murray2010ess}. Physical weights $\pi_s \propto p(\mathbf s_w\mid u^{(s)})^{\omega'}$ use the largest exponent $\omega'$ that keeps the effective sample size at least $S/4$.
|
||||||
|
|
||||||
|
\paragraph{Sequential Monte Carlo posterior (Experiment~2).}
|
||||||
|
Importance weights over 64 anchor-conditioned samples cannot move mass to warps that the anchor posterior rarely proposes, and in development runs that posterior did not contract to the true warp (Section~\ref{sec:exp:diag}). The second posterior therefore uses tempered sequential Monte Carlo. It starts from $N_p = 1024$ anchor-posterior samples and targets $p(u\mid \text{anchors})\, p(\mathbf s_w\mid u, \psi)^{\omega}$. The tempering exponent rises from 0 to $\omega$ in adaptive steps that keep the effective sample size at least $N_p/2$. Each step uses systematic resampling followed by eight elliptical slice moves. Banks of $S = 64$ labels are drawn without replacement from the $N_p$ particles.
|
||||||
|
|
||||||
|
Before the trial we pre-registered a stability criterion: the 95th percentile over $t$ of the difference between mean warps of independent runs must not exceed 0.5\,ms. On development data $N_p = 1024$ meets it at $c = 1$ in 4 of 4 cells at 10\,dB and in 3 of 4 at $-5$\,dB. At $c = 2$ the mean warp is unstable under every configuration we tried, and the posterior is often multimodal (Section~\ref{sec:exp:mech}). We summarize posterior width by $\sigpost = w_{90}/3.29$, where $w_{90}$ is the 90\% interval width of $\tau(t)$ averaged over the main window and the training wells. No labels are used to compute it.
|
||||||
|
|
||||||
|
\subsection{Labels for each warp}
|
||||||
|
\label{sec:method:labels}
|
||||||
|
|
||||||
|
For each warp sample,
|
||||||
|
\begin{equation}
|
||||||
|
y_w^{(s)}(t_i) = (\aaf\phi_w)\big(z_w^{(s)}(t_i)\big),
|
||||||
|
\end{equation}
|
||||||
|
where $z_w^{(s)}$ is the inverse of $t_w(\cdot\,; u^{(s)})$, which exists because the warp is monotone, and $\aaf$ is an anti-alias filter applied before sampling at 4\,ms. Samples whose warp does not cover the main window receive zero weight. Every method, including the point-tie baselines and the oracle, builds labels with this operator, so methods differ only in the warps they use.
|
||||||
|
|
||||||
|
\subsection{Training objective}
|
||||||
|
\label{sec:method:rml}
|
||||||
|
|
||||||
|
The network outputs a mean $\mu_\theta$ and a standard deviation $\sigma_\theta$ for every sample. For a window of $n$ samples and a bank of $S$ labels with weights $\pi_s > 0$, $\sum_s \pi_s = 1$, let
|
||||||
|
\begin{equation}
|
||||||
|
\ell_s = \sum_{i=1}^{n} \log\N\big(y_{s,i};\, \mu_i, \sigma_i^2\big), \qquad
|
||||||
|
\RML_\lambda = -\frac{1}{\lambda n}\log\sum_{s=1}^{S}\pi_s\, e^{\lambda \ell_s}, \qquad
|
||||||
|
\RML_\infty = -\frac1n\max_s \ell_s .
|
||||||
|
\label{eq:rml}
|
||||||
|
\end{equation}
|
||||||
|
The training loss is the mean of $\RML_\lambda$ over windows and wells.
|
||||||
|
|
||||||
|
\paragraph{The tempering $\lambda$ accounts for correlated residuals.}
|
||||||
|
With $\lambda = 1$, differences between bank members are $O(n)$ and the log-sum-exp puts almost all weight on one member. Residuals are also autocorrelated, so a window holds less information than $n$ independent observations. If two members differ by $\Delta_\ell = \sum_i d_i$, and $d_i$ is a product of two zero-mean Gaussian processes with common autocorrelation $r_{\mathrm{ac}}$, then $\Var\Delta_\ell \approx n \Var(d)\,\tau_c$ with $\tau_c = 1 + 2\sum_{k\ge1}r_{\mathrm{ac}}(k)^2$. Setting $\lambda = 1/\tau_c$ gives $\lambda\Delta_\ell$ the variance of a log-likelihood difference over $n/\tau_c$ independent observations, the simplest magnitude adjustment of a composite likelihood \citep{pauli2011composite,ribatet2012composite}. Residuals are not available before training, so we estimate $r_{\mathrm{ac}}$ from the pooled autocorrelation of the high-passed training labels, truncated at the first non-positive lag. This gives $\tau_c \approx 2.7$--$2.9$ samples and $\lambda \approx 0.36$--$0.37$, nearly constant across the grid. The choice is a heuristic fixed before the experiments, and we make no claim about it.
|
||||||
|
|
||||||
|
\paragraph{The loss contains the common alternatives.}
|
||||||
|
The following statements are exact and are checked numerically in the code's unit tests. Proofs are in Appendix~\ref{app:proofs}, which also gives the identity for soft-DTW (Lemma~\ref{lem:sdtw}).
|
||||||
|
|
||||||
|
\begin{lemma}[Point tie]
|
||||||
|
\label{lem:s1}
|
||||||
|
If $S = 1$, or all bank members coincide, then $\RML_\lambda = -\ell/n$, the Gaussian negative log-likelihood, for every $\lambda$.
|
||||||
|
\end{lemma}
|
||||||
|
|
||||||
|
\begin{lemma}[Between hard-min and mixture mean]
|
||||||
|
\label{lem:sandwich}
|
||||||
|
Let $M(\lambda) = \lambda^{-1}\log \E_\pi e^{\lambda\ell}$. Then $\RML_\lambda = -M(\lambda)/n$ is non-increasing in $\lambda$, with
|
||||||
|
\begin{equation}
|
||||||
|
-\frac1n\max_s\ell_s \le \RML_\lambda \le -\frac1n\sum_s\pi_s\ell_s ,
|
||||||
|
\end{equation}
|
||||||
|
and it tends to the right-hand side as $\lambda \to 0$ and to $\RML_\infty$ as $\lambda \to \infty$. For uniform $\pi$, $0 \le \RML_\lambda - \RML_\infty \le \log S/(\lambda n)$.
|
||||||
|
\end{lemma}
|
||||||
|
|
||||||
|
As $\lambda \to 0$, the optimal mean is the regression of the $\pi$-weighted mean label on $X$, and the optimal variance adds the spread of the bank. Whether this blurs the predictor depends on how the bank relates to the true warp. If the members scatter around a point tie whose error is independent of the data, the mean label is blurred further (Section~\ref{sec:theory:blur}). If the bank is the calibrated posterior, the population optimum is that of the true warp (Proposition~\ref{prop:bank}).
|
||||||
|
|
||||||
|
\begin{lemma}[Gradient]
|
||||||
|
\label{lem:grad}
|
||||||
|
$\nabla_\theta \RML_\lambda = -\frac1n\sum_s r_s \nabla_\theta \ell_s$ with responsibilities $r = \operatorname{softmax}(\log\pi + \lambda\ell)$.
|
||||||
|
\end{lemma}
|
||||||
|
|
||||||
|
Each gradient step is therefore a generalized M-step whose weights are computed at the current $\theta$.
|
||||||
|
|
||||||
|
\begin{lemma}[Shift-tolerant losses]
|
||||||
|
\label{lem:shift}
|
||||||
|
With a bank of the point-tie label shifted by every integer lag in $\pm k_{\max}$ samples and uniform $\pi$, $\RML_\infty$ is the hard-min shift loss with learned variance, and $\RML_{1/\tau_c}$ is its soft-min version.
|
||||||
|
\end{lemma}
|
||||||
|
|
||||||
|
Soft-DTW is RML over every monotone alignment in a band, with a uniform prior, no anchors and no physics, at $\lambda = 2/\gamma$. With $\gamma = 0.1$ this is $\lambda = 20$, much closer to the hard minimum than $\lambda \approx 0.37$.
|
||||||
|
|
||||||
|
\subsection{Network and training}
|
||||||
|
\label{sec:method:train}
|
||||||
|
|
||||||
|
All learned methods share one backbone and differ only in their labels and loss; the backbone check of Experiment~3 adds a second. The input is a $3\times3$ trace patch around the well (nine channels), z-scored per channel within each well. Three dilated 1-D convolutions (kernel 5, dilations 1, 2 and 4, 64 channels) feed a two-layer bidirectional gated recurrent unit (GRU); we call this backbone the CNN--GRU, with CNN for convolutional neural network. A $1\times1$ head with a $1\times1$ skip connection outputs $\mu$ and $\sigma$ (softplus, $\sigma \ge 10^{-3}$). Dropout is 0.05. We train with Adam (learning rate $5\times10^{-3}$, gradient clipping at 5) on full batches of all training wells. Losses are computed on 64-sample windows starting at samples $0, 2, \dots, 62$ of the 126-sample main window. Labels are standardized by the mean and standard deviation of the anti-aliased log over the training wells, statistics that do not depend on the tie.
|
||||||
|
|
||||||
|
The number of iterations is selected separately for each method from $\{125, 250, 500, 1000, 2000\}$ by total RMSE on the development realizations (benchmark controls inherit the budget of the method they modify; Table~\ref{tab:benchdesign}); on F3 it is selected by inner validation (Appendix~\ref{sec:exp:f3}). Every method has the same candidate set, and band metrics are not used for selection. The second backbone, a temporal convolutional network (TCN), has no recurrence: four dilated 1-D convolutions (kernel 5, dilations 1, 2, 4 and 8, 64 channels, ReLU, the same dropout) and the same output head without the skip connection. Its iterations were selected by the same rule on development realizations 902--905 (10\,dB, $c = 1$). Every method selected 125, the smallest candidate, and the candidate set was not extended. Ensembles average five seeds (on F3, three inner models $\times$ five seeds), with $\mu = \overline{\mu_s}$ and $\sigma^2 = \overline{\sigma_s^2} + \Var_s \mu_s$.
|
||||||
|
|
||||||
|
\subsection{Compared methods}
|
||||||
|
\label{sec:method:baselines}
|
||||||
|
|
||||||
|
Table~\ref{tab:methods} lists the methods. In the language of Lemmas~\ref{lem:s1}--\ref{lem:shift}, deterministic and posterior-mean ties are RML with $S = 1$ at different warps, the anchor-free losses are RML with anchor-free banks, and the anchor banks and the \mRML{} are RML with anchor-conditioned banks.
|
||||||
|
|
||||||
|
\begin{table}[!tbp]
|
||||||
|
\centering
|
||||||
|
\caption{Compared methods. All learned methods use the backbone of Section~\ref{sec:method:train}. Bank: labels entering \eqref{eq:rml}. NLL: Gaussian negative log-likelihood.}
|
||||||
|
\label{tab:methods}
|
||||||
|
\small
|
||||||
|
\begin{tabular}{lp{0.47\linewidth}l}
|
||||||
|
\toprule
|
||||||
|
Name & Labels / bank & Loss \\
|
||||||
|
\midrule
|
||||||
|
\multicolumn{3}{l}{\emph{Field baselines (F3 only)}} \\
|
||||||
|
Depth--time trend & trend fitted on training wells (no seismic) & -- \\
|
||||||
|
Attribute models & ridge, random forest or gradient boosting on seismic attributes and TWT & -- \\
|
||||||
|
Impedance inversion & model-based inversion with a well-interpolated low-frequency model, then linear $\phi$--impedance & -- \\
|
||||||
|
Composite loss & backbone with a composite loss$^{\dagger}$ & composite \\
|
||||||
|
\midrule
|
||||||
|
\multicolumn{3}{l}{\emph{Deterministic ties ($S = 1$)}} \\
|
||||||
|
Sonic tie & sonic integration from one shallow anchor & NLL \\
|
||||||
|
Calibrated sonic & marker-calibrated sonic through the anchors & NLL \\
|
||||||
|
Correlation tie & calibrated sonic plus local shifts from synthetic--seismic correlation & NLL \\
|
||||||
|
Phase-estimated correlation & correlation tie with the SMC-estimated wavelet phase & NLL \\
|
||||||
|
\midrule
|
||||||
|
\multicolumn{3}{l}{\emph{Posterior-mean ties ($S = 1$)}} \\
|
||||||
|
Anchor mean & weighted mean warp of the Experiment~1 anchor posterior & NLL \\
|
||||||
|
\mPM & mean warp of the SMC posterior & NLL \\
|
||||||
|
\midrule
|
||||||
|
\multicolumn{3}{l}{\emph{Reference}} \\
|
||||||
|
Oracle & true warp (synthetic only; a ceiling, not a competitor) & NLL \\
|
||||||
|
\midrule
|
||||||
|
\multicolumn{3}{l}{\emph{Anchor-free alignment losses (labels from the calibrated sonic)}} \\
|
||||||
|
Hard-min shift & calibrated sonic shifted by $\pm 8$ samples, uniform $\pi$ & $\RML_\infty$ \\
|
||||||
|
Soft-min shift & as hard-min shift & $\RML_{1/\tau_c}$ \\
|
||||||
|
Soft-DTW & all monotone alignments in a $\pm8$ band; Gaussian NLL cost, symmetric steps & soft-DTW, $\gamma = 0.1$ \\
|
||||||
|
DILATE & as soft-DTW & DILATE, $\alpha = 0.5$ \\
|
||||||
|
\midrule
|
||||||
|
\multicolumn{3}{l}{\emph{Anchor-conditioned banks}} \\
|
||||||
|
Anchor bank & 64 anchor-posterior warps, uniform $\pi$ & $\RML_{1/\tau_c}$ \\
|
||||||
|
Reweighted anchor bank & as anchor bank, tempered physical weights & $\RML_{1/\tau_c}$ \\
|
||||||
|
\mRML & 64 SMC particles, uniform $\pi$ & $\RML_{1/\tau_c}$ \\
|
||||||
|
\midrule
|
||||||
|
\multicolumn{3}{l}{\emph{Benchmark additions (Experiment~3)$^{\ddagger}$}} \\
|
||||||
|
Gaussian bank & 64 warps $\bar u + \eta$, $\eta$ Gaussian with the covariance of the SMC particles (monotone draws only), uniform $\pi$ & $\RML_{1/\tau_c}$ \\
|
||||||
|
Midpoint label & two-mode error: label at $u^\star \pm \Delta/2$, sign drawn per well & NLL \\
|
||||||
|
Two-member bank & $\{u^\star, u^\star \pm \Delta\}$, sign drawn per well, $\pi = (\frac12, \frac12)$ & $\RML_{1/\tau_c}$ \\
|
||||||
|
Two-member hard-min & as two-member bank & $\RML_\infty$ \\
|
||||||
|
\midrule
|
||||||
|
Calibrated-sonic ensemble & the five-seed ensemble of the calibrated sonic, the reference for calibration & NLL \\
|
||||||
|
\bottomrule
|
||||||
|
\end{tabular}
|
||||||
|
|
||||||
|
\smallskip
|
||||||
|
\footnotesize $^{\dagger}$Labels from the calibrated sonic; deterministic output. Loss: Huber regression loss $+\,0.60$ correlation $+\,0.05$ first-difference $+\,0.10$ standardized-shape $+\,0.10$ variance-matching $+\,0.20$ best-shift MSE (minimum over shifts of $\pm 8$ samples). $^{\ddagger}$The backbone check also trains the Oracle, calibrated sonic, correlation tie, phase-estimated correlation, \mPM{} and \mRML{} with the TCN backbone.
|
||||||
|
\end{table}
|
||||||
|
|
||||||
|
\subsection{Metrics}
|
||||||
|
\label{sec:method:metrics}
|
||||||
|
|
||||||
|
Accuracy is reported in porosity units (p.u., porosity $\times 100$). We split every trace into a low band ($|f| < f_c$) and a seismic band ($|f| \ge f_c$, $f_c = 6$\,Hz), using a fourth-order Butterworth filter applied forward and backward (zero phase). On F3, energy below 5\,Hz is 0.2--0.5\% of the total. The primary metrics are the root-mean-square error (RMSE) and the Pearson correlation coefficient (PCC) in the seismic band (band RMSE, band PCC), because registration errors act there while the low band is dominated by the trend. We also report total RMSE and PCC and the band standard-deviation ratio. Calibration is described by the coverage of central intervals at 50, 80, 90 and 95\%, the calibration error (mean absolute deviation of coverage from nominal over these levels), the Gaussian negative log-likelihood and the continuous ranked probability score (CRPS). Warp accuracy (synthetic only) is the RMSE of $\tau(t)$ against the true warp over the main window, together with 90\% coverage. Statistics are computed per test well and then averaged over wells (macro-averaged). Intervals are 95\% bootstrap intervals over realizations (2000 resamples). On F3 the time samples within a well are not independent and there are only four wells, so field results are descriptive and we compute no per-sample $p$-values.
|
||||||
@@ -1,233 +0,0 @@
|
|||||||
\section{Theory}
|
|
||||||
\label{sec:theory}
|
|
||||||
|
|
||||||
\paragraph{Notation.}
|
|
||||||
$t$ is seismic two-way time, $X$ the seismic input around a well, and $y(t)$ the label under correct registration. $\delta(t)$ is the registration error, and the observed label is $\tilde y(t) = y(t + \delta(t))$. The oracle predictor is $m(t) = \E[y(t)\mid X]$, the MSE-optimal predictor under correct labels. The Fourier transform is $\hat g(f) = \int g(t)\,e^{-i2\pi f t}\dd t$, and $T_\beta h(t) = h(t-\beta)$ is a time shift. $S_a$ is the power spectrum of $a$. The seismic band is $|f| \ge f_c$ with $f_c = 6$\,Hz, and $B$ is the corresponding high-pass operator, with $a_b = Ba$. In the experiments $B$ is a zero-phase fourth-order Butterworth filter. Its response is real and non-negative, so every result below holds with $S$ replaced by $|H_B|^2 S$. Spectral statements assume second-order stationarity in $t$, which is a working assumption for well logs.
|
|
||||||
|
|
||||||
\subsection{Misregistered labels blur the optimal predictor}
|
|
||||||
|
|
||||||
\begin{proposition}[Blur]
|
|
||||||
\label{prop:blur}
|
|
||||||
Assume (A1) that for every $t$, $\delta(t)$ is independent of $(X, y(\cdot))$ with distribution $p_t$, and (A2) that $\E[y(t)^2] < \infty$. Then the MSE-optimal predictor of the observed label is
|
|
||||||
\begin{equation}
|
|
||||||
\hat y^\star(t) = \E[\tilde y(t)\mid X] = \int p_t(d)\, m(t+d)\dd d .
|
|
||||||
\end{equation}
|
|
||||||
If $p_t \equiv p$, then $\hat y^\star$ is $m$ passed through a linear time-invariant filter with frequency response equal to the characteristic function of $\delta$,
|
|
||||||
\begin{equation}
|
|
||||||
P(f) = \E\big[e^{i2\pi f\delta}\big], \qquad \delta \sim \N(\mu_\delta, \sigma^2) \;\Rightarrow\; P(f) = e^{i2\pi f\mu_\delta}\, e^{-2\pi^2\sigma^2 f^2}.
|
|
||||||
\label{eq:transfer}
|
|
||||||
\end{equation}
|
|
||||||
\end{proposition}
|
|
||||||
|
|
||||||
Only the marginal distribution of $\delta(t)$ at each $t$ enters $\hat y^\star$. Whether the error is a smooth drift or independent jitter does not change the population optimum, although it changes finite-sample learning. A non-zero mean $\mu_\delta$ adds a linear phase, that is, a common shift. This common shift is the direction that Proposition~\ref{prop:ident} shows to be unidentified. Assumption (A1) says that the error is independent of the truth: the observed label at $t$ is the true label at $t + \delta(t)$, with $\delta$ independent of everything else. This is the classical structure of errors-in-variables models \citep{fuller1987measurement,carroll2006measurement}, applied to the time index rather than to the value of the label. It is a modelling assumption. On F3 the same sonic log produces both the label and the time axis, so $\delta$ and $y$ are not strictly independent. Section~\ref{sec:theory:post} shows that a tie estimated from the well data can have the opposite structure, with the opposite effect.
|
|
||||||
|
|
||||||
\begin{corollary}[Seismic-band bounds]
|
|
||||||
\label{cor:band}
|
|
||||||
Let $\langle h\rangle = \int_{|f|\ge f_c} h\, S_{m}\dd f \big/ \int_{|f|\ge f_c} S_{m}\dd f$. Then
|
|
||||||
\begin{equation}
|
|
||||||
\frac{\sd \hat y^\star_b}{\sd y_b} \le \sqrt{\langle |P|^2\rangle} \le \sup_{|f|\ge f_c}|P(f)|,
|
|
||||||
\qquad
|
|
||||||
\PCC_b(\hat y^\star) = \kappa(P)\,\PCC_b(m), \quad \kappa(P) = \frac{\langle \operatorname{Re} P\rangle}{\sqrt{\langle|P|^2\rangle}} \le 1 ,
|
|
||||||
\end{equation}
|
|
||||||
with equality in $\kappa$ if and only if $P$ is a positive constant on the support of $S_{m_b}$.
|
|
||||||
\end{corollary}
|
|
||||||
|
|
||||||
The coherence at each frequency is unchanged. Blur does not destroy information at the population level, but it reweights the band towards low frequencies. Undoing it would require multiplying by $e^{+2\pi^2\sigma^2 f^2}$, which amplifies estimation error wherever $|P| \approx 0$, and $\sigma$ is unknown in practice. Taking the F3 seismic amplitude spectrum as a proxy for the recoverable band, a Gaussian error with $\sigma = 8$\,ms keeps less than 7\% of the seismic-band variance.
|
|
||||||
|
|
||||||
\begin{corollary}[Variance matching rescales amplitude only]
|
|
||||||
\label{cor:var}
|
|
||||||
Consider $J(h) = \E\|h - \tilde y\|^2 + \Psi(\E h, \Var h)$ over predictors $h$ that are functions of $X$, where $\Psi$ is any penalty on the mean and variance of the prediction (for example a penalty on the standard-deviation ratio). Every minimizer satisfies $h^\star - \E h^\star = a\,(\hat y^\star - \E\hat y^\star)$ for some $a \ge 0$.
|
|
||||||
\end{corollary}
|
|
||||||
|
|
||||||
A variance-matching loss can therefore restore the overall standard-deviation ratio, but the in-band spectrum keeps the shape $|P|^2 S_m$. The prediction becomes larger but stays blurred. Baseline B2 (Section~\ref{sec:method:baselines}) combines a variance-matching term with a best-shift term and is affected in the same way.
|
|
||||||
|
|
||||||
\paragraph{Verification (H1).}
|
|
||||||
We trained the backbone of Section~\ref{sec:method:train} with MSE on oracle synthetic labels shifted by $\delta_{wj} = \sigma z_{wj}$, $z \sim \N(0,1)$. The shift is fixed within each 64-sample window and independent of everything else, so (A1) holds by construction. We used $c = 0$, $N = 16$, eight realizations and five seeds. The cross-spectrum ratio
|
|
||||||
\begin{equation}
|
|
||||||
\hat H_\sigma(f) = \frac{\sum \operatorname{Re}[Y^*(f)\hat Y_\sigma(f)]}{\sum \operatorname{Re}[Y^*(f)\hat Y_0(f)]}
|
|
||||||
\end{equation}
|
|
||||||
estimates $P_\sigma(f)$; the sums run over test wells, realizations and seeds. The pre-registered statistic is $r(\sigma)$, the geometric mean of $\hat H_\sigma/P_\sigma$ over frequencies with $f \ge f_c$, $P_\sigma \ge 0.1$ and reference cross-power at least 10\% of its in-band maximum. The hypothesis is rejected if $r \notin [0.5, 2]$ for any $\sigma > 0$. Table~\ref{tab:h1} and Fig.~\ref{fig:h1} show the result: $r = 1.009$, 1.009 and 1.007 for $\sigma = 4$, 8 and 16\,ms, and $r = 1.093$ for $\sigma = 32$\,ms. Proposition~\ref{prop:blur} is not rejected. Two limitations apply. First, the frequency-selection rule keeps only 6.8--22.5\,Hz, where the MSE predictor has coherent power (72\% of the in-band cross-spectrum); the test says nothing above about 23\,Hz. Second, at 32\,ms the measured attenuation is 9\% weaker than predicted and the interval excludes 1. This is within the pre-registered tolerance, and we have not identified its cause.
|
|
||||||
|
|
||||||
\begin{table}[t]
|
|
||||||
\centering
|
|
||||||
\caption{Test of Proposition~\ref{prop:blur} (H1). $r(\sigma)$: geometric mean of measured over theoretical transfer; 95\% bootstrap interval over realizations. Band metrics in p.u.\ on test wells.}
|
|
||||||
\label{tab:h1}
|
|
||||||
\small
|
|
||||||
\begin{tabular}{rcccccc}
|
|
||||||
\toprule
|
|
||||||
$\sigma$ (ms) & $r(\sigma)$ & 95\% CI & frequencies & band RMSE & band PCC & band sd ratio \\
|
|
||||||
\midrule
|
|
||||||
0 & 1 & -- & 17 & 0.426 & 0.954 & 0.945 \\
|
|
||||||
4 & 1.009 & [0.996, 1.019] & 17 & 0.587 & 0.908 & 0.817 \\
|
|
||||||
8 & 1.009 & [0.990, 1.025] & 17 & 0.805 & 0.817 & 0.677 \\
|
|
||||||
16 & 1.007 & [0.975, 1.038] & 15 & 1.042 & 0.670 & 0.475 \\
|
|
||||||
32 & 1.093 & [1.046, 1.143] & 4 & 1.269 & 0.388 & 0.247 \\
|
|
||||||
\bottomrule
|
|
||||||
\end{tabular}
|
|
||||||
\end{table}
|
|
||||||
|
|
||||||
\begin{figure}[t]
|
|
||||||
\centering
|
|
||||||
\includegraphics[width=\linewidth]{p2_h1.pdf}
|
|
||||||
\caption{Test of Proposition~\ref{prop:blur}. (a) Estimated transfer $\hat H_\sigma(f)$ on the frequencies used (solid) and $e^{-2\pi^2\sigma^2 f^2}$ (dashed). The shaded band below 6\,Hz is outside the seismic band and is not used. (b) $r(\sigma)$ with 95\% intervals over realizations and the number of frequencies used; the shaded region is the pre-registered non-rejection interval $[0.5, 2]$. Setting: $c = 0$, $N = 16$, MSE loss.}
|
|
||||||
\label{fig:h1}
|
|
||||||
\end{figure}
|
|
||||||
|
|
||||||
\subsection{Without anchors, absolute timing is not identified}
|
|
||||||
|
|
||||||
Consider $N$ training wells with seismic $X_w$, depth logs $\phi_w$ and warps $u_w = (b_w, g_w)$ (Section~\ref{sec:method:prior}). Let $y^{u}(t) = (\aaf\phi)(z_u(t))$ be the label under warp $u$, where $z_u$ inverts $t_u$ and $\aaf$ is an anti-alias filter. Let $e_b$ be the direction that adds the same $\beta$ to every $b_w$. The joint MAP objective over network parameters $\theta$ and warps $\mathbf{u}$ is
|
|
||||||
\begin{equation}
|
|
||||||
\Phi(\theta, \mathbf u) = \sum_w \Big[\mathcal L_w(\theta; y_w^{u_w}) + \log p(u_w) + \sum_k \log \N\big(t_{wk};\, t_{u_w}(z_{wk}),\, \sigma_a^2\big)\Big],
|
|
||||||
\end{equation}
|
|
||||||
with Gaussian log-likelihood $\mathcal L_w$ over windows and anchors $(z_{wk}, t_{wk})$.
|
|
||||||
|
|
||||||
\begin{proposition}[Identifiability]
|
|
||||||
\label{prop:ident}
|
|
||||||
Assume (B) that the model class is closed under output shifts: for each $\theta$ and each admissible $\beta$ there is $\theta'$ with $\mu_{\theta'} = T_\beta \mu_\theta$ and $\sigma_{\theta'} = T_\beta\sigma_\theta$. Then, up to window-edge effects:
|
|
||||||
\begin{enumerate}
|
|
||||||
\item[(a)] without anchors, with a flat prior on $b$ and no seismic tie term, $\Phi(\theta', \mathbf u + \beta e_b) = \Phi(\theta, \mathbf u)$, so the objective has a ridge in $\beta$ shared by all wells;
|
|
||||||
\item[(b)] a prior $b_w \sim \N(0, \sigma_b^2)$ adds curvature $N/\sigma_b^2$ along the ridge;
|
|
||||||
\item[(c)] anchors with finite $\sigma_a$ add curvature $\sum_w K_w/\sigma_a^2$, where $K_w$ is the number of anchors at well $w$, so that
|
|
||||||
\begin{equation}
|
|
||||||
\sd(\beta) \approx \Big(\frac{\sum_w K_w}{\sigma_a^2} + \frac{N}{\sigma_b^2}\Big)^{-1/2} \approx \frac{\sigma_a}{\sqrt{\sum_w K_w}} .
|
|
||||||
\end{equation}
|
|
||||||
\end{enumerate}
|
|
||||||
\end{proposition}
|
|
||||||
|
|
||||||
With 4 wells of 16 anchors at $\sigma_a = 7$\,ms, $\sd(\beta) \approx 0.9$\,ms. With only the prior $\sigma_b = 50$\,ms, $\sd(\beta) \approx 50/\sqrt N$, that is 35\,ms for $N = 2$ and 12.5\,ms for $N = 16$. A common shift $\beta$ multiplies the band-limited correlation at frequency $f$ by $\cos(2\pi f\beta)$, and $\cos(2\pi\cdot 20\,\mathrm{Hz}\cdot 12.5\,\mathrm{ms}) = 0$. Assumption (B) holds exactly for fully convolutional networks with a wide enough last layer and approximately for the CNN--GRU used here.
|
|
||||||
|
|
||||||
\paragraph{The seismic tie term.}
|
|
||||||
Seismic is observed on a fixed time axis, so a tie likelihood that compares the seismic with a warped synthetic is not invariant to $\beta$. In principle it pins absolute time. In practice a small shift trades off against a constant wavelet phase rotation: the two coincide at $f_0 = \psi/(2\pi\beta)$ and differ by $2\pi(f - f_0)\beta$ elsewhere. For $\beta = 4$\,ms the largest phase difference over $\pm 30$\,Hz around $f_0$ is only about $43^\circ$. Information about $\beta$ thus comes from the bandwidth, not the centre frequency.
|
|
||||||
|
|
||||||
\paragraph{Consequences.}
|
|
||||||
Shift-tolerant losses and soft-DTW choose the alignment that best fits the network's current prediction and use no anchors. Within the range of their shift bank or band they fall under case (a): network and alignment can drift together without penalty. A tie posterior conditioned on anchors does not have this ridge. Its absolute timing is set before training, with per-well common-shift uncertainty of about $\sigma_a/\sqrt{K_w}$.
|
|
||||||
|
|
||||||
\subsection{Labels from a tie: blur or sharpening}
|
|
||||||
\label{sec:theory:post}
|
|
||||||
|
|
||||||
Proposition~\ref{prop:blur} treats the registration error as independent of everything else. A tie estimated from the data at a training well need not have this property. Let $D$ denote all data at the well (seismic, logs and anchors), and let the network input $X$ be a function of $D$. Let $u^\star$ be the true warp, so that $y = y^{u^\star}$, and let $\hat u = \hat u(D)$ be a point tie with label $\tilde y = y^{\hat u}$. The misregistration can be written in either direction,
|
|
||||||
\begin{equation}
|
|
||||||
\tilde y(t) = y\big(t + \delta(t)\big),\ \ \delta(t) = t_{u^\star}\big(z_{\hat u}(t)\big) - t;
|
|
||||||
\qquad
|
|
||||||
y(t) = \tilde y\big(t + \varepsilon(t)\big),\ \ \varepsilon(t) = t_{\hat u}\big(z_{u^\star}(t)\big) - t .
|
|
||||||
\label{eq:twoerrors}
|
|
||||||
\end{equation}
|
|
||||||
Let $\tilde m(t) = \E[\tilde y(t)\mid X]$ be the optimal predictor of the point label ($\hat y^\star$ in Proposition~\ref{prop:blur}), and let $Q(f) = \E[e^{i2\pi f\varepsilon}]$.
|
|
||||||
|
|
||||||
\begin{proposition}[Two error structures]
|
|
||||||
\label{prop:tie}
|
|
||||||
Assume (A2) for $y$ and $\tilde y$.
|
|
||||||
\begin{enumerate}
|
|
||||||
\item[(a)] \emph{Classical error.} If $\delta(t)$ is independent of $y(\cdot)$ given $X$, with conditional distribution $p_t(\cdot\mid X)$, then
|
|
||||||
\begin{gather*}
|
|
||||||
\tilde m(t) = \int p_t(d\mid X)\, m(t+d)\dd d, \\
|
|
||||||
\Var\big(\tilde y(t)\mid X\big) = \int p_t(d\mid X)\Var\big(y(t+d)\mid X\big)\dd d + \Var_{p_t}\!\big[m(t+d)\big].
|
|
||||||
\end{gather*}
|
|
||||||
\item[(b)] \emph{Berkson error.} If $\varepsilon(t)$ is independent of $D$ given $X$, with conditional distribution $q_t(\cdot\mid X)$, then
|
|
||||||
\begin{gather*}
|
|
||||||
m(t) = \int q_t(e\mid X)\, \tilde m(t+e)\dd e, \\
|
|
||||||
\Var\big(y(t)\mid X\big) = \int q_t(e\mid X)\Var\big(\tilde y(t+e)\mid X\big)\dd e + \Var_{q_t}\!\big[\tilde m(t+e)\big].
|
|
||||||
\end{gather*}
|
|
||||||
\end{enumerate}
|
|
||||||
If $p_t$ and $q_t$ do not depend on $t$, then, averaged over the window and up to edge terms, the point label has the larger conditional variance under (a) and the smaller under (b). If they depend on neither $t$ nor $X$, then $\tilde m$ is $m$ filtered by $P$ under (a), and $m$ is $\tilde m$ filtered by $Q$ under (b). For zero-mean Gaussian errors with variance $\sigma^2$, the transfer from $m$ to $\tilde m$ is $e^{-2\pi^2\sigma^2 f^2}$ under (a) and $e^{+2\pi^2\sigma^2 f^2}$ under (b).
|
|
||||||
\end{proposition}
|
|
||||||
|
|
||||||
Structure (a) is the classical structure of measurement-error models, in which the error is independent of the true value. Structure (b) is the Berkson structure, in which the error is independent of the assigned value \citep{berkson1950two,carroll2006measurement}. Here the error lies in the time index of the label, and the two structures bias the learned predictor in opposite directions. Under (a) the point label blurs the optimal predictor and widens the learned variance. Under (b) it sharpens the predictor and narrows the variance. Structure (b) is the natural idealization for a tie computed as a posterior mean, $\hat u = \E[u^\star\mid D]$. Then $\E[u^\star - \hat u\mid D] = 0$ by construction, and in a linear-Gaussian model $u^\star - \hat u$ is independent of $D$. For the bulk offset $b$ in \eqref{eq:warp}, the time error equals the posterior error of $b$ and inherits this property; for the drift it does so approximately, when the posterior is narrow. A tie fitted in another way, for example by maximizing a synthetic--seismic correlation, can have either structure or neither. On synthetic data the two can be told apart: for the bulk offset, classical error means $\Cov(\hat b - b^\star, b^\star) = 0$, and Berkson error means $\Cov(b^\star - \hat b, \hat b) = 0$.
|
|
||||||
|
|
||||||
A bank of labels removes the dependence on a single tie when it represents the posterior correctly.
|
|
||||||
|
|
||||||
\begin{proposition}[Calibrated bank]
|
|
||||||
\label{prop:bank}
|
|
||||||
Call a bank $\{(u_s, \pi_s)\}$ calibrated if, for every integrable $G$, $\sum_s \pi_s G(u_s, D) = \E[G(u^\star, D)\mid D]$. For a calibrated bank:
|
|
||||||
\begin{enumerate}
|
|
||||||
\item[(a)] the mean label $\bar y = \sum_s \pi_s y^{u_s}$ satisfies $\bar y(t) = \E[y(t)\mid D]$ and $\E[\bar y(t)\mid X] = m(t)$;
|
|
||||||
\item[(b)] for every network $(\mu_\theta, \sigma_\theta)$ that depends on the data only through $X$, $\E\big[\sum_s \pi_s \ell_s\big] = \E[\ell^\star]$, where $\ell^\star$ is the window log-likelihood \eqref{eq:rml} of the label at the true warp.
|
|
||||||
\end{enumerate}
|
|
||||||
Hence the $\lambda \to 0$ limit of RML (Lemma~\ref{lem:sandwich}) has the population minimizer of training on the true labels, $\mu = m$ and $\sigma^2 = \Var(y\mid X)$, and MSE on the mean label has the population minimizer $\mu = m$.
|
|
||||||
\end{proposition}
|
|
||||||
|
|
||||||
Calibration is an idealization; it holds for an exact posterior sample as $S \to \infty$. Under it, marginalizing over the posterior removes the population bias of both structures. The mean warp does not share this property. \mPM{} trains on the label at the mean warp $\bar u$, not on the mean label. Expanding $y^{u}$ around $\bar u = \sum_s\pi_s u_s$,
|
|
||||||
\begin{equation*}
|
|
||||||
\bar y - y^{\bar u} = \tfrac12 \sum_s \pi_s\, (u_s - \bar u)^\top \nabla_u^2 y^{\bar u}\, (u_s - \bar u) + O\big(\|u_s - \bar u\|^3\big),
|
|
||||||
\end{equation*}
|
|
||||||
so the two labels agree to first order in the posterior spread. If the time error of the mean warp has structure (b), the population optimum of \mPM{} is sharpened by $1/Q$, while that of the mean label is exact.
|
|
||||||
|
|
||||||
\begin{corollary}[Two modes]
|
|
||||||
\label{cor:twomode}
|
|
||||||
Let the error ($\delta$ under (a), $\varepsilon$ under (b)) be constant over the window and equal to $\pm\Delta/2$ with probability $\frac12$ each, independently of $X$. Then $P(f) = Q(f) = \cos(\pi f\Delta)$, and under either structure the transfer from $m$ to $\tilde m$ is negative for $1/(2\Delta) < |f| < 3/(2\Delta)$: there the point label trains the network towards the wrong sign. A Gaussian error with the same variance $\Delta^2/4$ has $P(f) = e^{-\pi^2\Delta^2f^2/2} > 0$ at every frequency. The mean label of a calibrated bank has transfer 1. Under (a), a bank of the point label shifted by $\pm\Delta/2$ with equal weights has transfer $\cos^2(\pi f\Delta) \ge 0$.
|
|
||||||
\end{corollary}
|
|
||||||
|
|
||||||
The phase reversal is a property of multimodal errors that a Gaussian summary hides. If the two modes are one dominant period apart, $\Delta = 1/f_0$, the reversed band is $f_0/2 < |f| < 3f_0/2$. The F3 seismic, from which the D2 wavelet is estimated, peaks near 60\,Hz (Section~\ref{sec:data:f3}), which gives 30--90\,Hz. Cycle skipping produces errors of this kind, and at $c = 2$ the SMC posterior is multimodal (Section~\ref{sec:method:posterior}). In this example, a bank centred on the point label removes the reversal only by attenuating the band further.
|
|
||||||
|
|
||||||
\begin{remark}[$\lambda > 0$]
|
|
||||||
\label{rem:lambda}
|
|
||||||
Proposition~\ref{prop:bank} concerns the limit $\lambda \to 0$. Expanding the cumulant generating function in \eqref{eq:rml},
|
|
||||||
\begin{equation*}
|
|
||||||
\RML_\lambda = -\frac1n\Big[\sum_s \pi_s\ell_s + \frac\lambda2 \Var_\pi(\ell) + O(\lambda^2)\Big].
|
|
||||||
\end{equation*}
|
|
||||||
The second term rewards predictors that fit some bank members much better than others. For $\lambda > 0$ the responsibilities of Lemma~\ref{lem:grad} shift weight towards the members that agree with the current network, which amounts to an implicit re-registration, and the population minimizer is in general no longer $(m, \Var(y\mid X))$.
|
|
||||||
\end{remark}
|
|
||||||
|
|
||||||
\paragraph{How much can a bank gain?}
|
|
||||||
Because $\E[y - m\mid X] = 0$, every predictor $h$ that depends on the data only through $X$ satisfies
|
|
||||||
\begin{equation*}
|
|
||||||
\E|B(h - y)|^2 = \E|B(m - y)|^2 + \E|B(h - m)|^2 ,
|
|
||||||
\end{equation*}
|
|
||||||
so in population no method beats the oracle in band MSE. If a point-label method converges to $\tilde m$ and a bank method to $m$, the ratio of their band RMSEs is
|
|
||||||
\begin{equation}
|
|
||||||
\rho^\star = \Big(1 + \frac{\E|B(\tilde m - m)|^2}{\E|B(m - y)|^2}\Big)^{-1/2},
|
|
||||||
\label{eq:rhostar}
|
|
||||||
\end{equation}
|
|
||||||
and no method can improve on the point label by more than this factor. With errors that do not depend on $t$ or $X$, $\E|B(\tilde m - m)|^2 = \int_{|f|\ge f_c}|1 - P|^2 S_m\dd f$ under (a) and $\int_{|f|\ge f_c}|1 - Q|^2|Q|^{-2}S_m\dd f$ under (b). For Gaussian errors both integrands equal $(2\pi^2\sigma^2f^2)^2 S_m$ to leading order, so the population distortion is of fourth order in $\sigma$. Beyond leading order the integrand under (b) is larger by the factor $e^{4\pi^2\sigma^2f^2}$, so a Berkson error leaves room for a larger gain than a classical error of the same width. The factor grows quickly with frequency: for $\sigma = 2$\,ms it is 1.10 at 25\,Hz and 1.77 at 60\,Hz. The weight $f^4$ also moves the distortion to high frequencies. For the Oracle predictions of Section~\ref{sec:exp:p2r}, 71--73\% of the band power that is coherent with the label lies below 25\,Hz, but the median frequency of the leading-order distortion is 67--72\,Hz. There the integral under (b) is 1.5--1.7 times that under (a) at $\sigma = 1.5$\,ms, 2.1--2.6 times at 2\,ms and 3.3--4.6 times at 2.5\,ms. A bound computed for one structure therefore does not hold for the other. The bound $1/B_a(\sigpost)$ registered for Section~\ref{sec:exp:p2r} is $\rho^\star$ under (a) for Gaussian errors, with the Oracle network's predictions in place of $m$. Section~\ref{sec:exp:p2r} also evaluates $1/B_b$, the same estimate under (b).
|
|
||||||
|
|
||||||
\paragraph{Finite samples.}
|
|
||||||
The label error itself is of first order. For zero-mean errors with variance $\sigma^2$, $\tilde y - y \approx \delta\, y'$ under (a) and $\tilde y - y \approx -\varepsilon\,\tilde y'$ under (b). To this order its conditional mean given $X$ vanishes, and for an error that is constant over the window its in-band variance is $\sigma^2\int_{|f|\ge f_c}(2\pi f)^2 S_y\dd f$. Most of this variance moves label noise that is unpredictable from $X$ anyway. To second order in $\sigma$ and averaged over the window, the conditional variance that a network trained on $\tilde y$ has to absorb grows by the mean of $\sigma^2 m'^2$ under (a) and shrinks by about as much under (b) (Proposition~\ref{prop:tie}). This is a second-order effect, against the fourth-order distortion of $\tilde m$, so with few wells finite-sample effects can outweigh the population bias. The argument is heuristic. It suggests that a tie error with exactly structure (b) would not, to second order, make a network worse than the Oracle, because its labels carry less conditional noise than the true labels. A bank can also change finite-sample learning in ways that \eqref{eq:rhostar} does not capture. A learned variance absorbs the spread of the bank and down-weights samples where the members disagree, and for $\lambda > 0$ the responsibilities re-register the labels during training (Remark~\ref{rem:lambda}). Section~\ref{sec:exp:p2r} compares the measured gains with $\rho^\star$.
|
|
||||||
|
|
||||||
\subsection{Coverage of the predictive intervals}
|
|
||||||
\label{sec:theory:cov}
|
|
||||||
|
|
||||||
Let a method predict a mean $\mu$ and a variance $s^2$ at every test sample. For method $j$ let $v_j = \E s^2$, $w_j = \E(y - \mu)^2$ and $\xi_j = v_j/w_j$, with expectations over test samples; $\xi = 1$ means that the predicted variance matches the squared error on average.
|
|
||||||
|
|
||||||
\begin{proposition}[Coverage]
|
|
||||||
\label{prop:coverage}
|
|
||||||
\begin{enumerate}
|
|
||||||
\item[(a)] For any methods $j$ and $O$, $\xi_j - \xi_O = (\Delta v - \xi_O\,\Delta w)/w_j$, with $\Delta v = v_j - v_O$ and $\Delta w = w_j - w_O$.
|
|
||||||
\item[(b)] Let $y$ be stationary, and let (A1) hold with real $0 \le P \le 1$. Compare the point label at its population optimum ($\mu = \tilde m$, $s^2 = \Var(\tilde y\mid X)$) with the oracle at its optimum ($\mu = m$, $s^2 = \Var(y\mid X)$). Then $\xi_O = 1$ and
|
|
||||||
\begin{equation*}
|
|
||||||
\xi_j - \xi_O = \frac{2}{w_j}\int P(1 - P)\, S_m\dd f \ \ge 0 .
|
|
||||||
\end{equation*}
|
|
||||||
\item[(c)] Under structure (b) of Proposition~\ref{prop:tie}, with $q_t$ independent of $t$ and $y$ stationary, the point label at its population optimum has $\xi_j \le 1$. A calibrated bank has $\xi_j = 1$.
|
|
||||||
\end{enumerate}
|
|
||||||
If $y - \mu = sZ/\sqrt{\xi}$ with $Z$ standard normal and independent of $s$, the interval $\mu \pm z s$ covers with probability $2\Phi(z\sqrt{\xi}) - 1$, which increases with $\xi$.
|
|
||||||
\end{proposition}
|
|
||||||
|
|
||||||
Part (a) is an identity and holds for any finite ensemble. A method covers more than the Oracle when its predicted variance exceeds the Oracle's by more than $\xi_O$ times its excess squared error. Parts (b) and (c) describe the population limit. There, classical tie error widens the intervals of a point-label method, Berkson error narrows them, and a calibrated bank matches the oracle. A finite ensemble can be far from this limit, and in our experiments every ensemble is (Section~\ref{sec:exp:p2r}).
|
|
||||||
|
|
||||||
\subsection{Scoring against a misregistered reference}
|
|
||||||
\label{sec:theory:ref}
|
|
||||||
|
|
||||||
Field evaluation compares predictions with labels at blind wells, and those labels need a tie as well. Let the reference be $y_{\mathrm{ref}}(t) = y(t + \varepsilon_r)$, where $\varepsilon_r$ is constant over the window, independent of the prediction $\hat y$ and of the true label $y$, and has characteristic function $Q_r$. Let $\hat y$ and $y$ be jointly stationary with cross-spectrum $S_{\hat y y}$, defined by $\E[\hat y(t)\,y(t+\tau)] = \int S_{\hat y y}(f)\,e^{i2\pi f\tau}\dd f$.
|
|
||||||
|
|
||||||
\begin{proposition}[Misregistered reference]
|
|
||||||
\label{prop:reference}
|
|
||||||
Under these assumptions,
|
|
||||||
\begin{equation}
|
|
||||||
\E|B(\hat y - y_{\mathrm{ref}})|^2 = \E|B(\hat y - y)|^2 + 2\int_{|f|\ge f_c}\operatorname{Re}\big[(1 - Q_r(f))\,S_{\hat y y}(f)\big]\dd f .
|
|
||||||
\label{eq:refbias}
|
|
||||||
\end{equation}
|
|
||||||
\end{proposition}
|
|
||||||
|
|
||||||
For a symmetric error, $0 \le 1 - Q_r \le 2$, so the reference penalizes in-band agreement with the true label. The extra term depends on the method, so it can change the ranking of two methods, and it does not average out over wells: more blind wells reduce the variance of a comparison but not its bias.
|
|
||||||
|
|
||||||
\begin{corollary}[Tolerance]
|
|
||||||
\label{cor:tolerance}
|
|
||||||
For two methods $A$ and $B$, let $G$ be the true band-MSE advantage of $A$ and $G_r$ the advantage measured against $y_{\mathrm{ref}}$. Then $G_r - G = 2\int_{|f|\ge f_c}\operatorname{Re}\big[(1 - Q_r)(S_{\hat y_B y} - S_{\hat y_A y})\big]\dd f$. Let $\hat y_A = Hm$ and $\hat y_B = HPm$, with real filters $0 \le H, P \le 1$: $A$ learns the oracle and $B$ the blurred optimum of (a), both shrunk by the same finite-sample factor $H$. Then
|
|
||||||
\begin{equation*}
|
|
||||||
G = \int_{|f|\ge f_c} H(1 - P)\big[2 - H(1 + P)\big] S_m\dd f \ \ge 0,
|
|
||||||
\qquad
|
|
||||||
G_r = \int_{|f|\ge f_c} H(1 - P)\big[2Q_r - H(1 + P)\big] S_m\dd f .
|
|
||||||
\end{equation*}
|
|
||||||
For $H = 1$ and zero-mean Gaussian errors with standard deviations $\sigma$ and $\sigma_r$, $2Q_r - 1 - P = 2\pi^2f^2(\sigma^2 - 2\sigma_r^2) + O(f^4)$, so to leading order the measured advantage has the sign of the true one only if $\sigma_r < \sigma/\sqrt2$.
|
|
||||||
\end{corollary}
|
|
||||||
|
|
||||||
Shrinkage relaxes this condition, because $2Q_r - H(1 + P)$ grows as $H$ decreases. If $B$ is over-sharp instead, as under (b), with $\hat y_B = HKm$ and $K \ge 1$, then $G_r - G = 2\int_{|f|\ge f_c} H(K - 1)(1 - Q_r)S_m\dd f \ge 0$, and the reference exaggerates the advantage of $A$. Independence between $\varepsilon_r$ and the prediction is plausible for a reference from check shots or a vertical seismic profile. A reference tied by synthetic--seismic matching depends on the same seismic as the prediction, and its error adds a covariance term to \eqref{eq:refbias}. Section~\ref{sec:exp:detect} estimates how many blind wells a comparison needs at a given reference error.
|
|
||||||
@@ -1,157 +0,0 @@
|
|||||||
\section{Registration-marginalized learning}
|
|
||||||
\label{sec:method}
|
|
||||||
|
|
||||||
RML has two stages. First, a posterior over the time--depth warp of each training well is computed from anchors and, optionally, from the seismic. No network is involved. Second, a network is trained on a bank of labels drawn from this posterior. At prediction time no warp is needed: the network maps seismic to a property trace on the seismic time axis.
|
|
||||||
|
|
||||||
\subsection{Warp prior and anchors}
|
|
||||||
\label{sec:method:prior}
|
|
||||||
|
|
||||||
For well $w$ with depth logs $\phi_w(z)$, $\mathrm{DT}_w(z)$ and $\rho_w(z)$, the time--depth map is
|
|
||||||
\begin{equation}
|
|
||||||
t_w(z; b_w, g_w) = t_{w,\mathrm{ref}} + b_w + 2\int_{z_{\mathrm{ref}}}^{z} \mathrm{DT}_w(u)\, e^{g_w(u)}\dd u .
|
|
||||||
\label{eq:warp}
|
|
||||||
\end{equation}
|
|
||||||
The log-slowness correction $g_w$ describes sonic--seismic drift from dispersion, tool effects or washouts. Because $e^{g} > 0$, the map is monotone by construction. $b_w \sim \N(0, \sigma_b^2)$ is a bulk offset. The prior on $g_w$ is a Gaussian process with constant mean $m_g$ and a Mat\'ern-3/2 kernel with scale $\sigma_g$ and length $\ell$. The hyperparameters $(m_g, \sigma_g, \ell)$ are fitted by type-II maximum likelihood on the anchors of the training wells only. $\sigma_a$ and $\sigma_b$ are fixed. Anchors are observed as $t_{wk} = t_w(z_{wk}) + \varepsilon_{wk}$ with $\varepsilon_{wk} \sim \N(0, \sigma_a^2)$. On F3, \eqref{eq:warp} has an important consequence: the same sonic log produces both the label and the time axis, so label and registration are coupled.
|
|
||||||
|
|
||||||
Fitted to the F3 anchors, the prior has $m_g = 0.014$, $\sigma_g = 0.10$ and $\ell = 71$\,ms. The fitted bulk spread is $\sigma_b = 19$\,ms. In leave-one-anchor-out tests, 87\% of held-out anchors lie inside the 90\% predictive interval. The synthetic benchmark draws its true warps from this fitted prior (Section~\ref{sec:data:d2}). Type-II maximum likelihood for $\sigma_a$ on F3 gives 0.4\,ms. This value is not reliable, because it treats the markers as exact: they are picks on the same seismic. We therefore use the empirical spread $\sigma_a = 7$\,ms (Section~\ref{sec:data:f3}). On F3, $\sigma_a$ is not identifiable from the data at hand.
|
|
||||||
|
|
||||||
\subsection{Physical tie likelihood}
|
|
||||||
\label{sec:method:tie}
|
|
||||||
|
|
||||||
For a training well with seismic trace $\mathbf s_w$ at the well location,
|
|
||||||
\begin{equation}
|
|
||||||
p(\mathbf s_w \mid g_w, b_w, \psi) = \N\big(\mathbf s_w;\ \alpha_w \mathbf W_\psi\, \mathbf r_w(b_w, g_w),\ \sigma_n^2 \mathbf I\big),
|
|
||||||
\end{equation}
|
|
||||||
where $\mathbf r_w$ is the reflectivity computed from acoustic impedance $\rho_w/\mathrm{DT}_w$ along the warp and blocked to 4\,ms, and $\mathbf W_\psi$ convolves with a 128\,ms statistical wavelet rotated by a constant phase $\psi$. The amplitude $\alpha_w \ge 0$ and the noise level $\sigma_n$ are profiled out, which gives $\log p = -\tfrac n2 \log \mathrm{RSS}$ over the extended window. The residuals are autocorrelated, so this likelihood is overconfident. We temper it by $\gamma = 1/\kappa$, where $\kappa$ is the variance inflation implied by the residual autocorrelation at the best anchor-only sample. The phase $\psi$ is chosen on a $15^\circ$ grid by marginal likelihood on the training wells. Test wells never enter this step.
|
|
||||||
|
|
||||||
\subsection{Two tie posteriors}
|
|
||||||
\label{sec:method:posterior}
|
|
||||||
|
|
||||||
\paragraph{Anchor posterior with importance weights (P2).}
|
|
||||||
We draw $S = 64$ warps per well from the anchor-conditioned posterior. The proposal is a Laplace (Gauss--Newton) approximation, refined by elliptical slice sampling \citep{murray2010ess}. Physical weights $\pi_s \propto p(\mathbf s_w\mid u^{(s)})^{\gamma}$ use the largest $\gamma$ that keeps the effective sample size at least $S/4$.
|
|
||||||
|
|
||||||
\paragraph{Sequential Monte Carlo posterior (P2r).}
|
|
||||||
Importance weights over 64 anchor-conditioned samples cannot move mass to warps that the anchor posterior rarely proposes. In development runs the weighted posterior did not contract to the true warp (Section~\ref{sec:exp:diag}). The second posterior therefore uses tempered sequential Monte Carlo. We introduced it only after the first pre-registered comparison had failed, so it is a deviation from the original protocol, and we report it as one (Section~\ref{sec:exp:diag}). It starts from $P = 1024$ anchor-posterior samples and targets $p(u\mid \text{anchors})\, p(\mathbf s_w\mid u, \psi)^{\gamma}$. The tempering exponent rises from 0 to $\gamma$ in adaptive steps that keep the effective sample size at least $P/2$. Each step uses systematic resampling followed by eight elliptical slice moves. Before the trial we registered a stability criterion: the 95th percentile over $t$ of the difference between mean warps of independent runs must not exceed 0.5\,ms. $P = 1024$ meets it at $c = 1$ on development data. At $c = 2$ the posterior is multimodal and the mean warp is unstable under every configuration we tried. We summarize posterior width by $\sigpost = w_{90}/3.29$, where $w_{90}$ is the 90\% interval width of $\tau(t)$ averaged over the main window and the training wells. No labels are used to compute it.
|
|
||||||
|
|
||||||
\subsection{Labels for each warp}
|
|
||||||
\label{sec:method:labels}
|
|
||||||
|
|
||||||
For each warp sample,
|
|
||||||
\begin{equation}
|
|
||||||
y_w^{(s)}(t_i) = (\aaf\phi_w)\big(z_w^{(s)}(t_i)\big),
|
|
||||||
\end{equation}
|
|
||||||
where $z_w^{(s)}$ is the inverse of $t_w(\cdot\,; u^{(s)})$, which exists because the warp is monotone, and $\aaf$ is an anti-alias filter applied before sampling at 4\,ms. Samples whose warp does not cover the main window receive zero weight. Every method in this paper, including the point-tie baselines and the oracle, builds labels with the same operator. Methods differ only in the warps they use.
|
|
||||||
|
|
||||||
\subsection{Training objective}
|
|
||||||
\label{sec:method:rml}
|
|
||||||
|
|
||||||
The network outputs a mean $\mu_\theta$ and a standard deviation $\sigma_\theta$ for every sample. For a window of $n$ samples and a bank of $S$ labels with weights $\pi_s > 0$, $\sum_s \pi_s = 1$, let
|
|
||||||
\begin{equation}
|
|
||||||
\ell_s = \sum_{i=1}^{n} \log\N\big(y_{s,i};\, \mu_i, \sigma_i^2\big), \qquad
|
|
||||||
\RML_\lambda = -\frac{1}{\lambda n}\log\sum_{s=1}^{S}\pi_s\, e^{\lambda \ell_s}, \qquad
|
|
||||||
\RML_\infty = -\frac1n\max_s \ell_s .
|
|
||||||
\label{eq:rml}
|
|
||||||
\end{equation}
|
|
||||||
The training loss is the mean of $\RML_\lambda$ over windows and wells.
|
|
||||||
|
|
||||||
\paragraph{Choice of $\lambda$.}
|
|
||||||
With $\lambda = 1$, differences between bank members are $O(n)$ and the log-sum-exp puts almost all weight on one member. Residuals are also autocorrelated, so a window holds less information than $n$ independent observations. If two members differ by $\Delta = \sum_i d_i$, and $d_i$ is a product of two zero-mean Gaussian processes with common autocorrelation $\rho$, then $\Var\Delta \approx n \Var(d)\,\tau_c$ with $\tau_c = 1 + 2\sum_{k\ge1}\rho(k)^2$. Setting $\lambda = 1/\tau_c$ gives $\lambda\Delta$ the variance of a log-likelihood difference over $n/\tau_c$ independent observations. This is the simplest magnitude adjustment of a composite likelihood \citep{pauli2011composite,ribatet2012composite}. Residuals are not available before training, so we estimate $\rho$ from the pooled autocorrelation of the high-passed training labels, truncated at the first non-positive lag. This gives $\tau_c \approx 2.7$ samples and $\lambda \approx 0.37$, nearly constant across the grid. The choice is a heuristic. We fixed it before the experiments and make no claim about it.
|
|
||||||
|
|
||||||
\paragraph{Special cases.}
|
|
||||||
The loss \eqref{eq:rml} contains the common alternatives. All five statements are exact and are checked numerically in the code's unit tests. Proofs are in Appendix~\ref{app:proofs}.
|
|
||||||
|
|
||||||
\begin{lemma}[Point tie]
|
|
||||||
\label{lem:s1}
|
|
||||||
If $S = 1$, or all bank members coincide, then $\RML_\lambda = -\ell/n$, the Gaussian negative log-likelihood, for every $\lambda$.
|
|
||||||
\end{lemma}
|
|
||||||
|
|
||||||
\begin{lemma}[Between hard-min and mixture mean]
|
|
||||||
\label{lem:sandwich}
|
|
||||||
Let $M(\lambda) = \lambda^{-1}\log \E_\pi e^{\lambda\ell}$. Then $\RML_\lambda = -M(\lambda)/n$ is non-increasing in $\lambda$, with
|
|
||||||
\begin{equation}
|
|
||||||
-\frac1n\max_s\ell_s \le \RML_\lambda \le -\frac1n\sum_s\pi_s\ell_s ,
|
|
||||||
\end{equation}
|
|
||||||
and it tends to the right-hand side as $\lambda \to 0$ and to $\RML_\infty$ as $\lambda \to \infty$. For uniform $\pi$, $0 \le \RML_\lambda - \RML_\infty \le \log S/(\lambda n)$.
|
|
||||||
\end{lemma}
|
|
||||||
|
|
||||||
As $\lambda \to 0$, the optimal mean is the regression of the $\pi$-weighted mean label on $X$, and the optimal variance adds the spread of the bank. Whether this blurs the predictor depends on how the bank relates to the true warp. If the members scatter around a point tie whose error satisfies (A1), the mean label is blurred further. If the bank is the calibrated posterior, the population optimum is that of the true warp (Proposition~\ref{prop:bank}).
|
|
||||||
|
|
||||||
\begin{lemma}[Gradient]
|
|
||||||
\label{lem:grad}
|
|
||||||
$\nabla_\theta \RML_\lambda = -\frac1n\sum_s r_s \nabla_\theta \ell_s$ with responsibilities $r = \operatorname{softmax}(\log\pi + \lambda\ell)$.
|
|
||||||
\end{lemma}
|
|
||||||
|
|
||||||
Each gradient step is therefore a generalized M-step whose weights are computed at the current $\theta$.
|
|
||||||
|
|
||||||
\begin{lemma}[Shift-tolerant losses]
|
|
||||||
\label{lem:shift}
|
|
||||||
With a bank of the point-tie label shifted by every integer lag in $\pm K$ samples and uniform $\pi$, $\RML_\infty$ is the hard-min shift loss with learned variance, and $\RML_{1/\tau_c}$ is its soft-min version.
|
|
||||||
\end{lemma}
|
|
||||||
|
|
||||||
\begin{lemma}[Soft-DTW]
|
|
||||||
\label{lem:sdtw}
|
|
||||||
Let $D_{ij} = -\log\N(y_j; \mu_i, \sigma_i^2)$, let $\mathcal P$ be the set of monotone alignment paths from $(0,0)$ to $(n-1,n-1)$ within a Sakoe--Chiba band, and let $\langle A, D\rangle_w$ be the path cost with symmetric step weights (diagonal steps counted twice; \citealp{sakoe1978dp}). For soft-DTW with these steps \citep{cuturi2017softdtw},
|
|
||||||
\begin{equation}
|
|
||||||
\frac{\mathrm{sDTW}_\gamma(D)}{2n} = \RML_{\lambda = 2/\gamma}\Big[\text{bank} = \mathcal P,\ \pi \text{ uniform},\ \ell_A = -\tfrac12\langle A, D\rangle_w\Big] - \frac{\gamma}{2n}\log|\mathcal P| .
|
|
||||||
\end{equation}
|
|
||||||
\end{lemma}
|
|
||||||
|
|
||||||
The last term does not depend on $\theta$. On the diagonal path, $\ell_A$ equals the Gaussian log-likelihood of the window. Soft-DTW is therefore RML over every monotone alignment in the band, with a uniform prior, no anchors and no physics, at $\lambda = 2/\gamma$; with $\gamma = 0.1$ this is $\lambda = 20$, much closer to the hard minimum than $\lambda \approx 0.37$. Symmetric steps give every path the same total weight $2n$. With standard steps, longer paths visit more cells and, since the negative log-likelihood can be negative, would be preferred. DILATE \citep{leguen2019dilate} adds a temporal-distortion term $\langle A^\star, \Omega\rangle$ with $A^\star = \nabla_D \mathrm{sDTW}_\gamma$ and $\Omega_{ij} = ((i-j)/n)^2$. Its gradient is a Hessian--vector product, which we compute by forward-mode differentiation of the backward pass \citep{mensch2018diffdp}. Our version differs from the original in two ways: the cost is the Gaussian negative log-likelihood, and the steps are symmetric.
|
|
||||||
|
|
||||||
\subsection{Network and training}
|
|
||||||
\label{sec:method:train}
|
|
||||||
|
|
||||||
All learned methods share one backbone and differ only in their labels and loss. The input is a $3\times3$ trace patch around the well (nine channels), z-scored per channel within each well. Three dilated 1-D convolutions (kernel 5, dilations 1, 2 and 4, 64 channels) feed a two-layer bidirectional GRU. A $1\times1$ head with a $1\times1$ skip connection outputs $\mu$ and $\sigma$ (softplus, $\sigma \ge 10^{-3}$). Dropout is 0.05. We train with Adam (learning rate $5\times10^{-3}$, gradient clipping at 5) on full batches of all training wells. Losses are computed on 64-sample windows starting at samples $0, 2, \dots, 62$ of the 126-sample main window. Labels are standardized by the mean and standard deviation of the anti-aliased log over the training wells. These statistics do not depend on the tie. The number of iterations is selected separately for each method from $\{125, 250, 500, 1000, 2000\}$ by total RMSE on the development realizations; on F3 it is selected by inner validation (Appendix~\ref{sec:exp:f3}). Every method has the same candidate set, and band metrics are not used for selection. Ensembles average five seeds (on F3, three inner models $\times$ five seeds), with $\mu = \overline{\mu_s}$ and $\sigma^2 = \overline{\sigma_s^2} + \Var_s \mu_s$.
|
|
||||||
|
|
||||||
\subsection{Compared methods}
|
|
||||||
\label{sec:method:baselines}
|
|
||||||
|
|
||||||
Table~\ref{tab:methods} lists the methods. In the language of Lemmas~\ref{lem:s1}--\ref{lem:sdtw}, the B3 family is RML with $S = 1$ at different point ties. B4 is RML with anchor-free banks, and M1, M2 and \mRML{} are RML with anchor-conditioned banks.
|
|
||||||
|
|
||||||
\begin{table}[t]
|
|
||||||
\centering
|
|
||||||
\caption{Compared methods. All learned methods use the backbone of Section~\ref{sec:method:train}. Bank: labels entering \eqref{eq:rml}.}
|
|
||||||
\label{tab:methods}
|
|
||||||
\small
|
|
||||||
\begin{tabular}{lp{0.5\linewidth}l}
|
|
||||||
\toprule
|
|
||||||
ID & Labels / bank & Loss \\
|
|
||||||
\midrule
|
|
||||||
\multicolumn{3}{l}{\emph{Field baselines (F3 only)}} \\
|
|
||||||
B0a & depth--time trend fitted on training wells (no seismic) & -- \\
|
|
||||||
B0b & ridge, random forest or gradient boosting on seismic attributes and TWT & -- \\
|
|
||||||
B1 & model-based impedance inversion with a well-interpolated low-frequency model, then linear $\phi$--impedance & -- \\
|
|
||||||
B2 & backbone with a composite loss$^{\dagger}$ & composite \\
|
|
||||||
\midrule
|
|
||||||
\multicolumn{3}{l}{\emph{Point ties ($S = 1$)}} \\
|
|
||||||
B3a & sonic integration from one shallow anchor & NLL \\
|
|
||||||
B3b & marker-calibrated sonic through the anchors & NLL \\
|
|
||||||
B3c & B3b plus local shifts from synthetic--seismic correlation & NLL \\
|
|
||||||
B3c-R & B3c with the SMC-estimated wavelet phase & NLL \\
|
|
||||||
B3d & weighted mean warp of the P2 anchor posterior & NLL \\
|
|
||||||
\mPM & mean warp of the SMC posterior & NLL \\
|
|
||||||
Oracle & true warp (synthetic only; a ceiling, not a competitor) & NLL \\
|
|
||||||
\midrule
|
|
||||||
\multicolumn{3}{l}{\emph{Anchor-free alignment losses (labels B3b)}} \\
|
|
||||||
B4a & B3b shifted by $\pm 8$ samples, uniform $\pi$ & $\RML_\infty$ \\
|
|
||||||
B4b & as B4a & $\RML_{1/\tau_c}$ \\
|
|
||||||
B4c & all monotone alignments in a $\pm8$ band & soft-DTW, $\gamma = 0.1$ \\
|
|
||||||
B4d & as B4c & DILATE, $\alpha = 0.5$ \\
|
|
||||||
\midrule
|
|
||||||
\multicolumn{3}{l}{\emph{Anchor-conditioned banks}} \\
|
|
||||||
M1 & 64 anchor-posterior warps, uniform $\pi$ & $\RML_{1/\tau_c}$ \\
|
|
||||||
M2 & as M1, tempered physical weights & $\RML_{1/\tau_c}$ \\
|
|
||||||
\mRML & 64 SMC particles, uniform $\pi$ & $\RML_{1/\tau_c}$ \\
|
|
||||||
\midrule
|
|
||||||
B5 & five-seed ensemble of B3b & NLL \\
|
|
||||||
\bottomrule
|
|
||||||
\end{tabular}
|
|
||||||
|
|
||||||
\smallskip
|
|
||||||
\footnotesize $^{\dagger}$Labels as B3b; deterministic output. Loss: Huber regression loss $+\,0.60$ correlation $+\,0.05$ first-difference $+\,0.10$ standardized-shape $+\,0.10$ variance-matching $+\,0.20$ best-shift MSE (minimum over shifts of $\pm 8$ samples).
|
|
||||||
\end{table}
|
|
||||||
|
|
||||||
\subsection{Metrics}
|
|
||||||
\label{sec:method:metrics}
|
|
||||||
|
|
||||||
Accuracy is reported in porosity units (p.u., porosity $\times 100$). We split every trace into a low band ($|f| < f_c$) and a seismic band ($|f| \ge f_c$, $f_c = 6$\,Hz). The split uses a zero-phase fourth-order Butterworth filter. On F3, energy below 5\,Hz is 0.2--0.5\% of the total. The primary metrics are RMSE and Pearson correlation in the seismic band (band RMSE, band PCC): registration errors act there, while the low band is dominated by the trend. We also report total RMSE and PCC and the band standard-deviation ratio. Calibration is described by the coverage of central intervals at 50, 80, 90 and 95\%, the calibration error (mean absolute deviation of coverage from nominal over these levels), the Gaussian negative log-likelihood and the CRPS. Warp accuracy (synthetic only) is the RMSE of $\tau(t)$ against the true warp over the main window, together with 90\% coverage. Statistics are computed per test well and then macro-averaged. Intervals are 95\% bootstrap intervals over realizations (2000 resamples). On F3 the time samples within a well are not independent and there are only four wells. Field results are therefore descriptive, and we compute no per-sample $p$-values.
|
|
||||||
156
paper/sections/05_theory.tex
Normal file
156
paper/sections/05_theory.tex
Normal file
@@ -0,0 +1,156 @@
|
|||||||
|
\section{Theory}
|
||||||
|
\label{sec:theory}
|
||||||
|
|
||||||
|
This section asks what a registration error in the training labels does to a learned predictor and to its evaluation. It uses the warps, labels and loss of Section~\ref{sec:method}, states each result in words, and keeps only the formulas needed later. Appendix~\ref{app:proofs} gives the formal statements and the proofs. Table~\ref{tab:theory} lists the results, the assumption behind each and how each was tested, and Table~\ref{tab:symbols} the main symbols.
|
||||||
|
|
||||||
|
\begin{table}[t]
|
||||||
|
\centering
|
||||||
|
\caption{Theoretical results of this section, their main assumptions and their tests. Formal statements are in Appendix~\ref{app:proofs}.}
|
||||||
|
\label{tab:theory}
|
||||||
|
\small
|
||||||
|
\begin{tabular}{>{\raggedright\arraybackslash}p{0.13\linewidth}>{\raggedright\arraybackslash}p{0.36\linewidth}>{\raggedright\arraybackslash}p{0.17\linewidth}>{\raggedright\arraybackslash}p{0.24\linewidth}}
|
||||||
|
\toprule
|
||||||
|
Result & Statement & Main assumption & Test and outcome \\
|
||||||
|
\midrule
|
||||||
|
Prop.~\ref{prop:blur} & Timing errors independent of the data blur the optimal predictor & independent error & controlled experiment: agrees to within 1\% for 4--16\,ms, below about 23\,Hz \\
|
||||||
|
Prop.~\ref{prop:ident} & Without anchors, a network and its alignment can drift together & model closed under shifts & anchors removed: warp error about ten times larger \\
|
||||||
|
Prop.~\ref{prop:tie} & Classical tie error blurs the predictor; Berkson error sharpens it & error structure & exploratory: Berkson at F3-like drift \\
|
||||||
|
Prop.~\ref{prop:bank} & A calibrated bank has the oracle's optimum; its gain over one label is of fourth order & calibrated bank, $\lambda \to 0$ & measured gains compared with the bound (Section~\ref{sec:exp:p2r}) \\
|
||||||
|
Cor.~\ref{cor:twomode} & A two-mode error reverses the sign of part of the band & two-point error & two-mode study: as predicted \\
|
||||||
|
Prop.~\ref{prop:coverage} & Coverage follows the error structure & population optimum & not tested: confounded with training length \\
|
||||||
|
Prop.~\ref{prop:reference}, Cor.~\ref{cor:tolerance} & A misregistered reference biases a comparison of methods & reference error independent of the prediction & exploratory: ranking reverses at about 4\,ms \\
|
||||||
|
\bottomrule
|
||||||
|
\end{tabular}
|
||||||
|
\end{table}
|
||||||
|
|
||||||
|
\begin{table}[t]
|
||||||
|
\centering
|
||||||
|
\caption{Main symbols.}
|
||||||
|
\label{tab:symbols}
|
||||||
|
\small
|
||||||
|
\setlength{\tabcolsep}{4pt}
|
||||||
|
\begin{tabular}{ll@{\qquad}ll}
|
||||||
|
\toprule
|
||||||
|
Symbol & Meaning & Symbol & Meaning \\
|
||||||
|
\midrule
|
||||||
|
$t$ & seismic two-way time & $\sigma_a$ & anchor pick uncertainty \\
|
||||||
|
$X$, $D$ & network input; all data at a well & $\sigma_b$ & prior spread of the bulk offset \\
|
||||||
|
$y$, $\tilde y$ & correctly placed label; observed label & $\sigpost$ & posterior width of the warp \\
|
||||||
|
$\delta$, $\varepsilon$ & timing error, classical and Berkson forms & $\sigma_{\mathrm{ref}}$ & timing error of the reference \\
|
||||||
|
$m$, $\tilde m$ & optimal predictors of $y$ and $\tilde y$ & $c$ & drift factor \\
|
||||||
|
$P$, $Q$ & characteristic functions of $\delta$, $\varepsilon$ & $N$, $n_{\mathrm{b}}$ & training wells; blind wells \\
|
||||||
|
$B$, $f_c$ & seismic-band filter; its 6\,Hz cutoff & $S$, $N_p$ & bank size; SMC particles \\
|
||||||
|
$\rho^\star$ & largest population gain of a bank & $\lambda$ & tempering of the RML loss \\
|
||||||
|
\bottomrule
|
||||||
|
\end{tabular}
|
||||||
|
\end{table}
|
||||||
|
|
||||||
|
\paragraph{Notation.}
|
||||||
|
$t$ is seismic two-way time, $X$ the seismic input around a well, and $y(t)$ the label under correct registration. $\delta(t)$ is the registration error, and the observed label is $\tilde y(t) = y(t + \delta(t))$. The oracle predictor is $m(t) = \E[y(t)\mid X]$, the MSE-optimal predictor under correct labels, and $S_a$ is the power spectrum of $a$. The seismic band is $|f| \ge f_c$ with $f_c = 6$\,Hz, and $B$ is the corresponding high-pass operator. Spectral statements assume second-order stationarity in $t$, which is a working assumption for well logs.
|
||||||
|
|
||||||
|
\subsection{Misregistered labels blur the optimal predictor}
|
||||||
|
\label{sec:theory:blur}
|
||||||
|
|
||||||
|
If the timing error does not depend on the data, which we call assumption (A1), the best a network can do on the observed labels is to predict an average of the oracle over the possible shifts (Proposition~\ref{prop:blur}). When the error distribution is the same at every time, this average is a filter whose frequency response is the characteristic function of the error,
|
||||||
|
\begin{equation*}
|
||||||
|
P(f) = \E\big[e^{i2\pi f\delta}\big], \qquad \delta \sim \N(\mu_\delta, \sigma^2) \;\Rightarrow\; P(f) = e^{i2\pi f\mu_\delta}\, e^{-2\pi^2\sigma^2 f^2}.
|
||||||
|
\end{equation*}
|
||||||
|
Only the marginal distribution of $\delta(t)$ at each $t$ enters. Whether the error is a smooth drift or independent jitter does not change the population optimum, although it changes finite-sample learning. A non-zero mean $\mu_\delta$ adds a common shift, the direction that Section~\ref{sec:theory:ident} shows to be unidentified. Assumption (A1) is the classical structure of errors-in-variables models \citep{fuller1987measurement,carroll2006measurement}, applied to the time index rather than to the value of the label. It is a modelling assumption: on F3 the same sonic log produces both the label and the time axis, so $\delta$ and $y$ are not strictly independent.
|
||||||
|
|
||||||
|
Blur lowers both the amplitude and the correlation of the prediction in the seismic band (Corollary~\ref{cor:band}). The coherence at each frequency is unchanged, so blur does not destroy information at the population level, but it reweights the band towards low frequencies. Undoing it would require multiplying by $e^{+2\pi^2\sigma^2 f^2}$, which amplifies estimation error wherever $|P| \approx 0$, and $\sigma$ is unknown in practice. Taking the F3 seismic amplitude spectrum as a proxy for the recoverable band, a Gaussian error with $\sigma = 8$\,ms keeps less than 7\% of the seismic-band variance. A predictor with less high-frequency power keeps more, as in Table~\ref{tab:h1}.
|
||||||
|
|
||||||
|
Matching the variance of the prediction to that of the label does not repair the blur: it rescales the amplitude, and the in-band spectrum keeps the shape $|P|^2 S_m$ (Corollary~\ref{cor:var}). The composite-loss baseline (Section~\ref{sec:method:baselines}) combines a variance-matching term with a best-shift term and is expected to behave in the same way.
|
||||||
|
|
||||||
|
\paragraph{A controlled experiment agrees with the predicted blur in the band it can test.}
|
||||||
|
We trained the backbone of Section~\ref{sec:method:train} with MSE on oracle synthetic labels shifted by $\delta_{wj} = \sigma z_{wj}$, $z \sim \N(0,1)$. The shift is fixed within each 64-sample window and independent of everything else, so (A1) holds by construction. We used $c = 0$, $N = 16$, eight realizations and five seeds. The cross-spectrum ratio
|
||||||
|
\begin{equation}
|
||||||
|
\hat H_\sigma(f) = \frac{\sum \operatorname{Re}[Y^*(f)\hat Y_\sigma(f)]}{\sum \operatorname{Re}[Y^*(f)\hat Y_0(f)]}
|
||||||
|
\end{equation}
|
||||||
|
estimates $P_\sigma(f)$; the sums run over test wells, realizations and seeds, with Hann-tapered traces zero-padded to 256 samples. The pre-registered statistic is $r(\sigma)$, the geometric mean of $\hat H_\sigma/P_\sigma$ over frequencies with $f \ge f_c$, $P_\sigma \ge 0.1$ and reference cross-power at least 10\% of its in-band maximum. The hypothesis is rejected if $r \notin [0.5, 2]$ for any $\sigma > 0$. That interval is loose, so the evidence lies in the point estimates and their intervals. It was not rejected: $r = 1.009$, 1.009 and 1.007 for $\sigma = 4$, 8 and 16\,ms, and $r = 1.093$ for $\sigma = 32$\,ms (Table~\ref{tab:h1}, Fig.~\ref{fig:h1}).
|
||||||
|
|
||||||
|
Two limits apply. The frequency-selection rule keeps only 6.8--22.5\,Hz, where the MSE predictor has coherent power (72\% of the in-band cross-spectrum), so the test says nothing above about 23\,Hz. At 32\,ms the measured attenuation is 9\% weaker than predicted and the interval excludes 1. This is within the pre-registered tolerance. Two candidate causes were not checked: only four frequencies remain at this $\sigma$, and a shift of 8 samples or more can run off the label trace, which truncates the realized shift distribution.
|
||||||
|
|
||||||
|
\begin{table}[t]
|
||||||
|
\centering
|
||||||
|
\caption{Test of Proposition~\ref{prop:blur}. $r(\sigma)$: geometric mean of measured over theoretical transfer; 95\% bootstrap interval over realizations. Band metrics in p.u.\ on test wells.}
|
||||||
|
\label{tab:h1}
|
||||||
|
\small
|
||||||
|
\begin{tabular}{rcccccc}
|
||||||
|
\toprule
|
||||||
|
$\sigma$ (ms) & $r(\sigma)$ & 95\% CI & frequencies & band RMSE & band PCC & band sd ratio \\
|
||||||
|
\midrule
|
||||||
|
0 & 1 & -- & 17 & 0.426 & 0.954 & 0.945 \\
|
||||||
|
4 & 1.009 & [0.996, 1.019] & 17 & 0.587 & 0.908 & 0.817 \\
|
||||||
|
8 & 1.009 & [0.990, 1.025] & 17 & 0.805 & 0.817 & 0.677 \\
|
||||||
|
16 & 1.007 & [0.975, 1.038] & 15 & 1.042 & 0.670 & 0.475 \\
|
||||||
|
32 & 1.093 & [1.046, 1.143] & 4 & 1.269 & 0.388 & 0.247 \\
|
||||||
|
\bottomrule
|
||||||
|
\end{tabular}
|
||||||
|
\end{table}
|
||||||
|
|
||||||
|
\begin{figure}[t]
|
||||||
|
\centering
|
||||||
|
\includegraphics[width=\linewidth]{p2_h1.pdf}
|
||||||
|
\caption{Test of Proposition~\ref{prop:blur}. (a) Estimated transfer $\hat H_\sigma(f)$ on the frequencies used (solid) and $e^{-2\pi^2\sigma^2 f^2}$ (dashed). The shaded band below 6\,Hz is outside the seismic band and is not used. (b) $r(\sigma)$ with 95\% intervals over realizations and the number of frequencies used; the shaded region is the pre-registered non-rejection interval $[0.5, 2]$. Setting: $c = 0$, $N = 16$, MSE loss.}
|
||||||
|
\label{fig:h1}
|
||||||
|
\end{figure}
|
||||||
|
|
||||||
|
\subsection{Without anchors, absolute timing is not identified}
|
||||||
|
\label{sec:theory:ident}
|
||||||
|
|
||||||
|
A network that can shift its output by a common amount can drift together with its label alignment without changing the loss, so the labels alone do not fix absolute timing (Proposition~\ref{prop:ident}, under assumption (A3) that the model class is closed under output shifts). A prior on the bulk offset and the anchors each add curvature along this ridge. With $K_w$ anchors at well $w$, the spread of a common shift $\beta$ along the ridge, with the other parameters held fixed, is
|
||||||
|
\begin{equation*}
|
||||||
|
\sd(\beta) \approx \Big(\frac{\sum_w K_w}{\sigma_a^2} + \frac{N}{\sigma_b^2}\Big)^{-1/2} \approx \frac{\sigma_a}{\sqrt{\sum_w K_w}} .
|
||||||
|
\end{equation*}
|
||||||
|
For illustration, with 4 wells of 16 anchors each (denser than the 9--11 in the F3 target window) at $\sigma_a = 7$\,ms, $\sd(\beta) \approx 0.9$\,ms. With only the prior $\sigma_b = 50$\,ms, $\sd(\beta) \approx 50/\sqrt N$, that is 35\,ms for $N = 2$ and 12.5\,ms for $N = 16$. A deterministic common shift $\beta$ multiplies the band-limited correlation at frequency $f$ by $\cos(2\pi f\beta)$, and $\cos(2\pi\cdot 20\,\mathrm{Hz}\cdot 12.5\,\mathrm{ms}) = 0$. The marginal spread, which also integrates over the drift of each well, is at least as large. Assumption (A3) holds exactly, up to window edges, for a fully convolutional network whose last-layer kernel extends at least $\beta_{\max}$ samples, the largest shift considered, beyond the weights it uses on each side, and approximately for the CNN--GRU used here.
|
||||||
|
|
||||||
|
A seismic tie term pins absolute time only weakly. Seismic is observed on a fixed time axis, so a likelihood comparing it with a warped synthetic is not invariant to $\beta$. In practice a small shift trades off against a constant wavelet phase rotation: the two coincide at $f_0 = \psi/(2\pi\beta)$ and differ by $2\pi(f - f_0)\beta$ elsewhere. For $\beta = 4$\,ms the largest phase difference over $\pm 30$\,Hz around $f_0$ is only about $43^\circ$, so information about $\beta$ comes from the bandwidth, not the centre frequency.
|
||||||
|
|
||||||
|
Shift-tolerant losses and soft-DTW choose the alignment that best fits the network's current prediction and use no anchors, so within the range of their shift bank or band they have this ridge. A tie posterior conditioned on anchors does not: its absolute timing is set before training, with per-well common-shift uncertainty of about $\sigma_a/\sqrt{K_w}$.
|
||||||
|
|
||||||
|
\subsection{Labels from a tie: blur or sharpening}
|
||||||
|
\label{sec:theory:post}
|
||||||
|
|
||||||
|
A tie estimated from the data at a training well need not satisfy (A1). Let $D$ denote all data at the well (seismic, logs and anchors), with the network input $X$ a function of $D$. Let $u^\star$ be the true warp, so that $y = y^{u^\star}$, and let $\hat u = \hat u(D)$ be a point tie with label $\tilde y = y^{\hat u}$. The misregistration can be written in either direction,
|
||||||
|
\begin{equation}
|
||||||
|
\tilde y(t) = y\big(t + \delta(t)\big),\ \ \delta(t) = t_{u^\star}\big(z_{\hat u}(t)\big) - t;
|
||||||
|
\qquad
|
||||||
|
y(t) = \tilde y\big(t + \varepsilon(t)\big),\ \ \varepsilon(t) = t_{\hat u}\big(z_{u^\star}(t)\big) - t .
|
||||||
|
\label{eq:twoerrors}
|
||||||
|
\end{equation}
|
||||||
|
Let $\tilde m(t) = \E[\tilde y(t)\mid X]$ be the optimal predictor of the point label, and let $Q(f) = \E[e^{i2\pi f\varepsilon}]$.
|
||||||
|
|
||||||
|
Which direction carries the independent error decides what the point label does (Proposition~\ref{prop:tie}). If $\delta$ is independent of the label given $X$, the error is classical: the point label blurs the optimal predictor and widens the learned variance. If $\varepsilon$ is independent of the data given $X$, the error is Berkson: the point label sharpens the predictor and narrows the variance. The variance statements hold on average over the window when the error distribution does not change with time. For a zero-mean Gaussian error whose distribution depends on neither time nor $X$, the transfer from $m$ to $\tilde m$ is $e^{-2\pi^2\sigma^2 f^2}$ under classical error and $e^{+2\pi^2\sigma^2 f^2}$ under Berkson error; the latter presupposes that the oracle's spectrum decays faster than $e^{-4\pi^2\sigma^2 f^2}$. A classical error is independent of the true value and a Berkson error of the assigned value \citep{berkson1950two,carroll2006measurement}.
|
||||||
|
|
||||||
|
The Berkson structure is the natural idealization for a tie computed as a posterior mean, $\hat u = \E[u^\star\mid D]$. Then $\E[u^\star - \hat u\mid D] = 0$ by construction, and in a linear-Gaussian model $u^\star - \hat u$ is independent of $D$. For the bulk offset $b$ in \eqref{eq:warp}, the time error equals the posterior error of $b$ and inherits this property; for the drift it does so approximately, when the posterior is narrow. A tie fitted in another way, for example by maximizing a synthetic--seismic correlation, can have either structure or neither. On synthetic data the two can be told apart: for the bulk offset, classical error implies $\Cov(\hat b - b^\star, b^\star) = 0$, and Berkson error implies $\Cov(b^\star - \hat b, \hat b) = 0$.
|
||||||
|
|
||||||
|
\paragraph{A calibrated bank removes the dependence on a single tie.}
|
||||||
|
A bank is calibrated when averages over its members equal posterior expectations. Training on a calibrated bank then has, as $\lambda \to 0$, the population optimum of training on the true labels (Proposition~\ref{prop:bank}). Calibration is an idealization. An exact posterior sample reaches it as $S \to \infty$, and a finite bank only approximates it. A sample from a tempered target, such as the SMC posterior of Section~\ref{sec:method:posterior}, does not reach it even in that limit. The mean warp does not share this property: the \mPM{} method trains on the label at the mean warp, which agrees with the mean label only to first order in the posterior spread. If the time error of the mean warp has the Berkson structure, the population optimum of the \mPM{} is sharpened by $1/Q$, while that of the mean label is exact. At finite $\lambda$ the responsibilities of Lemma~\ref{lem:grad} shift weight towards the members that agree with the current network, an implicit re-registration, and the population minimizer changes (Remark~\ref{rem:lambda}).
|
||||||
|
|
||||||
|
\paragraph{A two-mode error can reverse the sign of part of the band.}
|
||||||
|
An error of $\pm\Delta/2$ with equal probability, constant over the window and independent of the data, has characteristic function $\cos(\pi f\Delta)$. Under either structure the transfer from $m$ to $\tilde m$ is then negative for $1/(2\Delta) < |f| < 3/(2\Delta)$: there the point label trains the network towards the wrong sign (Corollary~\ref{cor:twomode}). A Gaussian error with the same variance has a positive transfer at every frequency. The mean label of a calibrated bank has transfer 1, whereas, under classical error, an equal-weight bank of the point label shifted by $\pm\Delta/2$ has transfer $\cos^2(\pi f\Delta)$ as $\lambda \to 0$: it contains the true warp but is not calibrated, and it removes the reversal only by attenuating the band further. If the two modes are one dominant period apart, $\Delta = 1/f_0$, the first reversed band is $f_0/2 < |f| < 3f_0/2$. The F3 seismic, from which the benchmark wavelet is estimated, peaks near 60\,Hz (Section~\ref{sec:data:f3}), which gives 30--90\,Hz. Cycle skipping produces errors of this kind, and at $c = 2$ the SMC posterior is multimodal (Section~\ref{sec:method:posterior}).
|
||||||
|
|
||||||
|
\paragraph{A bank can gain only a fourth-order amount in population.}
|
||||||
|
In population no method beats the oracle in band MSE. If a point-label method converges to $\tilde m$ and a bank method to $m$, the ratio of their band RMSEs is
|
||||||
|
\begin{equation}
|
||||||
|
\rho^\star = \Big(1 + \frac{\E|B(\tilde m - m)|^2}{\E|B(m - y)|^2}\Big)^{-1/2},
|
||||||
|
\label{eq:rhostar}
|
||||||
|
\end{equation}
|
||||||
|
and no method can improve on the point label by more than this factor. With errors that do not depend on $t$ or $X$, $\E|B(\tilde m - m)|^2 = \int_{|f|\ge f_c}|1 - P|^2 S_m\dd f$ under classical error and $\int_{|f|\ge f_c}|1 - Q|^2|Q|^{-2}S_m\dd f$ under Berkson error. For Gaussian errors both integrands equal $(2\pi^2\sigma^2f^2)^2 S_m$ to leading order, so the population distortion is of fourth order in $\sigma$.
|
||||||
|
|
||||||
|
Beyond leading order the Berkson integrand is larger by the factor $e^{4\pi^2\sigma^2f^2}$, so a Berkson error leaves room for a larger gain than a classical error of the same width. For $\sigma = 2$\,ms the factor is 1.10 at 25\,Hz and 1.77 at 60\,Hz. The weight $f^4$ also moves the distortion to high frequencies. For the Oracle predictions of Section~\ref{sec:exp:p2r}, 71--73\% of the band power that is coherent with the label lies below 25\,Hz, but the median frequency of the leading-order distortion is 67--72\,Hz. There the Berkson integral is 1.5--1.7 times the classical one at $\sigma = 1.5$\,ms, 2.1--2.6 times at 2\,ms and 3.3--4.6 times at 2.5\,ms, so a bound computed for one structure does not hold for the other. Section~\ref{sec:exp:p2r} evaluates \eqref{eq:rhostar} for Gaussian errors at the posterior width, with the Oracle network's predictions in place of $m$. We write $\rhoCl$ for the classical bound, which was pre-registered, and $\rhoBk$ for the Berkson bound, which was computed post hoc.
|
||||||
|
|
||||||
|
\paragraph{Finite-sample effects can outweigh this population bias.}
|
||||||
|
The label error itself is of first order, and most of its in-band variance moves label noise that is unpredictable from $X$ anyway. To second order in $\sigma$ and averaged over the window, the conditional variance that a network trained on $\tilde y$ has to absorb grows by the mean of $\sigma^2 m'^2$ under classical error and shrinks by about as much under Berkson error. This is a second-order effect, against the fourth-order distortion of $\tilde m$, so with few wells finite-sample effects can outweigh the population bias. The argument is heuristic. It suggests that a tie error with exactly the Berkson structure would not, to second order, make a network worse than the Oracle, because its labels carry less conditional noise than the true labels. A bank can also change finite-sample learning in ways that \eqref{eq:rhostar} does not capture: a learned variance absorbs the spread of the bank and down-weights samples where the members disagree, and for $\lambda > 0$ the responsibilities re-register the labels during training.
|
||||||
|
|
||||||
|
\subsection{Coverage of the predictive intervals}
|
||||||
|
\label{sec:theory:cov}
|
||||||
|
|
||||||
|
The error structure also affects predictive intervals. Let a method predict a mean $\mu$ and a variance $\hat\sigma^2$ at every test sample. For method $j$ let $v_j = \E \hat\sigma^2$, $w_j = \E(y - \mu)^2$ and $\xi_j = v_j/w_j$, with expectations over test samples; $\xi = 1$ means that the predicted variance matches the squared error on average. In population, classical tie error widens the intervals of a point-label method, Berkson error narrows them, and a calibrated bank matches the oracle (Proposition~\ref{prop:coverage}). For any finite ensemble, a method has a larger dispersion ratio $\xi$ than the Oracle, and under a Gaussian error scaling covers more, when its predicted variance exceeds the Oracle's by more than $\xi_O$ times its excess squared error. A finite ensemble can be far from the population limit, and in our experiments every ensemble is (Section~\ref{sec:exp:p2r}).
|
||||||
|
|
||||||
|
\subsection{Scoring against a misregistered reference}
|
||||||
|
\label{sec:theory:ref}
|
||||||
|
|
||||||
|
Field evaluation compares predictions with labels at blind wells, and those labels need a tie as well. Let the reference be $y_{\mathrm{ref}}(t) = y(t + \varepsilon_{\mathrm{ref}})$, where $\varepsilon_{\mathrm{ref}}$ is constant over the window, independent of the prediction $\hat y$ and of the true label $y$, and has characteristic function $Q_{\mathrm{ref}}$. The error adds a term to the measured band MSE that, for a symmetric error, penalizes in-band agreement with the true label (Proposition~\ref{prop:reference}). The term depends on the method, so it can change the ranking of two methods, and it does not average out over wells: more blind wells reduce the variance of a comparison but not its bias.
|
||||||
|
|
||||||
|
Corollary~\ref{cor:tolerance} gives the accuracy that a comparison needs. Consider a method that learns the oracle and one that learns the blurred optimum, with zero-mean Gaussian errors of standard deviation $\sigma$ in the tie and $\sigma_{\mathrm{ref}}$ in the reference. The measured advantage can have the sign of the true one only if $\sigma_{\mathrm{ref}} < \sigma/\sqrt2$. The reference must therefore be more accurate than the tie error the comparison is meant to detect, by at least a factor of $\sqrt2$. The condition is necessary, not sufficient, and finite-sample shrinkage of the predictions in the band (the factor $H$ of Corollary~\ref{cor:tolerance}) relaxes it. Against an over-sharp method, as under Berkson error, the reference instead exaggerates the advantage of the better-registered method. Independence between $\varepsilon_{\mathrm{ref}}$ and the prediction is plausible for a reference from check shots or a vertical seismic profile. A reference tied by synthetic--seismic matching depends on the same seismic as the prediction, and its error adds a further covariance term. Section~\ref{sec:exp:detect} works through the numbers.
|
||||||
@@ -1,27 +1,29 @@
|
|||||||
\section{Experiments}
|
\section{Experiments}
|
||||||
\label{sec:experiments}
|
\label{sec:experiments}
|
||||||
|
|
||||||
We ran two pre-registered synthetic experiments, in order, and then pre-registered field tests on F3 and Volve (Section~\ref{sec:exp:scope}; details in Appendix~\ref{app:field}). Before each main run, the protocol (grid, methods, iteration budgets, pass rules) was locked by a SHA-256 hash, and the scripts refuse to run if the hash does not match. The two synthetic protocols were also committed and tagged in version control before their main runs. The field protocols were committed only after their runs, so for them the record of timing is the time stamp inside the lock file (Appendix~\ref{app:field}). In the synthetic experiments, every design choice was made on two development realizations (900 and 901), which are never used for results. Test labels were never used to choose a shift, checkpoint or hyperparameter. In the synthetic experiments, a comparison \emph{improves} if the candidate's seismic-band RMSE is at most 0.90 times that of the best competitor, \emph{or} its band PCC is at least 0.05 higher. Here ``best'' means the competitor with the smallest mean band RMSE in that cell. A cell \emph{passes} if the comparison improves in at least 4 of 5 seeds (each averaged over realizations) and in more than half of the realizations (each averaged over seeds). All cells use eight test wells.
|
We ran three synthetic experiments and two field tests, each under a protocol locked before its main run (Appendix~\ref{app:record}). Experiment~1 tested banks drawn from an anchor-conditioned posterior and failed. Experiment~2, designed after that failure and run on new realizations, replaced the posterior. Field tests on F3 and Volve followed (Section~\ref{sec:exp:scope}). Experiment~3, designed after the field tests had failed, stressed the results of Experiment~2 (Section~\ref{sec:exp:bench}). Test labels were never used to choose a shift, checkpoint or hyperparameter.
|
||||||
|
|
||||||
\subsection{Experiment 1: anchor-posterior banks (gate G-B)}
|
Two pre-registered rules decide the synthetic comparisons, and all cells use eight test wells. Under the \emph{margin rule}, the candidate \emph{improves} if its seismic-band RMSE is at most 0.90 times that of the best competitor, \emph{or} its band PCC is at least 0.05 higher. Here ``best'' means the competitor with the smallest mean band RMSE in that cell. Under the \emph{no-margin rule}, the candidate improves if its band RMSE is lower. Under either rule a cell \emph{passes} if the candidate improves in at least 4 of 5 seeds (each averaged over realizations) and in more than half of the realizations (each averaged over seeds). Experiment~1 and the posterior-mean claims use the margin rule. The bank claim, the two-mode claim and the counts of cells in the drift--well-count grid use the no-margin rule, and we say a candidate is \emph{better} when it passes that rule.
|
||||||
|
|
||||||
|
\subsection{Experiment 1: anchor-posterior banks}
|
||||||
\label{sec:exp:p2}
|
\label{sec:exp:p2}
|
||||||
|
|
||||||
\paragraph{Design.}
|
\paragraph{Design.}
|
||||||
SNR 10\,dB with full anchors; drift $c \in \{0, 0.5, 1, 2\}$; $N \in \{2, 4, 8, 16\}$; realizations 0--7; five seeds. The candidate was M2. The competitors were all point ties (B3a--B3d) and all anchor-free alignment losses (B4a--B4d). The gate required M2 to pass in at least 3 of the 4 cells at $c = 1$. In addition, at $c = 0$ the ratio of M2 to the best competitor had to be at most 1.02, both averaged over $N$ and for each $N$.
|
The data had an SNR of 10\,dB and full anchors, with $c \in \{0, 0.5, 1, 2\}$, $N \in \{2, 4, 8, 16\}$, realizations 0--7 and five seeds. The candidate was the reweighted anchor bank, and the competitors were all deterministic ties, the anchor mean and all anchor-free alignment losses (Table~\ref{tab:methods}). The protocol required the candidate to pass in at least 3 of the 4 cells at $c = 1$. In addition, at $c = 0$ its ratio to the best competitor had to be at most 1.02, both averaged over $N$ and for each $N$.
|
||||||
|
|
||||||
\paragraph{Result: the gate failed.}
|
\paragraph{The test failed: the anchor bank did not beat the best deterministic tie.}
|
||||||
No cell at $c = 1$ passed. The ratio of M2 to the best competitor (B3c in every cell) was 1.045, 1.025, 1.020 and 0.985 for $N = 2$, 4, 8 and 16, with band PCC differences between $-0.018$ and $+0.003$ (Fig.~\ref{fig:p2phase}). The zero-drift guard also failed: the macro ratio was 1.039, and the per-$N$ ratios against B3d were 1.015, 1.045, 1.051 and 1.056. Table~\ref{tab:p2} gives band RMSE for every method at $c = 1$. M2 was about as good as the best point tie and B3d, and it stayed 20--24\% above the oracle. We report this verdict as it stands; nothing in the second experiment changes it.
|
No cell at $c = 1$ passed. The ratio of the bank to the best competitor (the correlation tie in every cell) was 1.045, 1.025, 1.020 and 0.985 for $N = 2$, 4, 8 and 16, with band PCC differences between $-0.018$ and $+0.003$ (Fig.~\ref{fig:p2phase}). The zero-drift guard also failed: the macro ratio (the ratio of band RMSEs averaged over $N$) was 1.039, and the per-$N$ ratios against the anchor mean were 1.015, 1.045, 1.051 and 1.056. The bank was about as good as the best deterministic tie and the anchor mean, and it stayed 20--25\% above the Oracle (Table~\ref{tab:p2}).
|
||||||
|
|
||||||
\begin{figure}[t]
|
\begin{figure}[t]
|
||||||
\centering
|
\centering
|
||||||
\includegraphics[width=\linewidth]{p2_phase.pdf}
|
\includegraphics[width=\linewidth]{p2_phase.pdf}
|
||||||
\caption{Experiment 1 (gate G-B). (a) Band RMSE of M2 divided by that of the best competitor, and (b) band PCC difference, over drift factor $c$ and number of training wells $N$. Cells show the mean over 8 realizations $\times$ 5 seeds, the 95\% bootstrap interval over realizations, and, in (a), the best competitor and whether the cell passed the pre-registered rule. The outlined row ($c = 1$) is the F3-like drift level.}
|
\caption{Experiment 1. (a) Band RMSE of the reweighted anchor bank divided by that of the best competitor, and (b) band PCC difference, over drift factor $c$ and number of training wells $N$. Cells show the mean over 8 realizations $\times$ 5 seeds, the 95\% bootstrap interval over realizations, and, in (a), the best competitor and whether the cell passed the margin rule. The outlined row ($c = 1$) is the F3-like drift level. \figcodes{B3b is the calibrated sonic; B3c the correlation tie; B3d the anchor mean}}
|
||||||
\label{fig:p2phase}
|
\label{fig:p2phase}
|
||||||
\end{figure}
|
\end{figure}
|
||||||
|
|
||||||
\begin{table}[t]
|
\begin{table}[t]
|
||||||
\centering
|
\centering
|
||||||
\caption{Experiment 1 at F3-like drift ($c = 1$, SNR 10\,dB, full anchors): band RMSE and band PCC, mean over 8 realizations $\times$ 5 seeds.}
|
\caption{Experiment 1 at F3-like drift ($c = 1$, 10\,dB, full anchors): band RMSE and band PCC, mean over 8 realizations $\times$ 5 seeds.}
|
||||||
\label{tab:p2}
|
\label{tab:p2}
|
||||||
\small
|
\small
|
||||||
\begin{tabular}{llcccc}
|
\begin{tabular}{llcccc}
|
||||||
@@ -30,80 +32,81 @@ No cell at $c = 1$ passed. The ratio of M2 to the best competitor (B3c in every
|
|||||||
\cmidrule(lr){3-4}\cmidrule(lr){5-6}
|
\cmidrule(lr){3-4}\cmidrule(lr){5-6}
|
||||||
Family & Method & $N = 4$ & $N = 16$ & $N = 4$ & $N = 16$ \\
|
Family & Method & $N = 4$ & $N = 16$ & $N = 4$ & $N = 16$ \\
|
||||||
\midrule
|
\midrule
|
||||||
Point tie & B3a & 1.480 & 1.420 & 0.202 & 0.258 \\
|
Deterministic tie & Sonic tie & 1.480 & 1.420 & 0.202 & 0.258 \\
|
||||||
& B3b & 0.937 & 0.774 & 0.729 & 0.826 \\
|
& Calibrated sonic & 0.937 & 0.774 & 0.729 & 0.826 \\
|
||||||
& B3c & \textbf{0.716} & 0.569 & \textbf{0.855} & 0.914 \\
|
& Correlation tie & \textbf{0.716} & 0.569 & \textbf{0.855} & 0.914 \\
|
||||||
& B3d & 0.759 & 0.627 & 0.833 & 0.891 \\
|
Posterior mean & Anchor mean & 0.759 & 0.627 & 0.833 & 0.891 \\
|
||||||
\midrule
|
\midrule
|
||||||
Anchor-free & B4a (hard-min shift) & 1.304 & 1.184 & 0.429 & 0.526 \\
|
Anchor-free & Hard-min shift & 1.304 & 1.184 & 0.429 & 0.526 \\
|
||||||
& B4b (soft-min shift) & 1.289 & 1.103 & 0.436 & 0.583 \\
|
& Soft-min shift & 1.289 & 1.103 & 0.436 & 0.583 \\
|
||||||
& B4c (soft-DTW) & 0.978 & 0.743 & 0.704 & 0.838 \\
|
& Soft-DTW & 0.978 & 0.743 & 0.704 & 0.838 \\
|
||||||
& B4d (DILATE) & 0.967 & 0.731 & 0.714 & 0.844 \\
|
& DILATE & 0.967 & 0.731 & 0.714 & 0.844 \\
|
||||||
\midrule
|
\midrule
|
||||||
Anchor bank & M1 & 0.805 & 0.589 & 0.809 & 0.905 \\
|
Anchor bank & Anchor bank & 0.805 & 0.589 & 0.809 & 0.905 \\
|
||||||
& M2 & 0.735 & \textbf{0.560} & 0.849 & \textbf{0.917} \\
|
& Reweighted anchor bank & 0.735 & \textbf{0.560} & 0.849 & \textbf{0.917} \\
|
||||||
\midrule
|
\midrule
|
||||||
Ceiling & Oracle & 0.612 & 0.451 & 0.897 & 0.948 \\
|
Ceiling & Oracle & 0.612 & 0.451 & 0.897 & 0.948 \\
|
||||||
\bottomrule
|
\bottomrule
|
||||||
\end{tabular}
|
\end{tabular}
|
||||||
\end{table}
|
\end{table}
|
||||||
|
|
||||||
\paragraph{Anchor-free alignment losses.}
|
\paragraph{Anchor-free losses fitted noise rather than recovering timing.}
|
||||||
At $N = 4$, all four anchor-free losses were worse than B3b, the point tie whose labels they start from. Hard-min and soft-min shift banks (B4a, B4b) were 38--53\% worse than B3b at both $N$. At $N = 16$, soft-DTW and DILATE were 4--6\% better than B3b, but still far behind B3c and M2. This is what Proposition~\ref{prop:ident} predicts. Within the shift range, the loss cannot tell a better alignment from a jointly shifted network and label, so the extra freedom fits noise rather than recovering timing.
|
At $N = 4$ all four anchor-free losses were worse than the calibrated sonic, the tie whose labels they start from. Hard-min and soft-min shift banks were 38--53\% worse than it at both $N$. At $N = 16$, soft-DTW and DILATE were 4--6\% better than the calibrated sonic but still far behind the correlation tie and the reweighted anchor bank. This is what Proposition~\ref{prop:ident} predicts: within the shift range, the loss cannot tell a better alignment from a jointly shifted network and label.
|
||||||
|
|
||||||
\paragraph{Anchors are necessary (H4).}
|
\paragraph{Anchors are necessary.}
|
||||||
At $c = 1$, $N = 4$ we removed the anchors from M1 and M2 and kept only the warp prior ($\sigma_b = 50$\,ms) and, for M2, the tie likelihood. To favour the anchor-free variant, it was given the true (zero) wavelet phase. Warp RMSE rose from 3.15 to 31.1\,ms for M2 (ratio 9.9, 95\% CI [8.3, 11.4]) and from 3.71 to 33.0\,ms for M1. Band RMSE rose from 0.735 to 1.398 p.u.\ for M2 (ratio 1.90, CI [1.80, 2.04]) and from 0.805 to 1.594 for M1. The pre-registered hypothesis that anchors are necessary was not rejected. The size of the warp error is consistent with Proposition~\ref{prop:ident}: with $\sigma_b = 50$\,ms and $N = 4$, $\sd(\beta) \approx 25$\,ms.
|
At $c = 1$, $N = 4$ we removed the anchors from both anchor banks and kept only the warp prior ($\sigma_b = 50$\,ms) and, for the reweighted bank, the tie likelihood. To favour the anchor-free variant, it was given the true (zero) wavelet phase. Warp RMSE rose from 3.15 to 31.1\,ms for the reweighted bank (ratio 9.9, 95\% CI [8.3, 11.4]) and from 3.71 to 33.0\,ms for the unweighted bank. Band RMSE rose from 0.735 to 1.398\,p.u.\ (ratio 1.90, CI [1.80, 2.04]) and from 0.805 to 1.594\,p.u. The size of the warp error is consistent with Proposition~\ref{prop:ident}: with $\sigma_b = 50$\,ms and $N = 4$, $\sd(\beta) \approx 25$\,ms.
|
||||||
|
|
||||||
\paragraph{Calibration (H3).}
|
\paragraph{The bank was not better calibrated.}
|
||||||
The pre-registered hypothesis that M2 ensembles are better calibrated than B5 (B3b ensembles) was rejected. Pooled over $N$ at $c = 1$, the calibration error was 0.278 for M2-ens against 0.230 for B5 (difference 0.048, 95\% CI [0.035, 0.061]). Every ensemble under-covered.
|
The pre-registered hypothesis that bank ensembles are better calibrated than the calibrated-sonic ensemble was rejected. Pooled over $N$ at $c = 1$, the calibration error was 0.278 for the reweighted bank against 0.230 for that ensemble (difference 0.048, 95\% CI [0.035, 0.061]). Every ensemble under-covered.
|
||||||
|
|
||||||
\subsection{Diagnosis on development data and deviation}
|
\subsection{Why Experiment 1 failed}
|
||||||
\label{sec:exp:diag}
|
\label{sec:exp:diag}
|
||||||
|
|
||||||
Gate G-B prescribed a time-boxed diagnosis followed by a pivot. Using only the development realizations, we found that the failure lay in registration, not in the loss. The M2 posterior was 64 anchor-conditioned samples reweighted by tempered tie likelihoods. It did not contract to the true warp: at $c = 1$, its warp RMSE was 3.25\,ms with a 90\% interval width of 11.6\,ms. This is comparable to the correlation-based point tie B3c (3.85\,ms), which explains why M2 $\approx$ B3d $\approx$ B3c. The SMC posterior of Section~\ref{sec:method:posterior}, with the wavelet phase re-estimated from its evidence, reached a warp RMSE of 0.56\,ms with 97\% coverage of the 90\% interval, and labels at its mean warp were close to the oracle. Experiment 1 therefore could not test whether posterior labels help, because its posterior was not informative enough.
|
The failure lay in registration, not in the loss. A diagnosis on the development realizations showed that 64 anchor-conditioned samples reweighted by tempered tie likelihoods did not contract to the true warp. At $c = 1$ their warp RMSE was 3.25\,ms with a 90\% interval width of 11.6\,ms, comparable to the 3.85\,ms of the correlation tie. The SMC posterior of Section~\ref{sec:method:posterior}, with the wavelet phase re-estimated from its evidence, reached a warp RMSE of 0.56\,ms with 97\% coverage of the 90\% interval, and labels at its mean warp were close to the oracle.
|
||||||
|
|
||||||
\paragraph{Deviation.}
|
The lesson is about order. Experiment~1 could not test whether posterior labels help, because its posterior was no better than the best deterministic tie. A tie posterior has to beat that tie in warp error before training on it can show a gain. The second experiment is therefore a new pre-registration, designed after the first failure on development realizations only, and run on realizations 8--15, which had not been generated when its protocol was locked (Appendix~\ref{app:record}).
|
||||||
Re-running on new realizations was not among the options pre-registered for a G-B failure. The second experiment is a new pre-registration, designed \emph{after} seeing the first failure, using development realizations only, and run on realizations 8--15, which had not been generated when its protocol was locked. The verdict of Experiment 1 stands. Two potential stresses were not tested: the bulk-offset prior $\sigma_b$ was neither learned nor varied, and a rock-physics misspecification stress was cut for time. The anchor uncertainty $\sigma_a$ was varied and is reported below.
|
|
||||||
|
|
||||||
\subsection{Experiment 2: SMC tie posterior}
|
\subsection{Experiment 2: SMC tie posterior}
|
||||||
\label{sec:exp:p2r}
|
\label{sec:exp:p2r}
|
||||||
|
|
||||||
\paragraph{Design.}
|
\paragraph{Design.}
|
||||||
Five observation regimes (Section~\ref{sec:data:d2}); $c \in \{0, 1, 2\}$; $N \in \{4, 16\}$; realizations 8--15; five seeds. Registration and SMC were run once per (realization, $c$, $N$). The protocol pre-registered three questions:
|
We used the five observation settings of Section~\ref{sec:data:d2}, $c \in \{0, 1, 2\}$, $N \in \{4, 16\}$, realizations 8--15 and five seeds. Registration and SMC were run once per (realization, $c$, $N$). The protocol pre-registered three questions.
|
||||||
\begin{itemize}
|
\begin{itemize}
|
||||||
\item \textbf{H2a.} Do labels at the SMC mean warp (\mPM) beat the best point tie (B3b, B3c, B3c-R)? This is decided per full-anchor regime (R10, R0, Rm5). A regime passes if both cells at $c = 1$ pass and the zero-drift guard holds. A secondary comparison adds B3d, the Experiment~1 posterior mean, to the competitors.
|
\item \textbf{Posterior-mean claim.} Do labels at the SMC mean warp beat the best deterministic tie (calibrated sonic, correlation tie, phase-estimated correlation; the last borrows the wavelet phase estimated by SMC)? This is decided for each full-anchor setting: a setting passes if both cells at $c = 1$ pass and the zero-drift guard holds. A secondary comparison adds the anchor mean to the competitors.
|
||||||
\item \textbf{H2b.} Does RML on the SMC bank (\mRML) beat \mPM{} when the posterior is wide ($\sigpost \ge 1.5$\,ms)? At $N = 16$ the protocol requires that (a) at least two thirds of wide cells pass; (b) the Spearman correlation between $\sigpost$ and the ratio \mRML/\mPM{} over all cells is negative; and (c) the mean ratio over narrow cells is at most 1.02.
|
\item \textbf{Bank claim.} Does the \mRML{} beat the \mPM{} when the posterior is wide ($\sigpost \ge 1.5$\,ms, a \emph{wide} cell)? At $N = 16$ the protocol requires three things: the \mRML{} is better than the \mPM{}, in at least two thirds of wide cells; the Spearman correlation between $\sigpost$ and the ratio \mRML{}/\mPM{} over all cells is negative; and the mean ratio over narrow cells is at most 1.02.
|
||||||
\item \textbf{$\sigma_a$ scope.} H2a is repeated at R10, $c = 1$ with every method registered using $\sigma_a = 3.5$ or 14\,ms, while the data are generated with 7\,ms.
|
\item \textbf{Anchor-uncertainty test.} The posterior-mean claim is repeated at 10\,dB, $c = 1$ with every method registered using $\sigma_a = 3.5$ or 14\,ms, while the data are generated with 7\,ms.
|
||||||
\end{itemize}
|
\end{itemize}
|
||||||
Cells at $c = 2$ are reported with an ``unstable posterior'' flag and are not used as primary evidence (Section~\ref{sec:method:posterior}). Calibration was not tested as a hypothesis. Development runs had shown that the seed ensembles under-cover more when trained on better labels, so the protocol made calibration descriptive only.
|
Cells at $c = 2$ are reported with an ``unstable posterior'' flag and are not primary evidence for the posterior-mean claim (Section~\ref{sec:method:posterior}); the pre-registered bank tests include them. Calibration was not tested as a hypothesis, because development runs had shown that seed ensembles under-cover more when trained on better labels.
|
||||||
|
|
||||||
\paragraph{H2a: posterior-mean labels beat the best point tie.}
|
\paragraph{Posterior-mean labels beat the best deterministic tie in all three full-anchor settings.}
|
||||||
All three full-anchor regimes passed (Table~\ref{tab:h2a}; Fig.~\ref{fig:p2rgrid} shows every method relative to the Oracle). At $c = 1$, \mPM{} reduced band RMSE relative to the best point tie by 14\% and 22\% at R10 ($N = 4$, 16), by 11\% at R0 and by 8\% at Rm5. At Rm5 the ratio stayed above 0.90 and the cells passed on band PCC ($+0.10$ and $+0.09$). Most of the gain is already present without drift. At $c = 0$ the macro ratios are 0.81, 0.85 and 0.88, against 0.78--0.92 at $c = 1$. Part of the advantage therefore comes from the seismic-conditioned, phase-estimated tie itself, not from correcting drift. When B3d is added as a competitor, H2a holds at R10 (2/2 cells; macro ratio at $c = 0$ is 0.94), holds in 1 of 2 cells at R0 and fails at Rm5 (0/2; ratios 0.98 and 0.97 against B3d). The claim that SMC labels beat the anchor posterior of Experiment~1 is therefore limited to high SNR. \mRML{} under the same rule passed all three regimes against point ties and R10 and R0 with B3d included.
|
At $c = 1$ the \mPM{} reduced band RMSE relative to the best deterministic tie by 14\% and 22\% at 10\,dB ($N = 4$, 16), by 11\% at 0\,dB and by 8--9\% at $-5$\,dB (Table~\ref{tab:h2a}; Fig.~\ref{fig:p2rgrid} shows every method relative to the Oracle). At $-5$\,dB the ratio stayed above 0.90 and the cells passed on band PCC ($+0.10$ and $+0.09$). Most of the gain is already present without drift: at $c = 0$ the macro ratios are 0.81, 0.85 and 0.88, against 0.78--0.92 at $c = 1$. Part of the advantage therefore comes from the seismic-conditioned, phase-estimated tie itself, not from correcting drift.
|
||||||
|
|
||||||
|
The advantage over the anchor mean of Experiment~1 is limited to high SNR. With the anchor mean added as a competitor, the claim holds at 10\,dB (2/2 cells; macro ratio at $c = 0$ is 0.94), in 1 of 2 cells at 0\,dB, and fails at $-5$\,dB (0/2; ratios 0.98 and 0.97 against the anchor mean). This is what one would expect if the seismic likelihood adds little to the anchors at low SNR, which we did not test. The \mRML{} under the same rule passed all three settings against the deterministic ties, and the 10 and 0\,dB settings with the anchor mean included.
|
||||||
|
|
||||||
\begin{table}[t]
|
\begin{table}[t]
|
||||||
\centering
|
\centering
|
||||||
\caption{H2a at $c = 1$: band RMSE of \mPM{} divided by that of the best point tie (95\% bootstrap CI over realizations) and band PCC difference. Zero-drift macro: same ratio at $c = 0$, averaged over $N$ (guard $\le 1.02$). Last column: verdict with B3d added as a competitor.}
|
\caption{Posterior-mean claim at $c = 1$: band RMSE of the \mPM{} divided by that of the best deterministic tie (95\% bootstrap CI over realizations) and band PCC difference. Zero-drift macro: same ratio at $c = 0$, averaged over $N$ (guard $\le 1.02$). Last column: cells passing with the anchor mean added as a competitor.}
|
||||||
\label{tab:h2a}
|
\label{tab:h2a}
|
||||||
\small
|
\small
|
||||||
\begin{tabular}{lcccccc}
|
\begin{tabular}{lcccccc}
|
||||||
\toprule
|
\toprule
|
||||||
& \multicolumn{2}{c}{$N = 4$} & \multicolumn{2}{c}{$N = 16$} & & \\
|
& \multicolumn{2}{c}{$N = 4$} & \multicolumn{2}{c}{$N = 16$} & & \\
|
||||||
\cmidrule(lr){2-3}\cmidrule(lr){4-5}
|
\cmidrule(lr){2-3}\cmidrule(lr){4-5}
|
||||||
Regime & ratio & $\Delta$PCC & ratio & $\Delta$PCC & zero-drift & with B3d \\
|
SNR & ratio & $\Delta$PCC & ratio & $\Delta$PCC & zero-drift & with anchor mean \\
|
||||||
\midrule
|
\midrule
|
||||||
R10 & 0.857 [0.805, 0.922] & +0.039 & 0.782 [0.748, 0.813] & +0.037 & 0.809 & 2/2 \\
|
10\,dB & 0.857 [0.805, 0.922] & +0.039 & 0.782 [0.748, 0.813] & +0.037 & 0.809 & 2/2 \\
|
||||||
R0 & 0.888 [0.856, 0.926] & +0.078 & 0.888 [0.870, 0.909] & +0.060 & 0.851 & 1/2 \\
|
0\,dB & 0.888 [0.856, 0.926] & +0.078 & 0.888 [0.870, 0.909] & +0.060 & 0.851 & 1/2 \\
|
||||||
Rm5 & 0.915 [0.883, 0.953] & +0.102 & 0.923 [0.908, 0.940] & +0.089 & 0.878 & 0/2 \\
|
$-5$\,dB & 0.915 [0.883, 0.953] & +0.102 & 0.923 [0.908, 0.940] & +0.089 & 0.878 & 0/2 \\
|
||||||
\bottomrule
|
\bottomrule
|
||||||
\end{tabular}
|
\end{tabular}
|
||||||
\end{table}
|
\end{table}
|
||||||
|
|
||||||
\paragraph{The gain requires a correct $\sigma_a$.}
|
\paragraph{The gain requires a correct anchor uncertainty.}
|
||||||
With misspecified anchor uncertainty, no cell passed (Table~\ref{tab:sigmaa}). Over-trusting the anchors ($\sigma_a = 3.5$\,ms) made \mPM{} 14\% \emph{worse} than the best point tie at $N = 16$. Under-trusting them (14\,ms) left a 7\% gain at $N = 16$ that did not pass. The SMC posterior was miscalibrated in both directions. With 3.5\,ms the warp RMSE was 4.8\,ms against a $\sigpost$ of 2.5\,ms (90\% coverage 0.62). With 14\,ms it was 2.8\,ms against 0.9\,ms (coverage 0.52). With the correct 7\,ms it was 0.63\,ms (coverage 0.89). On F3 the markers are not independent check shots, and $\sigma_a$ cannot be identified from them. This is the main risk for transfer to the field.
|
With misspecified anchor uncertainty, no cell passed (Table~\ref{tab:sigmaa}). Over-trusting the anchors ($\sigma_a = 3.5$\,ms) made the \mPM{} 14\% \emph{worse} than the best deterministic tie at $N = 16$. Under-trusting them (14\,ms) left a 7\% gain at $N = 16$ that did not pass. The cause is a miscalibrated posterior in both directions. With 3.5\,ms the warp RMSE was 4.8\,ms against a $\sigpost$ of 2.5\,ms (90\% coverage 0.62); with 14\,ms it was 2.8\,ms against 0.9\,ms (coverage 0.52); with the correct 7\,ms it was 0.63\,ms (coverage 0.89). On F3 the markers are not independent check shots and $\sigma_a$ cannot be identified from them, so this is the main risk for transfer to the field. The practical consequence is that $\sigma_a$ must be estimated from independent time--depth data before the posterior is used.
|
||||||
|
|
||||||
\begin{table}[t]
|
\begin{table}[t]
|
||||||
\centering
|
\centering
|
||||||
\caption{$\sigma_a$ arm (R10, $c = 1$; data generated with $\sigma_a = 7$\,ms; every method registered with $\sigma_a^{\mathrm{reg}}$). Ratio: band RMSE of \mPM{} divided by that of the best point tie. Warp RMSE and coverage: SMC posterior on the training wells, $N = 16$.}
|
\caption{Anchor-uncertainty test (10\,dB, $c = 1$; data generated with $\sigma_a = 7$\,ms; every method registered with $\sigma_a^{\mathrm{reg}}$). Ratio: band RMSE of the \mPM{} divided by that of the best deterministic tie. Warp RMSE and coverage: SMC posterior on the training wells, $N = 16$.}
|
||||||
\label{tab:sigmaa}
|
\label{tab:sigmaa}
|
||||||
\small
|
\small
|
||||||
\setlength{\tabcolsep}{4pt}
|
\setlength{\tabcolsep}{4pt}
|
||||||
@@ -118,37 +121,27 @@ $\sigma_a^{\mathrm{reg}}$ (ms) & ratio $N = 4$ & ratio $N = 16$ & cells pass & $
|
|||||||
\end{tabular}
|
\end{tabular}
|
||||||
\end{table}
|
\end{table}
|
||||||
|
|
||||||
\paragraph{H2b: RML helps when the posterior is wide.}
|
\paragraph{The bank helps when the posterior is wide.}
|
||||||
At $N = 16$ all three tests passed (Table~\ref{tab:h2b}, Fig.~\ref{fig:h2b}a). All 8 wide cells passed, the ratio decreased with $\sigpost$ (Spearman $\rho = -0.85$, one-sided permutation $p < 0.001$), and the mean ratio over narrow cells was 0.996. The gains in wide cells ranged from 2\% (Rm5, $c = 1$) to 11\% (R10tb, $c = 1$). At $c = 2$ they reached 33\% (R10tb), but those cells are flagged unstable. At $N = 4$, which was reported but not used for the verdict, 6 of 8 wide cells passed ($\rho = -0.77$, narrow mean 1.001).
|
At $N = 16$ all three tests passed (Table~\ref{tab:h2b}, Fig.~\ref{fig:h2b}a). The \mRML{} was better in all 8 wide cells, the ratio decreased with $\sigpost$ (Spearman correlation $-0.85$, one-sided permutation $p < 0.001$), and the mean ratio over narrow cells was 0.996. The gains in wide cells ranged from 2\% ($-5$\,dB, $c = 1$) to 11\% (two-anchor setting, $c = 1$). At $c = 2$ they reached 33\% (two-anchor setting), but those cells are flagged unstable. At $N = 4$, which was reported but not used for the verdict, 6 of 8 wide cells passed (Spearman correlation $-0.77$, narrow mean 1.001).
|
||||||
|
|
||||||
\paragraph{Comparison with the population bound.}
|
|
||||||
The column $1/B_a$ of Table~\ref{tab:h2b} is the registered bound: $\rho^\star$ of \eqref{eq:rhostar} for Gaussian classical error at $\sigpost$, computed by blurring the Oracle's predictions. It is the largest gain over the point label that removing a population blur could give (Section~\ref{sec:theory:post}). The measured ratio is below it in 7 of the 8 wide cells (Fig.~\ref{fig:h2b}b). At Rm5, $c = 1$, for example, the bound allows no gain (1.000), yet RML gained 2\%. The exception is R10tb at $c = 2$, where $\sigpost$ lies beyond the 6\,ms edge of the grid on which $B$ was computed. The tabulated value is therefore $1/B_a(6\,\mathrm{ms})$, and at $\sigpost$ itself the bound is 0.481.
|
|
||||||
|
|
||||||
The registered structure is not the one expected for \mPM{}, whose labels sit at the posterior-mean warp. The natural idealization for the error of a posterior mean is the Berkson structure (b), and under (b) the bound is lower (Section~\ref{sec:theory:post}). The column $1/B_b$ gives this bound, computed post hoc in the same way but by sharpening the Oracle's predictions, at $\sigpost$ itself. The measured ratio is below it in 3 of the 8 wide cells, all at $c = 1$ (R0, R0h and R10tb). In R0h and R10tb the margin is less than 0.004, well inside the 95\% interval of the ratio. Sharpening also amplifies the Oracle's own estimation error, which lowers $1/B_b$, most of all at $c = 2$. Two variants limit this amplification. One holds the gain at its 60\,Hz value above 60\,Hz. The other replaces the spectrum of the Oracle's predictions by their cross-spectrum with the true labels. Both select the same three cells, and with the cross-spectrum the (a) bound is exceeded in only 5 of the 8 cells.
|
|
||||||
|
|
||||||
Both bounds are evaluated at the posterior width, which understates the error of an overconfident posterior. Evaluated instead at the measured warp error of \mPM{} on the training wells, the ratio is still below the (a) bound in 6 of the 8 cells but below the (b) bound in at most one (R0, $c = 1$, under the two variants). An excess over the population bound is therefore not established. It appears under the classical structure, and under the Berkson structure it is confined to $c = 1$ and mostly disappears at the measured warp error. Whether the error of the mean warp has the Berkson structure was not tested (Section~\ref{sec:exp:mech}).
|
|
||||||
|
|
||||||
The Oracle's advantage over \mPM{} can be compared with the same bounds. These ratios are post hoc and computed from the registered band RMSE of every method. At $c = 1$, $N = 16$, the Oracle's band RMSE was 0.93, 0.92 and 0.93 times that of \mPM{} at R0, R0h and Rm5, and 0.76 times at R10tb. These ratios are below the (a) bound in all four cells, below the (b) bound at $\sigpost$ in three or four of them, depending on the estimator, and below the (b) bound at the measured warp error in one or two. Part of the gap is not caused by registration at all. At $c = 0$, where the SMC warp RMSE on the training wells was 0.2--0.7\,ms and every bound is within 0.4\% of 1, the Oracle was still 1--3\% better than \mPM{} at $N = 16$. The two also differ in training length, which was selected on development data (500 and 250 iterations; Section~\ref{sec:method:train}).
|
|
||||||
|
|
||||||
In the wide cells at $N = 16$, \mRML{} closed 27--46\% of the gap between \mPM{} and the Oracle at $c = 1$, and 39--65\% at $c = 2$. It never reached the Oracle. Its band RMSE stayed 4--6\% above the Oracle's at R0, R0h and Rm5, and 17\% ($c = 1$) and 63\% ($c = 2$) above it at R10tb. The confirmatory experiments do not show where the gain comes from. If the error of the mean warp has the Berkson structure, most of the gain is within what removing the population sharpening of \mPM{} could give. A bank can also gain in finite samples. It acts as label augmentation: the network cannot memorize a single misregistered label, and the learned variance absorbs the spread of the bank and down-weights samples where the members disagree. For $\lambda > 0$ the responsibilities re-register the labels during training (Remark~\ref{rem:lambda}). When the posterior is multimodal, the error of the mean warp is not Gaussian, and the gain available to a bank can exceed the Gaussian bound (Corollary~\ref{cor:twomode}). Section~\ref{sec:exp:mech} examines these sources in an exploratory analysis.
|
|
||||||
|
|
||||||
\begin{table}[t]
|
\begin{table}[t]
|
||||||
\centering
|
\centering
|
||||||
\caption{H2b at $N = 16$, wide cells ($\sigpost \ge 1.5$\,ms): band RMSE of \mRML{} divided by that of \mPM{} (95\% CI); the population bounds at $\sigpost$ for Gaussian classical error, $1/B_a$ (registered), and for Gaussian Berkson error, $1/B_b$ (post hoc), computed by blurring and by sharpening the Oracle's predictions (Section~\ref{sec:theory:post}); and the SMC warp error on the training wells. A ratio below a bound is a larger gain than removing that population distortion could give. $\dagger$: unstable posterior ($c = 2$). $\ddagger$: $\sigpost$ exceeds the 6\,ms grid of $B$; the entry is $1/B_a(6\,\mathrm{ms})$, and the bound at $\sigpost$ is 0.481.}
|
\caption{Bank claim at $N = 16$, wide cells ($\sigpost \ge 1.5$\,ms): band RMSE of the \mRML{} divided by that of the \mPM{} (95\% CI); the classical bound $\rhoCl$ (pre-registered) and the Berkson bound $\rhoBk$ (post hoc) at $\sigpost$, computed by blurring and by sharpening the Oracle's predictions (Section~\ref{sec:theory:post}); and the SMC warp error on the training wells. A ratio below a bound is a larger gain than removing that population distortion could give. $\dagger$: unstable posterior ($c = 2$). $\ddagger$: $\sigpost$ exceeds the 6\,ms grid of the bound; the pre-registered grid of the bound stops at 6\,ms, so the entry is the bound there, and the bound at $\sigpost$ is 0.481. Entries of $\rhoBk$ at $c = 2$ are omitted because amplified estimation error of the Oracle dominates them (0.768, 0.285, 0.132 and $<$0.001, in the order of the table).}
|
||||||
\label{tab:h2b}
|
\label{tab:h2b}
|
||||||
\small
|
\small
|
||||||
|
\setlength{\tabcolsep}{4pt}
|
||||||
\begin{tabular}{lcccccccc}
|
\begin{tabular}{lcccccccc}
|
||||||
\toprule
|
\toprule
|
||||||
Regime & $c$ & $\sigpost$ (ms) & ratio & 95\% CI & $1/B_a$ & $1/B_b$ & warp RMSE (ms) & cov$_{90}$ \\
|
Setting & $c$ & $\sigpost$ (ms) & ratio & 95\% CI & $\rhoCl$ & $\rhoBk$ & warp RMSE (ms) & cov$_{90}$ \\
|
||||||
\midrule
|
\midrule
|
||||||
R0 & 1 & 1.53 & 0.967 & [0.956, 0.979] & 0.999 & 0.982 & 1.86 & 0.86 \\
|
0\,dB & 1 & 1.53 & 0.967 & [0.956, 0.979] & 0.999 & 0.982 & 1.86 & 0.86 \\
|
||||||
R0h & 1 & 1.72 & 0.970 & [0.953, 0.989] & 0.996 & 0.972 & 2.36 & 0.83 \\
|
half-anchor & 1 & 1.72 & 0.970 & [0.953, 0.989] & 0.996 & 0.972 & 2.36 & 0.83 \\
|
||||||
R10tb & 1 & 1.92 & 0.890 & [0.866, 0.915] & 0.964 & 0.893 & 4.78 & 0.53 \\
|
two-anchor & 1 & 1.92 & 0.890 & [0.866, 0.915] & 0.964 & 0.893 & 4.78 & 0.53 \\
|
||||||
Rm5 & 1 & 2.56 & 0.982 & [0.966, 0.995] & 1.000 & 0.904 & 2.91 & 0.86 \\
|
$-5$\,dB & 1 & 2.56 & 0.982 & [0.966, 0.995] & 1.000 & 0.904 & 2.91 & 0.86 \\
|
||||||
R0 & 2$^\dagger$ & 2.79 & 0.952 & [0.940, 0.962] & 0.968 & 0.768 & 2.72 & 0.94 \\
|
0\,dB & 2$^\dagger$ & 2.79 & 0.952 & [0.940, 0.962] & 0.968 & -- & 2.72 & 0.94 \\
|
||||||
Rm5 & 2$^\dagger$ & 3.96 & 0.964 & [0.953, 0.977] & 0.980 & 0.285 & 3.92 & 0.91 \\
|
$-5$\,dB & 2$^\dagger$ & 3.96 & 0.964 & [0.953, 0.977] & 0.980 & -- & 3.92 & 0.91 \\
|
||||||
R0h & 2$^\dagger$ & 4.18 & 0.904 & [0.889, 0.925] & 0.910 & 0.132 & 4.10 & 0.94 \\
|
half-anchor & 2$^\dagger$ & 4.18 & 0.904 & [0.889, 0.925] & 0.910 & -- & 4.10 & 0.94 \\
|
||||||
R10tb & 2$^\dagger$ & 11.49 & 0.667 & [0.615, 0.713] & 0.634$^\ddagger$ & $<$0.001 & 19.08 & 0.62 \\
|
two-anchor & 2$^\dagger$ & 11.49 & 0.667 & [0.615, 0.713] & 0.634$^\ddagger$ & -- & 19.08 & 0.62 \\
|
||||||
\bottomrule
|
\bottomrule
|
||||||
\end{tabular}
|
\end{tabular}
|
||||||
\end{table}
|
\end{table}
|
||||||
@@ -156,96 +149,264 @@ R10tb & 2$^\dagger$ & 11.49 & 0.667 & [0.615, 0.713] & 0.634$^\ddagger$ & $<$0.0
|
|||||||
\begin{figure}[t]
|
\begin{figure}[t]
|
||||||
\centering
|
\centering
|
||||||
\includegraphics[width=\linewidth]{p2r_h2b.pdf}
|
\includegraphics[width=\linewidth]{p2r_h2b.pdf}
|
||||||
\caption{H2b. (a) Band RMSE of \mRML{} divided by that of \mPM{} against the posterior width $\sigpost$, for every regime $\times$ $c$ $\times$ $N$ cell (filled: $N = 16$; open: $N = 4$; marker shape: drift factor $c$). Bars are 95\% bootstrap intervals over realizations. The dashed line is the pre-registered 1.5\,ms threshold for wide cells. (b) The same ratio against the registered population bound $1/B_a(\sigpost)$ for classical error, computed from Oracle predictions (Section~\ref{sec:theory:post}). Cells below the diagonal gained more than removing a classical population blur could give. The bound $1/B_b$ for Berkson error, the natural idealization for labels at the posterior-mean warp, is lower, and at $N = 16$ only three wide cells, all at $c = 1$, lie below it (Table~\ref{tab:h2b}). For R10tb at $c = 2$ the bound is evaluated at the 6\,ms edge of its grid. Cells at $c = 2$ have an unstable posterior and are not primary evidence.}
|
\caption{Bank claim. (a) Band RMSE of the \mRML{} divided by that of the \mPM{} against the posterior width $\sigpost$, for every setting $\times$ $c$ $\times$ $N$ cell (filled: $N = 16$; open: $N = 4$; marker shape: drift factor $c$). Bars are 95\% bootstrap intervals over realizations. The dashed line is the pre-registered 1.5\,ms threshold for wide cells. (b) The same ratio against the classical bound $\rhoCl(\sigpost)$. Cells below the diagonal gained more than removing a classical population blur could give. The Berkson bound $\rhoBk$ is lower, and at $N = 16$ only three wide cells, all at $c = 1$, lie below it (Table~\ref{tab:h2b}). For the two-anchor setting at $c = 2$ the bound is evaluated at the 6\,ms edge of its grid. \figcodes{M2-Sa is the \mRML{}; B3d-Sa the \mPM{}; $1/B$ is $\rhoCl$}}
|
||||||
\label{fig:h2b}
|
\label{fig:h2b}
|
||||||
\end{figure}
|
\end{figure}
|
||||||
|
|
||||||
\paragraph{Posterior quality.}
|
\paragraph{Whether the bank gain exceeds a population correction depends on the error structure.}
|
||||||
The SMC posterior was close to calibrated when the anchors were dense and $\sigma_a$ was correct. At $c = 1$, $N = 16$, the 90\% coverage was 0.89 at R10, 0.86 at R0 and 0.86 at Rm5. With only top and bottom anchors (R10tb) it was overconfident: warp RMSE 4.8\,ms against $\sigpost = 1.9$\,ms, with 90\% coverage 0.53. RML still gained the most in this regime. The bank covers part of the error even when its width understates it.
|
The measured ratio is below the classical bound $\rhoCl$ in 7 of the 8 wide cells (Fig.~\ref{fig:h2b}b). At $-5$\,dB, $c = 1$, for example, the bound allows no gain (1.000), yet the bank gained 2\%. Labels at a posterior-mean warp are expected to have Berkson error, however, and the Berkson bound is lower. The ratio is below $\rhoBk$ in 3 of the 4 wide cells at $c = 1$ (0\,dB, half-anchor and two-anchor), and in the last two the margin is less than 0.004, well inside the 95\% interval of the ratio. At $c = 2$ sharpening multiplies the high frequencies of the Oracle's predictions by a factor that grows quickly with $\sigpost$, so the estimate of $\rhoBk$ measures amplified estimation error and we do not interpret it. Two variants limit this amplification: one holds the gain at its 60\,Hz value above 60\,Hz, and the other uses the cross-spectrum with the true labels. Both select the same three cells, and with the cross-spectrum the classical bound is exceeded in only 5 of the 8.
|
||||||
|
|
||||||
|
Both bounds use the posterior width, which understates the error of an overconfident posterior. At the measured warp error of the \mPM{} on the training wells, the ratio is below $\rhoCl$ in 6 of the 8 cells but below $\rhoBk$ in at most one (0\,dB, $c = 1$, under the two variants). An excess over the population bound is therefore not established.
|
||||||
|
|
||||||
|
\paragraph{The bank closes part of the gap to the Oracle, and part of that gap is not registration.}
|
||||||
|
In the wide cells at $N = 16$, the \mRML{} closed 27--46\% of the gap between the \mPM{} and the Oracle at $c = 1$, and 39--65\% at $c = 2$, and it never reached the Oracle. At $c = 0$ the SMC warp RMSE on the training wells was 0.2--0.7\,ms and every bound is within 0.4\% of 1, yet the Oracle was still 1--3\% better than the \mPM{} at $N = 16$. The two also differ in training length (500 and 250 iterations). Section~\ref{sec:exp:mech} returns to this.
|
||||||
|
|
||||||
|
\paragraph{The posterior was near nominal with dense anchors and overconfident with sparse ones.}
|
||||||
|
At $c = 1$, $N = 16$, the 90\% coverage of the SMC warp posterior was 0.89 at 10\,dB, 0.86 at 0\,dB and 0.86 at $-5$\,dB. With only top and bottom anchors it was overconfident: warp RMSE 4.8\,ms against $\sigpost = 1.9$\,ms, with 90\% coverage 0.53. The bank still gained the most in this setting, so it covers part of the error even when its width understates it.
|
||||||
|
|
||||||
\begin{figure}[t]
|
\begin{figure}[t]
|
||||||
\centering
|
\centering
|
||||||
\includegraphics[width=\linewidth]{p2r_grid.pdf}
|
\includegraphics[width=\linewidth]{p2r_grid.pdf}
|
||||||
\caption{Experiment 2 overview. Band RMSE of each method divided by that of the Oracle (true warp), by anchor regime and drift factor $c$, for (a) $N = 4$ and (b) $N = 16$ training wells. Each entry is the mean over 8 realizations $\times$ 5 seeds. The colour scale is clipped at 2.0; R10tb at $c = 2$ reaches 3.15. \mPM{} is B3d-Sa and \mRML{} is M2-Sa.}
|
\caption{Experiment 2 overview. Band RMSE of each method divided by that of the Oracle (true warp), by observation setting and drift factor $c$, for (a) $N = 4$ and (b) $N = 16$ training wells. Each entry is the mean over 8 realizations $\times$ 5 seeds. The colour scale is clipped at 2.0; the two-anchor setting at $c = 2$ reaches 3.15. \figcodes{R10, R0, Rm5 are 10, 0, $-5$\,dB; R0h half-anchor; R10tb two-anchor; B3b calibrated sonic; B3c correlation tie; B3c-R phase-estimated correlation; B3d anchor mean; B3d-Sa \mPM{}; M2-Sa \mRML{}}}
|
||||||
\label{fig:p2rgrid}
|
\label{fig:p2rgrid}
|
||||||
\end{figure}
|
\end{figure}
|
||||||
|
|
||||||
\paragraph{Predictive uncertainty (descriptive).}
|
\paragraph{Seed ensembles under-covered, and more so with better labels.}
|
||||||
Every five-seed ensemble under-covered. At R10, $c = 1$, $N = 16$, the 90\% coverage was 0.79 for B5, 0.58 for \mPM-ens, 0.58 for \mRML-ens and 0.48 for Oracle-ens, with calibration errors 0.114, 0.300, 0.291 and 0.379. Ensembles trained on better labels predicted smaller $\sigma$ and covered less.
|
At 10\,dB, $c = 1$, $N = 16$, the 90\% coverage was 0.79 for the calibrated-sonic ensemble, 0.58 for the \mPM{} and \mRML{} ensembles and 0.48 for the Oracle ensemble. Every ensemble was too narrow: the dispersion ratio $\xi$ of Section~\ref{sec:theory:cov} was 0.19 for the Oracle and at most 0.66, against 1 for a matched second moment (Table~\ref{tab:t4}). The ordering follows training length as much as label quality. On the development realizations of Experiment~1, the 90\% coverage of single Oracle models fell from 0.47 after 125 iterations to 0.10 after 2000, while their RMSE varied by less than 10\%. In Experiment~2 training length and label source are confounded, so the population statements of Proposition~\ref{prop:coverage} for the point label and the calibrated bank are not tested. A seed ensemble of a heteroscedastic network does not carry the tie posterior to the test wells, and we make no calibration claim.
|
||||||
|
|
||||||
Table~\ref{tab:t4} examines this pattern post hoc, with the dispersion ratio $\xi$ of Section~\ref{sec:theory:cov} computed from the saved test-well predictions. Every ensemble was too narrow: $\xi$ was 0.19 for the Oracle and at most 0.66 (B5), against 1 for a matched second moment. Because $\xi_O$ is small, Proposition~\ref{prop:coverage}(a) requires only a small excess of predicted variance for a method to cover more than the Oracle. Each method had a larger $\xi$ and a higher coverage than the Oracle in 80--99\% of the 240 realization cells. The ordering follows training length as much as label quality. At R10, B3c-R had a median warp error of 3.5\,ms on the training wells, against 0.55\,ms for the SMC mean warp. It was trained for the Oracle's 500 iterations and reached the same $\xi$ as \mPM{} at 250. Over all regimes its excess over the Oracle was the smallest of any method (0.02--0.03). Most of the excess of \mPM{} and \mRML{} was already present at $c = 0$, where the median warp error of their labels was 0.34\,ms. Within the 250-iteration group, the methods with worse labels (B3d, B3c) had the larger excess, as Proposition~\ref{prop:coverage}(b) predicts. Training length acts on its own. On the development realizations of Experiment~1 (SNR 10, $c = 1$, $N = 16$), the 90\% coverage of single Oracle models fell from 0.47 after 125 iterations to 0.23 after 500 and 0.10 after 2000. Their mean $\sigma$ fell by a factor of five, while their RMSE varied by less than 10\%. In Experiment~2 training length and label source are confounded, so parts (b) and (c) of Proposition~\ref{prop:coverage} are not tested. A seed ensemble of a heteroscedastic network does not carry the tie posterior to the test wells. We make no calibration claim.
|
|
||||||
|
|
||||||
\begin{table}[t]
|
\begin{table}[t]
|
||||||
\centering
|
\centering
|
||||||
\caption{Dispersion of the five-seed ensembles (post hoc, descriptive). Left: R10, $c = 1$, $N = 16$. Iterations: training length selected on development data. rms $s$: root mean predicted variance $\overline{\sigma_s^2} + \Var_s\mu_s$; RMSE of the ensemble mean (p.u.); $\xi$: dispersion ratio of Section~\ref{sec:theory:cov}, averaged over realizations; cov$_{90}$: coverage of the central 90\% Gaussian interval. Right: mean excess $\xi_j - \xi_O$ over the Oracle in the same realization, averaged over the five regimes, both $N$ and eight realizations, by drift factor $c$.}
|
\caption{Dispersion of the five-seed ensembles (post hoc, descriptive). Left: 10\,dB, $c = 1$, $N = 16$. Iterations: training length selected on development data. rms $\hat\sigma$: root mean predicted variance $\overline{\sigma_s^2} + \Var_s\mu_s$; total RMSE of the ensemble mean (p.u.); $\xi$: dispersion ratio of Section~\ref{sec:theory:cov}, averaged over realizations; cov$_{90}$: coverage of the central 90\% Gaussian interval. Right: mean excess $\xi_j - \xi_O$ over the Oracle in the same realization, averaged over the five settings, both $N$ and eight realizations, by drift factor $c$.}
|
||||||
\label{tab:t4}
|
\label{tab:t4}
|
||||||
\small
|
\small
|
||||||
|
\setlength{\tabcolsep}{4pt}
|
||||||
\begin{tabular}{lcccccccc}
|
\begin{tabular}{lcccccccc}
|
||||||
\toprule
|
\toprule
|
||||||
& & \multicolumn{4}{c}{R10, $c = 1$, $N = 16$} & \multicolumn{3}{c}{$\xi_j - \xi_O$} \\
|
& & \multicolumn{4}{c}{10\,dB, $c = 1$, $N = 16$} & \multicolumn{3}{c}{$\xi_j - \xi_O$} \\
|
||||||
\cmidrule(lr){3-6}\cmidrule(lr){7-9}
|
\cmidrule(lr){3-6}\cmidrule(lr){7-9}
|
||||||
Ensemble & iterations & rms $s$ & RMSE & $\xi$ & cov$_{90}$ & $c = 0$ & $c = 1$ & $c = 2$ \\
|
Ensemble & iterations & rms $\hat\sigma$ & RMSE & $\xi$ & cov$_{90}$ & $c = 0$ & $c = 1$ & $c = 2$ \\
|
||||||
\midrule
|
\midrule
|
||||||
Oracle & 500 & 0.48 & 1.13 & 0.189 & 0.48 & -- & -- & -- \\
|
Oracle & 500 & 0.48 & 1.13 & 0.189 & 0.48 & -- & -- & -- \\
|
||||||
B3c-R & 500 & 0.61 & 1.20 & 0.262 & 0.55 & 0.018 & 0.027 & 0.026 \\
|
Phase-est.\ correlation & 500 & 0.61 & 1.20 & 0.262 & 0.55 & 0.018 & 0.027 & 0.026 \\
|
||||||
\mPM{} & 250 & 0.58 & 1.15 & 0.265 & 0.58 & 0.032 & 0.051 & 0.058 \\
|
\mPM{} & 250 & 0.58 & 1.15 & 0.265 & 0.58 & 0.032 & 0.051 & 0.058 \\
|
||||||
\mRML{} & 250 & 0.60 & 1.16 & 0.275 & 0.58 & 0.031 & 0.046 & 0.054 \\
|
\mRML{} & 250 & 0.60 & 1.16 & 0.275 & 0.58 & 0.031 & 0.046 & 0.054 \\
|
||||||
B3d & 250 & 0.76 & 1.24 & 0.379 & 0.65 & 0.041 & 0.072 & 0.064 \\
|
Anchor mean & 250 & 0.76 & 1.24 & 0.379 & 0.65 & 0.041 & 0.072 & 0.064 \\
|
||||||
B3c & 250 & 0.74 & 1.23 & 0.372 & 0.64 & 0.058 & 0.072 & 0.064 \\
|
Correlation tie & 250 & 0.74 & 1.23 & 0.372 & 0.64 & 0.058 & 0.072 & 0.064 \\
|
||||||
B5 & 125 & 1.10 & 1.36 & 0.662 & 0.79 & 0.199 & 0.199 & 0.179 \\
|
Calibrated-sonic ens.\ & 125 & 1.10 & 1.36 & 0.662 & 0.79 & 0.199 & 0.199 & 0.179 \\
|
||||||
\bottomrule
|
\bottomrule
|
||||||
\end{tabular}
|
\end{tabular}
|
||||||
\end{table}
|
\end{table}
|
||||||
|
|
||||||
\subsection{Mechanism of the bank gain (exploratory)}
|
\subsection{Where the bank gain comes from (exploratory)}
|
||||||
\label{sec:exp:mech}
|
\label{sec:exp:mech}
|
||||||
|
|
||||||
\todoblock{T2, exploratory, on the Experiment~2 bank (realizations 8--15), declared in \texttt{docs/research/t2-mechanism.md} before it is run (scheduled 1/11/2026). Planned tests: (i) warp error of the responsibility-weighted bank against that of the mean warp, at the end of training (re-registration, Remark~\ref{rem:lambda}); (ii) a control bank of random Gaussian-process time shifts with the same spread (label augmentation); (iii) split of the wide cells by posterior multimodality (Corollary~\ref{cor:twomode}); (iv) the Berkson-versus-classical covariance test of Section~\ref{sec:theory:post} for the bulk offset of \mPM{} and B3c-R, which decides which bound of Table~\ref{tab:h2b} applies; (v) \mPM{} retrained at the Oracle's budget, to separate training length from label error. The question is whether any gain remains beyond the population correction of the Berkson structure, not why a gain exceeds the registered bound. Disclose that the post hoc ratios and both bounds of Section~\ref{sec:exp:p2r}, at $\sigpost$ and at the warp error and with the 60\,Hz and cross-spectral variants, were inspected on 29/10/2026, before the declaration.}
|
We examined five possible sources of the bank gain, on the wide cells at $N = 16$ of the Experiment~2 bank. The tests and their readings were declared in advance, but the analysis uses the test realizations and followed the post hoc comparisons above, so none of its results is confirmatory. Appendix~\ref{app:record} gives the details.
|
||||||
|
\begin{itemize}
|
||||||
|
\item \emph{Error structure.} We tested the \mPM{} only, and the bulk offset only. Writing the error of the estimated offset as $\hat b - b^\star$, the Berkson structure predicts zero correlation between this error and $\hat b$ and a negative correlation between the error and $b^\star$. In all four wide cells at $c = 1$ the first correlation was near zero (pooled $-0.026$ $[-0.124, 0.072]$) and the second was $-0.44$ to $-0.77$. For the bulk offset at $c = 1$, the applicable bound is therefore $\rhoBk$. At $c = 2$ the test gave Berkson only at $-5$\,dB.
|
||||||
|
\item \emph{Training length.} At the Oracle's budget of 500 iterations, the ratio of the Oracle to the \mPM{} at $c = 1$ was 0.949, 0.944 and 0.957 at 0\,dB, half-anchor and $-5$\,dB, against 0.927, 0.919 and 0.933 at the pre-registered budgets. Training length thus accounts for 30--35\% of the pre-registered gap, and it does not explain the remaining 4--6\%. At $c = 0$ the gap nearly vanished (0.985--1.006).
|
||||||
|
\item \emph{Gaussian bank.} A bank with the posterior's first two moments and no link to the seismic improved on the \mPM{} in 7 of the 8 cells. At $c = 1$ it matched the \mRML{} in three of four cells (ratios to the \mPM{} 0.970 and 0.970, 0.904 and 0.890, 0.984 and 0.982). At $c = 2$ the SMC bank was ahead in three of four cells.
|
||||||
|
\item \emph{Re-registration.} The warp averaged with the end-of-training responsibilities as weights was closer to the true warp than the uniform mean of the bank in all 8 cells, with 13--39\% lower warp error. This is necessary for re-registration to help at test wells, not sufficient.
|
||||||
|
\item \emph{Multimodality.} Multimodal wells were rare except in the two-anchor setting at $c = 2$ (51\% of wells) and the half-anchor setting at $c = 2$ (19\%), and under the primary criterion the gain was not larger where they occurred (adjusted difference of log ratios $-0.012$ $[-0.043, 0.020]$).
|
||||||
|
\end{itemize}
|
||||||
|
Together these results suggest label augmentation as the main effect at $c = 1$, and information specific to the SMC bank at $c = 2$, where the posterior is unstable. None of them identifies a mechanism.
|
||||||
|
|
||||||
|
\subsection{Experiment 3: how far the results extend}
|
||||||
|
\label{sec:exp:bench}
|
||||||
|
|
||||||
|
Experiment~3 asks where the results of Experiment~2 stop. It has five studies (Table~\ref{tab:benchdesign}). The \emph{drift--well-count grid} fills the plane of $c$ and $N$ in every setting. The \emph{misspecification study} generates the data with a simulator that departs from the registration's model (Section~\ref{sec:data:d2}). The \emph{alignment-loss comparison} adds the anchor-free losses to the competitors of Experiment~2. The \emph{backbone check} repeats six cells with a TCN. The \emph{two-mode study} replaces the estimated posterior by a label error of known structure, the setting of Corollary~\ref{cor:twomode}. At each training well the bank is the true warp and the true warp shifted by $+\Delta$ or $-\Delta$, with the sign drawn per well and $\Delta \in \{8, 16, 32\}$\,ms.
|
||||||
|
|
||||||
|
The protocol has nine claims with a prediction for each, which yield eleven verdicts with no family-wise correction, decided by the two rules above. The experiment reuses the test realizations and SMC particles of Experiment~2, so its claims are extensions on the same realizations, not independent replications. Nine of the eleven verdicts passed (Table~\ref{tab:benchverdicts}), and the two failures are the most informative results. Appendix~\ref{app:record} explains a discrepancy between the locked code and the locked statements, which changes one conclusion.
|
||||||
|
|
||||||
|
\begin{table}[!htbp]
|
||||||
|
\centering
|
||||||
|
\caption{Design of Experiment~3. All studies use test realizations 8--15, five seeds and eight test wells per realization. Cells of the first and third studies that coincide with Experiment~2 ($c \in \{0, 1, 2\}$, $N \in \{4, 16\}$) are read from Experiment~2. Iteration budgets are those of Experiment~2 (for the anchor-free losses, those of Experiment~1: 125, 125, 500 and 250); the Gaussian bank, midpoint label and two-member bank use 250, the two-member hard-min 125, and every TCN method 125.}
|
||||||
|
\label{tab:benchdesign}
|
||||||
|
\small
|
||||||
|
\setlength{\tabcolsep}{3pt}
|
||||||
|
\begin{tabular}{p{0.19\linewidth}p{0.40\linewidth}p{0.34\linewidth}}
|
||||||
|
\toprule
|
||||||
|
Study & Cells & Methods \\
|
||||||
|
\midrule
|
||||||
|
Drift--well-count grid & 5 settings $\times$ $c \in \{0, 0.5, 1, 1.5, 2\}$ $\times$ $N \in \{2, 4, 8, 16\}$ & Oracle, deterministic ties, anchor mean, \mPM, \mRML \\
|
||||||
|
Misspecification & 10 and $-5$\,dB $\times$ 7 presets $\times$ $c = 1$ $\times$ $N \in \{4, 16\}$ & as above without anchor mean, plus Gaussian bank \\
|
||||||
|
Alignment losses & 5 settings $\times$ $c \in \{0, 1, 2\}$ $\times$ $N \in \{4, 16\}$ & anchor-free losses, Gaussian bank \\
|
||||||
|
Backbone & 10\,dB, $-5$\,dB and half-anchor $\times$ $c = 1$ $\times$ $N \in \{4, 16\}$ & as misspecification without Gaussian bank, TCN \\
|
||||||
|
Two-mode error & 10 and $-5$\,dB $\times$ $c = 1$ $\times$ $N \in \{4, 16\}$ $\times$ $\Delta \in \{8, 16, 32\}$\,ms & Oracle, midpoint label, two-member bank, two-member hard-min \\
|
||||||
|
\bottomrule
|
||||||
|
\end{tabular}
|
||||||
|
\end{table}
|
||||||
|
|
||||||
|
\begin{table}[!htbp]
|
||||||
|
\centering
|
||||||
|
\caption{Verdicts of Experiment~3. As worded: the locked statements applied by a separate script. As coded: the output of the locked code (Appendix~\ref{app:record}). No family-wise correction.}
|
||||||
|
\label{tab:benchverdicts}
|
||||||
|
\small
|
||||||
|
\setlength{\tabcolsep}{3pt}
|
||||||
|
\begin{tabular}{p{0.64\linewidth}lll}
|
||||||
|
\toprule
|
||||||
|
Claim (abridged) & Predicted & As worded & As coded \\
|
||||||
|
\midrule
|
||||||
|
\multicolumn{4}{l}{\emph{Drift--well-count grid}} \\
|
||||||
|
Posterior-mean claim extends to 10\,dB, $c = 1.5$, $N \in \{4, 16\}$ & pass & pass & none$^a$ \\
|
||||||
|
In wide families (setting, $c$), the gain of the \mRML{} over the \mPM{} grows with $N$ & pass & pass & pass \\
|
||||||
|
\multicolumn{4}{l}{\emph{Misspecification (posterior-mean claim at 10\,dB, $c = 1$, mild level)}} \\
|
||||||
|
\quad unit-dependent rock physics & pass & \textbf{fail} & fail \\
|
||||||
|
\quad frequency-dependent wavelet phase & pass & \textbf{fail} & fail \\
|
||||||
|
\quad scaled warp prior & uncertain & pass & pass \\
|
||||||
|
\mRML{}/\mPM{} $\le 1.02$ for all 14 presets $\times$ settings & pass & pass & pass \\
|
||||||
|
\multicolumn{4}{l}{\emph{Alignment losses}} \\
|
||||||
|
Posterior-mean claim unchanged with the anchor-free losses added to the competitors & pass & pass$^b$ & \textbf{fail}$^c$ \\
|
||||||
|
\multicolumn{4}{l}{\emph{Backbone}} \\
|
||||||
|
Posterior-mean claim at 10\,dB, $c = 1$ with the TCN & pass & pass & pass \\
|
||||||
|
\mRML{} (TCN) better than \mPM{} (TCN) at $-5$\,dB and half-anchor, $c = 1$, $N = 16$ & pass$^d$ & pass & pass \\
|
||||||
|
\multicolumn{4}{l}{\emph{Two-mode error}} \\
|
||||||
|
Transfer of the midpoint label negative in $(1/(2\Delta), 3/(2\Delta))$ at 10\,dB, $\Delta = 32$\,ms & pass & pass & pass \\
|
||||||
|
Two-member bank better than midpoint label at $\Delta \in \{16, 32\}$\,ms, $N = 16$, 10 and $-5$\,dB & pass & pass & pass \\
|
||||||
|
\bottomrule
|
||||||
|
\end{tabular}
|
||||||
|
|
||||||
|
\smallskip
|
||||||
|
\footnotesize $^a$The code requires exactly two cells. $^b$Passes at 10, 0 and $-5$\,dB. $^c$The code adds the Gaussian bank to the competitors. $^d$Recorded as uncertain: the TCN has no recurrent context.
|
||||||
|
\end{table}
|
||||||
|
|
||||||
|
\paragraph{The posterior-mean advantage holds in most of the plane of drift and well count.}
|
||||||
|
At 10\,dB, $c = 1.5$, the \mPM{} reduced band RMSE relative to the best deterministic tie (phase-estimated correlation) by 15\% at $N = 4$ (0.853 [0.805, 0.910], 5/5 seeds, 7/8 realizations) and by 20\% at $N = 16$ (0.796 [0.762, 0.826], 8/8). Across all 100 cells, the \mPM{} was better than the best deterministic tie, without a margin, in 91 (Fig.~\ref{fig:bench_s1}a). The ratio was 0.78--0.89 at 10\,dB and 0.84--0.96 at 0 and $-5$\,dB. All nine exceptions are in the settings with sparse anchors, seven in the two-anchor setting and two in the half-anchor setting; four are at $N = 2$. The excess of the \mPM{} over the Oracle grows with the posterior width: fitting $\mathrm{RMSE}^2_{\mathrm{SMC\,mean}} = \mathrm{RMSE}^2_{\mathrm{Oracle}} + \vartheta\,\sigpost^2$ per setting gives $\vartheta = 0.009$--$0.018$\,p.u.$^2$/ms$^2$, with $R^2 = 0.29$ (10\,dB) to 0.61 (0\,dB and two-anchor). This descriptive fit explains only part of the variation, and its source is not identified: the heuristic of Section~\ref{sec:theory:post} predicts no such penalty under exact Berkson error.
|
||||||
|
|
||||||
|
\paragraph{The bank gain grows with well count and posterior width.}
|
||||||
|
In all 13 families (setting, $c$) whose $N = 16$ cell is wide, the ratio \mRML{}/\mPM{} was lower at $N = 16$ than at $N = 2$. The pooled Spearman correlation between $\log_2 N$ and the ratio was $-0.47$ (one-sided permutation within families, $p < 10^{-4}$). Across the plane the ratio fell with $\sigpost$ (Spearman correlation $-0.66$ over the 100 cells; Fig.~\ref{fig:bench_s1}b). The \mRML{} was better than the \mPM{} in 44 of the 52 wide cells; all eight exceptions are at $N \le 4$ and have ratios 0.994--1.008. Over the 48 narrow cells the mean ratio was 0.995. The largest gains were in the two-anchor setting, where only two anchors constrain each warp and $\sigpost$ reaches 12\,ms: 0.734 at $c = 1.5$ and 0.667 at $c = 2$ ($N = 16$).
|
||||||
|
|
||||||
|
\begin{figure}[!htbp]
|
||||||
|
\centering
|
||||||
|
\includegraphics[width=\linewidth]{bench_s1.pdf}
|
||||||
|
\caption{Drift--well-count grid over drift factor $c$ and number of training wells $N$, by observation setting. (a) Band RMSE of the \mPM{} divided by that of the best deterministic tie. (b) Band RMSE of the \mRML{} divided by that of the \mPM{}. Entries are means over 8 realizations $\times$ 5 seeds; values in parentheses fail the no-margin rule. Outlined cells in (b) are wide ($\sigpost \ge 1.5$\,ms). Cells at $c \in \{0, 1, 2\}$, $N \in \{4, 16\}$ are those of Experiment~2. Cells at $c = 2$ have an unstable posterior. \figcodes{R10, R0, Rm5 are 10, 0, $-5$\,dB; R0h half-anchor; R10tb two-anchor; B3d-Sa \mPM{}; M2-Sa \mRML{}}}
|
||||||
|
\label{fig:bench_s1}
|
||||||
|
\end{figure}
|
||||||
|
|
||||||
|
\paragraph{Under a frequency-dependent wavelet phase the posterior becomes confidently wrong.}
|
||||||
|
The misspecification study failed for the wavelet, contrary to the prediction. The SMC re-estimated a constant phase of 43--46$^\circ$ and its posterior collapsed onto a wrong warp: warp error 2.58 and 2.26\,ms with 90\% coverage 0.17 and 0.10, which is 3.3--3.6 times its width (Table~\ref{tab:s2}). The band RMSE of the \mPM{} rose by 25\% ($N = 4$) and 50\% ($N = 16$) relative to the nominal cells. That of the correlation tie, which uses the statistical wavelet, rose by at most 4\%, which made it the best deterministic tie. At the strong level the loss was larger (the \mPM{} was 1.22 and 1.39 times the correlation tie). The lesson is that a posterior can be worse than a cruder tie when its forward model is wrong. On field data no true warp exposes this. A check that needs no truth is the disagreement between the SMC mean warp and a correlation tie built with the statistical wavelet, which we did not test. Under attenuation the posterior kept its coverage (0.86--0.87), and the cell passed at $N = 16$ only.
|
||||||
|
|
||||||
|
\paragraph{Under unit-dependent rock physics the gain is largely kept but misses the margin.}
|
||||||
|
This claim also failed, for a different reason. Registration was nearly unaffected: the SMC warp error rose from 1.20 to 1.52\,ms at $N = 4$ and from 0.63 to 1.05\,ms at $N = 16$, with 90\% coverage 0.87. The learning problem became harder for every method: the Oracle's band RMSE rose by factors of 1.56 and 1.84, and at $N = 16$ the \mPM{} stayed within 3\% of it. The ratio to the best deterministic tie rose to 0.940 and 0.934, so the cells missed the 0.90 margin, and the band PCC difference ($+0.044$, $+0.041$) stayed below $+0.05$. The \mPM{} still passed the no-margin rule against the best deterministic tie at both $N$. The difference between the squared band RMSE of the best deterministic tie and that of the \mPM{} fell only from 0.137 to 0.122\,p.u.$^2$ at $N = 4$ and from 0.132 to 0.107 at $N = 16$. The tie posterior remained usable here. What failed is the ratio rule: when a change in the simulator raises the error of every method, a ratio dilutes a largely preserved label gain, so absolute gains should be judged beside ratios.
|
||||||
|
|
||||||
|
\begin{table}[!htbp]
|
||||||
|
\centering
|
||||||
|
\caption{Misspecification study at 10\,dB, $c = 1$ (values for $N = 4$ / $N = 16$ where two are given). Model error: RMS residual between the clean seismic and the best synthetic within the registration's model family at the true warp, relative to the noise RMS at 10\,dB; warp presets change the true warp, not the forward model. Warp RMSE and cov$_{90}$: SMC posterior on the training wells. Ratio: band RMSE of the \mPM{} divided by that of the best deterministic tie; $^\ast$ cell passes the margin rule. \mRML{}/\mPM{}: mean over $N$. Oracle: band RMSE of the Oracle relative to the nominal cell, $N = 16$.}
|
||||||
|
\label{tab:s2}
|
||||||
|
\small
|
||||||
|
\setlength{\tabcolsep}{2.5pt}
|
||||||
|
\begin{tabular}{lccccccc}
|
||||||
|
\toprule
|
||||||
|
& & & & \multicolumn{2}{c}{ratio} & & \\
|
||||||
|
\cmidrule(lr){5-6}
|
||||||
|
Preset & model error & warp RMSE (ms) & cov$_{90}$ & $N = 4$ & $N = 16$ & bank/mean & Oracle \\
|
||||||
|
\midrule
|
||||||
|
nominal & 0.23 & 1.20 / 0.63 & 0.85 / 0.89 & 0.857$^\ast$ & 0.782$^\ast$ & 1.000 & 1 \\
|
||||||
|
rock physics, mild & 1.24 & 1.52 / 1.05 & 0.87 / 0.87 & 0.940 & 0.934 & 0.999 & 1.84 \\
|
||||||
|
rock physics, strong & 1.68 & 2.15 / 1.52 & 0.83 / 0.86 & 0.963 & 0.955 & 0.998 & 2.13 \\
|
||||||
|
wavelet phase, mild & 1.08 & 2.58 / 2.26 & 0.17 / 0.10 & 1.023 & 1.042 & 1.020 & 1.00 \\
|
||||||
|
wavelet phase, strong & 1.93 & 4.74 / 4.24 & 0.04 / 0.03 & 1.217 & 1.386 & 1.003 & 1.02 \\
|
||||||
|
attenuation & 1.41 & 1.68 / 1.06 & 0.86 / 0.87 & 0.927 & 0.842$^\ast$ & 1.019 & 0.97 \\
|
||||||
|
scaled warp prior & -- & 1.63 / 1.25 & 0.78 / 0.91 & 0.862$^\ast$ & 0.798$^\ast$ & 0.984 & 1.00 \\
|
||||||
|
out-of-family warp & -- & 2.25 / 1.38 & 0.67 / 0.70 & 0.892 & 0.820$^\ast$ & 0.988 & 1.02 \\
|
||||||
|
\bottomrule
|
||||||
|
\end{tabular}
|
||||||
|
\end{table}
|
||||||
|
|
||||||
|
\paragraph{The advantage survives a misspecified warp prior, and the bank did not harm.}
|
||||||
|
Under the scaled warp prior the claim passed at 10\,dB, the only misspecified axis for which we claim it. The coverage was 0.78--0.91 under that preset and 0.67--0.70 under the out-of-family warp, and the ratios stayed near their nominal values; with the out-of-family warp at $N = 4$ the cell failed on seeds (3/5) with a ratio of 0.892, a single cell that we did not investigate. At $-5$\,dB the protocol declared a null in advance, because the noise amplitude is 1.78 times that of the signal and buries model errors of 0.19--0.34 of the noise. Of the 14 cells at $-5$\,dB, 13 passed the margin rule. Averaged over $N$, \mRML{}/\mPM{} was at most 1.02 for every preset and setting (0.984--1.020 at 10\,dB, 0.984--1.012 at $-5$\,dB). The bank did not harm, but in this study it helped little: no 10\,dB cell was wide, and it was better than the \mPM{} in 3 of the 14 cells at 10\,dB and 7 of 14 at $-5$\,dB.
|
||||||
|
|
||||||
|
\paragraph{Anchor-free losses do not change the claim, and a Gaussian bank matches the SMC mean.}
|
||||||
|
As worded, the alignment-loss claim passed at 10, 0 and $-5$\,dB. It failed in the half-anchor and two-anchor settings, where it is descriptive, because the \mPM{} did not clear the margin against the deterministic ties when anchors are sparse; the anchor-free losses were never the best competitor at $c \le 1$. The Gaussian bank, a disclosed addition that is not a point tie, was the best competitor at $c = 1$ in every setting, and the ratio of the \mPM{} to it was 0.99--1.02 at 10, 0 and $-5$\,dB. The advantage of the \mPM{} therefore does not extend to a bank with the same first two moments.
|
||||||
|
|
||||||
|
\paragraph{The results hold with a second backbone.}
|
||||||
|
With the TCN at 10\,dB, $c = 1$, the \mPM{} reduced band RMSE relative to the best TCN deterministic tie by 16\% and 18\% ($N = 4$, 16), and the \mRML{} (TCN) was better than the \mPM{} (TCN) in the half-anchor setting (0.977 [0.968, 0.987]) and at $-5$\,dB (0.983 [0.975, 0.991]) at $N = 16$. The TCN was a weaker backbone (Appendix~\ref{app:record}).
|
||||||
|
|
||||||
|
\paragraph{A two-mode error reverses the band, and a bank containing the truth repairs it.}
|
||||||
|
The midpoint label has error $\pm\Delta/2$, so Corollary~\ref{cor:twomode} predicts the transfer $\cos(\pi f\Delta)$. At 10\,dB, $\Delta = 32$\,ms, its measured transfer relative to the Oracle, averaged over the usable frequencies in 15.6--46.9\,Hz, was $-0.70$ ($N = 4$) and $-0.49$ ($N = 16$), against $-0.69$ and $-0.49$ for the cosine over the same frequencies; its first zero crossing was at 14.6\,Hz against 15.6\,Hz in theory (Fig.~\ref{fig:bench_s8}). At $-5$\,dB the values were $-0.70$ and $-0.74$, against $-0.74$ and $-0.71$. At $N = 16$, the two-member bank reduced band RMSE relative to the midpoint label by 66\% and 72\% at 10\,dB ($\Delta = 16$, 32\,ms) and by 29\% and 36\% at $-5$\,dB, and at these $\Delta$ it came within 4\% of the Oracle (Table~\ref{tab:s8}).
|
||||||
|
|
||||||
|
The two-member bank contains the true warp but is not calibrated in the sense of Proposition~\ref{prop:bank}, so in the limit $\lambda \to 0$ its transfer would be $\cos^2(\pi f\Delta)$. In a post hoc comparison over the three cells at $N = 16$ with usable frequencies in the reversed band, its transfer there was 0.92--1.00, against means of 0.05--0.59 for $\cos^2(\pi f\Delta)$ at the same frequencies. It thus did more than average its two members, as re-registration by the responsibilities would (Remark~\ref{rem:lambda}). The two-member hard-min was close to it, with a higher band RMSE in every cell. At $\Delta = 8$\,ms Corollary~\ref{cor:twomode} anticipates a harder case: below $1/(2\Delta) = 62.5$\,Hz, $\cos^2(\pi f\Delta) < \cos(\pi f\Delta)$, so a bank that only averaged its members would be more blurred than the midpoint label, and it can win only through re-registration.
|
||||||
|
|
||||||
|
\begin{table}[!htbp]
|
||||||
|
\centering
|
||||||
|
\caption{Two-mode study ($c = 1$): band RMSE ratios, mean over 8 realizations $\times$ 5 seeds, for $N = 4$ / $N = 16$. Mid: midpoint label; Bank: two-member bank; Hard: two-member hard-min. $^\ast$ bank better than midpoint label at $N = 16$ (no-margin rule). $\Delta = 8$\,ms is descriptive.}
|
||||||
|
\label{tab:s8}
|
||||||
|
\small
|
||||||
|
\setlength{\tabcolsep}{4pt}
|
||||||
|
\begin{tabular}{lcccccc}
|
||||||
|
\toprule
|
||||||
|
SNR & $\Delta$ (ms) & Mid/Oracle & Bank/Mid & Bank/Mid, $N = 16$ & Hard/Mid & Bank/Oracle \\
|
||||||
|
\midrule
|
||||||
|
10\,dB & 8 & 1.56 / 1.78 & 0.88 / 0.60 & 0.600 [0.569, 0.635]$^\ast$ & 0.90 / 0.67 & 1.37 / 1.07 \\
|
||||||
|
10\,dB & 16 & 2.30 / 2.94 & 0.49 / 0.34 & 0.340 [0.327, 0.360]$^\ast$ & 0.54 / 0.37 & 1.13 / 1.00 \\
|
||||||
|
10\,dB & 32 & 2.73 / 3.64 & 0.43 / 0.28 & 0.280 [0.267, 0.294]$^\ast$ & 0.46 / 0.31 & 1.17 / 1.02 \\
|
||||||
|
$-5$\,dB & 8 & 1.16 / 1.17 & 0.98 / 0.88 & 0.881 [0.852, 0.912]$^\ast$ & 1.01 / 0.92 & 1.14 / 1.03 \\
|
||||||
|
$-5$\,dB & 16 & 1.37 / 1.46 & 0.83 / 0.71 & 0.706 [0.680, 0.734]$^\ast$ & 0.85 / 0.73 & 1.14 / 1.03 \\
|
||||||
|
$-5$\,dB & 32 & 1.46 / 1.64 & 0.80 / 0.64 & 0.635 [0.609, 0.673]$^\ast$ & 0.82 / 0.66 & 1.16 / 1.04 \\
|
||||||
|
\bottomrule
|
||||||
|
\end{tabular}
|
||||||
|
\end{table}
|
||||||
|
|
||||||
|
\begin{figure}[!htbp]
|
||||||
|
\centering
|
||||||
|
\includegraphics[width=\linewidth]{bench_s8.pdf}
|
||||||
|
\caption{Two-mode study at $N = 16$: measured transfer $\hat H(f)$ of the midpoint label (modes $\Delta$ apart), the two-member bank containing the true warp, and the two-member hard-min, relative to the Oracle, pooled over test wells, realizations and seeds, for (a) 10\,dB and (b) $-5$\,dB. Curves are shown at the usable frequencies (Oracle cross-spectrum at least 10\% of its maximum above 6\,Hz). Dashed: $\cos(\pi f\Delta)$ (Corollary~\ref{cor:twomode}). Shaded: the band $1/(2\Delta) < f < 3/(2\Delta)$ in which the transfer of the midpoint label is negative. \figcodes{R10 and Rm5 are 10 and $-5$\,dB; PM2 midpoint label; BK2 two-member bank; HM2 two-member hard-min}}
|
||||||
|
\label{fig:bench_s8}
|
||||||
|
\end{figure}
|
||||||
|
|
||||||
\subsection{Detectability of a gain at blind wells (exploratory)}
|
\subsection{Detectability of a gain at blind wells (exploratory)}
|
||||||
\label{sec:exp:detect}
|
\label{sec:exp:detect}
|
||||||
|
|
||||||
A field test scores predictions at blind wells against labels that need a tie of their own. By Proposition~\ref{prop:reference}, an error in that reference biases the comparison, and more wells reduce its variance but not its bias. To estimate how many blind wells a field test needs, we rescored the saved test predictions of Experiment~2 against perturbed references. The analysis was declared before it was run, but after both field gates had failed (Section~\ref{sec:exp:scope}). After the first run we added points to the grid of reference errors, from $\{0, 2, 4, 8\}$ to $\{0, 0.5, 1, 1.5, 2, 3, 4, 8\}$\,ms, because the outcome changed between 0 and 2\,ms, where the grid had no points. No rule, threshold or input changed. The analysis is exploratory.
|
By Proposition~\ref{prop:reference}, an error in the reference at blind wells biases a comparison of methods, and more wells reduce its variance but not its bias. To estimate how many blind wells a field test needs, we rescored the saved test predictions of Experiment~2 against perturbed references. The analysis is exploratory: it was declared before it was run but after both field tests had failed (Appendix~\ref{app:record}).
|
||||||
|
|
||||||
\paragraph{Design.}
|
\paragraph{Design.}
|
||||||
We used the cells at R10, R0 and Rm5 with $c = 1$ and $N \in \{4, 16\}$, and compared \mRML{} with the best point tie of each cell, the competitor of H2a: B3c-R in four cells, B3c at R10 with $N = 4$ and B3b at Rm5 with $N = 4$. For each test well, the reference is the true label read at $t + s(t)$, with $s = a + bx$, where $x$ runs linearly from $-1$ to 1 across the window, $a \sim \N(0, \sigma_{\mathrm{ref}}^2)$ and $b \sim \N(0, \sigma_{\mathrm{ref}}^2/4)$. The RMS of $s$ is then $1.04\,\sigma_{\mathrm{ref}}$. Each well receives 64 draws. A well counts as a win if the seed-averaged \mRML{} has the lower band RMSE against this reference. Wells of one realization share their training wells, so their outcomes are correlated. The probability that a rule passes with $n$ blind wells is therefore computed from a beta-binomial distribution whose mean is the win rate and whose intra-class correlation is that of the outcome within realizations. We compare two rules: $k$ of $n$ wells with $k = \lceil 0.75n\rceil$, the form of both field gates (three of four on F3, five of six on Volve), and a one-sided sign test at $\alpha = 0.05$. $N^\star$ is the smallest $n \le 40$ at which a rule passes with probability at least 0.8.
|
We used the cells at 10, 0 and $-5$\,dB with $c = 1$ and $N \in \{4, 16\}$, and compared the \mRML{} with the best deterministic tie of each cell. For each test well, the reference is the true label read at $t + \varepsilon_{\mathrm{ref}}(t)$, with $\varepsilon_{\mathrm{ref}} = a + bx$, where $x$ runs linearly from $-1$ to 1 across the window, $a \sim \N(0, \sigma_{\mathrm{ref}}^2)$ and $b \sim \N(0, \sigma_{\mathrm{ref}}^2/4)$. Its RMS is then $1.04\,\sigma_{\mathrm{ref}}$, and each well receives 64 draws. A well counts as a win if the seed-averaged \mRML{} has the lower band RMSE against this reference. Wells of one realization share their training wells, so the probability that a rule passes with $n_{\mathrm{b}}$ blind wells is computed from a beta-binomial distribution whose mean is the win rate and whose intra-class correlation is that of the outcome within realizations. We compare a $k$-of-$n_{\mathrm{b}}$ rule with $k = \lceil 0.75\,n_{\mathrm{b}}\rceil$, the form of both field rules, and a one-sided sign test at $\alpha = 0.05$. We write $n_{\mathrm{b}}^\star$ for the smallest $n_{\mathrm{b}} \le 40$ at which a rule passes with probability at least 0.8. The clustering enters the power but not the nominal level of the sign test, which is anti-conservative when wells share training wells. A field test should therefore calibrate its null for the clustering of blind wells that share training data, for example with the same beta-binomial model.
|
||||||
|
|
||||||
\paragraph{A reference error of a few milliseconds reverses the ranking.}
|
\paragraph{A reference error of a few milliseconds reverses the ranking.}
|
||||||
With an exact reference, \mRML{} won at 81--97\% of the test wells, and its median band RMSE was 0.80--0.92 times that of the competitor (Table~\ref{tab:t3}). Both numbers worsened as the reference error grew. At $\sigma_{\mathrm{ref}} = 4$\,ms, the win rate was 0.46--0.64 and the median ratio 0.96--1.01. At 8\,ms, the win rate was 0.22--0.44 and the median ratio exceeded 1 in every cell: against this reference the point tie scored better, although against the true labels it was worse. In the three cells with $N = 16$, the median ratio crossed 1 between 3.6 and 4.3\,ms. Corollary~\ref{cor:tolerance} places the crossing, to leading order and without shrinkage, at $\sigma/\sqrt2$, where $\sigma$ is the tie error of the point label. The RMS warp error of B3c-R on the training wells of these cells was 4.2, 5.8 and 7.3\,ms at R10, R0 and Rm5, so $\sigma/\sqrt2$ is 3.0, 4.1 and 5.1\,ms. The simulated crossings follow the same order and lie within 1\,ms of these values. The agreement can only be approximate: \mRML{} is not the oracle that the corollary assumes, the tie errors are not constant Gaussian shifts, and the reference error here includes a stretch.
|
With an exact reference, the \mRML{} won at 81--97\% of the test wells, and its median band RMSE was 0.80--0.92 times that of the competitor (Table~\ref{tab:t3}). At $\sigma_{\mathrm{ref}} = 4$\,ms the win rate was 0.46--0.64 and the median ratio 0.96--1.01. At 8\,ms the win rate was 0.22--0.44 and the median ratio exceeded 1 in every cell: against this reference the deterministic tie scored better, although against the true labels it was worse. In the three cells with $N = 16$, the median ratio crossed 1 between 3.6 and 4.3\,ms. Corollary~\ref{cor:tolerance} places the crossing at or below $\sigma/\sqrt2$ for an unshrunk oracle, where $\sigma$ is the tie error of the point label. The RMS warp error of the phase-estimated correlation tie on the training wells of these cells was 4.2, 5.8 and 7.3\,ms at 10, 0 and $-5$\,dB, so $\sigma/\sqrt2$ is 3.0, 4.1 and 5.1\,ms. The simulated crossings, 3.6, 3.8 and 4.3\,ms by linear interpolation, follow the same order and lie within 1\,ms of these values: below them at 0 and $-5$\,dB, and 0.6\,ms above at 10\,dB, outside the corollary's condition. The assumptions explain why the agreement can only be approximate: shrinkage relaxes the condition, the \mRML{} is not an oracle, the tie errors are not constant Gaussian shifts, and the reference error here includes a stretch.
|
||||||
|
|
||||||
\paragraph{Wells needed.}
|
\paragraph{The number of wells needed rises quickly with the reference error.}
|
||||||
With an exact reference, the sign test needs five blind wells at R0 (both $N$) and at R10 with $N = 16$, and 18 and 11 wells at Rm5 with $N = 4$ and 16. At R10 with $N = 4$, the outcomes are strongly correlated within realizations (intra-class correlation 0.45), and no $n \le 40$ reaches a pass probability of 0.8. The number of wells rises quickly with the reference error. At 1\,ms, four of the six cells need 11--30 wells; at 2\,ms, only R0 stays within 40 (23 and 37 wells); at 3\,ms or more, no cell does. The $k$-of-$n$ rule appears to need fewer wells, but it is not a test. With independent wells and no true difference, it passes with probability $5/16 = 0.31$ at $n = 4$ and $7/64 = 0.11$ at $n = 6$. A one-sided sign test at $\alpha = 0.05$ cannot reject at all with four wells, because its smallest attainable $p$-value is $1/16$.
|
With an exact reference, the sign test needs five blind wells at 0\,dB (both $N$) and at 10\,dB with $N = 16$, and 18 and 11 wells at $-5$\,dB with $N = 4$ and 16. At 10\,dB with $N = 4$, the outcomes are strongly correlated within realizations (intra-class correlation 0.45), and no $n_{\mathrm{b}} \le 40$ reaches a pass probability of 0.8. At 1\,ms, four of the six cells need 11--30 wells; at 2\,ms, only 0\,dB stays within 40 (23 and 37 wells); at 3\,ms or more, no cell does. The $k$-of-$n_{\mathrm{b}}$ rule appears to need fewer wells, but it is not a test. With independent wells and no true difference, it passes with probability $5/16 = 0.31$ at $n_{\mathrm{b}} = 4$ and $7/64 = 0.11$ at $n_{\mathrm{b}} = 6$. A one-sided sign test at $\alpha = 0.05$ cannot reject at all with four wells, because its smallest attainable $p$-value is $1/16$.
|
||||||
|
|
||||||
|
\paragraph{A worked example.}
|
||||||
|
Consider a comparison at $-5$\,dB with $N = 16$ training wells, where the best deterministic tie has a warp error of $\sigma = 7.3$\,ms on the training wells. Corollary~\ref{cor:tolerance} requires a reference error below $\sigma/\sqrt2 = 5.1$\,ms for the measured advantage to keep its sign, and in the simulation the ranking reversed at 4.3\,ms. Detecting the gain requires much more. A sign test with a power of 0.8 needs 11 blind wells with an exact reference, 16 with $\sigma_{\mathrm{ref}} = 0.5$\,ms and 30 with 1\,ms, and at 1.5\,ms or more 40 wells do not suffice (Table~\ref{tab:t3}). An analyst who can estimate the reference error can read the required number of wells from this table, for predictors of comparable skill. The alternative reference we built for Teapot Dome has a residual of 6.75\,ms (Section~\ref{sec:exp:scope}), which exceeds even the limit for the sign of the comparison.
|
||||||
|
|
||||||
\begin{table}[t]
|
\begin{table}[t]
|
||||||
\centering
|
\centering
|
||||||
\caption{Detectability at blind wells (exploratory; saved test predictions of Experiment~2, $c = 1$). Competitor: the best point tie of the cell. Win: fraction of the 64 test wells at which \mRML{} has the lower band RMSE against the perturbed reference; ratio: median ratio of band RMSE, \mRML{} to competitor; ICC: intra-class correlation of the win within realizations. $N^\star$: smallest number of blind wells at which a one-sided sign test ($\alpha = 0.05$) rejects with probability at least 0.8; --: not reached with 40 wells.}
|
\caption{Detectability at blind wells (exploratory; saved test predictions of Experiment~2, $c = 1$). Competitor: the best deterministic tie of the cell. Win: fraction of the 64 test wells at which the \mRML{} has the lower band RMSE against the perturbed reference; ratio: median ratio of band RMSE, \mRML{} to competitor; ICC: intra-class correlation of the win within realizations. $n_{\mathrm{b}}^\star$: smallest number of blind wells at which a one-sided sign test ($\alpha = 0.05$) rejects with probability at least 0.8; --: not reached with 40 wells.}
|
||||||
\label{tab:t3}
|
\label{tab:t3}
|
||||||
\small
|
\small
|
||||||
\setlength{\tabcolsep}{4pt}
|
\setlength{\tabcolsep}{3pt}
|
||||||
\begin{tabular}{llccccccccccc}
|
\begin{tabular}{llccccccccccc}
|
||||||
\toprule
|
\toprule
|
||||||
& & \multicolumn{3}{c}{$\sigma_{\mathrm{ref}} = 0$} & \multicolumn{2}{c}{win} & \multicolumn{6}{c}{$N^\star$ at $\sigma_{\mathrm{ref}}$ (ms)} \\
|
& & \multicolumn{3}{c}{$\sigma_{\mathrm{ref}} = 0$} & \multicolumn{2}{c}{win} & \multicolumn{6}{c}{$n_{\mathrm{b}}^\star$ at $\sigma_{\mathrm{ref}}$ (ms)} \\
|
||||||
\cmidrule(lr){3-5}\cmidrule(lr){6-7}\cmidrule(lr){8-13}
|
\cmidrule(lr){3-5}\cmidrule(lr){6-7}\cmidrule(lr){8-13}
|
||||||
Cell & Competitor & win & ratio & ICC & 4\,ms & 8\,ms & 0 & 0.5 & 1 & 1.5 & 2 & $\ge 3$ \\
|
Cell & Competitor & win & ratio & ICC & 4\,ms & 8\,ms & 0 & 0.5 & 1 & 1.5 & 2 & $\ge 3$ \\
|
||||||
\midrule
|
\midrule
|
||||||
R10, $N = 4$ & B3c & 0.81 & 0.85 & 0.45 & 0.53 & 0.39 & -- & -- & -- & -- & -- & -- \\
|
10\,dB, $N = 4$ & Correlation & 0.81 & 0.85 & 0.45 & 0.53 & 0.39 & -- & -- & -- & -- & -- & -- \\
|
||||||
R10, $N = 16$ & B3c-R & 0.97 & 0.80 & 0.00 & 0.46 & 0.22 & 5 & 5 & 11 & 23 & -- & -- \\
|
10\,dB, $N = 16$ & Phase-est.\ corr. & 0.97 & 0.80 & 0.00 & 0.46 & 0.22 & 5 & 5 & 11 & 23 & -- & -- \\
|
||||||
R0, $N = 4$ & B3c-R & 0.95 & 0.87 & 0.07 & 0.64 & 0.39 & 5 & 8 & 11 & 13 & 23 & -- \\
|
0\,dB, $N = 4$ & Phase-est.\ corr. & 0.95 & 0.87 & 0.07 & 0.64 & 0.39 & 5 & 8 & 11 & 13 & 23 & -- \\
|
||||||
R0, $N = 16$ & B3c-R & 0.97 & 0.87 & 0.00 & 0.48 & 0.27 & 5 & 8 & 13 & 18 & 37 & -- \\
|
0\,dB, $N = 16$ & Phase-est.\ corr. & 0.97 & 0.87 & 0.00 & 0.48 & 0.27 & 5 & 8 & 13 & 18 & 37 & -- \\
|
||||||
Rm5, $N = 4$ & B3b & 0.84 & 0.92 & 0.39 & 0.60 & 0.44 & 18 & 30 & -- & -- & -- & -- \\
|
$-5$\,dB, $N = 4$ & Calibrated sonic & 0.84 & 0.92 & 0.39 & 0.60 & 0.44 & 18 & 30 & -- & -- & -- & -- \\
|
||||||
Rm5, $N = 16$ & B3c-R & 0.89 & 0.92 & 0.08 & 0.51 & 0.31 & 11 & 16 & 30 & -- & -- & -- \\
|
$-5$\,dB, $N = 16$ & Phase-est.\ corr. & 0.89 & 0.92 & 0.08 & 0.51 & 0.31 & 11 & 16 & 30 & -- & -- & -- \\
|
||||||
\bottomrule
|
\bottomrule
|
||||||
\end{tabular}
|
\end{tabular}
|
||||||
\end{table}
|
\end{table}
|
||||||
|
|
||||||
\subsection{Scope: two field cases}
|
\subsection{Field cases: what they can and cannot show}
|
||||||
\label{sec:exp:scope}
|
\label{sec:exp:scope}
|
||||||
|
|
||||||
\paragraph{Both field gates failed.}
|
\paragraph{Neither field test met its pass rule.}
|
||||||
We ran two field tests under locked protocols. On F3, with four wells, gate G-C required \mRML{} to have a lower band RMSE than the selected point tie at no fewer than three of the four blind wells, and macro coverage of its 80\% and 90\% intervals within $[0.75, 0.85]$ and $[0.85, 0.95]$. On Volve, with six deviated wells and a density-driven porosity label, gate G-D asked for the same at five of six wells under two hold-out schemes, with total RMSE on the labelled samples. Both gates failed. On F3, \mRML{} improved at one well of four, and coverage was 0.52 and 0.61. Its sensitivity variants (anchor uncertainty, scoring reference, band split, label) improved at one to three wells and never met the coverage condition. On Volve, \mRML{} improved at two (leave-one-well-out) and three (slot) of six wells, and coverage of the 90\% interval was 0.48 and 0.47. No method had skill at the Volve blind wells: $R^2$ was negative for every method, and a constant at the training-well mean of PHIF had a lower macro RMSE than every network (6.03 and 6.59\,p.u.\ under the two schemes, against 6.50 and 7.13\,p.u.\ for \mRML; post hoc). Appendix~\ref{app:field} gives the designs, all tables and the protocol deviations. Neither test is an independent replication. F3 also supplied the statistics and the warp prior of the synthetic generator (Section~\ref{sec:data:d2}), and the Volve test was designed after the F3 gate had failed.
|
On F3, with four wells, the rule required the \mRML{} to have a lower band RMSE than the selected deterministic tie at no fewer than three of the four blind wells, and macro coverage of its 80\% and 90\% intervals within $[0.75, 0.85]$ and $[0.85, 0.95]$. On Volve, with six deviated wells and a density-driven porosity label, the (descriptive) rule asked for the same at five of six wells under two hold-out schemes (single wells, and slots, the groups of wells that share a borehole), with total RMSE on the labelled samples. On F3, the \mRML{} improved at one well of four, and coverage was 0.52 and 0.61. Its sensitivity variants (anchor uncertainty, scoring reference, band split, label) improved at one to three wells and never met the coverage condition. On Volve, it improved at two (leave-one-well-out) and three (slot) of six wells, and coverage of the 90\% interval was 0.48 and 0.47. No method had skill at the Volve blind wells: macro $R^2$ was negative for every method, and a constant at the training-well mean of the porosity label (PHIF) had a lower macro RMSE than every network (6.03 and 6.59\,p.u.\ under the two schemes, against 6.50 and 7.13\,p.u.\ for the \mRML; post hoc). We claim no improvement on field data and no calibrated uncertainty. Appendix~\ref{app:field} gives the designs and all tables.
|
||||||
|
|
||||||
\paragraph{Neither test could have detected the effect.}
|
\paragraph{Neither test could have detected the effect.}
|
||||||
After both gates had failed, we stated four conditions under which a field test of this kind bears on the synthetic result, and evaluated them without test labels. The thresholds of C1 and C2 were taken mechanically from Experiment~2, so the conditions are post hoc but were not tuned to the field results. (C1) The networks have blind-well skill within the range in which Experiment~2 found the effect: at inner-validation wells, a band PCC of at least 0.468 and an $R^2$ of at least 0.053, the smallest values reached by the best point tie in the cells that passed H2a, and a lower RMSE than a constant. (C2) The tie posterior is wide, $\sigpost \ge 1.5$\,ms, the threshold of H2b; this condition matters only for the comparison with \mPM. (C3) $\sigma_a$ is identified by independent time--depth data at three or more wells outside the test set, because a misset $\sigma_a$ removed the H2a advantage (Table~\ref{tab:sigmaa}). (C4) The number of blind wells reaches $N^\star$ (Table~\ref{tab:t3}). C2 held on both datasets, with median $\sigpost$ of 2.8\,ms on F3 and 4.3\,ms on Volve. C1 failed on both: band PCC at the inner-validation wells was 0.15 on F3 and 0.13 and 0.04 on Volve (leave-one-well-out and slot), and $R^2$ was 0.04, $-0.99$ and $-0.99$. C3 and C4 fail by construction. F3 has no independent time--depth data, and Volve has check shots at two wells. Both tests scored against marker-calibrated sonic ties of the test wells, whose errors are unknown. With four wells no sign test can reject, and with independent wells the gate rules pass with probability 0.31 (three of four) and 0.11 (five of six) when there is no true difference. The failure of either gate is therefore no evidence against the synthetic result, and a pass would not have been evidence for it.
|
After both tests had failed, we stated four conditions under which a field test of this kind bears on the synthetic result and evaluated them without test labels. Their thresholds come mechanically from Experiment~2, so the conditions are post hoc but were not tuned to the field results.
|
||||||
|
\begin{itemize}
|
||||||
|
\item \emph{Skill.} The networks have blind-well skill within the range in which Experiment~2 found the effect: at inner-validation wells, a band PCC of at least 0.468 and an $R^2$ of at least 0.053, the smallest values reached by the best deterministic tie in the cells that passed the posterior-mean claim, and a lower RMSE than a constant. This failed on both datasets: band PCC was 0.15 on F3 and, on runs too short for a meaningful band split, 0.13 and 0.04 on Volve (leave-one-well-out and slot), and $R^2$ was 0.04, $-0.99$ and $-0.99$.
|
||||||
|
\item \emph{Width.} The tie posterior is wide, $\sigpost \ge 1.5$\,ms, which matters only for the comparison with the \mPM{}. This held on both datasets, with median $\sigpost$ of 2.8\,ms on F3 and 4.3\,ms on Volve.
|
||||||
|
\item \emph{Anchor uncertainty.} $\sigma_a$ is identified by independent time--depth data at three or more wells outside the test set, because a misset $\sigma_a$ removed the advantage (Table~\ref{tab:sigmaa}). This fails by construction: F3 has no independent time--depth data, and Volve has check shots at two wells, only one of them among the six used.
|
||||||
|
\item \emph{Well count.} The number of blind wells reaches $n_{\mathrm{b}}^\star$ (Table~\ref{tab:t3}). This also fails by construction. Both tests scored against marker-calibrated sonic ties of the test wells, whose errors are unknown, and with four wells no sign test can reject.
|
||||||
|
\end{itemize}
|
||||||
|
With independent wells the two pass rules succeed with probability 0.31 (three of four) and 0.11 (five of six) when there is no true difference. The failure of either test is therefore no evidence against the synthetic result, and a pass would not have been evidence for it.
|
||||||
|
|
||||||
\paragraph{Limits of field validation.}
|
\paragraph{With more wells, the reference error remains the binding constraint.}
|
||||||
A dataset with more wells does not by itself remove the constraint. After the field tests we inventoried Teapot Dome (NPR-3, Wyoming; \citealp{bader2017teapot}), where 152 wells inside the 3-D survey have density logs across a common target interval. This step is post hoc and exploratory. Its conditions were declared before the data were obtained, and the alternative reference described next was declared after the inventory but before any residual or porosity value was computed. Time--depth tables exist at four wells. Three are labelled as derived from synthetic seismograms, and the fourth, a vertical seismic profile, ends above the main reservoirs. Even counting one of the three as independent, at most two wells have an independent time--depth reference, against the $3 + 11$ that C3 and C4 need at Rm5. As an alternative reference, we paired the times of two interpreted 3-D horizons at the wells with the depths of the corresponding formation tops. On 37 development wells we predicted each time from the depth with a quadratic lateral trend of average velocity, fitted by leave-one-out. The residual standard deviation was 6.75\,ms (90\% bootstrap interval over wells 4.1--9.4\,ms; robust estimate 5.0\,ms). Most of it was a bulk shift per well (6.6\,ms): the residuals of the two horizons at a well were correlated (0.85), and those of neighbouring wells were not. The shift is therefore not a smooth velocity change that the trend missed; it resembles per-well errors of datum, statics or top picks. The differential part was 2.8\,ms, and 2.5\,ms from the sonic at five wells. Every estimate exceeded the declared tolerance of 1.5\,ms, the largest grid value at which the Rm5 cell with $N = 16$ reaches a power of 0.8 with no more than the 115 remaining wells. We therefore stopped before reading any porosity value. One dataset is not a survey, but in this one the binding constraint on field validation was the error of the scoring reference, not the number of wells.
|
Teapot Dome (NPR-3, Wyoming; \citealp{bader2017teapot}) has 152 wells inside the 3-D survey with density logs across a common target interval. At most two of them have an independent time--depth reference, against the $3 + 11$ that the anchor-uncertainty and well-count conditions need at $-5$\,dB. The best alternative reference we could build, from interpreted horizons and formation tops, had a residual standard deviation of 6.75\,ms against a tolerance of 1.5\,ms, so we stopped before reading any porosity value (Appendix~\ref{sec:exp:teapot}). One dataset is not a survey, but in this one the binding constraint on field validation was the error of the scoring reference, not the number of wells.
|
||||||
|
|||||||
@@ -1,33 +1,67 @@
|
|||||||
\section{Discussion}
|
\section{Discussion}
|
||||||
\label{sec:discussion}
|
\label{sec:discussion}
|
||||||
|
|
||||||
\paragraph{What the synthetic experiments show.}
|
\paragraph{What held.}
|
||||||
The two experiments separate two questions that are easy to conflate. The first is whether the tie posterior is informative. The second is whether training on it helps. In Experiment~1 the posterior was not informative: 64 anchor-conditioned samples reweighted by tie likelihoods stayed as wide as the anchors allowed, and labels drawn from them were no better than a good correlation-based point tie. Once the posterior contracted (SMC, Experiment~2), labels at its mean beat every point tie in all three full-anchor regimes, and a bank of its samples gained further when the posterior was wide. Better registration of the training labels came first. Marginalizing over what remained then added a smaller, width-dependent gain. Neither result says that marginalization rescues a poor posterior, and Experiment~1 is direct evidence that it does not.
|
Two questions are easy to conflate: whether the tie posterior is informative, and whether training on it helps. Once the posterior contracted, labels at its mean beat the deterministic ties, and a bank of its samples added a smaller gain when the posterior was wide. Better registration came first, and marginalizing over what remained came second. At 10\,dB the advantage extended to stronger drift, a second backbone and the milder misspecified warp prior, and the theory predicted both the blur and the two-mode sign reversal. All of this holds when the data follow the model that the registration assumes.
|
||||||
|
|
||||||
|
\paragraph{What failed, and what each failure teaches.}
|
||||||
|
Table~\ref{tab:lessons} lists the failed tests. Three patterns recur. The training loss did not rescue a poor posterior: in Experiment~1 marginalizing improved on the posterior's mean but not on the best deterministic tie. A posterior that is confidently wrong was worse than a cruder tie, and on field data only independent times could reveal it. A field comparison needs skill, a reference and enough wells before its outcome means anything.
|
||||||
|
|
||||||
|
\begin{table}[!htbp]
|
||||||
|
\centering
|
||||||
|
\caption{Failed or limited tests, their causes and the resulting lessons. Causes marked $^\ast$ are consistent with the evidence but were not tested directly.}
|
||||||
|
\label{tab:lessons}
|
||||||
|
\small
|
||||||
|
\setlength{\tabcolsep}{3pt}
|
||||||
|
\begin{tabular}{>{\raggedright\arraybackslash}p{0.19\linewidth}>{\raggedright\arraybackslash}p{0.19\linewidth}>{\raggedright\arraybackslash}p{0.27\linewidth}>{\raggedright\arraybackslash}p{0.27\linewidth}}
|
||||||
|
\toprule
|
||||||
|
Test & Outcome & Cause & Lesson \\
|
||||||
|
\midrule
|
||||||
|
Anchor bank, Experiment~1 & 0 of 4 cells at $c = 1$ & Posterior did not contract: warp RMSE 3.25\,ms against 3.85\,ms for the correlation tie & Check on development data that the posterior beats the best deterministic tie in warp error. SMC reached 0.56\,ms \\
|
||||||
|
Anchor uncertainty halved or doubled & 0 of 2 cells in each arm (one setting) & Posterior miscalibrated both ways: coverage 0.62 and 0.52 against 0.89 & Estimate $\sigma_a$ from independent time--depth data outside the test set \\
|
||||||
|
Frequency-dependent wavelet phase & Ratio 1.023 and 1.042 & Constant-phase fit collapsed onto a wrong warp: coverage 0.17 and 0.10 & Compare the SMC mean warp with a correlation tie built with the statistical wavelet (untested), which degraded by at most 4\% \\
|
||||||
|
Unit-dependent rock physics & Ratio 0.940 and 0.934; missed 0.90 & Every method worsened (Oracle up to 1.84 times); registration still worked and the squared-error gain was largely kept & The tie posterior stays usable; judge gains in absolute error as well as by ratio \\
|
||||||
|
Advantage over the anchor mean at $-5$\,dB & 0 of 2 cells; ratios 0.98 and 0.97 & Seismic likelihood adds little to the anchors at low SNR$^\ast$ & Expect the SMC posterior to help mainly where the seismic constrains the tie \\
|
||||||
|
Calibration of seed ensembles & Under-coverage in every test & Seed spread carries no tie uncertainty; coverage fell with training length$^\ast$ & Do not read seed spread as tie uncertainty; propagate the posterior to new wells, for example through prediction in depth (not attempted) \\
|
||||||
|
F3 field test & 1 of 4 wells; coverage 0.52 and 0.61 & Little band skill (PCC 0.15); differences an eighth of the seed variation & Show band skill at blind wells before comparing ties \\
|
||||||
|
Volve field test & 2 and 3 of 6 wells; a constant beat every network & Between-well porosity level dominates: well means span 8.5\,p.u. & Compare with a constant first; the tie has little to act on otherwise \\
|
||||||
|
Teapot Dome & Stopped before any porosity value & Reference error 6.75\,ms against a 1.5\,ms tolerance & Choose field data by the reference, not the well count \\
|
||||||
|
\bottomrule
|
||||||
|
\end{tabular}
|
||||||
|
\end{table}
|
||||||
|
|
||||||
\paragraph{Where the bank gain comes from.}
|
\paragraph{Where the bank gain comes from.}
|
||||||
The theory gives a population limit, and whether the measured gains exceed it depends on the structure of the tie error. In population, a calibrated bank has the minimizer of training on the true labels (Proposition~\ref{prop:bank}), and no method improves on a point label by more than the factor $\rho^\star$ of \eqref{eq:rhostar}. Its distortion term is of fourth order in the tie error. For the Oracle predictions of Experiment~2 it sits near 70\,Hz, where a Berkson error distorts much more than a classical error of the same width (Section~\ref{sec:theory:post}). Under the registered bound for classical error, \mRML{} gained more than the limit allows in 7 of the 8 wide cells at $N = 16$. Under the bound for Berkson error, the natural idealization for labels at the posterior-mean warp, it did so in 3 cells at the posterior width and in at most 1 at the measured warp error of \mPM{} (Section~\ref{sec:exp:p2r}). In most cells the bank gain is therefore no larger than removing a population sharpening of \mPM{} could give, but this rests on an error structure that was not tested. On synthetic data the covariance test of Section~\ref{sec:theory:post} can settle it (Section~\ref{sec:exp:mech}). Finite-sample effects can add to this population effect or outweigh it: the label error itself is of first order, and its effect on the conditional variance that a network must absorb is of second order, against the fourth-order population distortion (Section~\ref{sec:theory:post}). Part of the gap to the Oracle is not caused by registration at all. At $c = 0$, with SMC warp errors of 0.2--0.7\,ms, the Oracle was still 1--3\% better than \mPM{}, and it was trained twice as long. \mRML{} closed 27--46\% of the gap between \mPM{} and the Oracle at $c = 1$, and it did not reach the Oracle in any wide cell at $N = 16$. Beyond the population correction, three mechanisms could contribute to the bank gain. The bank acts as label augmentation, and the learned variance absorbs its spread. For $\lambda > 0$ the responsibilities re-register the labels during training (Remark~\ref{rem:lambda}). A multimodal posterior gives the mean warp a non-Gaussian error, against which a bank can gain more than the Gaussian bound allows (Corollary~\ref{cor:twomode}). Until the exploratory analysis of Section~\ref{sec:exp:mech} is done, the bank gain is an empirical regularity of this benchmark whose source is not identified.
|
In population, no method improves on a point label by more than the factor $\rho^\star$ of \eqref{eq:rhostar}. The measured gains exceed the classical limit in most wide cells, but at $c = 1$, where the bulk offset has a Berkson error, they exceed the Berkson limit in three of four cells, by at most 0.015 (Section~\ref{sec:exp:p2r}). Finite-sample effects can add to this population effect or outweigh it. A Gaussian bank with only the first two moments obtained most of the gain in three of four cells at $c = 1$, the responsibilities re-registered the training labels, and no evidence under the primary criterion linked the gain to multimodality. The bank gain therefore remains an empirical regularity of this benchmark whose source is not identified.
|
||||||
|
|
||||||
\paragraph{When to use a bank rather than the posterior mean.}
|
\paragraph{Practical advice: training on an uncertain tie.}
|
||||||
Within this benchmark the answer depends on the posterior width. When the posterior is narrow ($\sigpost < 1.5$\,ms), \mRML{} and \mPM{} are equivalent within 1\% on average, so the bank costs little and brings nothing. When the posterior is wide, because of low SNR, sparse anchors or strong drift, \mRML{} passed in all eight wide cells at $N = 16$, and over all cells at $N = 16$ the gain grew with the width (Spearman $\rho = -0.85$). The bank is cheap: 64 labels per window add little to the cost of training. A practical rule is therefore to train with the bank whenever the tie posterior is wider than about 1.5\,ms. The largest gain at $c = 1$ came with sparse anchors (R10tb), where the posterior was overconfident and the bank was narrower than the error it was meant to represent, so in that regime the bank helped without being calibrated. On real data the width cannot be checked against a true warp, and it depends on $\sigma_a$.
|
These recommendations hold within this benchmark, where the data follow the registration's model.
|
||||||
|
\begin{enumerate}
|
||||||
|
\item \emph{Check the posterior first.} On development data with known timing, confirm that the posterior beats the best deterministic tie in warp error. If it does not, training on it did not help here (Section~\ref{sec:exp:diag}).
|
||||||
|
\item \emph{Estimate the anchor uncertainty from independent time--depth data outside the test set.} Every positive result of Experiment~2 assumes that $\sigma_a$ is known, so this is a precondition and the main risk. On F3 the markers are horizon-tie picks on the same seismic. A type-II estimate treats them as exact (0.4\,ms), while the spread between markers and horizons suggests 7\,ms. The two values place F3 at opposite ends of the $\sigpost$ axis, at about 0.6\,ms (narrow, like the 10\,dB setting) or 2.5--3.4\,ms (wide, close to $-5$\,dB). The arms at 3.5 and 14\,ms did not change the F3 outcome (Appendix~\ref{sec:exp:f3}).
|
||||||
|
\item \emph{Compare the posterior with a cruder tie.} A large disagreement between the SMC mean warp and a correlation tie built with the statistical wavelet would flag a wrong forward model. We did not test this check, and its usefulness depends on the baseline disagreement in well-specified cases, which we did not measure.
|
||||||
|
\item \emph{Choose by posterior width.} Below $\sigpost = 1.5$\,ms, the \mPM{} and the \mRML{} are equivalent within 1\% on average. Above it, the bank is the safer choice: it passed the no-margin rule in all eight wide cells at $N = 16$ and was better than the \mPM{} in 44 of the 52 wide cells of Experiment~3, the eight exceptions being at $N \le 4$ and within 1\%. Once the posterior exists, the bank adds little training cost: the network is evaluated once per window, and only the likelihood is evaluated for each of the 64 labels. A Gaussian bank with the posterior's mean and covariance came within 2.5\% of the SMC bank at $c = 1$. On real data the width cannot be checked against a true warp, and it depends on $\sigma_a$.
|
||||||
|
\item \emph{Do not read seed spread as tie uncertainty.} Every seed ensemble under-covered, and carrying the tie posterior to new wells needs another mechanism, for example prediction in depth through the warp posterior, which we did not attempt.
|
||||||
|
\end{enumerate}
|
||||||
|
|
||||||
\paragraph{The anchor uncertainty is the main risk.}
|
\paragraph{Practical advice: comparing tie methods in the field.}
|
||||||
Every positive result of Experiment~2 assumes that $\sigma_a$ is known. Halving or doubling it removed the H2a advantage in every cell and miscalibrated the posterior in both directions (Table~\ref{tab:sigmaa}). On F3 the time--depth markers are horizon-tie picks on the same seismic. A type-II estimate treats them as exact (0.4\,ms), while the spread between markers and horizons suggests 7\,ms. The two values place F3 at opposite ends of the $\sigpost$ axis, at about 0.6\,ms (narrow, like R10) or 2.5--3.4\,ms (wide, close to Rm5), and the arms at 3.5 and 14\,ms did not change the F3 outcome (Appendix~\ref{sec:exp:f3}). The width that decides between \mPM{} and \mRML{} inherits this dependence. An estimate of $\sigma_a$ from independent time--depth data at wells outside the test set is therefore a precondition for using the tie posterior, not a refinement of it.
|
Proposition~\ref{prop:reference} and the detectability analysis turn the field failures into four requirements, derived under the benchmark simulator.
|
||||||
|
\begin{enumerate}
|
||||||
\paragraph{What a field test of registration needs.}
|
\item \emph{A reference independent of the seismic and accurate to about 1\,ms.} To leading order, the measured advantage has the sign of the true one only if the reference error is below $1/\sqrt2$ times the tie error being detected (Corollary~\ref{cor:tolerance}), and power is lost well before that point. Check shots or a vertical seismic profile can in principle meet this requirement once their datum and statics are reconciled with the seismic; we did not test their accuracy. A reference tied by synthetic--seismic matching on the same seismic cannot, because its error is not independent of the predictions.
|
||||||
Proposition~\ref{prop:reference} and the detectability analysis (Section~\ref{sec:exp:detect}) turn the field failures into four requirements. They are derived under the simulator of the benchmark. First, the scoring reference must be independent of the seismic and accurate to about 1\,ms. To leading order, the measured advantage has the sign of the true one only if the reference error is below $1/\sqrt2$ times the tie error that the comparison is meant to detect (Corollary~\ref{cor:tolerance}), and power is lost well before that point. With an exact reference, a sign test reached a power of 0.8 with 5--18 blind wells in five of the six cells. At 1\,ms it needed 11--30 wells in four cells, and at 3\,ms or more no cell reached that power with 40 wells. Check shots or a vertical seismic profile can meet this requirement once their datum and statics are reconciled with the seismic. A reference tied by synthetic--seismic matching on the same seismic cannot, because its error is not independent of the predictions. Second, the number of blind wells should follow from a power analysis at the expected effect, and the pass rule should be a test. A rule of $k$ of $n$ wells is not one: with independent wells and no true difference, three of four passes with probability 0.31 and five of six with probability 0.11, and no one-sided sign test at $\alpha = 0.05$ can reject with four wells. Third, $\sigma_a$ must be estimated outside the test set (previous paragraph). Fourth, the networks must have skill in the seismic band at blind wells before registration can matter there. The two field cases that we tested meet none of the four. Teapot Dome, the one large dataset that we inventoried, has 152 wells but fails the first and the third: at most two of its wells have an independent time--depth reference, and the best reference that we could build from horizons and formation tops had a per-well error of 5--7\,ms (Section~\ref{sec:exp:scope}).
|
\item \emph{A number of blind wells set by a power analysis, with a test as the pass rule.} With an exact reference, a sign test reached a power of 0.8 with 5--18 blind wells in five of the six cells. At 1\,ms it needed 11--30 wells in four cells, and at 3\,ms or more no cell reached that power with 40 wells. Section~\ref{sec:exp:detect} works through one case.
|
||||||
|
\item \emph{An anchor uncertainty estimated outside the test set} (item 2 above).
|
||||||
\paragraph{What the field cases show.}
|
\item \emph{Networks with skill in the seismic band at blind wells,} shown before registration is compared.
|
||||||
Both field gates failed, but in neither case was the timing of the training labels what limited the error at the blind wells. On F3 the networks followed the low-frequency trend (total PCC about 0.5) but predicted little of the seismic band. The macro difference in band RMSE between \mRML{} and B3c-R, 0.016\,p.u., was an eighth of the variation between seeds (up to 0.13\,p.u.) and smaller than the shift produced by plausible alternative scoring references (up to 0.15\,p.u.). Two contrasts with the synthetic results suggest that the F3 band score was insensitive to the timing of the labels, although we did not test this. Without anchors, band RMSE nearly doubled in the synthetic test of H4 but fell slightly on F3 (1.247 against 1.272\,p.u.). The shift-bank losses B4a and B4b, 38--53\% worse than B3b in Experiment~1, had a lower band RMSE than every point tie on F3. The F3 label is, moreover, a linear function of the sonic at three of the four wells, so label and time axis share a source, which violates (A1). On Volve, whose label is density-driven, the error was dominated by the level of porosity, whose well means span 8.5\,p.u. The tie methods changed the macro RMSE by at most 0.25\,p.u.\ out of 6--7\,p.u., and a constant at the training-well mean beat every network (Appendix~\ref{sec:exp:volve}). Neither case is evidence against the synthetic results, and neither is evidence for them. They bound the scope of the paper: its claims about learning rest on the benchmark, and its claims about the field concern what a test there would need.
|
\end{enumerate}
|
||||||
|
The two field cases meet none of the four. Neither F3 nor Volve is evidence against the synthetic results, and neither is evidence for them. On F3 the macro difference in band RMSE between the \mRML{} and the phase-estimated correlation tie, 0.016\,p.u., was an eighth of the variation between seeds and smaller than the spread produced by plausible alternative scoring references. On Volve the tie methods changed the macro RMSE by at most 0.26\,p.u.\ out of 6--7\,p.u. Two contrasts suggest that the F3 band score was insensitive to the timing of the labels, although we did not test this. Without anchors, band RMSE nearly doubled in the synthetic test but fell slightly on F3 (1.247 against 1.272\,p.u.). The shift-bank losses, 38--53\% worse than the calibrated sonic in Experiment~1, had a lower band RMSE than every deterministic tie on F3. The F3 label is also a linear function of the sonic, so label and time axis share a source, which violates (A1). The claims of this paper about learning rest on the benchmark, and its claims about the field concern what a test there would need.
|
||||||
|
|
||||||
\paragraph{Limitations.}
|
\paragraph{Limitations.}
|
||||||
\begin{itemize}
|
\begin{itemize}
|
||||||
\item \textbf{One simulator.} Every confirmatory result comes from one generator, whose statistics and warp prior were estimated on F3. The registration methods use the warp family and the wavelet of the generator. They differ from it only in the prior hyperparameters, which are fitted to the training anchors or fixed, and in the estimated wavelet phase, so a misspecified warp family or wavelet has not been tested. \todo{S2 of \texttt{protocol\_bench} (three misspecification axes). If S2 is not locked and run before submission, call the study a controlled synthetic study, not a benchmark, throughout.}
|
\item \textbf{One simulator.} In the nominal cells the data follow the rock physics and the warp-prior family that the registration assumes, with a registration prior on the bulk offset wider than the truth, so the gains there are not estimates of the gains to expect on field data. Every confirmatory result comes from one generator family with statistics estimated on F3. Lateral heterogeneity, multiples, anisotropy and non-stationary noise were not simulated, and the misspecification levels are not calibrated to any field.
|
||||||
\item \textbf{Experiment~2 is a deviation.} It was pre-registered and run on new realizations, but it was designed after Experiment~1 had failed, and re-running was not among the options registered for that failure (Section~\ref{sec:exp:diag}).
|
\item \textbf{Band of the benchmark.} The learned predictors have coherent power mostly below about 25\,Hz, whereas the F3 seismic peaks near 60\,Hz. The measured sensitivities to timing error may therefore understate what a label with more high-frequency content would suffer.
|
||||||
\item \textbf{Strong drift.} At $c = 2$ the SMC posterior was multimodal and its mean was unstable between runs. These cells are reported but are not evidence.
|
\item \textbf{Dependence between tests.} Experiment~2 was designed after Experiment~1 had failed. Experiment~3 reuses its test realizations and SMC particles and was designed after the field tests and post hoc analyses. F3 also supplied the statistics of the generator, and the Volve test was designed after the F3 test had failed.
|
||||||
\item \textbf{Untested stresses.} The bulk-offset prior $\sigma_b$ was not varied, and the anchor-free losses B4a--B4d were not rerun with the SMC posterior. \todo{S3 (B4 under the SMC posterior) and S8 (controlled cycle-skip regime).}
|
\item \textbf{The $\lambda \to 0$ objective was not trained.} Every bank used $\lambda = 1/\tau_c$, where RML is not near the limit analysed in Section~\ref{sec:theory:post}, and neither MSE on the bank-mean label nor the $\lambda \to 0$ loss was run. The tempering is a heuristic fixed in advance.
|
||||||
\item \textbf{Monte Carlo variability.} At low SNR the SMC run-to-run stability criterion failed in one of four development cells at $c = 1$, mainly through the phase estimate. This variability is small relative to $\sigpost$, but it was not removed.
|
\item \textbf{Strong drift.} At $c = 2$ the mean warp of the SMC posterior was unstable between runs and the posterior was often multimodal. These cells are not primary evidence for the posterior-mean claim.
|
||||||
\item \textbf{Uncertainty quantification.} Seed ensembles under-covered for every method ($\xi$ of 0.19--0.66 at R10, $c = 1$, $N = 16$), and more so for better labels and longer training. Because training length and label source are confounded, parts (b) and (c) of Proposition~\ref{prop:coverage} remain untested. On F3 the macro 80\% coverage of every probabilistic method was 0.38--0.52, and on Volve 0.29--0.39. Carrying the tie posterior to predictive uncertainty at a new well needs a different mechanism, for example prediction in depth through the warp posterior. We did not attempt this.
|
\item \textbf{Untested stresses.} Experiment~3 did not vary the anchor uncertainty, varied the bulk-offset prior only together with the other drift hyperparameters, and tested cycle skipping only in an idealized two-mode form. At low SNR the SMC stability criterion failed in one of four development cells at $c = 1$, mainly through the phase estimate.
|
||||||
\item \textbf{The tempering $\lambda$.} $\lambda = 1/\tau_c$ is a heuristic fixed in advance. We did not compare it with alternatives and make no claim about it.
|
\item \textbf{Uncertainty quantification.} Seed ensembles under-covered for every method ($\xi$ of 0.19--0.66 at 10\,dB, $c = 1$, $N = 16$; on F3 the macro 80\% coverage of every pre-registered probabilistic method was 0.38--0.52, on Volve 0.29--0.39). Because training length and label source are confounded, the population statements of Proposition~\ref{prop:coverage} for the point label and the calibrated bank remain untested.
|
||||||
\item \textbf{One backbone.} All learned methods share one CNN--GRU; only two F3 ablations used a second, purely convolutional backbone (Table~\ref{tab:f3abl}). Assumption (B) of Proposition~\ref{prop:ident} holds only approximately for it. \todo{S4 (second backbone).}
|
\item \textbf{Backbone.} Apart from two F3 ablations, the only second backbone is the TCN, in three settings; it was weaker and selected the smallest budget, so this is a check of robustness. Assumption (A3) holds only approximately for either backbone.
|
||||||
\item \textbf{Detectability.} Section~\ref{sec:exp:detect} rescored predictions with the skill of Experiment~2 against references whose errors are smooth and independent of the predictions. Its numbers of wells hold for predictors of comparable skill. A reference tied on the same seismic adds a covariance with the predictions that we did not model.
|
\item \textbf{Detectability.} The analysis rescored predictions with the skill of Experiment~2 against references whose errors are smooth and independent of the predictions. A reference tied on the same seismic adds a covariance with the predictions that we did not model.
|
||||||
\end{itemize}
|
\end{itemize}
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
\section{Conclusions}
|
\section{Conclusions}
|
||||||
\label{sec:conclusion}
|
\label{sec:conclusion}
|
||||||
|
|
||||||
A well tie is an uncertain estimate, yet learning workflows treat it as exact. Its error is an error in the time index of the label. Under an independence assumption, the error convolves the optimal predictor with its distribution and blurs the seismic band, and without time anchors the absolute timing of a network and its label alignment is not identified. An estimated tie can have the classical error structure, which blurs the learned predictor, or the Berkson structure, which sharpens it. A calibrated bank of posterior labels removes both biases in population, but its population gain over a point label is of fourth order in the tie error.
|
A well tie is an uncertain estimate, yet learning workflows treat it as exact. Treating its error as an error in the time index of the label explains two opposite effects: timing errors independent of the data blur the optimal predictor, whereas the error of a posterior-mean tie sharpens it in a linear-Gaussian model. For Gaussian errors, a calibrated bank of posterior labels has a population gain of only fourth order in the tie error, so finite-sample effects can dominate.
|
||||||
|
|
||||||
On a registration-aware synthetic benchmark calibrated to F3, the first pre-registered comparison failed because the anchor-only posterior was not informative. In the second, designed after that failure, labels at the mean of a sequential Monte Carlo tie posterior beat the best point tie by 8--22\% in seismic-band RMSE, provided that the anchor uncertainty was correctly specified. Training on the posterior bank gained further when the posterior was wide. Under the Berkson error structure that is natural for a posterior-mean tie, the gain stayed within the population limit in most cells. That structure was not tested, and the experiments do not separate the population effect from finite-sample effects of the bank.
|
On synthetic data calibrated to F3, the outcome depended first on the tie posterior. A posterior that did not contract gave no gain, and one that did gave labels with 8--22\% lower seismic-band RMSE than the best deterministic tie. That advantage required a correct anchor uncertainty, in the one setting tested, and a wavelet phase within the tie model. It held at stronger drift, with a second backbone and under the milder of two misspecified warp priors. A bank of posterior samples added a smaller gain when the posterior was wide, and a two-mode label error reversed the sign of the learned seismic band as predicted.
|
||||||
|
|
||||||
Whether such gains hold on field data is a question that the public datasets we examined cannot answer. A blind-well comparison of tie methods needs a reference that is independent of the seismic and accurate to about 1\,ms, enough blind wells for a test with adequate power, an anchor uncertainty estimated outside the test set, and networks with skill in the seismic band. The F3 and Volve tests met none of these conditions and failed, and Teapot Dome has independent time--depth references at no more than two of its 152 wells. We claim no improvement on field data and no calibrated uncertainty. The benchmark, the locked protocols and the detectability analysis are the means to test such claims once a dataset that meets these conditions is available.
|
Whether such gains hold on field data remains open. F3 and Volve showed no consistent improvement, and Teapot Dome has independent time--depth references at no more than two of the 152 wells with density logs across its target inside the 3-D survey. A field comparison of tie methods needs a reference independent of the seismic and accurate to about 1\,ms, enough blind wells for a test with adequate power, an anchor uncertainty estimated outside the test set, and networks with skill in the seismic band. The benchmark, the locked protocols and the detectability analysis allow these gains to be tested once a dataset that meets these conditions is available.
|
||||||
|
|
||||||
\paragraph{Data and code availability.}
|
\paragraph{Data and code availability.}
|
||||||
The F3 Netherlands data are publicly available from dGB Earth Sciences under a CC BY-SA 3.0 licence. The Volve data are available from Equinor under a CC BY-NC-SA 4.0 licence. The Teapot Dome data (RMOTC, U.S.\ Department of Energy) are available from the Texas Data Repository \citep{bader2017teapot}. \todo{Verify the three licences on the providers' pages at submission (Teapot: recorded as CC0 in the project notes).} The code, locked protocols, synthetic generator configurations and the scripts that produce every table and figure are available at \todo{repository URL and archived DOI}.
|
The F3 Demo 2023 data are available from dGB Earth Sciences through the TerraNubis portal under a CC BY-SA 3.0 licence \citep{dgb2023f3demo}. The Volve data are available from Equinor \citep{equinor2018volve}; the licence files of the release name CC BY-NC-SA 4.0, and the data owners are Equinor, ExxonMobil, Bayerngas and the Norwegian Petroleum Directorate. The Teapot Dome data (RMOTC, U.S.\ Department of Energy) are available from the Texas Data Repository \citep{bader2017teapot}. \todo{Verify the Teapot licence on the repository page at submission (recorded as CC0 in the project notes). F3 and Volve were checked on the providers' pages on 2 November 2026.} The code, locked protocols, synthetic generator configurations and the scripts that produce every table and figure are available at \todo{repository URL and archived DOI}. The derived data from which every table and figure is computed (summaries, run-level metrics, saved test predictions and the descriptive F3 porosity volume) are archived with a manifest of SHA-256 hashes at \todo{archive DOI}, in separate archives for the F3-derived and synthetic data (CC BY-SA 3.0) and for the Volve-derived data (CC BY-NC-SA 4.0). A clean-room check recomputes the summaries, verdicts, post hoc tables and figures from the code and these archives alone, without raw seismic data. The benchmark package contains 630 tasks on the test realizations 8--15 and the development realizations 900--905, each with its inputs and its hidden true warps and labels, together with the reference results of 21 methods and a scorer that applies the locked rules; it is archived at \todo{Zenodo DOI; licence inherited from F3 (CC BY-SA 3.0), to be confirmed}.
|
||||||
|
|
||||||
\paragraph{Computer code availability.}
|
\paragraph{Computer code availability.}
|
||||||
\todo{Required by Computers \& Geosciences. Fields in the journal's template (unverified against the current guide): name of the code; developers and contact (e-mail, phone); year first available; hardware requirements (development on an NVIDIA RTX 3060 12\,GB and an H200); software required (Python 3.12, PyTorch; give the versions of the environment locks); program language; program size; licence; repository link.}
|
\todo{Required by Computers \& Geosciences. Fields in the journal's template (unverified against the current guide): name of the code; developers and contact (e-mail, phone); year first available; hardware requirements (development on an NVIDIA RTX 3060 12\,GB and an H200); software required (Python 3.12, PyTorch; give the versions of the environment locks); program language; program size; licence; repository link.}
|
||||||
@@ -23,4 +23,4 @@ The F3 Netherlands data are publicly available from dGB Earth Sciences under a C
|
|||||||
\todo{Elsevier requires authors to disclose the use of generative AI in preparing the manuscript. The authors must write this statement.}
|
\todo{Elsevier requires authors to disclose the use of generative AI in preparing the manuscript. The authors must write this statement.}
|
||||||
|
|
||||||
\paragraph{Acknowledgements.}
|
\paragraph{Acknowledgements.}
|
||||||
\todo{Acknowledgements and funding.}
|
We thank dGB Earth Sciences for making the F3 data available as an OpendTect project via their TerraNubis portal (terranubis.com), and Equinor and the former Volve licence partners (ExxonMobil and Bayerngas) and the Norwegian Petroleum Directorate for releasing the Volve data. \todo{Other acknowledgements and funding.}
|
||||||
|
|||||||
@@ -1,74 +1,248 @@
|
|||||||
\section{Proofs}
|
\section{Formal results and proofs}
|
||||||
\label{app:proofs}
|
\label{app:proofs}
|
||||||
|
|
||||||
\subsection{Proposition~\ref{prop:blur}}
|
This appendix states the results of Section~\ref{sec:theory} formally, in the order of that section, and proves them. The Fourier transform is $\hat g(f) = \int g(t)\,e^{-i2\pi f t}\dd t$, $T_\beta h(t) = h(t-\beta)$ is a time shift, and $a_b = Ba$ is the seismic-band part of $a$. In the experiments $B$ is a fourth-order Butterworth filter applied forward and backward (zero phase). Its response is real and non-negative, so every result below holds with $S$ replaced by $|H_B|^2 S$.
|
||||||
By (A1), $\E[y(t+\delta(t))\mid X, \delta(t) = d] = \E[y(t+d)\mid X] = m(t+d)$. Taking the expectation over $\delta(t) \sim p_t$, which is independent of $X$, and exchanging the order of integration (Fubini, using (A2)) gives $\hat y^\star(t) = \int p_t(d)\, m(t+d)\dd d$. If $p_t \equiv p$, the Fourier transform of $m(\cdot + d)$ is $e^{i2\pi f d}\hat m(f)$, so $\hat y^\star$ has transform $P(f)\hat m(f)$ with $P(f) = \E e^{i2\pi f\delta}$. For $\delta \sim \N(\mu_\delta, \sigma^2)$, $P$ is the Gaussian characteristic function evaluated at $2\pi f$. \hfill$\square$
|
|
||||||
|
|
||||||
If the marginal distribution changes slowly with $t$ (for example, drift that grows with depth), $\hat y^\star$ is a time-varying filter that is locally $P$ with $\sigma(t)$.
|
\subsection{Blur}
|
||||||
|
|
||||||
\subsection{Corollary~\ref{cor:band}}
|
\begin{proposition}[Blur]
|
||||||
Let $e = y - m$. Since $\E[e(t)\mid X] = 0$ and $m(t')$ is a function of $X$, $\Cov(e(t), m(t')) = 0$ for all $t, t'$. Hence $S_{ym} = S_m$ and $S_y = S_m + S_e$. The band operator $B$ commutes with the filter $P$. Because $\delta$ is real, $P(-f) = P(f)^*$. Therefore
|
\label{prop:blur}
|
||||||
|
Assume (A1) that for every $t$, $\delta(t)$ is independent of $(X, y(\cdot))$ with distribution $p_t$, and (A2) that $\sup_t\E[y(t)^2] < \infty$. Then the MSE-optimal predictor of the observed label is
|
||||||
|
\begin{equation}
|
||||||
|
\tilde m(t) = \E[\tilde y(t)\mid X] = \int p_t(d)\, m(t+d)\dd d .
|
||||||
|
\end{equation}
|
||||||
|
If $p_t \equiv p$, then $\tilde m$ is $m$ passed through a linear time-invariant filter with frequency response equal to the characteristic function of $\delta$,
|
||||||
|
\begin{equation}
|
||||||
|
P(f) = \E\big[e^{i2\pi f\delta}\big], \qquad \delta \sim \N(\mu_\delta, \sigma^2) \;\Rightarrow\; P(f) = e^{i2\pi f\mu_\delta}\, e^{-2\pi^2\sigma^2 f^2}.
|
||||||
|
\label{eq:transfer}
|
||||||
|
\end{equation}
|
||||||
|
\end{proposition}
|
||||||
|
|
||||||
|
\noindent\emph{Proof.} By (A1), $\E[y(t+\delta(t))\mid X, \delta(t) = d] = \E[y(t+d)\mid X] = m(t+d)$. Taking the expectation over $\delta(t) \sim p_t$, which is independent of $X$, and exchanging the order of integration (Fubini, using (A2)) gives $\tilde m(t) = \int p_t(d)\, m(t+d)\dd d$. If $p_t \equiv p$, the Fourier transform of $m(\cdot + d)$ is $e^{i2\pi f d}\hat m(f)$, so $\tilde m$ has transform $P(f)\hat m(f)$ with $P(f) = \E e^{i2\pi f\delta}$. For $\delta \sim \N(\mu_\delta, \sigma^2)$, $P$ is the Gaussian characteristic function evaluated at $2\pi f$. \hfill$\square$
|
||||||
|
|
||||||
|
If the marginal distribution changes slowly with $t$ (for example, drift that grows with depth), $\tilde m$ is a time-varying filter that is locally $P$ with $\sigma(t)$.
|
||||||
|
|
||||||
|
|
||||||
|
\subsection{Seismic-band bounds}
|
||||||
|
|
||||||
|
\begin{corollary}[Seismic-band bounds]
|
||||||
|
\label{cor:band}
|
||||||
|
Let $\langle h\rangle = \int_{|f|\ge f_c} h\, S_{m}\dd f \big/ \int_{|f|\ge f_c} S_{m}\dd f$. Then
|
||||||
|
\begin{equation}
|
||||||
|
\frac{\sd \tilde m_b}{\sd y_b} \le \sqrt{\langle |P|^2\rangle} \le \sup_{|f|\ge f_c}|P(f)|,
|
||||||
|
\qquad
|
||||||
|
\PCC_b(\tilde m) = \kappa(P)\,\PCC_b(m), \quad \kappa(P) = \frac{\langle \operatorname{Re} P\rangle}{\sqrt{\langle|P|^2\rangle}} \le 1 ,
|
||||||
|
\end{equation}
|
||||||
|
with equality in $\kappa$ if and only if $P$ is a positive constant on the support of $S_{m_b}$.
|
||||||
|
\end{corollary}
|
||||||
|
|
||||||
|
\noindent\emph{Proof.} Let $e = y - m$. Since $\E[e(t)\mid X] = 0$ and $m(t')$ is a function of $X$, $\Cov(e(t), m(t')) = 0$ for all $t, t'$. Hence $S_{ym} = S_m$ and $S_y = S_m + S_e$. The band operator $B$ commutes with the filter $P$. Because $\delta$ is real, $P(-f) = P(f)^*$. Therefore
|
||||||
\begin{equation*}
|
\begin{equation*}
|
||||||
\Var \hat y_b = \int_{|f|\ge f_c} |P|^2 S_m \dd f, \qquad \Cov(\hat y_b, y_b) = \int_{|f|\ge f_c} \operatorname{Re}P\, S_m \dd f .
|
\Var \tilde m_b = \int_{|f|\ge f_c} |P|^2 S_m \dd f, \qquad \Cov(\tilde m_b, y_b) = \int_{|f|\ge f_c} \operatorname{Re}P\, S_m \dd f .
|
||||||
\end{equation*}
|
\end{equation*}
|
||||||
With $\langle\cdot\rangle$ the average weighted by $S_{m_b}$,
|
With $\langle\cdot\rangle$ the average weighted by $S_{m_b}$,
|
||||||
\begin{equation*}
|
\begin{equation*}
|
||||||
\frac{\sd\hat y_b}{\sd y_b} = \sqrt{\langle|P|^2\rangle}\,\frac{\sd m_b}{\sd y_b} \le \sqrt{\langle|P|^2\rangle} \le \sup_{|f|\ge f_c}|P(f)|,
|
\frac{\sd\tilde m_b}{\sd y_b} = \sqrt{\langle|P|^2\rangle}\,\frac{\sd m_b}{\sd y_b} \le \sqrt{\langle|P|^2\rangle} \le \sup_{|f|\ge f_c}|P(f)|,
|
||||||
\qquad
|
\qquad
|
||||||
\PCC_b(\hat y^\star) = \frac{\langle\operatorname{Re}P\rangle}{\sqrt{\langle|P|^2\rangle}}\,\frac{\sd m_b}{\sd y_b},
|
\PCC_b(\tilde m) = \frac{\langle\operatorname{Re}P\rangle}{\sqrt{\langle|P|^2\rangle}}\,\frac{\sd m_b}{\sd y_b},
|
||||||
\end{equation*}
|
\end{equation*}
|
||||||
and $\PCC_b(m) = \sd m_b/\sd y_b \le 1$ because $\Cov(m_b, y_b) = \Var m_b$. By Cauchy--Schwarz, $\kappa(P) \le \langle|P|\rangle/\sqrt{\langle|P|^2\rangle} \le 1$, with equality if and only if $P$ is a positive constant on the support of $S_{m_b}$. At each frequency with $P(f) \ne 0$ the coherence is $|S_{\hat y y}|^2/(S_{\hat y}S_y) = S_m/S_y$, which does not depend on $P$. If $\mu_\delta \ne 0$, $\operatorname{Re}P = e^{-2\pi^2\sigma^2 f^2}\cos(2\pi f\mu_\delta)$, which lowers $\kappa$ further. \hfill$\square$
|
and $\PCC_b(m) = \sd m_b/\sd y_b \le 1$ because $\Cov(m_b, y_b) = \Var m_b$. By Cauchy--Schwarz, $\kappa(P) \le \langle|P|\rangle/\sqrt{\langle|P|^2\rangle} \le 1$, with equality if and only if $P$ is a positive constant on the support of $S_{m_b}$. At each frequency with $P(f) \ne 0$ the coherence is $|S_{\tilde m y}|^2/(S_{\tilde m}S_y) = S_m/S_y$, which does not depend on $P$. If $\mu_\delta \ne 0$, $\operatorname{Re}P = e^{-2\pi^2\sigma^2 f^2}\cos(2\pi f\mu_\delta)$, which lowers $\kappa$ further. \hfill$\square$
|
||||||
|
|
||||||
\subsection{Corollary~\ref{cor:var}}
|
|
||||||
Moments are averaged over $t$ in the window, and $h$ ranges over functions of $X$ with finite variance. Since $\hat y^\star = \E[\tilde y\mid X]$, $\E\|h - \tilde y\|^2 = \E\|h - \hat y^\star\|^2 + \E\|\hat y^\star - \tilde y\|^2$. Fix $\E h$ and $\Var h = v$. Then $\E\|h - \hat y^\star\|^2 = (\E h - \E\hat y^\star)^2 + v + \Var\hat y^\star - 2\Cov(h, \hat y^\star)$, which is smallest when the covariance is largest. By Cauchy--Schwarz, $\Cov(h, \hat y^\star) \le \sqrt{v\Var\hat y^\star}$, with equality if and only if $h - \E h = a(\hat y^\star - \E\hat y^\star)$ with $a = \sqrt{v/\Var\hat y^\star}$. Optimizing over $(\E h, v)$ then only selects $a$ and a constant. \hfill$\square$
|
|
||||||
|
|
||||||
For $a > 0$, $h^\star$ has the same PCC and band PCC as $\hat y^\star$, and its in-band spectrum is $a^2|P|^2 S_m$. The statement holds at the population level for a sufficiently rich model class.
|
\subsection{Variance matching}
|
||||||
|
|
||||||
\subsection{Proposition~\ref{prop:ident}}
|
\begin{corollary}[Variance matching rescales amplitude only]
|
||||||
Since $t_{u + \beta e_b}(z) = t_u(z) + \beta$, we have $z_{u+\beta e_b}(t) = z_u(t - \beta)$ and hence $y^{u + \beta e_b} = T_\beta y^u$. By (B), $\mu_{\theta'} = T_\beta\mu_\theta$ and $\sigma_{\theta'} = T_\beta\sigma_\theta$. The Gaussian log-likelihood on a window $I$ is $\sum_{i\in I}\log\N(y(t_i - \beta); \mu(t_i-\beta), \sigma^2(t_i-\beta))$, which is the log-likelihood on the window $I - \beta$. Summed over windows that tile the trace, the two objectives differ only at edge samples. The log-sum-exp of RML preserves this invariance, because every bank member is shifted by the same amount. The prior on $g$ is unchanged, because $g$ is unchanged. This proves (a). Parts (b) and (c) follow by direct computation from $t_{u+\beta e_b}(z_{wk}) = t_{u_w}(z_{wk}) + \beta$. The prior adds $-\sum_w (b_w + \beta)^2/(2\sigma_b^2)$, with curvature $N/\sigma_b^2$. The anchors add $-\sum_{w,k}(t_{wk} - t_{u_w}(z_{wk}) - \beta)^2/(2\sigma_a^2)$, with curvature $\sum_w K_w/\sigma_a^2$. The expression for $\sd(\beta)$ is the inverse square root of the total curvature, that is, a quadratic approximation along the ridge. \hfill$\square$
|
\label{cor:var}
|
||||||
|
Consider $J(h) = \E\|h - \tilde y\|^2 + \Psi(\E h, \Var h)$ over predictors $h$ that are functions of $X$, where $\Psi$ is any penalty on the mean and variance of the prediction (for example a penalty on the standard-deviation ratio). Every minimizer satisfies $h^\star - \E h^\star = a\,(\tilde m - \E\tilde m)$ for some $a \ge 0$.
|
||||||
|
\end{corollary}
|
||||||
|
|
||||||
\subsection{Proposition~\ref{prop:tie}}
|
\noindent\emph{Proof.} Moments are averaged over $t$ in the window, and $h$ ranges over functions of $X$ with finite variance. Since $\tilde m = \E[\tilde y\mid X]$, $\E\|h - \tilde y\|^2 = \E\|h - \tilde m\|^2 + \E\|\tilde m - \tilde y\|^2$. Fix $\E h$ and $\Var h = v$. Then $\E\|h - \tilde m\|^2 = (\E h - \E\tilde m)^2 + v + \Var\tilde m - 2\Cov(h, \tilde m)$, which is smallest when the covariance is largest. By Cauchy--Schwarz, $\Cov(h, \tilde m) \le \sqrt{v\Var\tilde m}$, with equality if and only if $h - \E h = a(\tilde m - \E\tilde m)$ with $a = \sqrt{v/\Var\tilde m}$. Optimizing over $(\E h, v)$ then only selects $a$ and a constant. \hfill$\square$
|
||||||
(a) Conditional on $X$ and $\delta(t) = d$, independence gives $\E[y(t+d)\mid X, \delta(t) = d] = m(t+d)$ and $\E[y(t+d)^2\mid X, \delta(t) = d] = \E[y(t+d)^2\mid X]$. Integrating over $p_t(\cdot\mid X)$ (Fubini, using (A2)) gives $\tilde m(t)$ and $\E[\tilde y(t)^2\mid X] = \int p_t(d\mid X)\{\Var(y(t+d)\mid X) + m(t+d)^2\}\dd d$. Subtracting $\tilde m(t)^2$ gives the variance.
|
|
||||||
|
For $a > 0$, $h^\star$ has the same PCC and band PCC as $\tilde m$, and its in-band spectrum is $a^2|P|^2 S_m$. The statement holds at the population level for a sufficiently rich model class.
|
||||||
|
|
||||||
|
|
||||||
|
\subsection{Identifiability}
|
||||||
|
|
||||||
|
Consider $N$ training wells with seismic $X_w$, depth logs $\phi_w$ and warps $u_w = (b_w, g_w)$ (Section~\ref{sec:method:prior}). Let $y^{u}(t) = (\aaf\phi)(z_u(t))$ be the label under warp $u$, where $z_u$ inverts $t_u$ and $\aaf$ is an anti-alias filter. Let $e_b$ be the direction that adds the same $\beta$ to every $b_w$. The joint MAP objective over network parameters $\theta$ and warps $\mathbf{u}$ is
|
||||||
|
\begin{equation}
|
||||||
|
\mathcal J(\theta, \mathbf u) = \sum_w \Big[\mathcal L_w(\theta; y_w^{u_w}) + \log p(u_w) + \sum_k \log \N\big(t_{wk};\, t_{u_w}(z_{wk}),\, \sigma_a^2\big)\Big],
|
||||||
|
\end{equation}
|
||||||
|
with Gaussian log-likelihood $\mathcal L_w$ over windows and anchors $(z_{wk}, t_{wk})$. The network outputs $\mu_\theta$ and $\sigma_\theta$ are those of Section~\ref{sec:method:rml}.
|
||||||
|
|
||||||
|
\begin{proposition}[Identifiability]
|
||||||
|
\label{prop:ident}
|
||||||
|
Assume (A3) that the model class is closed under output shifts: for each $\theta$ and each shift $\beta$ by a whole number of samples with $|\beta| \le \beta_{\max}$ there is $\theta'$ with $\mu_{\theta'} = T_\beta \mu_\theta$ and $\sigma_{\theta'} = T_\beta\sigma_\theta$. Then, up to window-edge effects:
|
||||||
|
\begin{enumerate}
|
||||||
|
\item[(a)] without anchors, with a flat prior on $b$ and no seismic tie term, $\mathcal J(\theta', \mathbf u + \beta e_b) = \mathcal J(\theta, \mathbf u)$, so the objective has a ridge in $\beta$ shared by all wells;
|
||||||
|
\item[(b)] a prior $b_w \sim \N(0, \sigma_b^2)$ adds curvature $N/\sigma_b^2$ along the ridge;
|
||||||
|
\item[(c)] anchors with finite $\sigma_a$ add curvature $\sum_w K_w/\sigma_a^2$, where $K_w$ is the number of anchors at well $w$, so that the spread of $\beta$ along the ridge, with the other parameters held fixed, is
|
||||||
|
\begin{equation}
|
||||||
|
\sd(\beta) \approx \Big(\frac{\sum_w K_w}{\sigma_a^2} + \frac{N}{\sigma_b^2}\Big)^{-1/2} \approx \frac{\sigma_a}{\sqrt{\sum_w K_w}} .
|
||||||
|
\end{equation}
|
||||||
|
\end{enumerate}
|
||||||
|
\end{proposition}
|
||||||
|
|
||||||
|
\noindent\emph{Proof.} Since $t_{u + \beta e_b}(z) = t_u(z) + \beta$, we have $z_{u+\beta e_b}(t) = z_u(t - \beta)$ and hence $y^{u + \beta e_b} = T_\beta y^u$. By (A3), $\mu_{\theta'} = T_\beta\mu_\theta$ and $\sigma_{\theta'} = T_\beta\sigma_\theta$. The Gaussian log-likelihood on a window $I$ is $\sum_{i\in I}\log\N(y(t_i - \beta); \mu(t_i-\beta), \sigma^2(t_i-\beta))$, which is the log-likelihood on the window $I - \beta$. Summed over windows that tile the trace, the two objectives differ only at edge samples. The log-sum-exp of RML preserves this invariance, because every bank member is shifted by the same amount. The prior on $g$ is unchanged, because $g$ is unchanged. This proves (a). Parts (b) and (c) follow by direct computation from $t_{u+\beta e_b}(z_{wk}) = t_{u_w}(z_{wk}) + \beta$. The prior adds $-\sum_w (b_w + \beta)^2/(2\sigma_b^2)$, with curvature $N/\sigma_b^2$. The anchors add $-\sum_{w,k}(t_{wk} - t_{u_w}(z_{wk}) - \beta)^2/(2\sigma_a^2)$, with curvature $\sum_w K_w/\sigma_a^2$. The expression for $\sd(\beta)$ is the inverse square root of the total curvature, that is, a quadratic approximation along the ridge with the other parameters fixed. In a Gaussian approximation this conditional variance is at most the marginal variance of $\beta$, by the law of total variance. \hfill$\square$
|
||||||
|
|
||||||
|
|
||||||
|
\subsection{Two error structures}
|
||||||
|
|
||||||
|
With $D$, $\hat u$, $\delta$, $\varepsilon$ and $Q$ as in Section~\ref{sec:theory:post}, eq.~\eqref{eq:twoerrors}:
|
||||||
|
|
||||||
|
\begin{proposition}[Two error structures]
|
||||||
|
\label{prop:tie}
|
||||||
|
Assume (A2) for $y$ and $\tilde y$.
|
||||||
|
\begin{enumerate}
|
||||||
|
\item[(a)] \emph{Classical error.} If $\delta(t)$ is independent of $y(\cdot)$ given $X$, with conditional distribution $p_t(\cdot\mid X)$, then
|
||||||
|
\begin{gather*}
|
||||||
|
\tilde m(t) = \int p_t(d\mid X)\, m(t+d)\dd d, \\
|
||||||
|
\Var\big(\tilde y(t)\mid X\big) = \int p_t(d\mid X)\Var\big(y(t+d)\mid X\big)\dd d + \Var_{p_t}\!\big[m(t+d)\big].
|
||||||
|
\end{gather*}
|
||||||
|
\item[(b)] \emph{Berkson error.} If $\varepsilon(t)$ is independent of $D$ given $X$, with conditional distribution $q_t(\cdot\mid X)$, then
|
||||||
|
\begin{gather*}
|
||||||
|
m(t) = \int q_t(e\mid X)\, \tilde m(t+e)\dd e, \\
|
||||||
|
\Var\big(y(t)\mid X\big) = \int q_t(e\mid X)\Var\big(\tilde y(t+e)\mid X\big)\dd e + \Var_{q_t}\!\big[\tilde m(t+e)\big].
|
||||||
|
\end{gather*}
|
||||||
|
\end{enumerate}
|
||||||
|
If $p_t$ and $q_t$ do not depend on $t$, then, averaged over the window and up to edge terms, the point label has the larger conditional variance under (a) and the smaller under (b). If they depend on neither $t$ nor $X$, then $\tilde m$ is $m$ filtered by $P$ under (a), and $m$ is $\tilde m$ filtered by $Q$ under (b). For zero-mean Gaussian errors with variance $\sigma^2$, the transfer from $m$ to $\tilde m$ is $e^{-2\pi^2\sigma^2 f^2}$ under (a) and $e^{+2\pi^2\sigma^2 f^2}$ under (b).
|
||||||
|
\end{proposition}
|
||||||
|
|
||||||
|
The Gaussian Berkson case is self-consistent only if $S_m$ decays faster than $e^{-4\pi^2\sigma^2f^2}$; otherwise $\tilde m$ would have infinite variance, contrary to (A2).
|
||||||
|
|
||||||
|
\noindent\emph{Proof.} (a) Conditional on $X$ and $\delta(t) = d$, independence gives $\E[y(t+d)\mid X, \delta(t) = d] = m(t+d)$ and $\E[y(t+d)^2\mid X, \delta(t) = d] = \E[y(t+d)^2\mid X]$. Integrating over $p_t(\cdot\mid X)$ (Fubini, using (A2)) gives $\tilde m(t)$ and $\E[\tilde y(t)^2\mid X] = \int p_t(d\mid X)\{\Var(y(t+d)\mid X) + m(t+d)^2\}\dd d$. Subtracting $\tilde m(t)^2$ gives the variance.
|
||||||
|
|
||||||
(b) $\tilde y$ is a function of $D$ because $\hat u$ is. Since $\varepsilon(t)$ is independent of $D$ given $X$, $\E[y(t)\mid D] = \E[\tilde y(t + \varepsilon(t))\mid D] = \int q_t(e\mid X)\,\tilde y(t+e)\dd e$, and in the same way $\E[y(t)^2\mid D] = \int q_t(e\mid X)\,\tilde y(t+e)^2\dd e$. Because $X$ is a function of $D$, the tower property gives $m(t) = \E\big[\E[y(t)\mid D]\mid X\big] = \int q_t(e\mid X)\,\tilde m(t+e)\dd e$, and the same for the second moment. Subtracting $m(t)^2$ gives the variance.
|
(b) $\tilde y$ is a function of $D$ because $\hat u$ is. Since $\varepsilon(t)$ is independent of $D$ given $X$, $\E[y(t)\mid D] = \E[\tilde y(t + \varepsilon(t))\mid D] = \int q_t(e\mid X)\,\tilde y(t+e)\dd e$, and in the same way $\E[y(t)^2\mid D] = \int q_t(e\mid X)\,\tilde y(t+e)^2\dd e$. Because $X$ is a function of $D$, the tower property gives $m(t) = \E\big[\E[y(t)\mid D]\mid X\big] = \int q_t(e\mid X)\,\tilde m(t+e)\dd e$, and the same for the second moment. Subtracting $m(t)^2$ gives the variance.
|
||||||
|
|
||||||
If $p_t = p(\cdot\mid X)$ does not depend on $t$, the window average of $\int p(d\mid X)\Var(y(t+d)\mid X)\dd d$ is $\int p(d\mid X)\,|W|^{-1}\!\int_{W+d}\Var(y(s)\mid X)\dd s\dd d$, which equals the window average of $\Var(y\mid X)$ up to contributions from the edges of the window $W$. Since $\Var_p[m(t+d)] \ge 0$, the window average of $\Var(\tilde y\mid X)$ is at least that of $\Var(y\mid X)$. Case (b) is the same with $y$ and $\tilde y$ exchanged. The Fourier statements follow as in Proposition~\ref{prop:blur}. For zero-mean Gaussian $\varepsilon$, $Q = e^{-2\pi^2\sigma^2 f^2} > 0$, so the transform of $\tilde m$ is $\hat m/Q$. \hfill$\square$
|
If $p_t = p(\cdot\mid X)$ does not depend on $t$, the window average of $\int p(d\mid X)\Var(y(t+d)\mid X)\dd d$ is $\int p(d\mid X)\,|W|^{-1}\!\int_{W+d}\Var(y(s)\mid X)\dd s\dd d$, which equals the window average of $\Var(y\mid X)$ up to contributions from the edges of the window $W$. Since $\Var_p[m(t+d)] \ge 0$, the window average of $\Var(\tilde y\mid X)$ is at least that of $\Var(y\mid X)$. Case (b) is the same with $y$ and $\tilde y$ exchanged. The Fourier statements follow as in Proposition~\ref{prop:blur}. For zero-mean Gaussian $\varepsilon$, $Q = e^{-2\pi^2\sigma^2 f^2} > 0$, so the transform of $\tilde m$ is $\hat m/Q$. \hfill$\square$
|
||||||
|
|
||||||
\subsection{Proposition~\ref{prop:bank}}
|
|
||||||
(a) Take $G(u, D) = y^u(t)$, which depends on $D$ through the logs. Calibration gives $\bar y(t) = \E[y^{u^\star}(t)\mid D] = \E[y(t)\mid D]$, and the tower property gives $\E[\bar y(t)\mid X] = m(t)$.
|
\subsection{Calibrated bank}
|
||||||
|
|
||||||
|
\begin{proposition}[Calibrated bank]
|
||||||
|
\label{prop:bank}
|
||||||
|
Call a bank $\{(u_s, \pi_s)\}$ calibrated for a function $G$ if
|
||||||
|
\begin{equation*}
|
||||||
|
\sum_s \pi_s G(u_s, D) = \E[G(u^\star, D)\mid D] .
|
||||||
|
\end{equation*}
|
||||||
|
\begin{enumerate}
|
||||||
|
\item[(a)] If the bank is calibrated for $G(u, D) = y^{u}(t)$ at every $t$, the mean label $\bar y = \sum_s \pi_s y^{u_s}$ satisfies $\bar y(t) = \E[y(t)\mid D]$ and $\E[\bar y(t)\mid X] = m(t)$;
|
||||||
|
\item[(b)] If it is calibrated for the window log-likelihood \eqref{eq:rml} of every network $(\mu_\theta, \sigma_\theta)$ that depends on the data only through $X$, then, for those networks, $\E\big[\sum_s \pi_s \ell_s\big] = \E[\ell^\star]$, where $\ell^\star$ is the log-likelihood of the label at the true warp.
|
||||||
|
\end{enumerate}
|
||||||
|
Under (b) the $\lambda \to 0$ limit of RML (Lemma~\ref{lem:sandwich}) has the population minimizer of training on the true labels, $\mu = m$ and $\sigma^2 = \Var(y\mid X)$, and under (a) MSE on the mean label has the population minimizer $\mu = m$.
|
||||||
|
\end{proposition}
|
||||||
|
|
||||||
|
Because the log-likelihood is quadratic in the label, (b) holds whenever the bank matches the posterior mean and variance of the label at every $t$.
|
||||||
|
|
||||||
|
\noindent\emph{Proof.} (a) Take $G(u, D) = y^u(t)$, which depends on $D$ through the logs. Calibration gives $\bar y(t) = \E[y^{u^\star}(t)\mid D] = \E[y(t)\mid D]$, and the tower property gives $\E[\bar y(t)\mid X] = m(t)$.
|
||||||
|
|
||||||
(b) Take $G(u, D) = \ell\big(y^u; \mu_\theta(X), \sigma_\theta(X)\big)$, a function of $(u, D)$ because $X$ is a function of $D$. Calibration gives $\sum_s \pi_s\ell_s = \E[\ell^\star\mid D]$, and taking expectations gives the claim. By Lemma~\ref{lem:sandwich}, $\RML_\lambda \to -\frac1n\sum_s\pi_s\ell_s$ as $\lambda \to 0$, so for every $\theta$ the limit has the expectation of the Gaussian negative log-likelihood on the true labels. Over functions of $X$, the latter is minimized sample by sample at $\mu_i = \E[y(t_i)\mid X]$ and $\sigma_i^2 = \Var(y(t_i)\mid X)$. For the MSE, $\E[\bar y - m\mid X] = 0$ by (a), so $\E(h - \bar y)^2 = \E(h - m)^2 + \E(m - \bar y)^2$ for every function $h$ of $X$.
|
(b) Take $G(u, D) = \ell\big(y^u; \mu_\theta(X), \sigma_\theta(X)\big)$, a function of $(u, D)$ because $X$ is a function of $D$. Calibration gives $\sum_s \pi_s\ell_s = \E[\ell^\star\mid D]$, and taking expectations gives the claim. By Lemma~\ref{lem:sandwich}, $\RML_\lambda \to -\frac1n\sum_s\pi_s\ell_s$ as $\lambda \to 0$, so for every $\theta$ the limit has the expectation of the Gaussian negative log-likelihood on the true labels. Over functions of $X$, the latter is minimized sample by sample at $\mu_i = \E[y(t_i)\mid X]$ and $\sigma_i^2 = \Var(y(t_i)\mid X)$. For the MSE, $\E[\bar y - m\mid X] = 0$ by (a), so $\E(h - \bar y)^2 = \E(h - m)^2 + \E(m - \bar y)^2$ for every function $h$ of $X$.
|
||||||
|
|
||||||
The expansion of $\bar y - y^{\bar u}$ in Section~\ref{sec:theory:post} is Taylor's theorem in $u$; the first-order term vanishes because $\sum_s \pi_s (u_s - \bar u) = 0$. \hfill$\square$
|
Expanding $y^{u}$ formally around $\bar u = \sum_s\pi_s u_s$,
|
||||||
|
\begin{equation*}
|
||||||
|
\bar y - y^{\bar u} = \tfrac12 \sum_s \pi_s\, (u_s - \bar u)^\top \nabla_u^2 y^{\bar u}\, (u_s - \bar u) + O\Big(\sum_s \pi_s\|u_s - \bar u\|^3\Big),
|
||||||
|
\end{equation*}
|
||||||
|
so the two labels agree to first order in the posterior spread. This is a second-order Taylor expansion in $u$, formal because $u$ contains the drift function $g$; the first-order term vanishes because $\sum_s \pi_s (u_s - \bar u) = 0$. \hfill$\square$
|
||||||
|
|
||||||
\subsection{Corollary~\ref{cor:twomode}}
|
|
||||||
The characteristic function of $\pm\Delta/2$ with equal probabilities is $\frac12\big(e^{i\pi f\Delta} + e^{-i\pi f\Delta}\big) = \cos(\pi f\Delta)$, which is negative for $\pi/2 < \pi|f|\Delta < 3\pi/2$. Under (a) the transfer from $m$ to $\tilde m$ is $P$; under (b) it is $1/Q$, which has the sign of $Q$. A zero-mean Gaussian with variance $\Delta^2/4$ has characteristic function $e^{-2\pi^2(\Delta^2/4)f^2}$. The calibrated bank is covered by Proposition~\ref{prop:bank}(a). For the shifted bank, $\bar y(t) = \frac12\big[\tilde y(t + \Delta/2) + \tilde y(t - \Delta/2)\big]$, so $\E[\bar y\mid X]$ is $\tilde m$ filtered by $\cos(\pi f\Delta)$, that is, $m$ filtered by $\cos^2(\pi f\Delta)$. \hfill$\square$
|
|
||||||
|
|
||||||
\subsection{Remark~\ref{rem:lambda} and Equation~\texorpdfstring{\eqref{eq:rhostar}}{(\ref{eq:rhostar})}}
|
\subsection{Two modes}
|
||||||
For a finite bank, $\log\E_\pi e^{\lambda\ell} = \lambda\E_\pi\ell + \frac{\lambda^2}{2}\Var_\pi\ell + O(\lambda^3)$; dividing by $-\lambda n$ gives the expansion in Remark~\ref{rem:lambda}.
|
|
||||||
|
\begin{corollary}[Two modes]
|
||||||
|
\label{cor:twomode}
|
||||||
|
Let the error ($\delta$ under (a), $\varepsilon$ under (b)) be constant over the window and equal to $\pm\Delta/2$ with probability $\frac12$ each, independently of $(X, y)$ under (a) and of $D$ under (b). Then $P(f) = Q(f) = \cos(\pi f\Delta)$, and under either structure the transfer from $m$ to $\tilde m$ is negative for $1/(2\Delta) < |f| < 3/(2\Delta)$: there the point label trains the network towards the wrong sign. A Gaussian error with the same variance $\Delta^2/4$ has $P(f) = e^{-\pi^2\Delta^2f^2/2} > 0$ at every frequency. The mean label of a calibrated bank has transfer 1. Under (a), take the bank of the point label shifted by $\pm\Delta/2$ with equal weights. The population optimum of MSE on its mean label, which is also that of RML on this bank as $\lambda \to 0$, has transfer $\cos^2(\pi f\Delta) \ge 0$. This bank contains the label at the true warp, but it is not calibrated: its equal weights are not the posterior probabilities of its two members.
|
||||||
|
\end{corollary}
|
||||||
|
|
||||||
|
\noindent\emph{Proof.} The characteristic function of $\pm\Delta/2$ with equal probabilities is $\frac12\big(e^{i\pi f\Delta} + e^{-i\pi f\Delta}\big) = \cos(\pi f\Delta)$, which is negative for $\pi/2 < \pi|f|\Delta < 3\pi/2$. Under (a) the transfer from $m$ to $\tilde m$ is $P$. Under (b), $\hat m = Q\,\hat{\tilde m}$, so the transfer is $1/Q$ wherever $Q \ne 0$ and has the sign of $Q$; $Q$ has no zero inside the open interval $1/(2\Delta) < |f| < 3/(2\Delta)$, and at its zeros the identity forces $\hat m = 0$. A zero-mean Gaussian with variance $\Delta^2/4$ has characteristic function $e^{-2\pi^2(\Delta^2/4)f^2}$. The calibrated bank is covered by Proposition~\ref{prop:bank}(a). For the shifted bank, $\bar y(t) = \frac12\big[\tilde y(t + \Delta/2) + \tilde y(t - \Delta/2)\big]$, so $\E[\bar y\mid X]$ is $\tilde m$ filtered by $\cos(\pi f\Delta)$, that is, $m$ filtered by $\cos^2(\pi f\Delta)$. This is the population minimizer of MSE on $\bar y$ and, as in the proof of Proposition~\ref{prop:bank}(b), of the $\lambda \to 0$ limit of RML on the bank, because the bank average of the Gaussian negative log-likelihood is minimized in $\mu$ at $\bar y$. A calibrated bank would have transfer 1 by Proposition~\ref{prop:bank}(a), so this bank is not calibrated. \hfill$\square$
|
||||||
|
|
||||||
|
|
||||||
|
\subsection{Finite tempering and the population gain}
|
||||||
|
|
||||||
|
\begin{remark}[$\lambda > 0$]
|
||||||
|
\label{rem:lambda}
|
||||||
|
Expanding the cumulant generating function in \eqref{eq:rml},
|
||||||
|
\begin{equation*}
|
||||||
|
\RML_\lambda = -\frac1n\Big[\sum_s \pi_s\ell_s + \frac\lambda2 \Var_\pi(\ell) + O(\lambda^2)\Big].
|
||||||
|
\end{equation*}
|
||||||
|
The second term rewards predictors that fit some bank members much better than others. For $\lambda > 0$ the responsibilities of Lemma~\ref{lem:grad} shift weight towards the members that agree with the current network, which amounts to an implicit re-registration, and the population minimizer is in general no longer $(m, \Var(y\mid X))$.
|
||||||
|
\end{remark}
|
||||||
|
|
||||||
|
Because $\E[y - m\mid X] = 0$, every predictor $h$ that depends on the data only through $X$ satisfies
|
||||||
|
\begin{equation*}
|
||||||
|
\E|B(h - y)|^2 = \E|B(m - y)|^2 + \E|B(h - m)|^2 ,
|
||||||
|
\end{equation*}
|
||||||
|
which is the identity behind \eqref{eq:rhostar}.
|
||||||
|
|
||||||
|
\noindent\emph{Proof.} For a finite bank, $\log\E_\pi e^{\lambda\ell} = \lambda\E_\pi\ell + \frac{\lambda^2}{2}\Var_\pi\ell + O(\lambda^3)$; dividing by $-\lambda n$ gives the expansion in Remark~\ref{rem:lambda}.
|
||||||
|
|
||||||
$B$ is linear, so $B(h - y) = B(h - m) + B(m - y)$. Here $B(h - m)$ is a function of $X$ and $\E[B(m - y)\mid X] = B\,\E[m - y\mid X] = 0$, so the cross term vanishes. Setting $h = \tilde m$ gives \eqref{eq:rhostar}. The transform of $\tilde m - m$ is $(P - 1)\hat m$ under (a) and $(1/Q - 1)\hat m$ under (b). For Gaussian errors let $x = 2\pi^2\sigma^2 f^2$. Then $(1 - e^{-x})^2 = x^2 + O(x^3)$, $(e^{x} - 1)^2 = x^2 + O(x^3)$, and their ratio is $e^{2x}$. At $\sigma = 2.5$\,ms and $f = 25$\,Hz, $e^{2x} = 1.167$. \hfill$\square$
|
$B$ is linear, so $B(h - y) = B(h - m) + B(m - y)$. Here $B(h - m)$ is a function of $X$ and $\E[B(m - y)\mid X] = B\,\E[m - y\mid X] = 0$, so the cross term vanishes. Setting $h = \tilde m$ gives \eqref{eq:rhostar}. The transform of $\tilde m - m$ is $(P - 1)\hat m$ under (a) and $(1/Q - 1)\hat m$ under (b). For Gaussian errors let $x = 2\pi^2\sigma^2 f^2$. Then $(1 - e^{-x})^2 = x^2 + O(x^3)$, $(e^{x} - 1)^2 = x^2 + O(x^3)$, and their ratio is $e^{2x}$. At $\sigma = 2.5$\,ms and $f = 25$\,Hz, $e^{2x} = 1.167$. \hfill$\square$
|
||||||
|
|
||||||
\subsection{Proposition~\ref{prop:coverage}}
|
|
||||||
(a) $\xi_j - \xi_O = (v_j w_O - v_O w_j)/(w_j w_O)$, and $v_j w_O - v_O w_j = \Delta v\, w_O - v_O\, \Delta w$. Dividing by $w_j w_O$ gives the identity.
|
\subsection{Coverage}
|
||||||
|
|
||||||
|
With $\mu$, $\hat\sigma^2$, $v_j$, $w_j$ and $\xi_j$ as in Section~\ref{sec:theory:cov}:
|
||||||
|
|
||||||
|
\begin{proposition}[Coverage]
|
||||||
|
\label{prop:coverage}
|
||||||
|
\begin{enumerate}
|
||||||
|
\item[(a)] For any methods $j$ and $O$, $\xi_j - \xi_O = (\Delta v - \xi_O\,\Delta w)/w_j$, with $\Delta v = v_j - v_O$ and $\Delta w = w_j - w_O$.
|
||||||
|
\item[(b)] Let $m$ and $y$ be jointly stationary, and let (A1) hold with $p_t \equiv p$ and real $0 \le P \le 1$. Compare the point label at its population optimum ($\mu = \tilde m$, $\hat\sigma^2 = \Var(\tilde y\mid X)$) with the oracle at its optimum ($\mu = m$, $\hat\sigma^2 = \Var(y\mid X)$). Then $\xi_O = 1$ and
|
||||||
|
\begin{equation*}
|
||||||
|
\xi_j - \xi_O = \frac{2}{w_j}\int P(1 - P)\, S_m\dd f \ \ge 0 .
|
||||||
|
\end{equation*}
|
||||||
|
\item[(c)] Under the Berkson structure of Proposition~\ref{prop:tie}(b), with $q_t$ independent of $t$ and $y$ stationary, the point label at its population optimum has $\xi_j \le 1$, up to edge terms. A calibrated bank at the $\lambda \to 0$ population optimum of Proposition~\ref{prop:bank} has $\xi = 1$.
|
||||||
|
\end{enumerate}
|
||||||
|
If $y - \mu = \hat\sigma Z/\sqrt{\xi}$ with $Z$ standard normal and independent of $\hat\sigma$, the interval $\mu \pm z \hat\sigma$ covers with probability $2\Phi(z\sqrt{\xi}) - 1$, which increases with $\xi$.
|
||||||
|
\end{proposition}
|
||||||
|
|
||||||
|
\noindent\emph{Proof.} (a) $\xi_j - \xi_O = (v_j w_O - v_O w_j)/(w_j w_O)$, and $v_j w_O - v_O w_j = \Delta v\, w_O - v_O\, \Delta w$. Dividing by $w_j w_O$ gives the identity.
|
||||||
|
|
||||||
(b) Let $V = \E\Var(y\mid X)$. For the oracle, $v_O = w_O = V$. By (A1) and stationarity, $\E\tilde y^2 = \E y^2 = V + \E m^2$, so $v_j = \E\tilde y^2 - \E\tilde m^2 = V + \int(1 - P^2)S_m\dd f$. By the orthogonality used for \eqref{eq:rhostar}, without the band operator, $w_j = V + \E(\tilde m - m)^2 = V + \int(1 - P)^2S_m\dd f$. Hence $\Delta v - \Delta w = \int[(1 - P^2) - (1 - P)^2]S_m\dd f = 2\int P(1 - P)S_m\dd f$, and (a) with $\xi_O = 1$ gives the result.
|
(b) Let $V = \E\Var(y\mid X)$. For the oracle, $v_O = w_O = V$. By (A1) and stationarity, $\E\tilde y^2 = \E y^2 = V + \E m^2$, so $v_j = \E\tilde y^2 - \E\tilde m^2 = V + \int(1 - P^2)S_m\dd f$. By the orthogonality used for \eqref{eq:rhostar}, without the band operator, $w_j = V + \E(\tilde m - m)^2 = V + \int(1 - P)^2S_m\dd f$. Hence $\Delta v - \Delta w = \int[(1 - P^2) - (1 - P)^2]S_m\dd f = 2\int P(1 - P)S_m\dd f$, and (a) with $\xi_O = 1$ gives the result.
|
||||||
|
|
||||||
(c) By orthogonality, $w_j = V + \E(\tilde m - m)^2 \ge V$. By Proposition~\ref{prop:tie}(b), $\Var(y(t)\mid X) \ge \int q(e\mid X)\Var(\tilde y(t+e)\mid X)\dd e$. Averaging over the window and taking expectations as in the proof of Proposition~\ref{prop:tie}, $V \ge \E\Var(\tilde y\mid X) = v_j$, so $\xi_j \le 1$. A calibrated bank has the population optimum of the oracle (Proposition~\ref{prop:bank}), so $\xi = 1$.
|
(c) By orthogonality, $w_j = V + \E(\tilde m - m)^2 \ge V$. By Proposition~\ref{prop:tie}(b), $\Var(y(t)\mid X) \ge \int q(e\mid X)\Var(\tilde y(t+e)\mid X)\dd e$. Averaging over the window and taking expectations as in the proof of Proposition~\ref{prop:tie}, $V \ge \E\Var(\tilde y\mid X) = v_j$, so $\xi_j \le 1$. At $\lambda \to 0$, a calibrated bank has the population optimum of the oracle (Proposition~\ref{prop:bank}), so $\xi = \xi_O = 1$.
|
||||||
|
|
||||||
For the coverage statement, $\Pr(|y - \mu| \le zs) = \Pr(|Z| \le z\sqrt\xi) = 2\Phi(z\sqrt\xi) - 1$. \hfill$\square$
|
For the coverage statement, $\Pr(|y - \mu| \le z\hat\sigma) = \Pr(|Z| \le z\sqrt\xi) = 2\Phi(z\sqrt\xi) - 1$. \hfill$\square$
|
||||||
|
|
||||||
\subsection{Proposition~\ref{prop:reference}}
|
|
||||||
Because $B$ is linear and time-invariant and $\varepsilon_r$ is constant over the window, $By_{\mathrm{ref}}(t) = (By)(t + \varepsilon_r)$. By independence and stationarity, $\E|By_{\mathrm{ref}}|^2 = \E|By|^2$ and
|
\subsection{Misregistered reference}
|
||||||
|
|
||||||
|
With the reference of Section~\ref{sec:theory:ref}, let $\hat y$ and $y$ be jointly stationary with cross-spectrum $S_{\hat y y}$, defined by $\E[\hat y(t)\,y(t+\tau)] = \int S_{\hat y y}(f)\,e^{i2\pi f\tau}\dd f$.
|
||||||
|
|
||||||
|
\begin{proposition}[Misregistered reference]
|
||||||
|
\label{prop:reference}
|
||||||
|
Under these assumptions,
|
||||||
|
\begin{equation}
|
||||||
|
\E|B(\hat y - y_{\mathrm{ref}})|^2 = \E|B(\hat y - y)|^2 + 2\int_{|f|\ge f_c}\operatorname{Re}\big[(1 - Q_{\mathrm{ref}}(f))\,S_{\hat y y}(f)\big]\dd f .
|
||||||
|
\label{eq:refbias}
|
||||||
|
\end{equation}
|
||||||
|
\end{proposition}
|
||||||
|
|
||||||
|
For a symmetric error, $0 \le 1 - Q_{\mathrm{ref}} \le 2$.
|
||||||
|
|
||||||
|
\noindent\emph{Proof.} Because $B$ is linear and time-invariant and $\varepsilon_{\mathrm{ref}}$ is constant over the window, $By_{\mathrm{ref}}(t) = (By)(t + \varepsilon_{\mathrm{ref}})$. By independence and stationarity, $\E|By_{\mathrm{ref}}|^2 = \E|By|^2$ and
|
||||||
\begin{equation*}
|
\begin{equation*}
|
||||||
\E\big[B\hat y(t)\; By(t + \varepsilon_r)\big] = \E_{\varepsilon_r}\!\int_{|f|\ge f_c} S_{\hat y y}(f)\, e^{i2\pi f\varepsilon_r}\dd f = \int_{|f|\ge f_c} S_{\hat y y}(f)\, Q_r(f)\dd f .
|
\E\big[B\hat y(t)\; By(t + \varepsilon_{\mathrm{ref}})\big] = \E_{\varepsilon_{\mathrm{ref}}}\!\int_{|f|\ge f_c} S_{\hat y y}(f)\, e^{i2\pi f\varepsilon_{\mathrm{ref}}}\dd f = \int_{|f|\ge f_c} S_{\hat y y}(f)\, Q_{\mathrm{ref}}(f)\dd f .
|
||||||
\end{equation*}
|
\end{equation*}
|
||||||
Expanding both squares, the two MSEs differ only in the cross term, $-2\int S_{\hat y y}Q_r\dd f$ against $-2\int S_{\hat y y}\dd f$ over $|f| \ge f_c$. The difference is real, so it equals its real part. \hfill$\square$
|
Expanding both squares, the two MSEs differ only in the cross term, $-2\int S_{\hat y y}Q_{\mathrm{ref}}\dd f$ against $-2\int S_{\hat y y}\dd f$ over $|f| \ge f_c$. The difference is real, so it equals its real part. \hfill$\square$
|
||||||
|
|
||||||
\subsection{Corollary~\ref{cor:tolerance}}
|
|
||||||
The expression for $G_r - G$ is \eqref{eq:refbias} applied to both methods. As in the proof of Corollary~\ref{cor:band}, $S_{my} = S_m$, so $S_{\hat y_A y} = HS_m$ and $S_{\hat y_B y} = HPS_m$. For $\hat y = Lm$ with a real filter $L$, $\E|B(\hat y - y)|^2 = \int_{|f|\ge f_c}(L^2 - 2L)S_m\dd f + \E|By|^2$. The difference between $L = HP$ and $L = H$ is $G$, and adding $G_r - G = -2\int_{|f|\ge f_c} H(1 - P)(1 - Q_r)S_m\dd f$ gives $G_r$. Both factors of the integrand of $G$ are non-negative when $0 \le H, P \le 1$. For Gaussian errors, $P = 1 - 2\pi^2\sigma^2f^2 + O(f^4)$ and $Q_r = 1 - 2\pi^2\sigma_r^2f^2 + O(f^4)$. The over-sharp case follows by substituting $S_{\hat y_B y} = HKS_m$. \hfill$\square$
|
|
||||||
|
|
||||||
\subsection{Lemmas~\ref{lem:s1}--\ref{lem:sdtw}}
|
\subsection{Tolerance}
|
||||||
|
|
||||||
|
\begin{corollary}[Tolerance]
|
||||||
|
\label{cor:tolerance}
|
||||||
|
For two methods 1 and 2, let $G$ be the true band-MSE advantage of method 1 and $G_{\mathrm{ref}}$ the advantage measured against $y_{\mathrm{ref}}$. Then $G_{\mathrm{ref}} - G = 2\int_{|f|\ge f_c}\operatorname{Re}\big[(1 - Q_{\mathrm{ref}})(S_{\hat y_2 y} - S_{\hat y_1 y})\big]\dd f$. Let $\hat y_1 = Hm$ and $\hat y_2 = HPm$, with real filters $0 \le H, P \le 1$: method 1 learns the oracle and method 2 the blurred optimum, both shrunk by the same finite-sample factor $H$. Then
|
||||||
|
\begin{equation*}
|
||||||
|
G = \int_{|f|\ge f_c} H(1 - P)\big[2 - H(1 + P)\big] S_m\dd f \ \ge 0,
|
||||||
|
\qquad
|
||||||
|
G_{\mathrm{ref}} = \int_{|f|\ge f_c} H(1 - P)\big[2Q_{\mathrm{ref}} - H(1 + P)\big] S_m\dd f .
|
||||||
|
\end{equation*}
|
||||||
|
For $H = 1$ and zero-mean Gaussian errors with standard deviations $\sigma$ and $\sigma_{\mathrm{ref}}$, $2Q_{\mathrm{ref}} - 1 - P = 2\pi^2f^2(\sigma^2 - 2\sigma_{\mathrm{ref}}^2) + O(f^4)$, so the measured advantage can have the sign of the true one only if $\sigma_{\mathrm{ref}} < \sigma/\sqrt2$. The condition is necessary at every frequency, not only to leading order, and it is not sufficient: the measured advantage changes sign at a reference error below $\sigma/\sqrt2$.
|
||||||
|
\end{corollary}
|
||||||
|
|
||||||
|
Shrinkage relaxes this condition, because $2Q_{\mathrm{ref}} - H(1 + P)$ grows as $H$ decreases. If method 2 is over-sharp instead, as under Berkson error, with $\hat y_2 = HRm$ and $R \ge 1$, then $G_{\mathrm{ref}} - G = 2\int_{|f|\ge f_c} H(R - 1)(1 - Q_{\mathrm{ref}})S_m\dd f \ge 0$, and the reference exaggerates the advantage of method 1.
|
||||||
|
|
||||||
|
\noindent\emph{Proof.} The expression for $G_{\mathrm{ref}} - G$ is \eqref{eq:refbias} applied to both methods. As in the proof of Corollary~\ref{cor:band}, $S_{my} = S_m$, so $S_{\hat y_1 y} = HS_m$ and $S_{\hat y_2 y} = HPS_m$. For $\hat y = Lm$ with a real filter $L$, $\E|B(\hat y - y)|^2 = \int_{|f|\ge f_c}(L^2 - 2L)S_m\dd f + \E|By|^2$. The difference between $L = HP$ and $L = H$ is $G$, and adding $G_{\mathrm{ref}} - G = -2\int_{|f|\ge f_c} H(1 - P)(1 - Q_{\mathrm{ref}})S_m\dd f$ gives $G_{\mathrm{ref}}$. Both factors of the integrand of $G$ are non-negative when $0 \le H, P \le 1$. For Gaussian errors, $P = e^{-2\pi^2\sigma^2f^2} = 1 - 2\pi^2\sigma^2f^2 + O(f^4)$ and $Q_{\mathrm{ref}} = e^{-2\pi^2\sigma_{\mathrm{ref}}^2f^2} = 1 - 2\pi^2\sigma_{\mathrm{ref}}^2f^2 + O(f^4)$, which gives the leading-order term. If $\sigma_{\mathrm{ref}} \ge \sigma/\sqrt2$, then $Q_{\mathrm{ref}} \le e^{-\pi^2\sigma^2f^2}$ and $2Q_{\mathrm{ref}} - 1 - P \le 2e^{-\pi^2\sigma^2f^2} - 1 - e^{-2\pi^2\sigma^2f^2} = -\big(1 - e^{-\pi^2\sigma^2f^2}\big)^2 \le 0$ at every $f$, so $G_{\mathrm{ref}} \le 0$ for $H = 1$. At $\sigma_{\mathrm{ref}} = \sigma/\sqrt2$ the inequality is strict wherever $S_m > 0$ in the band, so by continuity $G_{\mathrm{ref}} < 0$ also for $\sigma_{\mathrm{ref}}$ slightly below $\sigma/\sqrt2$. The over-sharp case follows by substituting $S_{\hat y_2 y} = HRS_m$. \hfill$\square$
|
||||||
|
|
||||||
|
|
||||||
|
\subsection{Lemmas of Section~\ref{sec:method:rml}}
|
||||||
|
|
||||||
\paragraph{Lemma~\ref{lem:s1}.} If all $\ell_s = \ell$, then $\log\sum_s\pi_s e^{\lambda\ell} = \lambda\ell$. \hfill$\square$
|
\paragraph{Lemma~\ref{lem:s1}.} If all $\ell_s = \ell$, then $\log\sum_s\pi_s e^{\lambda\ell} = \lambda\ell$. \hfill$\square$
|
||||||
|
|
||||||
@@ -81,7 +255,19 @@ The expression for $G_r - G$ is \eqref{eq:refbias} applied to both methods. As i
|
|||||||
|
|
||||||
\paragraph{Lemma~\ref{lem:shift}.} With the stated bank and uniform $\pi$, $\RML_\infty = -\frac1n\max_k \ell_k$, where $\ell_k$ is the window log-likelihood of the label shifted by $k$ samples. This is the hard-min over shifts of the Gaussian negative log-likelihood. The finite-$\lambda$ case is the corresponding soft minimum. \hfill$\square$
|
\paragraph{Lemma~\ref{lem:shift}.} With the stated bank and uniform $\pi$, $\RML_\infty = -\frac1n\max_k \ell_k$, where $\ell_k$ is the window log-likelihood of the label shifted by $k$ samples. This is the hard-min over shifts of the Gaussian negative log-likelihood. The finite-$\lambda$ case is the corresponding soft minimum. \hfill$\square$
|
||||||
|
|
||||||
\paragraph{Lemma~\ref{lem:sdtw}.} By definition,
|
\paragraph{Soft-DTW.} The identity behind the statement in Section~\ref{sec:method:rml} is the following.
|
||||||
|
|
||||||
|
\begin{lemma}[Soft-DTW]
|
||||||
|
\label{lem:sdtw}
|
||||||
|
Let $D_{ij} = -\log\N(y_j; \mu_i, \sigma_i^2)$, let $\mathcal P$ be the set of monotone alignment paths from $(0,0)$ to $(n-1,n-1)$ within a Sakoe--Chiba band, and let $\langle A, D\rangle_w$ be the path cost with symmetric step weights (diagonal steps and the start cell counted twice; \citealp{sakoe1978dp}). For soft-DTW with these steps \citep{cuturi2017softdtw},
|
||||||
|
\begin{equation}
|
||||||
|
\frac{\mathrm{sDTW}_\gamma(D)}{2n} = \RML_{\lambda = 2/\gamma}\Big[\text{bank} = \mathcal P,\ \pi \text{ uniform},\ \ell_A = -\tfrac12\langle A, D\rangle_w\Big] - \frac{\gamma}{2n}\log|\mathcal P| .
|
||||||
|
\end{equation}
|
||||||
|
\end{lemma}
|
||||||
|
|
||||||
|
The last term does not depend on $\theta$. On the diagonal path, $\ell_A$ equals the Gaussian log-likelihood of the window. The unit tests check this identity in its single-path case. Symmetric steps give every path the same total weight $2n$. With standard steps, longer paths visit more cells and, since the negative log-likelihood can be negative, would be preferred. DILATE \citep{leguen2019dilate} adds a temporal-distortion term $\langle A^\star, \Omega\rangle$ with $A^\star = \nabla_D \mathrm{sDTW}_\gamma$ and $\Omega_{ij} = ((i-j)/n)^2$. Its gradient is a Hessian--vector product, which we compute by forward-mode differentiation of the backward pass \citep{mensch2018diffdp}. Our version differs from the original in two ways: the cost is the Gaussian negative log-likelihood, and the steps are symmetric.
|
||||||
|
|
||||||
|
\paragraph{Proof of Lemma~\ref{lem:sdtw}.} By definition,
|
||||||
\begin{equation*}
|
\begin{equation*}
|
||||||
\mathrm{sDTW}_\gamma(D) = -\gamma\log\sum_{A\in\mathcal P}e^{-\langle A,D\rangle_w/\gamma}.
|
\mathrm{sDTW}_\gamma(D) = -\gamma\log\sum_{A\in\mathcal P}e^{-\langle A,D\rangle_w/\gamma}.
|
||||||
\end{equation*}
|
\end{equation*}
|
||||||
@@ -89,4 +275,4 @@ Substituting $\ell_A = -\frac12\langle A,D\rangle_w$, $\pi_A = |\mathcal P|^{-1}
|
|||||||
\begin{equation*}
|
\begin{equation*}
|
||||||
\RML_{2/\gamma} = -\frac{\gamma}{2n}\log\sum_{A}|\mathcal P|^{-1}e^{-\langle A,D\rangle_w/\gamma} = \frac{\mathrm{sDTW}_\gamma(D)}{2n} + \frac{\gamma}{2n}\log|\mathcal P| .
|
\RML_{2/\gamma} = -\frac{\gamma}{2n}\log\sum_{A}|\mathcal P|^{-1}e^{-\langle A,D\rangle_w/\gamma} = \frac{\mathrm{sDTW}_\gamma(D)}{2n} + \frac{\gamma}{2n}\log|\mathcal P| .
|
||||||
\end{equation*}
|
\end{equation*}
|
||||||
With symmetric steps, every path has total weight $2n$, and on the diagonal path $\langle A, D\rangle_w = 2\sum_i D_{ii}$, so $\ell_A = \sum_i\log\N(y_i;\mu_i,\sigma_i^2)$. \hfill$\square$
|
With symmetric steps and the start cell counted twice, every path has total weight $2 + (2n - 2) = 2n$, because the weight of each step equals its increment of $i + j$, which grows from $0$ to $2n - 2$ along the path; and on the diagonal path $\langle A, D\rangle_w = 2\sum_i D_{ii}$, so $\ell_A = \sum_i\log\N(y_i;\mu_i,\sigma_i^2)$. \hfill$\square$
|
||||||
|
|||||||
@@ -1,59 +1,35 @@
|
|||||||
\section{Field cases in detail}
|
\section{Field cases in detail}
|
||||||
\label{app:field}
|
\label{app:field}
|
||||||
|
|
||||||
This appendix reports the two field tests in full. Section~\ref{sec:exp:scope} summarizes them and states what they can and cannot show. Both protocols were locked before their main runs; both gates failed, and nothing was changed after the test wells were scored.
|
This appendix reports the two field tests in full. Section~\ref{sec:exp:scope} summarizes them and states what they can and cannot show. Both protocols were locked before their main runs (Appendix~\ref{app:record}), both pass rules failed, and nothing was changed after the test wells were scored.
|
||||||
|
|
||||||
\subsection{F3 field data (gate G-C)}
|
\subsection{F3 field data}
|
||||||
\label{sec:exp:f3}
|
\label{sec:exp:f3}
|
||||||
|
|
||||||
\paragraph{Baselines.}
|
\paragraph{No learned model beat a depth--time trend in total RMSE.}
|
||||||
Table~\ref{tab:p1} gives leave-one-well-out results for the baselines on F3. The label is $\mathrm{PHIE}_{\mathrm{DT}}$, and the reference is the marker-calibrated sonic of the test well. The test well contributes nothing to training, tie, hyperparameters or checkpoint selection. A depth--time trend fitted on the training wells (B0a) has the lowest RMSE. No learned model beats it in total RMSE, and its seismic-band PCC is negative. Seismic-attribute ridge regression (B0b) has the highest band PCC (0.24). Among networks, labels from the marker-calibrated tie (B3b) beat single-anchor sonic integration (B3a). With four wells these numbers are descriptive.
|
The label is $\mathrm{PHIE}_{\mathrm{DT}}$, the reference is the marker-calibrated sonic of the test well, and the test well contributes nothing to training, tie, hyperparameters or checkpoint selection. In Table~\ref{tab:f3all} the depth--time trend has the lowest RMSE (2.48\,p.u.), although its seismic-band PCC is negative, and ridge regression on seismic attributes has the highest band PCC (0.24). With four wells these numbers are descriptive.
|
||||||
|
|
||||||
\begin{table}[t]
|
|
||||||
\centering
|
|
||||||
\caption{F3 leave-one-well-out baselines (label $\mathrm{PHIE}_{\mathrm{DT}}$, marker-calibrated reference, 600--1100\,ms). Macro over four wells; $\pm$: standard deviation over five seeds.}
|
|
||||||
\label{tab:p1}
|
|
||||||
\small
|
|
||||||
\begin{tabular}{lcccc}
|
|
||||||
\toprule
|
|
||||||
Method & RMSE (p.u.) & PCC & band PCC & skill vs B0a \\
|
|
||||||
\midrule
|
|
||||||
B0a (trend) & \textbf{2.48} & 0.81 & $-0.13$ & 0.00 \\
|
|
||||||
B0b ridge & 2.58 & \textbf{0.83} & \textbf{0.24} & $-0.09$ \\
|
|
||||||
B0b random forest & $2.67 \pm 0.01$ & 0.79 & $-0.03$ & $-0.22$ \\
|
|
||||||
B0b gradient boosting & 2.68 & 0.78 & 0.01 & $-0.20$ \\
|
|
||||||
B1 (impedance inversion) & 3.60 & 0.44 & $-0.02$ & $-1.29$ \\
|
|
||||||
B2 (composite loss) & $3.07 \pm 0.16$ & 0.52 & 0.15 & $-0.65$ \\
|
|
||||||
B3a & $2.93 \pm 0.24$ & 0.62 & $-0.02$ & $-0.47$ \\
|
|
||||||
B3b & $2.82 \pm 0.21$ & 0.68 & 0.15 & $-0.36$ \\
|
|
||||||
\bottomrule
|
|
||||||
\end{tabular}
|
|
||||||
\end{table}
|
|
||||||
|
|
||||||
\paragraph{Protocol and deviations.}
|
|
||||||
The field test was pre-registered in a third protocol. Its SHA-256 lock also covers the code, the input data and the software environment, and the scripts refuse to run if any of them changes. The lock file records that it was written one minute before the main run started (28 October 2026, 00:14 and 00:15 local time). The protocol was committed to version control and tagged only after the run, together with the results. The record that the lock preceded the run is therefore the time stamp inside the lock file, which is self-reported, not the version history. Before the lock we ran a timing pilot of the registration and a preflight of the classical baselines on F3. Neither computed a metric on a test well. No result on an F3 test well was used to design it. Two facts limit what the test can show. First, F3 is not an untouched field dataset. The same four wells gave the baselines of Table~\ref{tab:p1}, computed before the protocol was written, and they calibrated the synthetic benchmark (Section~\ref{sec:data:d2}). The field test is therefore a descriptive follow-up on wells we had already seen, not an independent replication. Second, the method under test comes from Experiment~2, whose protocol was itself designed after Experiment~1 had failed (Section~\ref{sec:exp:diag}). The field result therefore bears on the SMC variant only, and it leaves the verdict of Experiment~1 unchanged.
|
|
||||||
|
|
||||||
\paragraph{Design.}
|
\paragraph{Design.}
|
||||||
We used nested leave-one-well-out validation. Each well is held out once as the outer test well. Within the three remaining wells, each is held out once as an inner validation well, and models are trained on the other two. Registration uses only the two training wells of each model: the warp-prior hyperparameters, the wavelet phase and the SMC posterior ($\sigma_a = 7$\,ms, $P = 1024$, $S = 64$) are all estimated from them. For each outer fold, method and seed, the iteration budget is chosen from $\{125, 250, 500, 1000, 2000\}$ by total validation MSE averaged over the three inner wells, with ties going to the smaller budget. This replaces the selection on development realizations used in the synthetic experiments (Section~\ref{sec:method:train}). The prediction at the outer well is a Gaussian with the mean and variance of the equally weighted mixture of 15 members (three inner models $\times$ five seeds). Nothing is refitted on the outer well, and its labels enter no choice. The primary label is $\mathrm{PHIE}_{\mathrm{DT}}$, and the reference is the marker-calibrated sonic of the test well, as in Table~\ref{tab:p1}.
|
We used nested leave-one-well-out validation. Each well is held out once as the outer test well. Within the three remaining wells, each is held out once as an inner validation well, and models are trained on the other two. Registration uses only the two training wells of each model: the warp-prior hyperparameters, the wavelet phase and the SMC posterior ($\sigma_a = 7$\,ms, $N_p = 1024$, $S = 64$) are all estimated from them. For each outer fold, method and seed, the iteration budget is chosen from $\{125, 250, 500, 1000, 2000\}$ by total validation MSE averaged over the three inner wells, with ties going to the smaller budget. The prediction at the outer well is a Gaussian with the mean and variance of the equally weighted mixture of 15 members (three inner models $\times$ five seeds). Nothing is refitted on the outer well, and its labels enter no choice.
|
||||||
|
|
||||||
Gate G-C required two conditions for \mRML{} in this configuration. (i) \emph{Direction}: lower band RMSE than the point tie chosen for that outer fold among B3b, B3c and B3c-R, by inner-validation MSE averaged over seeds, at no fewer than three of the four outer wells. Any reduction counts, so this rule is weaker than the 0.90 ratio of the synthetic experiments. (ii) \emph{Coverage}: macro coverage of the central 80\% and 90\% intervals within $\pm 0.05$ of nominal, that is, in $[0.75, 0.85]$ and $[0.85, 0.95]$. Coverage is the fraction of time samples in the window that fall inside the interval. These samples are strongly correlated, so coverage is a description, not a test. The protocol also states that better accuracy cannot compensate for failed coverage. Before the run we had recorded that the coverage condition would probably fail, because every ensemble had under-covered in the synthetic experiments. We kept the threshold.
|
The pass rule had two conditions for the \mRML{}. (i) \emph{Direction}: lower band RMSE than the deterministic tie chosen for that outer fold among the calibrated sonic, the correlation tie and the phase-estimated correlation, by inner-validation MSE averaged over seeds, at no fewer than three of the four outer wells. Any reduction counts, so this rule is weaker than the 0.90 ratio of the synthetic experiments. (ii) \emph{Coverage}: macro coverage of the central 80\% and 90\% intervals within $\pm 0.05$ of nominal, that is, in $[0.75, 0.85]$ and $[0.85, 0.95]$. These time samples are strongly correlated, so coverage is a description, not a test. Better accuracy cannot compensate for failed coverage. Before the run we had recorded that the coverage condition would probably fail, because every ensemble had under-covered in the synthetic experiments, and we kept the threshold.
|
||||||
|
|
||||||
\paragraph{Result: the gate failed.}
|
\paragraph{Both conditions failed.}
|
||||||
Both conditions failed (Table~\ref{tab:f3gc}). Inner validation chose B3c-R as the competitor at all four outer wells. \mRML{} had lower band RMSE only at F03-4, by 1.9\%. At F02-1 and F03-2 it was 0.8\% and 0.02\% worse, and at F06-1 it was 7.0\% worse. Its macro band RMSE was 1.272\,p.u., against 1.256\,p.u.\ for B3c-R. Macro coverage was 0.524 for the 80\% intervals and 0.609 for the 90\% intervals, far below the lower limits of 0.75 and 0.85. At F03-2 and F03-4 the 80\% and 90\% intervals covered 0.75 and 0.80 of the samples, just below and well below nominal. At F02-1 and F06-1 they covered 0.22--0.38 and 0.33--0.50. At these two wells most of the error lay below 6\,Hz: the low-band RMSE was 4.31 and 3.64\,p.u., out of a total RMSE of 4.56 and 3.82\,p.u., while the mean predicted standard deviation was 1.05 and 1.27\,p.u. Seed by seed (three-member ensembles), \mRML{} beat B3c-R at one to three of the four wells. The macro band RMSE of each method varied between seeds by up to 0.13\,p.u.\ (\mRML: 1.28--1.41\,p.u.; B3c-R: 1.29--1.41\,p.u.), eight times the gap between the combined ensembles. The competitor was not changed after the test wells were scored, and the intervals were not widened. Under this protocol, training on the SMC bank gave no band-RMSE gain over the best point tie on F3, and its predictive intervals were much too narrow. We make no claim of improvement on field data and no claim of calibrated uncertainty.
|
Inner validation chose the phase-estimated correlation as the competitor at all four outer wells (Table~\ref{tab:f3gc}). The \mRML{} had lower band RMSE only at F03-4, by 1.9\%. At F02-1 and F03-2 it was 0.8\% and 0.02\% worse, and at F06-1 it was 7.0\% worse. Its macro band RMSE was 1.272\,p.u., against 1.256\,p.u.\ for the competitor. Macro coverage was 0.524 for the 80\% intervals and 0.609 for the 90\% intervals. At F03-2 and F03-4 the 80\% and 90\% intervals covered 0.75 and 0.80 of the samples. At F02-1 and F06-1 they covered 0.22--0.38 and 0.33--0.50. At these two wells most of the error lay below 6\,Hz: the low-band RMSE was 4.31 and 3.64\,p.u., out of a total RMSE of 4.56 and 3.82\,p.u., while the mean predicted standard deviation was 1.05 and 1.27\,p.u. Seed by seed (three-member ensembles), the \mRML{} beat the competitor at one to three of the four wells, and the macro band RMSE of each method varied between seeds by up to 0.13\,p.u.\ (\mRML: 1.28--1.41\,p.u.; competitor: 1.29--1.41\,p.u.), eight times the gap between the combined ensembles.
|
||||||
|
|
||||||
\begin{table}[t]
|
\begin{table}[t]
|
||||||
\centering
|
\centering
|
||||||
\caption{Gate G-C on F3 (label $\mathrm{PHIE}_{\mathrm{DT}}$, marker-calibrated reference, 600--1100\,ms, $\sigma_a = 7$\,ms, 15-member ensemble). Competitor: the point tie chosen by inner validation. Ratio: band RMSE of \mRML{} divided by that of the competitor; at F03-2 it is 1.0002. Coverage: fraction of the 126 time samples inside the central interval of \mRML; at F03-2 and F03-4 the same counts (94 and 101 samples) occur by coincidence.}
|
\caption{F3 pass rule (label $\mathrm{PHIE}_{\mathrm{DT}}$, marker-calibrated reference, 600--1100\,ms, $\sigma_a = 7$\,ms, 15-member ensemble). Competitor: the deterministic tie chosen by inner validation. Ratio: band RMSE of \mRML{} divided by that of the competitor; at F03-2 it is 1.0002. Coverage: fraction of the 126 time samples inside the central interval of \mRML; at F03-2 and F03-4 the same counts (94 and 101 samples) occur by coincidence.}
|
||||||
\label{tab:f3gc}
|
\label{tab:f3gc}
|
||||||
\small
|
\small
|
||||||
\begin{tabular}{lccccc}
|
\begin{tabular}{lccccc}
|
||||||
\toprule
|
\toprule
|
||||||
Outer well & competitor & ratio & improved & cov$_{80}$ & cov$_{90}$ \\
|
Outer well & competitor & ratio & improved & cov$_{80}$ & cov$_{90}$ \\
|
||||||
\midrule
|
\midrule
|
||||||
F02-1 & B3c-R & 1.008 & no & 0.222 & 0.333 \\
|
F02-1 & Phase-est.\ corr. & 1.008 & no & 0.222 & 0.333 \\
|
||||||
F03-2 & B3c-R & 1.000 & no & 0.746 & 0.802 \\
|
F03-2 & Phase-est.\ corr. & 1.000 & no & 0.746 & 0.802 \\
|
||||||
F03-4 & B3c-R & 0.981 & yes & 0.746 & 0.802 \\
|
F03-4 & Phase-est.\ corr. & 0.981 & yes & 0.746 & 0.802 \\
|
||||||
F06-1 & B3c-R & 1.070 & no & 0.381 & 0.500 \\
|
F06-1 & Phase-est.\ corr. & 1.070 & no & 0.381 & 0.500 \\
|
||||||
\midrule
|
\midrule
|
||||||
Macro & & & 1/4 & 0.524 & 0.609 \\
|
Macro & & & 1/4 & 0.524 & 0.609 \\
|
||||||
Required & & & $\ge 3/4$ & $[0.75, 0.85]$ & $[0.85, 0.95]$ \\
|
Required & & & $\ge 3/4$ & $[0.75, 0.85]$ & $[0.85, 0.95]$ \\
|
||||||
@@ -61,8 +37,8 @@ Required & & & $\ge 3/4$ & $[0.75, 0.85]$ & $[0.85, 0.95]$ \\
|
|||||||
\end{tabular}
|
\end{tabular}
|
||||||
\end{table}
|
\end{table}
|
||||||
|
|
||||||
\paragraph{Relation to Experiment~2.}
|
\paragraph{Two features of F3 limit what the test can detect.}
|
||||||
In the synthetic benchmark, \mRML{} beat the best point tie in all three full-anchor regimes, under a stricter rule (Section~\ref{sec:exp:p2r}). On F3 this direction held at one well of four. The field test does not show why, and we tested no explanation. Two features of F3 limit what it can detect. First, the synthetic gains required a correctly specified $\sigma_a$ (Table~\ref{tab:sigmaa}). On F3, $\sigma_a$ is not identified: 7\,ms comes from the marker--horizon spread (Section~\ref{sec:data:f3}), not from an independent measurement. Second, the reference is itself a point tie, the marker-calibrated sonic of B3b. Its registration error adds to the band RMSE of every method, which pulls ratios towards one, and it favours methods whose label errors resemble its own. Neither feature changes the verdict.
|
In the synthetic benchmark the \mRML{} beat the best deterministic tie in all three full-anchor settings under a stricter rule, while on F3 this direction held at one well of four. The field test does not show why, and we tested no explanation. First, the synthetic gains required a correctly specified $\sigma_a$ (Table~\ref{tab:sigmaa}), and on F3 $\sigma_a$ is not identified: 7\,ms comes from the marker--horizon spread, not from an independent measurement. Second, the reference is itself a point tie, the marker-calibrated sonic. Its registration error adds to the band RMSE of every method, which pulls ratios towards one, and it favours methods whose label errors resemble its own.
|
||||||
|
|
||||||
\begin{table}[t]
|
\begin{table}[t]
|
||||||
\centering
|
\centering
|
||||||
@@ -73,26 +49,26 @@ In the synthetic benchmark, \mRML{} beat the best point tie in all three full-an
|
|||||||
\toprule
|
\toprule
|
||||||
Method & band RMSE & band PCC & RMSE & PCC & cov$_{80}$ & cov$_{90}$ \\
|
Method & band RMSE & band PCC & RMSE & PCC & cov$_{80}$ & cov$_{90}$ \\
|
||||||
\midrule
|
\midrule
|
||||||
B0a (trend) & 1.239 & $-0.13$ & \textbf{2.48} & 0.81 & -- & -- \\
|
Depth--time trend & 1.239 & $-0.13$ & \textbf{2.48} & 0.81 & -- & -- \\
|
||||||
B0b ridge & 1.271 & \textbf{0.24} & 2.58 & \textbf{0.83} & -- & -- \\
|
Ridge & 1.271 & \textbf{0.24} & 2.58 & \textbf{0.83} & -- & -- \\
|
||||||
B0b random forest & 1.511 & $-0.03$ & 2.67 & 0.79 & -- & -- \\
|
Random forest & 1.511 & $-0.03$ & 2.67 & 0.79 & -- & -- \\
|
||||||
B0b gradient boosting & 1.537 & 0.01 & 2.68 & 0.78 & -- & -- \\
|
Gradient boosting & 1.537 & 0.01 & 2.68 & 0.78 & -- & -- \\
|
||||||
B1 (impedance inversion) & 3.090 & $-0.02$ & 3.60 & 0.44 & -- & -- \\
|
Impedance inversion & 3.090 & $-0.02$ & 3.60 & 0.44 & -- & -- \\
|
||||||
B2 (composite loss) & 1.252 & 0.19 & 3.09 & 0.53 & 0.38 & 0.44 \\
|
Composite loss & 1.252 & 0.19 & 3.09 & 0.53 & 0.38 & 0.44 \\
|
||||||
\midrule
|
\midrule
|
||||||
B3a & 1.348 & $-0.01$ & 3.13 & 0.44 & 0.47 & 0.57 \\
|
Sonic tie & 1.348 & $-0.01$ & 3.13 & 0.44 & 0.47 & 0.57 \\
|
||||||
B3b & 1.284 & 0.16 & 3.07 & 0.52 & 0.50 & 0.59 \\
|
Calibrated sonic & 1.284 & 0.16 & 3.07 & 0.52 & 0.50 & 0.59 \\
|
||||||
B3c & 1.282 & 0.20 & 3.14 & 0.45 & 0.48 & 0.58 \\
|
Correlation tie & 1.282 & 0.20 & 3.14 & 0.45 & 0.48 & 0.58 \\
|
||||||
B3c-R & 1.256 & 0.20 & 2.98 & 0.59 & 0.51 & 0.59 \\
|
Phase-est.\ corr. & 1.256 & 0.20 & 2.98 & 0.59 & 0.51 & 0.59 \\
|
||||||
B3d & 1.266 & 0.16 & 3.05 & 0.52 & 0.51 & 0.60 \\
|
Anchor mean & 1.266 & 0.16 & 3.05 & 0.52 & 0.51 & 0.60 \\
|
||||||
\mPM & 1.275 & 0.15 & 3.00 & 0.57 & 0.47 & 0.57 \\
|
\mPM & 1.275 & 0.15 & 3.00 & 0.57 & 0.47 & 0.57 \\
|
||||||
\midrule
|
\midrule
|
||||||
B4a & 1.232 & 0.18 & 3.24 & 0.39 & 0.49 & 0.58 \\
|
Hard-min shift & 1.232 & 0.18 & 3.24 & 0.39 & 0.49 & 0.58 \\
|
||||||
B4b & \textbf{1.211} & 0.22 & 3.17 & 0.43 & 0.49 & 0.60 \\
|
Soft-min shift & \textbf{1.211} & 0.22 & 3.17 & 0.43 & 0.49 & 0.60 \\
|
||||||
B4c & 1.237 & 0.22 & 3.12 & 0.57 & 0.42 & 0.52 \\
|
Soft-DTW & 1.237 & 0.22 & 3.12 & 0.57 & 0.42 & 0.52 \\
|
||||||
B4d & 1.254 & 0.21 & 3.14 & 0.57 & 0.47 & 0.58 \\
|
DILATE & 1.254 & 0.21 & 3.14 & 0.57 & 0.47 & 0.58 \\
|
||||||
\midrule
|
\midrule
|
||||||
M1 & 1.286 & 0.13 & 3.14 & 0.49 & 0.50 & 0.58 \\
|
Anchor bank & 1.286 & 0.13 & 3.14 & 0.49 & 0.50 & 0.58 \\
|
||||||
\mRML & 1.272 & 0.18 & 3.12 & 0.49 & \textbf{0.52} & \textbf{0.61} \\
|
\mRML & 1.272 & 0.18 & 3.12 & 0.49 & \textbf{0.52} & \textbf{0.61} \\
|
||||||
\midrule
|
\midrule
|
||||||
No band content & 1.224 & -- & -- & -- & -- & -- \\
|
No band content & 1.224 & -- & -- & -- & -- & -- \\
|
||||||
@@ -100,26 +76,26 @@ No band content & 1.224 & -- & -- & -- & -- & -- \\
|
|||||||
\end{tabular}
|
\end{tabular}
|
||||||
\end{table}
|
\end{table}
|
||||||
|
|
||||||
\paragraph{All methods.}
|
\paragraph{The networks predicted little of the seismic band.}
|
||||||
Table~\ref{tab:f3all} lists every method under the nested design. B0a, B0b and B1 use the code of Table~\ref{tab:p1} and reproduce its values. The networks have higher total RMSE than in Table~\ref{tab:p1} (B3b: 3.07 against 2.82\,p.u.); here each model is trained on two wells rather than three, and its budget is chosen by inner validation. Only B4b had a lower macro band RMSE than a prediction with no seismic-band content (1.211 against 1.224\,p.u.). B0a, which has almost no band content, came within 1.3\% of that value, and every point tie, \mPM{} and \mRML{} lay above it. Band PCC did not exceed 0.22 for any network. On F3 the networks therefore predicted little of the seismic-band variation of the label, and G-C compared methods whose band errors were nearly the same size: without B3a, the 13 networks span 1.211--1.286\,p.u. The ranking also differs from the synthetic experiments. All four anchor-free losses, B4a--B4d, had lower macro band RMSE than every point tie, \mPM{} and \mRML, by up to 0.06\,p.u. Every probabilistic method under-covered. Macro coverage was 0.38--0.52 for the 80\% intervals and 0.44--0.61 for the 90\% intervals, and \mRML{} had the highest values of both.
|
Table~\ref{tab:f3all} lists every method under the nested design. The networks have higher total RMSE than in a simpler leave-one-well-out design with three training wells (calibrated sonic: 3.07 against 2.82\,p.u., not tabulated), because each model here is trained on two wells and its budget is chosen by inner validation. Only the soft-min shift had a lower macro band RMSE than a prediction with no seismic-band content (1.211 against 1.224\,p.u.). The depth--time trend, which has almost no band content, came within 1.3\% of that value, and every deterministic tie, the \mPM{} and the \mRML{} lay above it. Band PCC did not exceed 0.22 for any network. The test therefore compared methods whose band errors were nearly the same size: without the sonic tie, the other 12 networks span 1.211--1.286\,p.u. The ranking also differs from the synthetic experiments. All four anchor-free losses had lower macro band RMSE than every deterministic tie, the \mPM{} and the \mRML{}, by 0.002--0.14\,p.u.\ (up to 0.06 relative to the \mPM{} and \mRML{}). Every probabilistic method under-covered: macro coverage was 0.38--0.52 for the 80\% intervals and 0.44--0.61 for the 90\% intervals, and the \mRML{} had the highest values of both.
|
||||||
|
|
||||||
\paragraph{Same posterior, $\sigma_a$ and scoring reference.}
|
\paragraph{Sensitivity analyses did not change the outcome.}
|
||||||
The protocol prescribes four further comparisons. None can replace a G-C condition, and none was used to choose a result. Table~\ref{tab:f3sens} gives the per-well ratios. In no row did the coverage condition hold.
|
The protocol prescribes four further comparisons, none of which can replace a condition of the pass rule (Table~\ref{tab:f3sens}). In no row did the coverage condition hold.
|
||||||
(a) Against \mPM, which is trained on the mean of the same SMC posterior, \mRML{} had lower band RMSE at two wells (F02-1 and F03-4) and higher band RMSE at F03-2, by 9.3\%. Its macro band RMSE was 0.003\,p.u.\ lower.
|
(a) Against the \mPM{}, trained on the mean of the same posterior, the \mRML{} had lower band RMSE at two wells (F02-1 and F03-4) and higher band RMSE at F03-2, by 9.3\%, and at F06-1, by 1.2\%. Its macro band RMSE was 0.003\,p.u.\ lower.
|
||||||
(b) With $\sigma_a = 3.5$ or 14\,ms, B3c-R, \mPM{} and \mRML{} were registered and trained again, and \mRML{} was compared with B3c-R at the same $\sigma_a$. It had lower band RMSE at one and two of the four wells, and the wells that improved were not the same in the three arms. Macro coverage was 0.47--0.48 and 0.57--0.59.
|
(b) With $\sigma_a = 3.5$ or 14\,ms, the phase-estimated correlation, the \mPM{} and the \mRML{} were registered and trained again, and the \mRML{} had lower band RMSE than that competitor at one and two of the four wells; the wells that improved were not the same in the three arms. Macro coverage was 0.47--0.48 and 0.57--0.59.
|
||||||
(c) When the test well is scored against the OpendTect time--depth model instead of the marker-calibrated sonic, \mRML{} again improved only at F03-4. We also scored each method against 64 warps of the test well, drawn from an anchor-only posterior whose prior was fitted on the other three wells. The 5--95\% range of band RMSE over these references was 0.06--0.15\,p.u.\ wide for \mRML{} and for B3c-R, and the ranges of the two methods overlapped at F02-1, F03-2 and F03-4. At F06-1 they did not overlap (\mRML: 1.13--1.18\,p.u.; B3c-R: 1.04--1.11\,p.u.).
|
(c) When the test well is scored against the OpendTect time--depth model instead, the \mRML{} again improved only at F03-4. We also scored each method against 64 warps of the test well, drawn from an anchor-only posterior whose prior was fitted on the other three wells. The 5--95\% range of band RMSE over these references was 0.06--0.15\,p.u.\ wide for both methods, and the ranges overlapped at F02-1, F03-2 and F03-4. At F06-1 they did not (\mRML: 1.13--1.18\,p.u.; competitor: 1.04--1.11\,p.u.).
|
||||||
(d) Moving the band cutoff to 5 or 8\,Hz changed no ratio by more than 0.01. With the original PHIE label, \mRML{} improved at three wells, but coverage was lower (0.45 and 0.50). In the window the two labels differ by an RMS of 3.2\,p.u.\ at F02-1 and by less than 0.02\,p.u.\ at the other wells. F02-1 is a training well in three of the four outer folds, and the ratios at those three test wells moved by up to 0.13. This shows how much a ratio near one depends on the label of a single training well. The gate is defined on $\mathrm{PHIE}_{\mathrm{DT}}$, and this row does not change its result.
|
(d) Moving the band cutoff to 5 or 8\,Hz changed no ratio by more than 0.011, but at 8\,Hz the \mRML{} also improved at F03-2 (2/4). With the original PHIE label, it improved at three wells, but coverage was lower (0.45 and 0.50). The two labels differ by an RMS of 3.2\,p.u.\ at F02-1 and by less than 0.02\,p.u.\ at the other wells. F02-1 is a training well in three of the four outer folds, and the ratios at those three test wells moved by up to 0.13, which shows how much a ratio near one depends on the label of a single training well.
|
||||||
|
|
||||||
\begin{table}[t]
|
\begin{table}[t]
|
||||||
\centering
|
\centering
|
||||||
\caption{F3 sensitivity of the G-C comparison (combined ensembles, descriptive). Ratio: band RMSE of \mRML{} divided by that of B3c-R, except in the second row (\mRML{} divided by \mPM). In the $\sigma_a$ rows both methods use the stated $\sigma_a$. Coverage is that of \mRML{} and does not depend on $f_c$ (--). At F03-2 with $f_c = 5$\,Hz the ratio is 1.00002.}
|
\caption{Sensitivity of the F3 comparison (combined ensembles, descriptive). Ratio: band RMSE of \mRML{} divided by that of Phase-est.\ corr., except in the second row (\mRML{} divided by \mPM). In the $\sigma_a$ rows both methods use the stated $\sigma_a$. Coverage is that of \mRML{} and does not depend on $f_c$ (--). At F03-2 with $f_c = 5$\,Hz the ratio is 1.00002.}
|
||||||
\label{tab:f3sens}
|
\label{tab:f3sens}
|
||||||
\small
|
\small
|
||||||
\begin{tabular}{lccccccc}
|
\begin{tabular}{lccccccc}
|
||||||
\toprule
|
\toprule
|
||||||
Variant & F02-1 & F03-2 & F03-4 & F06-1 & improved & cov$_{80}$ & cov$_{90}$ \\
|
Variant & F02-1 & F03-2 & F03-4 & F06-1 & improved & cov$_{80}$ & cov$_{90}$ \\
|
||||||
\midrule
|
\midrule
|
||||||
Registered (Table~\ref{tab:f3gc}) & 1.008 & 1.000 & 0.981 & 1.070 & 1/4 & 0.52 & 0.61 \\
|
Pre-registered (Table~\ref{tab:f3gc}) & 1.008 & 1.000 & 0.981 & 1.070 & 1/4 & 0.52 & 0.61 \\
|
||||||
\mRML{} / \mPM & 0.970 & 1.093 & 0.941 & 1.012 & 2/4 & -- & -- \\
|
\mRML{} / \mPM & 0.970 & 1.093 & 0.941 & 1.012 & 2/4 & -- & -- \\
|
||||||
$\sigma_a = 3.5$\,ms & 1.010 & 0.939 & 1.003 & 1.034 & 1/4 & 0.48 & 0.59 \\
|
$\sigma_a = 3.5$\,ms & 1.010 & 0.939 & 1.003 & 1.034 & 1/4 & 0.48 & 0.59 \\
|
||||||
$\sigma_a = 14$\,ms & 0.989 & 0.959 & 1.020 & 1.035 & 2/4 & 0.47 & 0.57 \\
|
$\sigma_a = 14$\,ms & 0.989 & 0.959 & 1.020 & 1.035 & 2/4 & 0.47 & 0.57 \\
|
||||||
@@ -131,69 +107,66 @@ PHIE label & 0.992 & 0.911 & 1.025 & 0.943 & 3/4 & 0.45 & 0.50 \\
|
|||||||
\end{tabular}
|
\end{tabular}
|
||||||
\end{table}
|
\end{table}
|
||||||
|
|
||||||
\paragraph{Posterior width and anchors.}
|
\paragraph{The posterior was wide, followed the anchor uncertainty and left the phase poorly identified.}
|
||||||
At $\sigma_a = 7$\,ms, $\sigpost$ of the SMC posterior ranged from 1.7 to 3.6\,ms over the 12 training wells of the six training pairs (median 2.8\,ms). Seven of the 12 values lay in the range of 2.5--3.4\,ms estimated before the run from all four wells. By the rule of Experiment~2 every pair is therefore wide ($\sigpost \ge 1.5$\,ms), the regime in which RML helped at $N = 16$. Each F3 model, however, is trained on two wells, and \mRML{} beat \mPM{} at two of the four outer wells (Table~\ref{tab:f3sens}). The width followed $\sigma_a$: it was 1.2--2.3\,ms at $\sigma_a = 3.5$\,ms and 1.8--6.2\,ms at 14\,ms. Without anchors it was 17--38\,ms at F02-1, F03-2 and F03-4, and 1.4--2.0\,ms at F06-1. The wavelet phase was poorly identified. The six phases estimated at $\sigma_a = 7$\,ms spread over an arc of 214$^\circ$. Over the phases evaluated for each pair, a window 90--120$^\circ$ wide, the summed log evidence of the two wells changed by only 1.0--5.0\,nats.
|
At $\sigma_a = 7$\,ms, $\sigpost$ ranged from 1.7 to 3.6\,ms over the 12 training wells of the six training pairs (median 2.8\,ms), and seven of the 12 values lay in the range of 2.5--3.4\,ms estimated before the run from all four wells. Every pair is therefore wide by the rule of Experiment~2. The width followed $\sigma_a$: it was 1.2--2.3\,ms at $\sigma_a = 3.5$\,ms and 1.9--6.2\,ms at 14\,ms. Without anchors it was 17--38\,ms at F02-1, F03-2 and F03-4, and 1.4--2.0\,ms at F06-1. The six phases estimated at $\sigma_a = 7$\,ms spread over an arc of 214$^\circ$. Over the phases evaluated for each pair, a window 90--120$^\circ$ wide, the summed log evidence of the two wells changed by only 1.0--5.0\,nats.
|
||||||
|
|
||||||
Leave-one-anchor-out $z$-scores test the anchor prior on the outer wells. For each well, a linearized Gaussian process conditioned on the anchors alone, with hyperparameters fitted on the other three wells and pick noise $\sigma_a = 7$\,ms, predicts each anchor time from the remaining anchors of that well. Of 62 held-out anchors, 61 lay inside the 90\% interval. The mean $z^2$ was 0.21 (per well: 0.20, 0.01, 0.01 and 0.59), against an expected value of 1. The anchor prior is therefore too wide rather than too narrow, the same direction as the type-II estimate of $\sigma_a$ (0.4\,ms, Section~\ref{sec:method:prior}) and the opposite direction to the under-coverage of porosity. This check does not test the calibration of the SMC posterior, which also depends on the seismic likelihood and the wavelet phase.
|
A second leave-one-anchor-out test, different from that of Section~\ref{sec:method:prior}, checks the anchor prior on the outer wells. For each well, a linearized Gaussian process conditioned on the anchors alone, with hyperparameters fitted on the other three wells and pick noise $\sigma_a = 7$\,ms, predicts each anchor time from the remaining anchors of that well. Of 62 held-out anchors, 61 lay inside the 90\% interval, and the mean $z^2$ was 0.21 (per well: 0.20, 0.01, 0.01 and 0.59), against an expected value of 1. The anchor prior is therefore too wide rather than too narrow, the same direction as the type-II estimate of $\sigma_a$ (0.4\,ms) and the opposite direction to the under-coverage of porosity. This check does not test the calibration of the SMC posterior, which also depends on the seismic likelihood and the wavelet phase.
|
||||||
|
|
||||||
\paragraph{Ablations (descriptive).}
|
\paragraph{Ablations moved the band score by more than the gap under test.}
|
||||||
The protocol lists twelve variants of \mRML{} on $\mathrm{PHIE}_{\mathrm{DT}}$ (Table~\ref{tab:f3abl}). They were scored like every other method, but none enters G-C. M2-anchor-only trains on the 64 anchor-only warps of M1 with the same weights, so it reproduces M1 exactly. Nine of the other eleven variants had lower macro band RMSE than \mRML. The variants spanned 1.242--1.309\,p.u., about four times the gap of 0.016\,p.u.\ between \mRML{} and B3c-R. Bank size had no consistent effect: with 1, 8, 64 and 256 SMC labels, band RMSE was 1.273, 1.256, 1.272 and 1.257\,p.u. A convolutional backbone without the GRU lowered band RMSE by about 2\% for both \mRML{} (M2-TCN) and \mPM{} (B3d-Sa-TCN), so it did not change their order. Removing the anchors (M2-no-anchors) lowered band RMSE to 1.247\,p.u.\ but gave the highest total RMSE of the variants (3.23\,p.u.). M2-fixed-sigma was the only variant with coverage close to nominal (0.87 and 0.92), and this is not calibration. Its predicted standard deviation is fixed at the standard deviation of the training labels, which gave 2.9--4.3\,p.u.\ after mixing, against 1.0--2.1\,p.u.\ for \mRML. Its 80\% intervals covered every sample at F03-2 and F03-4 and 0.74 and 0.73 of the samples at F02-1 and F06-1. The macro value is an average of these, not evidence of correct width. M2-LFM adds the low-pass mean label of the training wells as an input channel. It had the lowest total RMSE of any network (2.62\,p.u., against 2.48\,p.u.\ for B0a) and the highest band RMSE of the variants (1.309\,p.u.). Its gain lies below $f_c$, where the gate does not score.
|
The protocol lists twelve ablations (Table~\ref{tab:f3abl}), scored like every other method. The anchor-only variant trains on the 64 anchor-only warps of the anchor bank with the same weights, so it reproduces that method exactly. Nine of the other eleven variants had lower macro band RMSE than the \mRML{}. The variants spanned 1.242--1.309\,p.u., about four times the gap of 0.016\,p.u.\ between the \mRML{} and its competitor. Bank size had no consistent effect: with 1, 8, 64 and 256 SMC labels, band RMSE was 1.273, 1.256, 1.272 and 1.257\,p.u. A convolutional backbone without the GRU lowered band RMSE by about 2\% for both the \mRML{} and the \mPM{}, so it did not change their order. Removing the anchors lowered band RMSE to 1.247\,p.u.\ but gave the highest total RMSE of the variants (3.23\,p.u.). The fixed-$\sigma$ variant was the only one with coverage close to nominal (0.87 and 0.92), and this is not calibration. Its predicted standard deviation is fixed at that of the training labels, which gave 2.9--4.3\,p.u.\ after mixing, against 1.0--2.1\,p.u.\ for the \mRML{}. Its 80\% intervals covered every sample at F03-2 and F03-4 and 0.74 and 0.73 of the samples at F02-1 and F06-1, so the macro value is an average of these, not evidence of correct width. Adding the low-pass mean label of the training wells as an input gave the lowest total RMSE of any network (2.62\,p.u., against 2.48\,p.u.\ for the depth--time trend) and the highest band RMSE of the variants (1.309\,p.u.). Its gain lies below $f_c$, where the pass rule does not score.
|
||||||
|
|
||||||
\begin{table}[t]
|
\begin{table}[t]
|
||||||
\centering
|
\centering
|
||||||
\caption{Ablations of \mRML{} on F3 (label $\mathrm{PHIE}_{\mathrm{DT}}$, marker-calibrated reference, $\sigma_a = 7$\,ms, combined ensembles; descriptive). Macro over four wells; RMSE in p.u. M2-anchor-only is identical to M1 by construction.}
|
\caption{Ablations of \mRML{} on F3 (label $\mathrm{PHIE}_{\mathrm{DT}}$, marker-calibrated reference, $\sigma_a = 7$\,ms, combined ensembles; descriptive). Macro over four wells; RMSE in p.u. The anchor-only variant is identical to the anchor bank by construction.}
|
||||||
\label{tab:f3abl}
|
\label{tab:f3abl}
|
||||||
\small
|
\small
|
||||||
\begin{tabular}{l>{\raggedright\arraybackslash}p{6.4cm}cccc}
|
\begin{tabular}{l>{\raggedright\arraybackslash}p{5.4cm}cccc}
|
||||||
\toprule
|
\toprule
|
||||||
Variant & change from \mRML & band RMSE & RMSE & cov$_{80}$ & cov$_{90}$ \\
|
Variant & change from \mRML & band RMSE & RMSE & cov$_{80}$ & cov$_{90}$ \\
|
||||||
\midrule
|
\midrule
|
||||||
\mRML & registered method: 64 SMC labels, CNN--GRU backbone & 1.272 & 3.12 & 0.52 & 0.61 \\
|
\mRML & pre-registered method: 64 SMC labels, CNN--GRU backbone & 1.272 & 3.12 & 0.52 & 0.61 \\
|
||||||
\midrule
|
\midrule
|
||||||
M2-anchor-only & 64 anchor-only warps (= M1) & 1.286 & 3.14 & 0.50 & 0.58 \\
|
Anchor only & 64 anchor-only warps (= anchor bank) & 1.286 & 3.14 & 0.50 & 0.58 \\
|
||||||
M2-no-anchors & no anchor conditioning; prior hyperparameters at the pre-declared medians & 1.247 & 3.23 & 0.48 & 0.56 \\
|
No anchors & no anchor conditioning; prior hyperparameters at the pre-declared medians & 1.247 & 3.23 & 0.48 & 0.56 \\
|
||||||
M2-bulk & sonic integration plus a constant shift, resampled by the seismic likelihood & 1.251 & 3.16 & 0.49 & 0.58 \\
|
Bulk shift only & sonic integration plus a constant shift, resampled by the seismic likelihood & 1.251 & 3.16 & 0.49 & 0.58 \\
|
||||||
M2-lambda1 & $\lambda = 1$ instead of $1/\tau_c$ & 1.257 & 3.09 & 0.52 & 0.62 \\
|
$\lambda = 1$ & $\lambda = 1$ instead of $1/\tau_c$ & 1.257 & 3.09 & 0.52 & 0.62 \\
|
||||||
M2-S1 & 1 SMC label & 1.273 & 3.08 & 0.48 & 0.57 \\
|
1 label & 1 SMC label & 1.273 & 3.08 & 0.48 & 0.57 \\
|
||||||
M2-S8 & 8 SMC labels & 1.256 & 3.11 & 0.48 & 0.59 \\
|
8 labels & 8 SMC labels & 1.256 & 3.11 & 0.48 & 0.59 \\
|
||||||
M2-S256 & 256 SMC labels & 1.257 & 3.10 & 0.50 & 0.58 \\
|
256 labels & 256 SMC labels & 1.257 & 3.10 & 0.50 & 0.58 \\
|
||||||
M2-fixed-sigma & $\sigma$ fixed at the training-label standard deviation & 1.242 & 3.08 & 0.87 & 0.92 \\
|
Fixed $\sigma$ & $\sigma$ fixed at the training-label standard deviation & 1.242 & 3.08 & 0.87 & 0.92 \\
|
||||||
M2-legacy-loss & composite loss of B2 on the bank mean added & 1.243 & 3.11 & 0.41 & 0.49 \\
|
Composite loss added & composite loss on the bank mean added & 1.243 & 3.11 & 0.41 & 0.49 \\
|
||||||
M2-TCN & four dilated convolutions, no GRU & 1.245 & 3.10 & 0.38 & 0.48 \\
|
TCN & four dilated convolutions, no GRU & 1.245 & 3.10 & 0.38 & 0.48 \\
|
||||||
B3d-Sa-TCN & \mPM{} with the M2-TCN backbone & 1.250 & 3.13 & 0.40 & 0.49 \\
|
\mPM{}, TCN & \mPM{} with the TCN backbone & 1.250 & 3.13 & 0.40 & 0.49 \\
|
||||||
M2-LFM & low-pass mean training label as an extra input & 1.309 & 2.62 & 0.40 & 0.50 \\
|
Low-frequency input & low-pass mean training label as an extra input & 1.309 & 2.62 & 0.40 & 0.50 \\
|
||||||
\bottomrule
|
\bottomrule
|
||||||
\end{tabular}
|
\end{tabular}
|
||||||
\end{table}
|
\end{table}
|
||||||
|
|
||||||
\paragraph{Predicted volume (descriptive).}
|
\paragraph{Predicted volume.}
|
||||||
A deployment ensemble of \mRML{} predicted all 649 interior inlines of the survey (Fig.~\ref{fig:f3vol}). It has 20 members: four three-well training sets $\times$ five seeds. The map shows sonic-derived porosity and its ensemble standard deviation. Away from the wells there is no ground truth, and three of the four training sets include any given well, so the prediction at a well is not blind. The same kind of ensemble under-covered at the outer wells, so its standard deviation is not a calibrated error bar. Over the $649 \times 949$ interior traces and the 600--1100\,ms window, the median of the predicted mean was 29.6\,p.u.\ (5--95\% of samples: 27.9--31.5\,p.u.). The median standard deviation was 1.3\,p.u.\ (5--95\%: 0.8--2.5\,p.u.). It was larger above 700\,ms (median 2.0\,p.u.) than below (1.2\,p.u.). Even the median standard deviation is less than half the total RMSE of \mRML{} at the outer wells (3.12\,p.u.).
|
A deployment ensemble of the \mRML{} (four three-well training sets $\times$ five seeds) predicted all 649 interior inlines of the survey. The volume is archived as a descriptive product. It is not blind at the wells, and its standard deviation is not a calibrated error bar.
|
||||||
|
|
||||||
\begin{figure}[t]
|
\subsection{Volve field data}
|
||||||
\centering
|
|
||||||
\includegraphics[width=\linewidth]{f3_volume.pdf}
|
|
||||||
\caption{Descriptive prediction of sonic-derived porosity ($\mathrm{PHIE}_{\mathrm{DT}}$) on F3 inline 442, through F03-4 (dashed line): (a) mean and (b) standard deviation of the 20-member \mRML{} deployment ensemble. Colour limits: 1st--99th percentile of the section for (a), 0 to the 99th percentile for (b). Three of the four training sets include F03-4, so the prediction at the well is not blind. Intervals from this kind of ensemble under-covered at the outer wells (Table~\ref{tab:f3gc}).}
|
|
||||||
\label{fig:f3vol}
|
|
||||||
\end{figure}
|
|
||||||
|
|
||||||
\paragraph{Execution.}
|
|
||||||
The run stopped once, after 132 of 649 volume inlines, when the operating system refused to replace a progress-display file. By then the gate had been computed. Only volume inference was resumed, with the locked code and models. Registration, training and scoring were not rerun, and the 132 inlines written before the stop were verified to be unchanged.
|
|
||||||
|
|
||||||
\subsection{Volve field data (gate G-D)}
|
|
||||||
\label{sec:exp:volve}
|
\label{sec:exp:volve}
|
||||||
|
|
||||||
\paragraph{Protocol and deviations.}
|
\paragraph{Data.}
|
||||||
The Volve test was designed on 28 October 2026, after the F3 gate had failed and before any porosity metric, prediction or training run on Volve. Its protocol follows the F3 protocol, and the lock again covers the code, the input data and the software environment. The lock file records that it was written at 01:17:42 UTC on 29 October 2026, before the primary run started; as on F3, this record is the time stamp inside the lock file. Before the lock, a timing pilot ran the registration on training wells only. Two design choices used Volve data, and neither used a porosity value: the target window, taken from the positions of the labelled samples of the six wells, and the member-support rule (ii) below, taken from a CPU smoke test on training wells. The protocol records eleven deviations from F3, of which four matter for reading the result. (i) The label runs are 16--37 samples long, shorter than the 64-sample training windows and the 6\,Hz band split of F3, so the primary metric is total RMSE on the labelled samples, and the loss uses a single 126-sample window with a mask over the label support of each bank member. (ii) Each bank member trains on its own label support. The first draft intersected the supports of all members, which reduced F-11 A to 7 samples, below the minimum of 8; the intersection is kept as a diagnostic. (iii) Under the slot scheme the inner validation is leave-one-well-out rather than slot-blind, because three slots leave too few groups, so inner validation can be optimistic there. (iv) The anchor uncertainty $\sigma_a = 7$\,ms is inherited from F3, not estimated on Volve. One deviation occurred after the lock. The protocol listed the $\sigma_a$ arms after the primary arm on one GPU; they ran concurrently on a second GPU of the same type. The device is not part of the job fingerprint, every job seeds itself, and the primary-arm gate recomputed with all arms present was identical. Like F3, this is a post-failure design on a dataset we had inspected, not an independent replication.
|
\label{sec:data:volve}
|
||||||
|
Volve (Norwegian North Sea) was released by Equinor in 2018 \citep{equinor2018volve}; the licence files of the release name CC BY-NC-SA 4.0. Its role is to break the label structure of F3. The computed effective porosity PHIF of the operator's petrophysical interpretation is driven by density, not by sonic: within each well its correlation with RHOB is $-0.92$ to $-0.99$, RHOB and NPHI explain 84--98\% of its variance, and adding DT raises this by at most 0.9 percentage points. Six wells have DT, RHOB, neutron porosity (NPHI) and PHIF: F-1, F-1 A, F-1 B, F-11 A, F-11 T2 and F-12. All six are deviated (maximum inclination 30--82$^\circ$; 4--54$^\circ$ over the labelled interval), and they share one platform. F-1 A and F-1 B leave the F-1 borehole at 2587\,m measured depth (MD), and F-11 A leaves F-11 T2 at about 2580\,m MD, so the wells form three slot groups, \{F-1, F-1 A, F-1 B\}, \{F-11 A, F-11 T2\} and \{F-12\}, whose members share the hole above the kick-off.
|
||||||
|
|
||||||
|
We use the post-stack ST10010 full-angle stack (3--41$^\circ$), a 2011 depth migration converted to time, at 4\,ms sampling. Its trace headers carry an invalid time scalar that standard readers apply to the start time, which shifts every sample 8\,ms late. We use the start time of the text header (4\,ms) and checked it against five interpreted horizons: the amplitude extremum along each falls at a lag of 0 to $+2$\,ms. Trajectories come from the operator's definitive surveys; recomputing them by minimum curvature reproduces the listed true vertical depth (TVD) within 0.01\,m. The seismic input of a well is a $3\times3$ patch of traces interpolated bilinearly along the deviated path at the time given by its time--depth relation, because a vertical trace at one bin differs from the path composite by a relative RMS of 0.19--0.61 over the labelled interval. Learning uses the window 2400--2900\,ms (126 samples) and tie likelihoods the extended window 2000--3200\,ms.
|
||||||
|
|
||||||
|
Of the six wells, only F-11 T2 has a zero-offset vertical seismic profile (VSP). As anchors we use the operator's well picks with a TWT from the Ty Formation downwards, excluding picks flagged as not logged, not reached or faulted; each well has 4--9 such anchors within its logged sonic interval. Shallower picks are unreliable (picks at the same depth in a shared borehole differ by about 110\,ms). At reservoir level every unflagged pick lies within $\pm 10$\,ms of the corresponding interpreted horizon, and at F-11 T2 the picks lie within $-6.1$ to $+2.3$\,ms of the VSP. The pick times come from the operator's time--depth models, so they are interpretations, not measurements, as on F3. Time is vertical time: DT is integrated over TVD and calibrated to the anchors by stretching between them. At F-11 T2 this marker-calibrated sonic lies within $-2.4$ to $-0.8$\,ms of the VSP over the labelled interval. We keep $\sigma_a = 7$\,ms from F3; it is not estimated on Volve.
|
||||||
|
|
||||||
|
PHIF is used only where DT is valid, which leaves 16--37 labelled 4\,ms samples per well (150 in total) at 2509--2819\,ms. The labelled runs lie 25--179\,m below the deepest anchor, so their timing depends on the drift of the sonic below it. They are shorter than one period at 6\,Hz, so the band split of F3 cannot be the primary metric here; band PCC is computed only descriptively, on high-passed runs of at least 16 samples. The well means of PHIF range from 8.5\,p.u.\ at F-1 to 17.0\,p.u.\ at F-12, against standard deviations of 3.3--6.0\,p.u.\ within wells.
|
||||||
|
|
||||||
\paragraph{Design.}
|
\paragraph{Design.}
|
||||||
The six wells are held out under two schemes (Section~\ref{sec:data:volve}). Under \emph{lowo}, each well is the outer test well once and the other five train. Under \emph{slot}, the whole slot group of the test well is held out, so F-1 trains on F-11 A, F-11 T2 and F-12 only; for F-12, which is alone in its slot, the two schemes coincide and its rows are identical. Within the outer training wells, each is held out once as an inner validation well. The held-out well never supplies its picks, sonic or logs to its own input. Its path is placed in time by the mean TVDSS--TWT relation of the wells it is held out from, which also moves the 3$\times$3 patch laterally along the deviated trajectory (by up to 76\,m, F-1 A under slot). Registration ($\sigma_a = 7$\,ms, $P = 1024$, $S = 64$) uses the training wells of each model only. Budgets are chosen from $\{125, 250, 500, 1000, 2000\}$ by inner-validation MSE on the labelled samples, and the prediction at the outer well is the moment-matched mixture of the inner models at the selected budget and five seeds (25 members under lowo, 15--25 under slot). The reference is the marker-calibrated vertical sonic of the test well. Gate G-D is descriptive. ``Consistent improvement'' needs \mRML{} below the selected point tie (B3b, B3c or B3c-R, by inner validation) at no fewer than five of six wells under both schemes, the F3 rule of three of four scaled up. ``Calibrated'' needs macro coverage of the 80\% and 90\% intervals within $[0.75, 0.85]$ and $[0.85, 0.95]$ under both schemes. Neither wording can override the F3 result.
|
The six wells are held out under two schemes. Under \emph{lowo}, each well is the outer test well once and the other five train. Under \emph{slot}, the whole slot group of the test well is held out, so F-1 trains on F-11 A, F-11 T2 and F-12 only; for F-12, which is alone in its slot, the two schemes coincide. Within the outer training wells, each is held out once as an inner validation well. The held-out well never supplies its picks, sonic or logs to its own input. Its path is placed in time by the mean TVDSS--TWT relation of the wells it is held out from, which also moves the 3$\times$3 patch laterally along the deviated trajectory (by up to 76\,m, F-1 A under slot). Registration ($\sigma_a = 7$\,ms, $N_p = 1024$, $S = 64$) uses the training wells of each model only. Budgets are chosen from $\{125, 250, 500, 1000, 2000\}$ by inner-validation MSE on the labelled samples, and the prediction at the outer well is the moment-matched mixture of the inner models at the selected budget and five seeds (25 members under lowo, 15--25 under slot). The reference is the marker-calibrated vertical sonic of the test well. The pass rule is descriptive. ``Consistent improvement'' needs the \mRML{} below the selected deterministic tie at no fewer than five of six wells under both schemes, the F3 rule of three of four scaled up. ``Calibrated'' needs macro coverage of the 80\% and 90\% intervals within $[0.75, 0.85]$ and $[0.85, 0.95]$ under both schemes.
|
||||||
|
|
||||||
\paragraph{Result: neither condition held.}
|
\paragraph{Neither condition held.}
|
||||||
Table~\ref{tab:volvegd} gives the per-well comparison. Under lowo, inner validation chose B3b at every well, and \mRML{} had lower RMSE at two wells (F-1 B by 1.1\% and F-11 T2 by 1.5\%). At the other four it was 0.4--4.6\% worse. Its macro RMSE was 6.50\,p.u.\ against 6.36\,p.u.\ for B3b. Under slot, inner validation chose B3c in the F-1 slot and B3b in the others, and \mRML{} improved at three wells. The two large ratios in that scheme, 0.85 at F-1 and 0.90 at F-1 B, are against B3c, which had the lowest inner-validation MSE in that fold but was worse than B3b at both test wells (8.04 against 7.27\,p.u.\ and 5.35 against 5.17\,p.u.); against B3b, \mRML{} is 5.8\% better at F-1 and 7.1\% better at F-1 B. Its macro RMSE under slot was 7.13\,p.u.\ against 7.32\,p.u.\ for the selected ties. Against \mPM, trained on the mean of the same posterior, \mRML{} was lower at three of six wells under lowo and four of six under slot, with macro differences of 0.02 and 0.13\,p.u. Macro coverage was 0.39 and 0.48 (lowo) and 0.35 and 0.47 (slot) for the 80\% and 90\% intervals, lower than on F3 and far below the bands. No well reached nominal coverage; the highest values were 0.68 and 0.72 at F-1 B. Nothing was changed after the test wells were scored. We make no claim of improvement and no claim of calibrated uncertainty on Volve.
|
Under lowo, inner validation chose the calibrated sonic at every well, and the \mRML{} had lower RMSE at two wells (F-1 B by 1.1\% and F-11 T2 by 1.5\%) and was 0.4--4.6\% worse at the other four (Table~\ref{tab:volvegd}). Its macro RMSE was 6.50\,p.u.\ against 6.36\,p.u.\ for the calibrated sonic. Under slot, inner validation chose the correlation tie in the F-1 slot and the calibrated sonic in the others, and the \mRML{} improved at three wells. The two large ratios in that scheme, 0.85 at F-1 and 0.90 at F-1 B, are against the correlation tie, which had the lowest inner-validation MSE in that fold but was worse than the calibrated sonic at both test wells (8.04 against 7.27\,p.u.\ and 5.35 against 5.17\,p.u.); against the calibrated sonic, the \mRML{} is 5.7\% better at F-1 and 7.2\% better at F-1 B. Its macro RMSE under slot was 7.13\,p.u.\ against 7.32\,p.u.\ for the selected ties. Against the \mPM{}, the \mRML{} was lower at three of six wells under lowo and four of six under slot, with macro differences of 0.02 and 0.13\,p.u. Macro coverage was 0.39 and 0.48 (lowo) and 0.35 and 0.47 (slot) for the 80\% and 90\% intervals, and no well reached nominal coverage; the highest values were 0.68 and 0.72 at F-1 B.
|
||||||
|
|
||||||
\begin{table}[t]
|
\begin{table}[t]
|
||||||
\centering
|
\centering
|
||||||
\caption{Gate G-D on Volve (label PHIF, marker-calibrated vertical-sonic reference, labelled samples in 2400--2900\,ms, $\sigma_a = 7$\,ms, combined ensembles). Competitor: the point tie chosen by inner validation. Ratio: RMSE of \mRML{} divided by that of the competitor. $n$: labelled 4\,ms samples. Coverage: fraction of those samples inside the central interval of \mRML. F-12 is alone in its slot, so its two rows are identical.}
|
\caption{Volve pass rule (label PHIF, marker-calibrated vertical-sonic reference, labelled samples in 2400--2900\,ms, $\sigma_a = 7$\,ms, combined ensembles). Competitor: the deterministic tie chosen by inner validation. Ratio: RMSE of \mRML{} divided by that of the competitor. $n$: labelled 4\,ms samples. Coverage: fraction of those samples inside the central interval of \mRML. F-12 is alone in its slot, so its two rows are identical.}
|
||||||
\label{tab:volvegd}
|
\label{tab:volvegd}
|
||||||
\small
|
\small
|
||||||
\setlength{\tabcolsep}{4pt}
|
\setlength{\tabcolsep}{4pt}
|
||||||
@@ -201,20 +174,20 @@ Table~\ref{tab:volvegd} gives the per-well comparison. Under lowo, inner validat
|
|||||||
\toprule
|
\toprule
|
||||||
Scheme & Outer well & $n$ & competitor & ratio & improved & cov$_{80}$ & cov$_{90}$ \\
|
Scheme & Outer well & $n$ & competitor & ratio & improved & cov$_{80}$ & cov$_{90}$ \\
|
||||||
\midrule
|
\midrule
|
||||||
lowo & F-1 & 37 & B3b & 1.035 & no & 0.459 & 0.541 \\
|
lowo & F-1 & 37 & Calibrated sonic & 1.035 & no & 0.459 & 0.541 \\
|
||||||
& F-1 A & 20 & B3b & 1.004 & no & 0.450 & 0.550 \\
|
& F-1 A & 20 & Calibrated sonic & 1.004 & no & 0.450 & 0.550 \\
|
||||||
& F-1 B & 25 & B3b & 0.989 & yes & 0.680 & 0.720 \\
|
& F-1 B & 25 & Calibrated sonic & 0.989 & yes & 0.680 & 0.720 \\
|
||||||
& F-11 A & 16 & B3b & 1.046 & no & 0.188 & 0.313 \\
|
& F-11 A & 16 & Calibrated sonic & 1.046 & no & 0.188 & 0.313 \\
|
||||||
& F-11 T2 & 23 & B3b & 0.985 & yes & 0.261 & 0.435 \\
|
& F-11 T2 & 23 & Calibrated sonic & 0.985 & yes & 0.261 & 0.435 \\
|
||||||
& F-12 & 29 & B3b & 1.043 & no & 0.276 & 0.310 \\
|
& F-12 & 29 & Calibrated sonic & 1.043 & no & 0.276 & 0.310 \\
|
||||||
& Macro & & & & 2/6 & 0.386 & 0.478 \\
|
& Macro & & & & 2/6 & 0.386 & 0.478 \\
|
||||||
\midrule
|
\midrule
|
||||||
slot & F-1 & 37 & B3c & 0.852 & yes & 0.270 & 0.432 \\
|
slot & F-1 & 37 & Correlation tie & 0.852 & yes & 0.270 & 0.432 \\
|
||||||
& F-1 A & 20 & B3c & 1.034 & no & 0.450 & 0.600 \\
|
& F-1 A & 20 & Correlation tie & 1.034 & no & 0.450 & 0.600 \\
|
||||||
& F-1 B & 25 & B3c & 0.897 & yes & 0.600 & 0.720 \\
|
& F-1 B & 25 & Correlation tie & 0.897 & yes & 0.600 & 0.720 \\
|
||||||
& F-11 A & 16 & B3b & 1.002 & no & 0.188 & 0.375 \\
|
& F-11 A & 16 & Calibrated sonic & 1.002 & no & 0.188 & 0.375 \\
|
||||||
& F-11 T2 & 23 & B3b & 0.988 & yes & 0.304 & 0.391 \\
|
& F-11 T2 & 23 & Calibrated sonic & 0.988 & yes & 0.304 & 0.391 \\
|
||||||
& F-12 & 29 & B3b & 1.043 & no & 0.276 & 0.310 \\
|
& F-12 & 29 & Calibrated sonic & 1.043 & no & 0.276 & 0.310 \\
|
||||||
& Macro & & & & 3/6 & 0.348 & 0.472 \\
|
& Macro & & & & 3/6 & 0.348 & 0.472 \\
|
||||||
\midrule
|
\midrule
|
||||||
\multicolumn{5}{l}{Required, under both schemes} & $\ge 5/6$ & $[0.75, 0.85]$ & $[0.85, 0.95]$ \\
|
\multicolumn{5}{l}{Required, under both schemes} & $\ge 5/6$ & $[0.75, 0.85]$ & $[0.85, 0.95]$ \\
|
||||||
@@ -222,12 +195,16 @@ slot & F-1 & 37 & B3c & 0.852 & yes & 0.270 & 0.432 \\
|
|||||||
\end{tabular}
|
\end{tabular}
|
||||||
\end{table}
|
\end{table}
|
||||||
|
|
||||||
\paragraph{No method had blind-well skill.}
|
\paragraph{No method had blind-well skill, because the between-well level dominates.}
|
||||||
Table~\ref{tab:volveall} lists the five registered methods. Every macro $R^2$ was negative under both schemes ($-0.84$ to $-1.71$): each method predicted the held-out well worse than that well's own label mean, which it cannot know. The macro PCC was 0.12--0.24. After the run we added one row for scale: a constant prediction at the pooled label mean of the outer training wells, with no seismic input. Its macro RMSE was 6.03\,p.u.\ (lowo) and 6.59\,p.u.\ (slot), below every network. Networks beat it only at F-1 and F-1 B; at the other four wells every network was worse than the constant under both schemes. The reason is the between-well variation of the label. The well means of PHIF span 8.5\,p.u.\ (F-1) to 17.0\,p.u.\ (F-12), while the within-well standard deviation is 3.3--6.0\,p.u. A held-out well therefore differs from the training mean by up to 6.4\,p.u.\ before any seismic information is used, and the networks reproduced this offset rather than correcting it: the mean error of \mRML{} at each well tracked the constant's (lowo: $+3.9$ against $+4.9$\,p.u.\ at F-1, $-5.4$ against $-4.3$ at F-11 A, $-6.8$ against $-6.0$ at F-12). After removing the per-well mean error, the standard deviation of the residual of \mRML{}, averaged over wells, was 5.2\,p.u.\ (lowo) and 5.1\,p.u.\ (slot), against an average within-well label standard deviation of 4.8\,p.u., and the standard deviation of its prediction along a well was 1.1--4.1\,p.u. The predictions varied less than the label and did not follow it. Allowing a free time shift of up to $\pm 64$\,ms between prediction and label (a diagnostic that never alters a score) raised the PCC of \mRML{} to 0.40--0.82. At three (lowo) and four (slot) of the six wells, however, the chosen shift was 56--64\,ms, at or near the search limit and far outside the tie posterior ($\sigpost$ below 10\,ms; see below). With 16--37 samples, the maximum over 33 lags is an optimistic statistic, and we read this diagnostic as uninformative. The differences between tie methods, up to 0.25\,p.u.\ in macro RMSE, are therefore differences between predictions that are all dominated by an error the tie does not control. The G-D comparison had no power on these wells, and its outcome is not evidence about RML in either direction.
|
Every macro $R^2$ was negative under both schemes ($-0.84$ to $-1.71$, Table~\ref{tab:volveall}). Except at F-1 B ($R^2$ 0.10--0.34 for every method under lowo, 0.05--0.07 for the \mPM{} and \mRML{} under slot), each method predicted the held-out well worse than that well's own label mean, which it cannot know. The macro PCC was 0.12--0.24. A constant prediction at the pooled label mean of the outer training wells, added after the run for scale, had a macro RMSE of 6.03\,p.u.\ (lowo) and 6.59\,p.u.\ (slot), below every network. Networks beat it only at F-1 and F-1 B (at F-1 under slot, only the \mPM{} and \mRML{}).
|
||||||
|
|
||||||
|
The reason is the between-well variation of the label. The well means of PHIF span 8.5\,p.u.\ (F-1) to 17.0\,p.u.\ (F-12), so a held-out well differs from the training mean by up to 6.4\,p.u.\ before any seismic information is used. The networks reproduced this offset rather than correcting it: the mean error of the \mRML{} at each well tracked the constant's (lowo: $+3.9$ against $+4.9$\,p.u.\ at F-1, $-5.4$ against $-4.3$ at F-11 A, $-6.8$ against $-6.0$ at F-12). After removing the per-well mean error, the standard deviation of its residual, averaged over wells, was 5.2\,p.u.\ (lowo) and 5.1\,p.u.\ (slot), against an average within-well label standard deviation of 4.8\,p.u., and the standard deviation of its prediction along a well was 1.1--4.1\,p.u. The predictions varied less than the label and did not follow it.
|
||||||
|
|
||||||
|
A free time shift of up to $\pm 64$\,ms between prediction and label, a diagnostic that never alters a score, raised the PCC of the \mRML{} to 0.40--0.82. At three (lowo) and four (slot) of the six wells, however, the chosen shift was 56--64\,ms, at or near the search limit and far outside the tie posterior ($\sigpost$ below 10\,ms). With 16--37 samples, the maximum over 33 lags is an optimistic statistic, and we read this diagnostic as uninformative. The differences between tie methods, up to 0.26\,p.u.\ in macro RMSE, are differences between predictions that are all dominated by an error the tie does not control. The comparison had no power on these wells, and its outcome is not evidence about RML in either direction.
|
||||||
|
|
||||||
\begin{table}[t]
|
\begin{table}[t]
|
||||||
\centering
|
\centering
|
||||||
\caption{Volve nested blind folds, all registered methods (label PHIF, marker-calibrated vertical-sonic reference, $\sigma_a = 7$\,ms, combined ensembles). Macro over six wells; RMSE in p.u. Coverage is descriptive. Last row: a constant prediction at the pooled label mean of the outer training wells, with no seismic input; computed after the run, for scale only.}
|
\caption{Volve nested blind folds, all pre-registered methods (label PHIF, marker-calibrated vertical-sonic reference, $\sigma_a = 7$\,ms, combined ensembles). Macro over six wells; RMSE in p.u. Coverage is descriptive. Last row: a constant prediction at the pooled label mean of the outer training wells, with no seismic input; computed after the run, for scale only.}
|
||||||
\label{tab:volveall}
|
\label{tab:volveall}
|
||||||
\small
|
\small
|
||||||
\begin{tabular}{lcccccccc}
|
\begin{tabular}{lcccccccc}
|
||||||
@@ -236,9 +213,9 @@ Table~\ref{tab:volveall} lists the five registered methods. Every macro $R^2$ wa
|
|||||||
\cmidrule(lr){2-5}\cmidrule(lr){6-9}
|
\cmidrule(lr){2-5}\cmidrule(lr){6-9}
|
||||||
Method & RMSE & $R^2$ & cov$_{80}$ & cov$_{90}$ & RMSE & $R^2$ & cov$_{80}$ & cov$_{90}$ \\
|
Method & RMSE & $R^2$ & cov$_{80}$ & cov$_{90}$ & RMSE & $R^2$ & cov$_{80}$ & cov$_{90}$ \\
|
||||||
\midrule
|
\midrule
|
||||||
B3b & 6.36 & $-0.84$ & 0.38 & 0.46 & 7.29 & $-1.64$ & 0.32 & 0.43 \\
|
Calibrated sonic & 6.36 & $-0.84$ & 0.38 & 0.46 & 7.29 & $-1.64$ & 0.32 & 0.43 \\
|
||||||
B3c & 6.55 & $-0.97$ & 0.32 & 0.40 & 7.32 & $-1.71$ & 0.33 & 0.40 \\
|
Correlation tie & 6.55 & $-0.97$ & 0.32 & 0.40 & 7.32 & $-1.71$ & 0.33 & 0.40 \\
|
||||||
B3c-R & 6.61 & $-1.02$ & 0.32 & 0.39 & 7.24 & $-1.61$ & 0.29 & 0.35 \\
|
Phase-est.\ corr. & 6.61 & $-1.02$ & 0.32 & 0.39 & 7.24 & $-1.61$ & 0.29 & 0.35 \\
|
||||||
\mPM & 6.52 & $-0.96$ & 0.39 & 0.45 & 7.26 & $-1.59$ & 0.33 & 0.44 \\
|
\mPM & 6.52 & $-0.96$ & 0.39 & 0.45 & 7.26 & $-1.59$ & 0.33 & 0.44 \\
|
||||||
\mRML & 6.50 & $-0.92$ & 0.39 & 0.48 & 7.13 & $-1.48$ & 0.35 & 0.47 \\
|
\mRML & 6.50 & $-0.92$ & 0.39 & 0.48 & 7.13 & $-1.48$ & 0.35 & 0.47 \\
|
||||||
\midrule
|
\midrule
|
||||||
@@ -247,19 +224,20 @@ Constant (training mean) & \textbf{6.03} & $-0.70$ & -- & -- & \textbf{6.59} & $
|
|||||||
\end{tabular}
|
\end{tabular}
|
||||||
\end{table}
|
\end{table}
|
||||||
|
|
||||||
\paragraph{Anchor uncertainty.}
|
\paragraph{The anchor uncertainty barely changed the error.}
|
||||||
B3c-R, \mPM{} and \mRML{} were registered and trained again at $\sigma_a = 3.5$ and 14\,ms (Table~\ref{tab:volvesens}). The macro RMSE of \mRML{} moved by at most 0.06\,p.u.\ (lowo: 6.49, 6.50 and 6.55\,p.u.; slot: 7.13, 7.13 and 7.09\,p.u.), and coverage stayed between 0.35 and 0.52. The number of wells at which \mRML{} beat B3c-R varied between two and four of six, with no pattern across the arms. In Experiment~2 the H2a advantage depended on $\sigma_a$, and on F3 the arms changed the per-well ratios but not the outcome. On Volve they barely changed the macro error, which is consistent with the previous paragraph: when the error is set by the between-well level, the tie has little to act on.
|
The phase-estimated correlation, the \mPM{} and the \mRML{} were registered and trained again at $\sigma_a = 3.5$ and 14\,ms (Table~\ref{tab:volvesens}). The macro RMSE of the \mRML{} moved by at most 0.07\,p.u.\ (lowo: 6.49, 6.50 and 6.55\,p.u.; slot: 7.13, 7.13 and 7.09\,p.u.), and coverage stayed between 0.35 and 0.52. The number of wells at which the \mRML{} beat its competitor varied between two and four of six, with no pattern across the arms. This is consistent with the previous paragraph: when the error is set by the between-well level, the tie has little to act on.
|
||||||
|
|
||||||
\begin{table}[t]
|
\begin{table}[t]
|
||||||
\centering
|
\centering
|
||||||
\caption{Volve sensitivity to $\sigma_a$ (combined ensembles, descriptive). Macro RMSE in p.u.\ of \mRML{} and of B3c-R at the same $\sigma_a$; improved: wells at which \mRML{} is below B3c-R; coverage of \mRML. The registered comparison of Table~\ref{tab:volvegd} is against the tie chosen by inner validation, which is B3b at most wells, so its counts differ.}
|
\caption{Volve sensitivity to $\sigma_a$ (combined ensembles, descriptive). Macro RMSE in p.u.\ of \mRML{} and of Phase-est.\ corr. at the same $\sigma_a$; improved: wells at which \mRML{} is below Phase-est.\ corr.; coverage of \mRML. The pre-registered comparison of Table~\ref{tab:volvegd} is against the tie chosen by inner validation, which is Calibrated sonic at most wells, so its counts differ.}
|
||||||
\label{tab:volvesens}
|
\label{tab:volvesens}
|
||||||
\small
|
\small
|
||||||
|
\setlength{\tabcolsep}{2.5pt}
|
||||||
\begin{tabular}{lcccccccc}
|
\begin{tabular}{lcccccccc}
|
||||||
\toprule
|
\toprule
|
||||||
& \multicolumn{4}{c}{lowo} & \multicolumn{4}{c}{slot} \\
|
& \multicolumn{4}{c}{lowo} & \multicolumn{4}{c}{slot} \\
|
||||||
\cmidrule(lr){2-5}\cmidrule(lr){6-9}
|
\cmidrule(lr){2-5}\cmidrule(lr){6-9}
|
||||||
$\sigma_a$ (ms) & \mRML & B3c-R & improved & cov$_{90}$ & \mRML & B3c-R & improved & cov$_{90}$ \\
|
$\sigma_a$ (ms) & \mRML & Phase-est.\ corr. & improved & cov$_{90}$ & \mRML & Phase-est.\ corr. & improved & cov$_{90}$ \\
|
||||||
\midrule
|
\midrule
|
||||||
3.5 & 6.49 & 6.65 & 4/6 & 0.48 & 7.13 & 7.28 & 3/6 & 0.42 \\
|
3.5 & 6.49 & 6.65 & 4/6 & 0.48 & 7.13 & 7.28 & 3/6 & 0.42 \\
|
||||||
7 & 6.50 & 6.61 & 4/6 & 0.48 & 7.13 & 7.24 & 2/6 & 0.47 \\
|
7 & 6.50 & 6.61 & 4/6 & 0.48 & 7.13 & 7.24 & 2/6 & 0.47 \\
|
||||||
@@ -268,5 +246,10 @@ $\sigma_a$ (ms) & \mRML & B3c-R & improved & cov$_{90}$ & \mRML & B3c-R & improv
|
|||||||
\end{tabular}
|
\end{tabular}
|
||||||
\end{table}
|
\end{table}
|
||||||
|
|
||||||
\paragraph{Posterior width and phase.}
|
\paragraph{The posterior width was set by the data, and registration was not the limiting step.}
|
||||||
Over the 78 training-well registrations of the primary arm, $\sigpost$ of the SMC posterior was 1.9--9.3\,ms over the main window (median 4.3\,ms) and 3.0\,ms over the labelled samples. It was narrowest at F-11 T2 (1.9--2.6\,ms) and widest at F-12 (4.3--9.3\,ms). Unlike F3, the width barely followed $\sigma_a$: the medians were 3.8, 4.3 and 4.1\,ms at 3.5, 7 and 14\,ms. This is consistent with the seismic likelihood rather than the anchor prior setting the width over the logged interval, but we did not test it. By the rule of Experiment~2 every training set was wide. The wavelet phase was better identified than on F3: the 22 phases of the primary arm lay within an arc of 43$^\circ$, against 214$^\circ$ on F3. A well-identified phase and a width set by the data rather than by $\sigma_a$ suggest that registration was not the limiting step, although on field data this cannot be checked against a true warp. The limiting step was the predictive task itself: with 150 labelled samples in six wells, between-well level differences of up to 8.5\,p.u.\ and a target window 2.4--2.9\,s deep in a deviated-well field, the seismic input did not carry the information needed to predict PHIF at a blind well by any of the methods tested.
|
Over the 78 training-well registrations of the primary arm, $\sigpost$ was 1.9--9.3\,ms over the main window (median 4.3\,ms) and 3.0\,ms over the labelled samples, narrowest at F-11 T2 (1.9--2.6\,ms) and widest at F-12 (4.3--9.3\,ms). Unlike F3, the width barely followed $\sigma_a$: the medians were 3.8, 4.3 and 4.1\,ms at 3.5, 7 and 14\,ms. This is consistent with the seismic likelihood rather than the anchor prior setting the width over the logged interval, but we did not test it. The wavelet phase was better identified than on F3: the 22 phases of the primary arm lay within an arc of 43$^\circ$, against 214$^\circ$ on F3. These features suggest that registration was not the limiting step, although on field data this cannot be checked against a true warp. The limiting step was the predictive task itself: with 150 labelled samples in six wells, between-well level differences of up to 8.5\,p.u.\ and a target window 2.4--2.9\,s deep in a deviated-well field, the seismic input did not carry the information needed to predict PHIF at a blind well by any of the methods tested.
|
||||||
|
|
||||||
|
\subsection{Teapot Dome inventory}
|
||||||
|
\label{sec:exp:teapot}
|
||||||
|
|
||||||
|
This step is post hoc and exploratory. Time--depth tables exist at four of the 152 wells: two are labelled as derived from a synthetic log, one from a synthetic seismogram, and the fourth, a vertical seismic profile, ends above the main reservoirs. As an alternative reference, we paired the times of two interpreted 3-D horizons at the wells with the depths of the corresponding formation tops. On 37 development wells we predicted each time from the depth with a quadratic lateral trend of average velocity, fitted by leave-one-out. The residual standard deviation was 6.75\,ms (90\% bootstrap interval over wells 4.1--9.4\,ms; robust estimate 5.0\,ms). Most of it was a bulk shift per well (6.6\,ms): the residuals of the two horizons at a well were correlated (0.85), and those of neighbouring wells were not, which resembles per-well errors of datum, statics or top picks. The differential part was 2.8\,ms, and 2.5\,ms from the sonic at five wells. Every estimate exceeded the declared tolerance of 1.5\,ms, the largest grid value at which the $-5$\,dB cell with $N = 16$ reaches a power of 0.8 with no more than the 115 remaining wells (58 wells by the formula of the power analysis).
|
||||||
|
|||||||
64
paper/sections/C_record.tex
Normal file
64
paper/sections/C_record.tex
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
\section{Protocol record and secondary results}
|
||||||
|
\label{app:record}
|
||||||
|
|
||||||
|
This appendix records when each protocol was locked, how the experiments deviated from the plan, and secondary results that enter no rule. It supports the main text and changes none of its verdicts.
|
||||||
|
|
||||||
|
\subsection{When each protocol was locked}
|
||||||
|
|
||||||
|
Before each main run, the protocol (grid, methods, iteration budgets, pass rules) was locked by a SHA-256 hash, and the scripts refuse to run if the hash does not match. The protocol of Experiment~2 was also committed and tagged in version control before its main runs. That of Experiment~1 was locked by hash before its main run but committed only afterwards, without a tag. The protocol of Experiment~3 was committed while its main runs were in progress, and the field protocols only after their runs; for these the record of timing is the time stamp inside the lock file, which is self-reported. In Experiments~1 and~2, every design choice was made on two development realizations (900 and 901), and Experiment~3 added four (902--905); development realizations are never used for results.
|
||||||
|
|
||||||
|
\paragraph{F3.}
|
||||||
|
The lock also covers the code, the input data and the software environment, and the lock file records that it was written one minute before the main run started. Earlier pilots of the registration and of the classical baselines computed no metric on a test well. F3 is not an untouched dataset: its four wells had already given baseline scores and had calibrated the synthetic benchmark. The test is therefore a descriptive follow-up, and it bears on the SMC variant only. Inference on the predicted volume stopped once and was resumed with the locked code and models, after the pass rule had been computed.
|
||||||
|
|
||||||
|
\paragraph{Volve.}
|
||||||
|
The test was designed after the F3 test had failed and before any porosity metric on Volve. Two design choices used Volve data but no porosity value: the target window and the member-support rule below. Of the eleven deviations from F3, four matter. (i) The label runs are 16--37 samples long, shorter than the 64-sample training windows and the 6\,Hz band split of F3, so the primary metric is total RMSE on the labelled samples, and the loss uses a single 126-sample window with a mask over the label support of each bank member. (ii) Each bank member trains on its own label support, because intersecting the supports reduced F-11 A to 7 samples, below the minimum of 8. (iii) Under the slot scheme the inner validation is leave-one-well-out, because three slots leave too few groups, so it can be optimistic there. (iv) $\sigma_a = 7$\,ms is inherited from F3.
|
||||||
|
|
||||||
|
\subsection{Deviations in the synthetic experiments}
|
||||||
|
|
||||||
|
\paragraph{Experiment 2.}
|
||||||
|
Re-running on new realizations was not among the options pre-registered for a failure of Experiment~1, which prescribed a time-boxed diagnosis followed by a pivot. Two potential stresses were not tested: the bulk-offset prior $\sigma_b$ was neither learned nor varied, and a rock-physics misspecification stress was cut for time.
|
||||||
|
|
||||||
|
\paragraph{Experiment 3.}
|
||||||
|
The experiment was designed after Experiment~2, after the field tests and after the post hoc analyses of Section~\ref{sec:exp:p2r}, and it reuses the test realizations 8--15. The drift--well-count grid, the alignment-loss comparison and the backbone check also reuse the SMC particles of Experiment~2, after a check that one cell (10\,dB, realization 8, $c = 1$, $N = 4$) reproduces its particles and predictions bit for bit. Two arms are disclosed additions that enter no rule, both motivated by the exploratory analysis of Section~\ref{sec:exp:mech}: the Gaussian bank in the misspecification and alignment-loss studies, and a record of every method's prediction at 500 iterations of the same training trajectories. The two-mode claim was narrowed before the lock: on development data the two-member bank was worse than the midpoint label at $\Delta = 8$\,ms, and that clause became descriptive. The protocol calls the two-member bank calibrated; it is calibrated only in the weaker sense that the truth is a member, not in the sense of Proposition~\ref{prop:bank}.
|
||||||
|
|
||||||
|
\paragraph{Misspecification levels.}
|
||||||
|
The levels were chosen on development realizations 902--905. The declared target for the mild level was 0.5--1.0 times the noise at 10\,dB, and both mild seismic levels lie above it. For the phase no milder level exists: a quarter of the minimum-phase spectrum (model error 0.62) already reduced the 90\% warp coverage to 0.25 on development data. For rock physics, milder levels changed the registration too little to be told apart, so the level was set by model error. Uniform errors in the rock-physics coefficients, a constant phase rotation and a shift of the peak frequency are absorbed by the registration's profiled amplitude and constant-phase fit; they were run on development data only, as controls.
|
||||||
|
|
||||||
|
\paragraph{Two readings of the verdicts.}
|
||||||
|
After the runs, the locked code that extracts the verdicts was found to differ from the locked statements in three places. For the first claim of the drift--well-count grid it requires exactly two cells at 10\,dB, $c = 1.5$, but the study has four values of $N$, so it returns no verdict. For the first misspecification claim it reports each axis but no overall verdict, which agrees with the statement (one verdict per axis). For the alignment-loss claim it adds the Gaussian bank to the competitors, whereas the statement names the deterministic ties and the anchor-free losses. We did not edit the locked code. A separate script, outside the code hash, checks the lock and applies the statements as worded, and Table~\ref{tab:benchverdicts} reports that reading. The two readings differ in conclusion only for the alignment-loss claim: as run, with the Gaussian bank among the competitors, it failed in every setting.
|
||||||
|
|
||||||
|
\paragraph{Detectability.}
|
||||||
|
After the first run we added points to the grid of reference errors, from $\{0, 2, 4, 8\}$ to $\{0, 0.5, 1, 1.5, 2, 3, 4, 8\}$\,ms, because the outcome changed between 0 and 2\,ms, where the grid had no points. No rule, threshold or input changed. For the Teapot Dome inventory, the conditions were declared before the data were obtained, and the alternative reference after the inventory but before any residual or porosity value was computed.
|
||||||
|
|
||||||
|
\subsection{Secondary results}
|
||||||
|
|
||||||
|
\paragraph{Gap to the Oracle.}
|
||||||
|
In the wide cells at $N = 16$, the band RMSE of the \mRML{} stayed 4--6\% above the Oracle's at 0\,dB and in the half-anchor and $-5$\,dB settings, and 17\% ($c = 1$) and 63\% ($c = 2$) above it in the two-anchor setting. At $c = 1$, the Oracle's band RMSE was 0.93, 0.92 and 0.93 times that of the \mPM{} at 0\,dB, in the half-anchor setting and at $-5$\,dB, and 0.76 times in the two-anchor setting. These post hoc ratios are below $\rhoCl$ in all four cells, below $\rhoBk$ at $\sigpost$ in three or four of them depending on the estimator, and below $\rhoBk$ at the measured warp error in one or two.
|
||||||
|
|
||||||
|
\paragraph{Exploratory analysis of the bank gain.}
|
||||||
|
Retraining reproduced the pre-registered runs exactly (10\,560 rows, maximum deviation 0), and the post hoc ratios and both bounds had been inspected before the declaration. The first correlation of the Berkson test at $c = 1$ was $0.017$, $-0.035$, $-0.027$ and $-0.052$ (each 95\% interval containing 0), and the estimated offsets were less dispersed than the true ones (variance ratio 0.41--0.81), as Berkson shrinkage implies. For the phase-estimated correlation tie the anchor-referenced test is not clean, so we draw no structural conclusion. The \mPM{} improved at 500 iterations in 7 of the 8 cells (ratios 0.973--0.985), so the budget selected on development data was not optimal for it. At equal budgets the \mRML{}/\mPM{} ratios were 0.980, 0.981, 0.887 and 0.986 at $c = 1$ and 0.962, 0.913, 0.687 and 0.966 at $c = 2$, in the order 0\,dB, half-anchor, two-anchor, $-5$\,dB.
|
||||||
|
|
||||||
|
The members of the Gaussian bank are as wide (marginal standard deviation 0.98--1.00 of the particles') and as wrong (warp error 1.00--1.02 times the SMC members') as the SMC bank. At 0\,dB, $c = 1$, its ratio to the \mPM{} was 0.987 $[0.972, 1.003]$ against 0.967 for the \mRML{}. At $c = 2$ the SMC bank was ahead at 0\,dB (0.969 against 0.952), in the half-anchor setting (0.944 against 0.904) and in the two-anchor setting (0.753 against 0.667), and not at $-5$\,dB. Under the declared reading, four cells were consistent with label augmentation alone, three showed information beyond the first two moments (all at $c = 2$), and one (0\,dB, $c = 1$) was read as against label augmentation; no reading had a majority.
|
||||||
|
|
||||||
|
The responsibility-weighted warp reduced the warp error of the uniform mean of the 64-member bank from, for example, 1.86 to 1.38\,ms at 0\,dB, $c = 1$, from 4.86 to 3.05\,ms in the two-anchor setting at $c = 1$, and from 19.3 to 11.7\,ms in that setting at $c = 2$. The mean of the 64 members differs slightly from the mean of all 1024 particles in Table~\ref{tab:h2b}. The effective number of members was 3.5--28 of 64, so at $\lambda = 1/\tau_c$ RML is not near its $\lambda \to 0$ limit, and the direction was the same at two other temperatures. We called a training well multimodal if a two-component Gaussian mixture fitted the window-mean offsets of its particles much better than one component ($\Delta\mathrm{BIC} > 10$, modes more than 4\,ms apart, smaller weight at least 0.1). With any multimodal well as the criterion, instead of at least a quarter of the wells, the difference of log ratios was $-0.017$ $[-0.031, -0.0002]$, which meets the declared criterion only marginally. The split has little power because multimodality is rare outside the unstable cells.
|
||||||
|
|
||||||
|
\paragraph{Coverage.}
|
||||||
|
The calibration errors of the four ensembles at 10\,dB, $c = 1$, $N = 16$ were 0.114, 0.300, 0.291 and 0.379 (calibrated sonic, \mPM{}, \mRML{}, Oracle). Because $\xi_O$ is small, Proposition~\ref{prop:coverage}(a) requires only a small excess of predicted variance for a method to cover more than the Oracle, and each method had a larger $\xi$ and a higher coverage than the Oracle in 80--99\% of the 240 realization cells. At 10\,dB, the phase-estimated correlation tie had a median warp error of 3.5\,ms on the training wells against 0.55\,ms for the SMC mean warp, yet at the Oracle's 500 iterations it reached the same $\xi$ as the \mPM{} at 250. Over all settings its excess over the Oracle was the smallest of any method (0.018--0.027). Most of the excess of the \mPM{} and \mRML{} was already present at $c = 0$, where the median warp error of their labels was 0.34\,ms. On the development realizations of Experiment~1 (10\,dB, $c = 1$, $N = 16$), the 90\% coverage of single Oracle models was 0.23 after 500 iterations, and their mean $\sigma$ fell by a factor of five between 125 and 2000 iterations. Within the 250-iteration group of Table~\ref{tab:t4}, the methods with worse labels (anchor mean, correlation tie) had the larger excess. This is the direction that Proposition~\ref{prop:coverage}(b) gives for classical error, but the anchor mean is a posterior mean, and the structure of these label errors was not tested.
|
||||||
|
|
||||||
|
\paragraph{Misspecification at $-5$\,dB.}
|
||||||
|
Except under the scaled warp prior, whose warp error rose by up to 40\%, the registration diagnostics stayed within 22\% of their nominal values (warp error 3.1--4.0\,ms against 3.31 and 2.91\,ms; coverage 0.74--0.86 against 0.83 and 0.86), and several presets exceeded the $\pm 10\%$ seen on development data. Across the 14 cells at $-5$\,dB, the \mRML{}/\mPM{} ratios were 0.970--1.020, and \mRML{}/Gaussian bank was 0.985--1.009 in all 28 cells of the study.
|
||||||
|
|
||||||
|
\paragraph{Alignment losses.}
|
||||||
|
At 10\,dB, $c = 1$, the band RMSE of the four anchor-free losses was 1.36, 1.31, 0.97 and 0.98 at $N = 4$ and 1.20, 1.14, 0.81 and 0.78 at $N = 16$, against 0.94 and 0.83 for the calibrated sonic and 0.61 and 0.45 for the \mPM{}.
|
||||||
|
|
||||||
|
\paragraph{Backbone.}
|
||||||
|
The \mPM{} (TCN) to best deterministic tie ratios at 10\,dB, $c = 1$ were 0.840 [0.787, 0.904] ($\Delta\mathrm{PCC} = +0.052$) and 0.823 [0.802, 0.841]. The band RMSE of the TCN was 0--7\% above that of the CNN--GRU at $N = 4$ and in the half-anchor and $-5$\,dB settings with $N = 16$, and 14--24\% above at 10\,dB with $N = 16$, where the three label sources became nearly equal (Oracle 0.560, \mPM{} 0.561, \mRML{} 0.565). Outside the claims, the posterior-mean rule with the TCN passed at $-5$\,dB (0.914 and 0.913, on band PCC) and failed in the half-anchor setting (0.944 and 0.943).
|
||||||
|
|
||||||
|
\paragraph{Gaussian bank across the alignment-loss grid.}
|
||||||
|
The Gaussian bank was better than the \mPM{} in 16 of the 30 cells by the no-margin rule. Ratios below 0.975 occurred only at $c \ge 1$ in the 0\,dB, half-anchor, two-anchor and $-5$\,dB settings (for example 0.954 and 0.904 in the two-anchor setting at $c = 1$), and at 10\,dB the ratio was 0.98--1.01. The \mRML{} was better than the Gaussian bank at $c = 2$ at 0\,dB and in the half-anchor and two-anchor settings (0.895 and 0.886) and, at $N = 16$, at $-5$\,dB. At $c = 1$ the ratio was 0.975--1.001, and the \mRML{} was better only at 0\,dB and in the two-anchor setting with $N = 4$. Information in the SMC bank beyond its first two moments mattered mainly at $c = 2$.
|
||||||
|
|
||||||
|
\paragraph{Two-mode study.}
|
||||||
|
At $\Delta = 8$\,ms, which is descriptive, the two-member bank was better than the midpoint label at $N = 16$ but not at $N = 4$.
|
||||||
|
|
||||||
|
\paragraph{Equal training budgets.}
|
||||||
|
Every method's training trajectory was also evaluated at 500 iterations, in the cells run in Experiment~3. No verdict-level result changed direction. The no-margin rule for \mRML{}/\mPM{} changed outcome in 14 of the 70 cells of the drift--well-count grid evaluated, all with ratios between 0.97 and 1.01 at both budgets. At 10\,dB, $c = 1.5$, \mPM{}/best deterministic tie was 0.867 and 0.793. At 10\,dB, $c = 1$, it was 0.944 and 0.920 under mild rock-physics error and 1.020 and 1.042 under the mild wavelet phase, so the misspecification failures are not caused by the training length. With the TCN at 10\,dB it was 0.864 and 0.813. The bank gain changed in narrow cells: at 10\,dB, $c = 1.5$, \mRML{}/\mPM{} was 0.997 and 0.999, against 0.978 and 0.987 at the pre-registered budgets. In wide cells it remained (two-anchor setting, $c = 1.5$: 0.916 and 0.747). The ratio of the two-member bank to the midpoint label changed by at most 0.013 (at most 0.01 at $\Delta \in \{16, 32\}$\,ms).
|
||||||
102
paper/self_review.md
Normal file
102
paper/self_review.md
Normal file
@@ -0,0 +1,102 @@
|
|||||||
|
# Self-review of the draft (30/10/2026)
|
||||||
|
|
||||||
|
Pass made with the `research-paper-writing` skill (Master-cai/Research-Paper-Writing-Skills).
|
||||||
|
Red TODO notes (`\todo`, `\todoblock`, `\figplaceholder`) were left byte-identical; no registered number or citation changed.
|
||||||
|
|
||||||
|
## Story (one line per element)
|
||||||
|
|
||||||
|
- **Thesis.** A well-tie error is an error in the time index of the label; we say what it does to a learned predictor, what a tie posterior can recover, and what a field test would need to detect the difference.
|
||||||
|
- **Theory.** Classical tie error blurs the optimal predictor; Berkson error sharpens it; anchors identify absolute time; a calibrated bank recovers the oracle optimum but its population gain is fourth order; a misregistered reference biases blind-well scores.
|
||||||
|
- **Benchmark.** Posterior-mean (SMC) labels beat point ties only with a correct σ_a, and mostly already at c = 0; a bank adds a width-dependent gain that mostly stays within the Berkson bound.
|
||||||
|
- **Detectability and field.** Blind-well comparisons need a reference accurate to about 1 ms and a power-based number of wells; F3, Volve and Teapot do not meet these conditions.
|
||||||
|
|
||||||
|
## Edits made
|
||||||
|
|
||||||
|
| Section | Edit | Skill rule |
|
||||||
|
|---|---|---|
|
||||||
|
| Abstract | H1 "within 1%" limited to σ = 4–16 ms; "most of it already without drift"; bank 8/8 limited to N = 16; "exact ties" → "an exact reference" | claim–evidence alignment |
|
||||||
|
| 1 | Paragraph 2 split (tie posteriors unused / size of the error); same three claim limits as the abstract | one message per paragraph; claim–evidence |
|
||||||
|
| 2 | Opening names the five strands; topic sentence for the well-tie paragraph; label-noise paragraph split | topic sentence first; one message per paragraph |
|
||||||
|
| 4 | Roadmap paragraph; labels `sec:theory:blur`, `sec:theory:ident` | self-contained structure |
|
||||||
|
| 5 | Opening says RML defines the compared methods, not a proposed winner (C3); repo codes P2/P2r → Experiment 1/2 | stable terminology |
|
||||||
|
| 6 | Opening split (protocol / pass rule); bound comparison opens with its conclusion | first sentence states the message |
|
||||||
|
| 7 | "Where the bank gain comes from" split into three paragraphs; "the bank is cheap" replaced by the cost argument from the loss definition; practical rule scoped to the benchmark | one message per paragraph; unsupported claim |
|
||||||
|
| 8 | "mostly already without drift" | claim–evidence |
|
||||||
|
|
||||||
|
## Claim–evidence map (Abstract, Introduction, Conclusions)
|
||||||
|
|
||||||
|
| Claim | Evidence | Status |
|
||||||
|
|---|---|---|
|
||||||
|
| Misregistered labels convolve the optimum with the error distribution | Prop. 1, App. A | supported (analytic, under A1) |
|
||||||
|
| Controlled experiment matches the transfer to within 1% for 4–16 ms | Table `tab:h1` (r = 1.007–1.009); only 6.8–22.5 Hz tested; 32 ms is 9% off | supported as worded |
|
||||||
|
| Without anchors absolute timing is not identified | Prop. 2; H4 (warp RMSE 3.15 → 31.1 ms) | supported |
|
||||||
|
| Berkson tie error sharpens the predictor | Prop. 3 | supported (analytic); **not tested empirically in the text** (Sec. 6.4 is a TODO) |
|
||||||
|
| Calibrated bank attains the oracle optimum; gain is fourth order | Prop. 4, Eq. `eq:rhostar` | supported (analytic) |
|
||||||
|
| PM labels 8–22% lower band RMSE than the best point tie | Table `tab:h2a` (ratios 0.782–0.923) | supported |
|
||||||
|
| Most of the PM advantage is present without drift | Table `tab:h2a` zero-drift column (0.81–0.88) | supported |
|
||||||
|
| PM advantage fails at σ_a halved or doubled | Table `tab:sigmaa` | supported **at R10 only**; the arm ran in one regime |
|
||||||
|
| Bank gains in all 8 wide cells at N = 16 | Table `tab:h2b`; N = 4: 6/8 | supported |
|
||||||
|
| Gain exceeds classical bound in 7/8, Berkson bound in 3/8 | Table `tab:h2b`, `outputs/p2r/posthoc/` | supported (Berkson bound post hoc) |
|
||||||
|
| 5–18 blind wells for power 0.8 with an exact reference; none within 40 at ≥ 3 ms | Table `tab:t3` | supported (exploratory, one simulator) |
|
||||||
|
| F3 and Volve tests failed and could not have detected the effect | Sec. 6.6, App. B, conditions C1–C4 | supported (C1–C4 post hoc) |
|
||||||
|
| Teapot has independent time–depth references at ≤ 2 of 152 wells | Sec. 6.6 | supported |
|
||||||
|
|
||||||
|
## Five-dimension adversarial review
|
||||||
|
|
||||||
|
**Contribution.** *Is anything new beyond assembling known pieces?* The paper says plainly that the ingredients are known (Sec. 2, last paragraph). The new parts are the analysis applied to the time index, the bound on what a bank can gain, and the detectability result. A reviewer may still see C3 (RML family) as a relabelling exercise; the text now frames it as a common language, which is the defensible position. **Open:** "to our knowledge" depends on the TODO novelty rescan.
|
||||||
|
|
||||||
|
**Writing clarity.** *Can an outsider follow it?* The main risks:
|
||||||
|
- Method names are repository codes (`B3d-Sa`, `M2-Sa`, `B3c-R`). The macros `\mPM` and `\mRML` allow a rename in one place; descriptive names (e.g. *SMC-mean* and *SMC-bank*) would help readers. Not changed: this is a naming decision for the authors.
|
||||||
|
- Section 4 (~3,900 words, 6 propositions, 4 corollaries) is dense for *Computers & Geosciences*.
|
||||||
|
- There is no overview/pipeline figure (tie posterior → label bank → network, plus scoring against a reference). The skill treats this as first-impression content. Recommended.
|
||||||
|
- Table `tab:t3` has 13 columns; consider moving the N* block to its own table.
|
||||||
|
|
||||||
|
**Experimental strength.** *Would the results survive a skeptical reader?*
|
||||||
|
- One simulator, one backbone, σ_b never varied: all disclosed (Sec. 7), pending S2/S4 TODOs.
|
||||||
|
- The σ_a arm ran only at R10. The abstract's "failed when the anchor uncertainty was set at half or twice its true value" is literally true but generalises from one regime; consider adding "(tested at high SNR)".
|
||||||
|
- H1 verifies Prop. 1 only below about 23 Hz, while the bank-gain distortion sits at 67–72 Hz (Sec. 4.3). A reviewer will connect these. Worth one sentence in Sec. 4.3 or 6.3.
|
||||||
|
|
||||||
|
**Evaluation completeness.** *Is anything a reviewer would ask for missing?*
|
||||||
|
- **Stale-text risk once T2 is written.** T2 is done (`docs/research/t2-results.md`: Berkson at c = 1; GP-noise bank gets most of the c = 1 gain; about a third of the PM–Oracle gap is training length). Sec. 6.4 is still a todoblock, so these passages now say the structure "was not tested" and must change together when 6.4 is written: abstract (bank sentence), Sec. 1 findings, Sec. 6.3 (end of the bound paragraphs and the gap paragraph), Sec. 7 "Where the bank gain comes from", Sec. 8 second paragraph.
|
||||||
|
- No wall-clock cost of the SMC posterior is reported, although the discussion recommends the bank.
|
||||||
|
|
||||||
|
**Method design soundness.** *Is the design defensible?*
|
||||||
|
- Experiment 2 was designed after Experiment 1 failed. It is disclosed as a deviation in Secs. 5, 6.2, 7 and 8, which is the right handling.
|
||||||
|
- λ = 1/τ_c is a fixed heuristic and is disclosed as such.
|
||||||
|
- Field gates use k-of-n rules that the paper itself shows are not tests. This is disclosed and turned into a finding, which is a strength.
|
||||||
|
|
||||||
|
## Not changed on purpose
|
||||||
|
|
||||||
|
- Every red TODO, including the title note and the S1–S8/T2 placeholders.
|
||||||
|
- Length (about 14,950 words against about 5,500): the user dropped the length pass on 29/10 (`docs/plan.md` §12 item 25).
|
||||||
|
- Appendices A and B: checked for terminology only, no edits.
|
||||||
|
|
||||||
|
## Hallucination audit (04/11/2026)
|
||||||
|
|
||||||
|
Done with the `scientific-writing`, `literature-review`, `citation-management` and `academic-humanizer` skills. The full record is in `docs/research/paper-audit.md`; the decision log entry is `docs/plan.md` §12 item 36.
|
||||||
|
|
||||||
|
- Five audit passes traced every number, citation and claim to `outputs/`, the locked protocols, the code and the reference texts in `refs/`. They returned 87 findings (G1 17, G2 11, G3 14, G4 18, G5 27), of which 4 were S1:
|
||||||
|
- the two TD models (G1-01);
|
||||||
|
- the warp-prior fit and the fixed σ_a and σ_b (G2-01);
|
||||||
|
- the Exp. 1 protocol tag (G3-01);
|
||||||
|
- PHIE_DT linear in sonic at all four wells (G5-01).
|
||||||
|
- 106 exact replacements were applied to the sections and highlights. A protected-token guard (cite, ref, label, math, numbers) against HEAD 423a333 shows only the approved changes:
|
||||||
|
- `tab:audit` now follows `td_qc.csv`;
|
||||||
|
- prabowo2025f3, tao2025structural and DILATE are dropped from one intro sentence;
|
||||||
|
- about 40 small number corrections.
|
||||||
|
- Claims were scoped to their evidence:
|
||||||
|
- the σ_a arm covers one regime;
|
||||||
|
- the extensions hold at R10;
|
||||||
|
- the misspecified warp prior covers dr_L1 only;
|
||||||
|
- T3 is exploratory and simulator-based;
|
||||||
|
- c = 2 cells are not primary evidence for H2a but enter H2b;
|
||||||
|
- the 500-iteration arm is a trajectory record, not retraining;
|
||||||
|
- the BK2 cos² comparison is post hoc.
|
||||||
|
- The academic-humanizer pass found almost no AI-style patterns left (no em-dashes, no AI vocabulary, no overclaiming verbs). It split seven long sentences, and the guard was unchanged afterwards.
|
||||||
|
- No verdict, gate or threshold changed. 69 pages, clean build.
|
||||||
|
- Open for the authors:
|
||||||
|
- G1-14 (Rizzuti/BootNet DL ✓);
|
||||||
|
- the 7 hand-downloaded PDFs, which are missing on this machine;
|
||||||
|
- the Volve licence wording (G2-10);
|
||||||
|
- the Rm5 "within the CI" null (G4-04);
|
||||||
|
- the optional Kassis et al. 2026 citation.
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
# Tài liệu không có toàn văn trong refs/ (cập nhật 26/10/2026)
|
# Tài liệu không có toàn văn trong refs/ (cập nhật 02/11/2026)
|
||||||
|
|
||||||
Quy ước (28/10/2026): mỗi PDF trong `refs/` được đặt tên theo key BibTeX của nó trong `paper/refs.bib`, ví dụ `refs/buland2003bayesianwavelet.pdf`.
|
Quy ước (28/10/2026): mỗi PDF trong `refs/` được đặt tên theo key BibTeX của nó trong `paper/refs.bib`, ví dụ `refs/buland2003bayesianwavelet.pdf`.
|
||||||
|
|
||||||
@@ -6,12 +6,11 @@ P03 (Xu et al. 2024) đã được tải tay ngày 26/10/2026. Các bài open ac
|
|||||||
|
|
||||||
## Bỏ qua (không tải được, quyết định không theo đuổi)
|
## Bỏ qua (không tải được, quyết định không theo đuổi)
|
||||||
|
|
||||||
Ngày 28/10/2026 đã xác nhận lần cuối là không lấy được toàn văn của P04, P05, P07, P09. Bản thảo trích các bài này dựa trên abstract và có chú thích "assessed from the abstract only" (xem `docs/plan.md` mục 2.2). P03 không thuộc nhóm này: toàn văn nằm ở `refs/xu2024sts.pdf`.
|
Ngày 28/10/2026 đã xác nhận lần cuối là không lấy được toàn văn của P04, P05, P07, P09. Ngày 02/11/2026 người dùng tải tay được P05 (`li2024bpinn.pdf`), nên P05 đã ra khỏi bảng dưới. Bản thảo trích các bài này dựa trên abstract và có chú thích "assessed from the abstract only" (xem `docs/plan.md` mục 2.2). P03 không thuộc nhóm này: toàn văn nằm ở `refs/xu2024sts.pdf`.
|
||||||
|
|
||||||
| Mã | Bài | DOI |
|
| Mã | Bài | DOI |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| P04 | Chen et al. 2024, IEEE TGRS | 10.1109/TGRS.2024.3460184 |
|
| P04 | Chen et al. 2024, IEEE TGRS | 10.1109/TGRS.2024.3460184 |
|
||||||
| P05 | Li, Grana & Liu 2024, Geophysics | 10.1190/geo2023-0737.1 |
|
|
||||||
| P07 | Di & Abubakar 2023, Geophys. Prospect. | 10.1111/1365-2478.13333 |
|
| P07 | Di & Abubakar 2023, Geophys. Prospect. | 10.1111/1365-2478.13333 |
|
||||||
| P09 | Dou & Li 2024, Comput. Geotech. | 10.1016/j.compgeo.2024.106194 |
|
| P09 | Dou & Li 2024, Comput. Geotech. | 10.1016/j.compgeo.2024.106194 |
|
||||||
| — | White & Simm 2003, First Break 21(10) | 10.3997/1365-2397.21.10.25640 |
|
| — | White & Simm 2003, First Break 21(10) | 10.3997/1365-2397.21.10.25640 |
|
||||||
@@ -19,7 +18,13 @@ Ngày 28/10/2026 đã xác nhận lần cuối là không lấy được toàn v
|
|||||||
|
|
||||||
## Chỉ có abstract: quét SEG/EAGE ngày 28/10/2026
|
## Chỉ có abstract: quét SEG/EAGE ngày 28/10/2026
|
||||||
|
|
||||||
Không có PDF vì EarthDoc và SEG Library chặn tải tự động. Abstract lấy từ OpenAlex; trích trong bài với chú thích "assessed from the abstract only". Key BibTeX: `lim2025awsm`, `lim2025bootnet`, `quesada2024faultlabels` (chưa có DOI), `huff2024anglestack`, `thiebaud2024lfc`, `rizzuti2024waveletflows`, `cordoba2025porosity`, `mirza2025labelquality`, `rizzuti2025uhr`, `guillon2020gtmetrics`. Nếu tải tay được bài nào, đặt tên PDF theo key. Nên ưu tiên `lim2025awsm`.
|
Không có PDF vì EarthDoc và SEG Library chặn tải tự động. Abstract lấy từ OpenAlex; trích trong bài với chú thích "assessed from the abstract only". Key BibTeX còn lại: `quesada2024faultlabels` (chưa có DOI), `huff2024anglestack`, `thiebaud2024lfc`, `cordoba2025porosity`, `mirza2025labelquality`. Nếu tải tay được bài nào, đặt tên PDF theo key.
|
||||||
|
|
||||||
|
**02/11/2026:** đã có toàn văn `rizzuti2024waveletflows.pdf` (5 trang, sha256 3e69efdb…) và `rizzuti2025uhr.pdf` (5 trang, sha256 42756aca…), bản do Shearwater Geoservices đăng công khai. Toàn văn khớp với cách Bảng `tab:positioning` xếp hai bài (DL ✓, không có tie hay bất định tie). Bài 2025 tự ghi việc đưa well log CPT và hiệu ứng wavelet vào khung UQ là việc sẽ làm. Chú thích ᵃ trong bảng lúc đó chưa bỏ (đã bỏ sau đó, xem đoạn dưới). Cùng ngày, OpenAlex, Unpaywall và web search không thấy bản truy cập mở của các bài còn lại trong danh sách này, cũng như của P04, P05, P07, P09, White & Simm 2003 và Herrera & van der Baan 2014. Có một ngoại lệ: Unpaywall báo `castagna2026quality` (TLE 2026, 10.1190/tle-2025-1058) là open access trên SEG Library, nhưng lệnh tải tự động bị từ chối, nên cần tải tay. Các bài cũng mới chỉ đọc abstract: `dacostasilva2026autotie` (10.1190/geo-2024-0011) và `herrera2014semiautomatic` (mục 12 ý 31 của plan).
|
||||||
|
|
||||||
|
**02/11/2026, sau đó:** người dùng tải tay thêm bốn bài, đã đổi tên theo key: `lim2025awsm.pdf` (sha256 56fd3a54…), `lim2025bootnet.pdf` (27846930…), `li2024bpinn.pdf` (f5d18e32…), `guillon2020gtmetrics.pdf` (2ea5af3c…). Toàn văn khớp với cách xếp trong Bảng `tab:positioning`. Chú thích ᵃ của bốn bài này và của hai bài Rizzuti đã bỏ (`docs/plan.md` mục 12 ý 33). Vẫn chỉ có abstract: `castagna2026quality` (open access, cần tải tay), `dacostasilva2026autotie`, `herrera2014semiautomatic`.
|
||||||
|
|
||||||
|
**Đóng ngày 02/11/2026 (quyết định của người dùng):** không tìm toàn văn thêm cho các bài còn lại (P04, P07, P09, White & Simm 2003, Herrera & van der Baan 2014, Autotie, Thiebaud, Cordoba, Mirza, Quesada, Huff). Các bài này giữ chú thích ᵃ. `castagna2026quality` (TLE 45(5) 378–390, CC BY) người dùng đã tải tay cùng ngày: `refs/castagna2026quality.pdf` (13 trang, sha256 5ec11aa1…), đã đọc toàn văn (`docs/plan.md` mục 12 ý 33). Danh sách này đóng.
|
||||||
|
|
||||||
## Chưa xác định được bài
|
## Chưa xác định được bài
|
||||||
|
|
||||||
|
|||||||
99
report.html
99
report.html
@@ -139,12 +139,32 @@ footer{margin-top:32px;color:var(--mute);font-size:12px}
|
|||||||
<p><b>Post hoc (chỉ để so thang, <code>scripts/25_p4_posthoc.py</code>):</b> dự đoán hằng số bằng trung bình PHIF của các giếng train có RMSE macro 6,03 (lowo) và 6,59 p.u. (slot), thấp hơn mọi mạng. Sai số do mức trung bình khác nhau giữa giếng (8,5–17,0 p.u.) chi phối; khác biệt giữa các phương pháp tie (≤ 0,25 p.u.) nhỏ so với sai số tổng 6–7 p.u. Phép so sánh G-D vì vậy không có lực phân biệt; Volve không phải bằng chứng ủng hộ hay chống RML.</p>
|
<p><b>Post hoc (chỉ để so thang, <code>scripts/25_p4_posthoc.py</code>):</b> dự đoán hằng số bằng trung bình PHIF của các giếng train có RMSE macro 6,03 (lowo) và 6,59 p.u. (slot), thấp hơn mọi mạng. Sai số do mức trung bình khác nhau giữa giếng (8,5–17,0 p.u.) chi phối; khác biệt giữa các phương pháp tie (≤ 0,25 p.u.) nhỏ so với sai số tổng 6–7 p.u. Phép so sánh G-D vì vậy không có lực phân biệt; Volve không phải bằng chứng ủng hộ hay chống RML.</p>
|
||||||
<p class="sub">Deviation sau khóa (chỉ lịch chạy): nhánh σ_a chạy song song trên cuda:0 thay vì sau nhánh chính trên cuda:1; G-D của nhánh chính tính lại khi có đủ các nhánh trùng hệt. Không chạy lại, không đổi thiết kế. Chi tiết: <code>docs/plan.md</code> §12 ý 20–21.</p>
|
<p class="sub">Deviation sau khóa (chỉ lịch chạy): nhánh σ_a chạy song song trên cuda:0 thay vì sau nhánh chính trên cuda:1; G-D của nhánh chính tính lại khi có đủ các nhánh trùng hệt. Không chạy lại, không đổi thiết kế. Chi tiết: <code>docs/plan.md</code> §12 ý 20–21.</p>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="card" style="margin-bottom:14px">
|
||||||
|
<b>Kết quả P6 benchmark (protocol_bench, realization 8–15) ngày 02/11: 9/11 verdict đạt; S2-H1 trượt ở trục rock physics và wavelet</b>
|
||||||
|
<p>Summarize bằng code đã khoá (<code>scripts/34_run_bench.py summarize</code>, 02:02 UTC), rồi đọc lại đúng lời phát biểu của protocol bằng <code>scripts/36_bench_verdicts.py</code> (ngoài lock, kiểm lock trước khi chạy). 9 claim, 11 verdict, không hiệu chỉnh family-wise. Tỉ số là band RMSE của B3d-Sa chia cho tie điểm tốt nhất, ở N = 4 / 16, trừ khi ghi khác.</p>
|
||||||
|
<div class="tw"><table><thead><tr><th>Verdict</th><th>Phát biểu (rút gọn)</th><th>Số liệu</th><th>Kết luận</th></tr></thead><tbody>
|
||||||
|
<tr><td>S1-H1</td><td>H2a mở rộng tới c = 1,5 ở R10</td><td>0,853 [0,805; 0,910] / 0,796 [0,762; 0,826]; đối thủ B3c-R</td><td>Đạt (code: null*)</td></tr>
|
||||||
|
<tr><td>S1-H2</td><td>Lợi ích bank tăng theo số giếng</td><td>13/13 họ rộng có r(16) < r(2); ρ = −0,47, p < 10⁻⁴</td><td>Đạt</td></tr>
|
||||||
|
<tr><td>S2-H1 rock physics</td><td>rp_L1, R10, c = 1</td><td>0,940 / 0,934; ΔPCC +0,044 / +0,041; cải thiện ở 2/5 và 1/5 seed</td><td>Không đạt (dự đoán đạt)</td></tr>
|
||||||
|
<tr><td>S2-H1 wavelet</td><td>wv_L1 (pha), R10, c = 1</td><td>1,023 / 1,042 so với B3c; posterior quá tự tin (cov90 0,17 / 0,10; warp RMSE 2,6 / 2,3 ms so với σ_post 0,7 ms)</td><td>Không đạt (dự đoán đạt)</td></tr>
|
||||||
|
<tr><td>S2-H1 drift</td><td>dr_L1, R10, c = 1</td><td>0,862 / 0,798</td><td>Đạt (dự đoán: không chắc)</td></tr>
|
||||||
|
<tr><td>S2-H2</td><td>M2-Sa không hại dưới sai mô hình</td><td>14/14 cặp (preset, regime) ≤ 1,02; lớn nhất 1,0199 (R10 wv_L1)</td><td>Đạt</td></tr>
|
||||||
|
<tr><td>S3-H1</td><td>H2a giữ khi thêm B4a–d làm đối thủ</td><td>R10 0,857 / 0,782; R0 0,888 / 0,888; Rm5 0,915 / 0,923; R0h, R10tb không đạt</td><td>Đạt, phạm vi R10, R0, Rm5 (code: không đạt*)</td></tr>
|
||||||
|
<tr><td>S4-H1</td><td>H2a với backbone TCN, R10 c = 1</td><td>0,840 / 0,823</td><td>Đạt</td></tr>
|
||||||
|
<tr><td>S4-H2</td><td>Bank với TCN ở hai ô rộng</td><td>M2-Sa/B3d-Sa: R0h 0,977, Rm5 0,983</td><td>Đạt</td></tr>
|
||||||
|
<tr><td>S8-H1</td><td>Đảo dấu hàm truyền ở Δ = 32 ms (Hệ quả 3)</td><td>Ĥ trung bình trong băng đảo dấu −0,70 / −0,49</td><td>Đạt</td></tr>
|
||||||
|
<tr><td>S8-H2</td><td>Bank hai mode hơn nhãn trung bình</td><td>BK2/PM2: R10 0,34 (Δ 16), 0,28 (Δ 32); Rm5 0,71, 0,64</td><td>Đạt</td></tr>
|
||||||
|
</tbody></table></div>
|
||||||
|
<p>* Code tổng hợp đã khoá khác lời phát biểu ở ba chỗ. S1-H1: code cần đúng 2 dòng ở R10 c = 1,5 nhưng S1 có 4 giá trị N nên trả null. S2-H1: code tính đúng từng trục nhưng <code>summary.md</code> in "not available". S3-H1: code đưa Ctl-GP (bank nhiễu GP cùng trung bình và hiệp phương sai posterior, thêm có công bố từ T2) vào tập đối thủ. Ctl-GP gần như trùng B3d-Sa (tỉ số 0,90–1,01 ở c = 1), nên B3d-Sa không thể hơn nó 10%; theo code S3-H1 trượt ở mọi regime. Cả hai cách đọc đều được báo cáo (D-13).</p>
|
||||||
|
<p>Mô tả: wv_L2 trượt như dự đoán (1,22 / 1,39); ô băng thông wv_Q chỉ đạt ở N = 16 (0,927 / 0,842). Ở Rm5 mọi preset đạt luật ô, trừ rp_L2 ở N = 4. B4a–d không là đối thủ tốt nhất ở ô c ≤ 1 nào. T2-1 (có công bố): M2-Sa hơn Ctl-GP ở 12/30 ô (c = 0: 2, c = 1: 3, c = 2: 7). S8 Δ = 8 ms: BK2/PM2 0,60–0,98.</p>
|
||||||
|
<p class="sub"><a href="outputs/bench/summary/verdict_final.md">Verdict cuối</a> · <a href="outputs/bench/summary/summary.md">Bảng tổng hợp</a> · <a href="outputs/bench/summary/verdict.json">verdict.json (code đã khoá)</a>. Chi tiết: <code>docs/plan.md</code> §12 ý 28.</p>
|
||||||
|
</div>
|
||||||
<div id="phases"></div>
|
<div id="phases"></div>
|
||||||
|
|
||||||
<h2>Các mục cần xác minh [XM]</h2>
|
<h2>Các mục cần xác minh [XM]</h2>
|
||||||
<div class="tw"><table id="xm"><thead><tr><th>Mục</th><th>Vị trí trong plan</th><th>Trạng thái</th><th>Kết quả hoặc việc còn lại</th></tr></thead><tbody></tbody></table></div>
|
<div class="tw"><table id="xm"><thead><tr><th>Mục</th><th>Vị trí trong plan</th><th>Trạng thái</th><th>Kết quả hoặc việc còn lại</th></tr></thead><tbody></tbody></table></div>
|
||||||
|
|
||||||
<h2>Quyết định (D-1 đến D-4 chốt 26/10/2026; D-5 đến D-12 chốt 29/10/2026)</h2>
|
<h2>Quyết định (D-1 đến D-4 chốt 26/10/2026; D-5 đến D-12 chốt 29/10/2026; D-13 chốt 02/11/2026)</h2>
|
||||||
<div class="tw"><table id="dec"><thead><tr><th>Mã</th><th>Quyết định</th><th>Chốt</th><th>Căn cứ</th></tr></thead><tbody></tbody></table></div>
|
<div class="tw"><table id="dec"><thead><tr><th>Mã</th><th>Quyết định</th><th>Chốt</th><th>Căn cứ</th></tr></thead><tbody></tbody></table></div>
|
||||||
|
|
||||||
<h2>Phát hiện đã kiểm chứng (từ dữ liệu)</h2>
|
<h2>Phát hiện đã kiểm chứng (từ dữ liệu)</h2>
|
||||||
@@ -292,7 +312,7 @@ const PHASES = [
|
|||||||
{id:"p4-p4x", t:"P4x exploratory (biến thể chọn sau khi thấy nhãn test)", s:"done", n:"Bỏ hẳn ngày 29/10/2026 (quyết định D-10): không tổng hợp, không vào bài, không chạy V3. Job exploratory/run_p4x.sh trên cuda:0 ở 560/921 khi chốt; sau đó dừng ở 670/921 (khoảng 04:05 UTC) và kill để trả GPU, nhánh B3d-Sa và V3 chưa chạy; kết quả không dùng. exploratory/ và outputs/p4x/ giữ làm hồ sơ."}
|
{id:"p4-p4x", t:"P4x exploratory (biến thể chọn sau khi thấy nhãn test)", s:"done", n:"Bỏ hẳn ngày 29/10/2026 (quyết định D-10): không tổng hợp, không vào bài, không chạy V3. Job exploratory/run_p4x.sh trên cuda:0 ở 560/921 khi chốt; sau đó dừng ở 670/921 (khoảng 04:05 UTC) và kill để trả GPU, nhánh B3d-Sa và V3 chưa chạy; kết quả không dùng. exploratory/ và outputs/p4x/ giữ làm hồ sơ."}
|
||||||
]},
|
]},
|
||||||
{id:"P5", name:"P5 Viết bài", start:"2026-10-29", end:"2026-10-31", weeks:"T5–T7 29–31/10",
|
{id:"P5", name:"P5 Viết bài", start:"2026-10-29", end:"2026-10-31", weeks:"T5–T7 29–31/10",
|
||||||
out:"mức A của Pivot 1: khung bài mới, các mệnh đề rẻ, T3/T4 trên số liệu đã có (xong 29/10); trích dẫn dataset 30–31/10 (lượt rút gọn độ dài đã bỏ, D-12)", gate:null,
|
out:"mức A của Pivot 1: khung bài mới, các mệnh đề rẻ, T3/T4 trên số liệu đã có (xong 29/10); trích dẫn dataset (xong 02/11; lượt rút gọn độ dài đã bỏ, D-12)", gate:null,
|
||||||
tasks:[
|
tasks:[
|
||||||
{id:"p5-d1", t:"Draft v1 và quyết định Pivot 1", s:"done", n:"29/10: đã viết đủ các mục Volve (dữ liệu, G-D, bảng tab:volvegd/volveall/volvesens, thảo luận, abstract, mở đầu, kết luận); bài build sạch, 42 trang. Trục bài đặt vào lý thuyết (Mệnh đề 1–2) và benchmark synthetic P2r; F3 và Volve là kiểm tra thực tế giới hạn phạm vi claim. Còn: citation dữ liệu, tác giả, rà văn phong. 29/10: chốt Pivot 1 (D-5 đến D-10), dời hạn sang 14/11; khảo sát dataset field public (docs/research/field-dataset-survey.md): chưa có dataset nào xác nhận đủ điều kiện cho field test có power, không thêm field test trong bài này."},
|
{id:"p5-d1", t:"Draft v1 và quyết định Pivot 1", s:"done", n:"29/10: đã viết đủ các mục Volve (dữ liệu, G-D, bảng tab:volvegd/volveall/volvesens, thảo luận, abstract, mở đầu, kết luận); bài build sạch, 42 trang. Trục bài đặt vào lý thuyết (Mệnh đề 1–2) và benchmark synthetic P2r; F3 và Volve là kiểm tra thực tế giới hạn phạm vi claim. Còn: citation dữ liệu, tác giả, rà văn phong. 29/10: chốt Pivot 1 (D-5 đến D-10), dời hạn sang 14/11; khảo sát dataset field public (docs/research/field-dataset-survey.md): chưa có dataset nào xác nhận đủ điều kiện cho field test có power, không thêm field test trong bài này."},
|
||||||
{id:"p5-a1", t:"Viết lại abstract, mở đầu, đóng góp, thảo luận, kết luận theo trục lý thuyết + benchmark", s:"done", n:"Xong sớm ngày 29/10 (plan §12 ý 24). Tiêu đề theo Pivot 1 (kèm TODO: đổi benchmark thành controlled synthetic study nếu S2 không kịp), abstract 292 từ (sau lượt tự sửa A6), keywords, paper/highlights.txt, đóng góp C1–C4. F3 và Volve thành mục phạm vi 6.6; chi tiết sang Phụ lục B (B.1 F3, B.2 Volve). Bài 55 trang (sau A6), build sạch; còn TODO đỏ cho S1–S8, T2 và các khai báo của tác giả."},
|
{id:"p5-a1", t:"Viết lại abstract, mở đầu, đóng góp, thảo luận, kết luận theo trục lý thuyết + benchmark", s:"done", n:"Xong sớm ngày 29/10 (plan §12 ý 24). Tiêu đề theo Pivot 1 (kèm TODO: đổi benchmark thành controlled synthetic study nếu S2 không kịp), abstract 292 từ (sau lượt tự sửa A6), keywords, paper/highlights.txt, đóng góp C1–C4. F3 và Volve thành mục phạm vi 6.6; chi tiết sang Phụ lục B (B.1 F3, B.2 Volve). Bài 55 trang (sau A6), build sạch; còn TODO đỏ cho S1–S8, T2 và các khai báo của tác giả."},
|
||||||
@@ -301,28 +321,29 @@ const PHASES = [
|
|||||||
{id:"p5-a4", t:"T3: khả năng phát hiện của field test (giải tích + mô phỏng trên dự đoán P2r)", s:"done", n:"29/10, exploratory, khai báo trước ở docs/research/applicability-teapot.md (Deviation 1: mở rộng lưới σ_ref). scripts/27_t3_power.py → outputs/t3/ (bài mục 6.5, bảng tab:t3). Khác phác thảo: reference là nhãn thật đọc tại warp nhiễu loạn cỡ σ_ref, luật đánh giá là sign test một phía. Cần 5–18 giếng blind với reference chính xác; từ 3 ms không ô nào đạt với 40 giếng."},
|
{id:"p5-a4", t:"T3: khả năng phát hiện của field test (giải tích + mô phỏng trên dự đoán P2r)", s:"done", n:"29/10, exploratory, khai báo trước ở docs/research/applicability-teapot.md (Deviation 1: mở rộng lưới σ_ref). scripts/27_t3_power.py → outputs/t3/ (bài mục 6.5, bảng tab:t3). Khác phác thảo: reference là nhãn thật đọc tại warp nhiễu loạn cỡ σ_ref, luật đánh giá là sign test một phía. Cần 5–18 giếng blind với reference chính xác; từ 3 ms không ô nào đạt với 40 giếng."},
|
||||||
{id:"p5-a5", t:"T10: related work về label noise / errors-in-variables", s:"done", n:"29/10: đoạn Label noise and errors in variables ở bài mục 2 (Berkson 1950, Fuller 1987, Carroll et al. 2006, Frénay & Verleysen 2014, Song et al. 2023, Mnih & Hinton 2012 đọc toàn văn, Balakrishnan 1962 chỉ có metadata Crossref). Bảng định vị thêm Mnih & Hinton."},
|
{id:"p5-a5", t:"T10: related work về label noise / errors-in-variables", s:"done", n:"29/10: đoạn Label noise and errors in variables ở bài mục 2 (Berkson 1950, Fuller 1987, Carroll et al. 2006, Frénay & Verleysen 2014, Song et al. 2023, Mnih & Hinton 2012 đọc toàn văn, Balakrishnan 1962 chỉ có metadata Crossref). Bảng định vị thêm Mnih & Hinton."},
|
||||||
{id:"p5-app", t:"Điều kiện áp dụng C1–C4 và thử Teapot Dome (exploratory)", s:"done", n:"29/10, plan §12 ý 23. Khai báo trước ở docs/research/applicability-teapot.md; kết quả ở docs/research/applicability-results.md. C1/C2 hồi cứu (scripts/26): F3, Volve trượt C1, đạt C2. Teapot: T0 trượt (tối đa 2 giếng TD độc lập), pilot P-a trượt (σ̂_knot 6,75 ms so với 1,5 ms). Dừng Teapot, quay về lịch mức B (D-11). data/Teapot/ (1,7 GB) đã vào .gitignore."},
|
{id:"p5-app", t:"Điều kiện áp dụng C1–C4 và thử Teapot Dome (exploratory)", s:"done", n:"29/10, plan §12 ý 23. Khai báo trước ở docs/research/applicability-teapot.md; kết quả ở docs/research/applicability-results.md. C1/C2 hồi cứu (scripts/26): F3, Volve trượt C1, đạt C2. Teapot: T0 trượt (tối đa 2 giếng TD độc lập), pilot P-a trượt (σ̂_knot 6,75 ms so với 1,5 ms). Dừng Teapot, quay về lịch mức B (D-11). data/Teapot/ (1,7 GB) đã vào .gitignore."},
|
||||||
{id:"p5-cite", t:"Trích dẫn dataset F3 và Volve", s:"todo", n:"30–31/10: thêm vào paper/refs.bib và mục 3 của bài. Lượt rút gọn độ dài cho venue đã bỏ theo quyết định của người dùng ngày 29/10 (D-12)."},
|
{id:"p5-cite", t:"Trích dẫn dataset F3 và Volve", s:"done", n:"Xong 02/11 (plan §12 ý 30): paper/refs.bib thêm dgb2023f3demo (F3 Demo 2023, dGB Earth Sciences, TerraNubis, CC BY-SA 3.0) và equinor2018volve (Volve, Equinor 2018; file giấy phép ghi CC BY-NC-SA 4.0); trích ở Sec. 3.1, 3.3 và mục availability của Sec. 8. Lượt rút gọn độ dài cho venue đã bỏ theo quyết định của người dùng ngày 29/10 (D-12)."},
|
||||||
{id:"p5-d2", t:"Draft v2, phụ lục chứng minh", s:"todo", n:"Dời sang 8–10/11 theo lịch mức B."},
|
{id:"p5-d2", t:"Draft v2, phụ lục chứng minh", s:"done", n:"Draft v2 về nội dung đã có từ 02/11: Thí nghiệm 3 (Sec. 6.5), T2 (Sec. 6.4) và trích dẫn dataset (plan §12 ý 30). Rà phụ lục chứng minh xong sớm ngày 02/11 (plan §12 ý 32): một agent con đọc độc lập Sec. 4, App. A và Bổ đề 5, trả 15 điểm; sửa 14 điểm, sửa một phần điểm còn lại (giữ tên cận B_a/B_b đã đăng ký). Các sửa chính: (A2) cần sup_t; (B) chỉ dịch nguyên mẫu, kèm ví dụ khi đúng; sd(β) là có điều kiện dọc ridge; khai triển Mệnh đề 4 là hình thức; bank ±Δ/2 trọng số bằng nhau ở Hệ quả 3 chứa warp thật nhưng không hiệu chỉnh; Hệ quả 4 (phương pháp đổi tên 1/2): σ_r < σ/√2 là điều kiện cần ở mọi tần số nhưng không đủ, nên Sec. 6.6 sửa lại so sánh điểm cắt 3,6/3,8/4,3 ms. Không verdict hay số đã báo cáo nào đổi. docs/theory.md đồng bộ. Bài 67 trang, không warning."},
|
||||||
{id:"p5-repro", t:"Gói tái lập (code, config, dữ liệu dẫn xuất)", s:"todo", n:"Dời sang 11–12/11."}
|
{id:"p5-repro", t:"Gói tái lập (code, config, dữ liệu dẫn xuất)", s:"done", n:"Xong sớm ngày 02/11, trừ bước deposit (plan §12 ý 32). scripts/39_repro_package.py (ngoài mọi lock): build → 5 archive tất định trong outputs/repro/ (f3_results 164 MB, f3_predictions 2,11 GB, f3_volume 505 MB: CC BY-SA 3.0; volve 8,9 MB: CC BY-NC-SA 4.0; teapot 95 KB: CC0, cần kiểm) và repro/MANIFEST.json (11.112 file, sha256 từng file); check; verify (phòng sạch không có dữ liệu thô, 12 bước, audit hook, so byte/giá trị/pixel) → repro/verify_report.md: chạy 02/11 (20 phút, CPU), 12/12 bước exit 0, không đọc file ngoài phòng sạch; 63 file trùng byte (8 hình trùng từng pixel), 3 file trùng giá trị, 0 file khác; tests/test_d2_misspec.py qua 15/15 trong phòng sạch; code --rev. Hướng dẫn tiếng Anh: repro/README.md; môi trường: repro/requirements-linux.txt. Còn: deposit và giấy phép code (người dùng), xác nhận giấy phép của bảng applicability gộp F3 và Volve."}
|
||||||
]},
|
]},
|
||||||
{id:"P6", name:"P6 Benchmark mức B", start:"2026-11-01", end:"2026-11-10", weeks:"CN 1/11 – T3 10/11",
|
{id:"P6", name:"P6 Benchmark mức B", start:"2026-11-01", end:"2026-11-10", weeks:"CN 1/11 – T3 10/11",
|
||||||
out:"protocol_bench khoá trước khi chạy; lưới đầy; trục misspec; phân tích cơ chế; gói benchmark", gate:null,
|
out:"protocol_bench khoá trước khi chạy; lưới đầy; trục misspec; phân tích cơ chế; gói benchmark; các mục kết quả trong bài (xong 02/11, trừ deposit Zenodo)", gate:null,
|
||||||
tasks:[
|
tasks:[
|
||||||
{id:"p6-t2", t:"T2 cơ chế của lợi ích bank (exploratory, realization 8–15)", s:"todo", n:"CN 1/11. Khai báo trước ở docs/research/t2-mechanism.md. Câu hỏi (đổi ngày 29/10): còn lợi ích nào vượt hiệu chỉnh quần thể của cấu trúc Berkson không. Năm phép kiểm theo todoblock bài mục 6.4: (i) warp error có trọng số responsibility so với warp trung bình; (ii) bank nhiễu GP đối chứng; (iii) tách ô posterior đa mode; (iv) kiểm Berkson hay classical bằng hiệp phương sai của offset (quyết định cận nào áp dụng); (v) B3d-Sa huấn luyện lại với số vòng lặp của Oracle. Phải khai rằng tỉ số post hoc và cả hai cận (tại σ_post, tại sai số warp, biến thể 60 Hz và phổ chéo) đã được xem ngày 29/10. Không confirmatory (D-8)."},
|
{id:"p6-t2", t:"T2 cơ chế của lợi ích bank (exploratory, realization 8–15)", s:"done", n:"Xong 29/10 (12:39–13:27 UTC; exploratory, realization 8–15). Khai báo băm trước mọi tính toán (f04e6607…), không sai lệch. Kiểm tái lập: huấn luyện lại khớp RMSE đã đăng ký, max |dev| = 0 trên 10.560 dòng. (i) warp trọng số responsibility thấp hơn warp trung bình ở 8/8 ô rộng (giảm 13–40 %): tái định vị ngầm có thật trên giếng train. (ii) bank nhiễu GP cùng hiệp phương sai đạt phần lớn lợi ích ở c = 1 (4/8 'phù hợp (a)', 3/8 'một phần', 1/8 'ngược'); thông tin của bank SMC cần ở c = 2. (iii) không có bằng chứng cho cơ chế đa mode theo luật chính. (iv) sai số nhãn của B3d-Sa là Berkson ở c = 1 (4/4 ô rộng) nên cận 1/B_b áp dụng; lợi ích H2b không vượt hiệu chỉnh quần thể. (v) khoảng một phần ba khoảng cách PM–Oracle ở c = 1 là do độ dài huấn luyện. Chi tiết: docs/research/t2-results.md, outputs/t2/summary.md. Không đổi H2a/H2b; không dùng để chọn lại budget."},
|
||||||
{id:"p6-gen", t:"Sửa generator cho S2 (misspec rock physics, wavelet, σ_b/drift); dev trên realization 902–905", s:"todo", n:"T2 2/11 – T3 3/11. Đường mặc định của D2 phải tái lập đúng P2r."},
|
{id:"p6-gen", t:"Sửa generator cho S2 (misspec rock physics, wavelet, σ_b/drift); dev trên realization 902–905", s:"done", n:"Xong sớm 29/10: tham số misspec trong synth_d2.py (rock_physics, wavelet, drift; misspec=None tái lập fingerprint P2r từng bit; 15 test mới), configs/d2_synth_bench.yaml (preset còn PLACEHOLDER), script 33 QC, docs/research/bench-generator.md. QC rid 902: rp_C bị likelihood α-profile hấp thụ hoàn toàn (chỉ làm đối chứng); wv_L1/L2 quá mạnh (model error 0.6 so với nhiễu R10 0.32). QC SMC rid 902 (cuda:1, 32 phút): đối chứng rp_C và wv_C đúng dự đoán; pha wavelet phụ thuộc tần số (minphase 1.0) là kiểu hỏng mạnh nhất và quá tự tin ở R10 (warp RMSE 4.2 ms, cov90 0.04, kém hơn tie chỉ anchor); rock physics phân tán theo đơn vị chỉ thấy ở R10; hai preset drift nhân đôi sai số ở R10 nhưng vẫn gần hiệu chỉnh. Mức chính chốt ở bước dev của p6-lock. T2 2/11 – T3 3/11. Đường mặc định của D2 phải tái lập đúng P2r."},
|
||||||
{id:"p6-lock", t:"Viết và khoá configs/protocol_bench.yaml (S1, S2, S3, S4, S8)", s:"todo", n:"T3 3/11, trước lần chạy chính đầu tiên; kèm .sha256 và .lock.json. Ghi rõ là thiết kế sau khi đã thấy P2r."},
|
{id:"p6-lock", t:"Viết và khoá configs/protocol_bench.yaml (S1, S2, S3, S4, S8)", s:"done", n:"Khoá 29/10 lúc 14:39 UTC (sha256 aa763f0a…; code_sha256 5ea2eb17…; 8 input, 102 artifact tham chiếu P2r, fingerprint danh nghĩa rid 8 và 902 khớp). Runner ml_porosity/benchmark/, scripts 34–35, scripts/run_bench.sh; 216 test pass. Tái lập ô P2r (R10, rid 8, c = 1, N = 4) qua runner: khớp từng bit. Mức S2 chốt trên dev 902–905: rock physics sd 0.10/0.15 theo đơn vị; wavelet minphase 0.5/1.0 và ô Q 80 riêng; drift hai cơ chế (siêu tham số sai; bước 8 ms + jitter 1 ms). rp_L1 (×1.24 nhiễu R10) và wv_L1 (×1.08) vượt dải L1 khai báo 0.5–1.0×, đã công bố trong protocol. Ở Rm5 khai báo trước kết quả null. Budget TCN chọn trên dev bằng luật protocol_p2: 125 vòng cho mọi phương pháp (nằm ở biên danh sách ứng viên, ghi rõ). Ô: S1 560 job SMC, S2 224, S3 240, S4 48, S8 96; thêm có công bố Ctl-GP và nhánh cùng budget 500. 9 claim khai báo trước, 11 verdict, không hiệu chỉnh family-wise, báo cáo mọi verdict. Thiết kế sau khi đã thấy P2r."},
|
||||||
{id:"p6-s1", t:"S1: lấp lưới c ∈ {0.5, 1.5}, N ∈ {2, 8}", s:"todo", n:"T4 4/11 – T5 5/11, hai GPU."},
|
{id:"p6-s1", t:"S1: lấp lưới c ∈ {0.5, 1.5}, N ∈ {2, 8}", s:"done", n:"Xong 02:16 UTC 30/10: 560/560 ô train (R10, Rm5, R0, R0h, R10tb × 112), posterior SMC xong trước đó. Bị SIGTERM 15:27 UTC 29/10, chạy lại trong tmux từ 16:07; 01:02 UTC 30/10 tách nhóm B thành hai driver R0h và R10tb (tổng 36 worker, CPU bão hòa). R10tb xong 01:50, nhóm A 01:57, R0h 02:16. Supervisor hai lần khởi động lại R0h khi dồn worker (01:53, 01:58), mất khoảng 10 phút job dở; không ảnh hưởng kết quả (resume theo fingerprint). Summarize 02/11: S1-H1 đạt (R10 c = 1.5: 0.853 / 0.796 ở N = 4/16), S1-H2 đạt (13/13 họ rộng, ρ = −0.47, p < 10⁻⁴)."},
|
||||||
{id:"p6-s3s4", t:"S3: B4 dưới posterior SMC; S4: backbone thứ hai", s:"todo", n:"T4 4/11 – T5 5/11."},
|
{id:"p6-s3s4", t:"S3: B4 dưới posterior SMC; S4: backbone thứ hai", s:"done", n:"Xong 00:58 UTC 30/10: train S3+S4+S8 đủ 384/384 job (tmux p6_s348, wall 8:50:41 từ 16:07 UTC). S4 dùng TCN, budget 125. Summarize 02/11: S3-H1 đạt theo phát biểu ở R10, R0, Rm5 (không đạt ở R0h, R10tb); code đã khoá đưa Ctl-GP vào đối thủ nên báo không đạt, báo cáo cả hai (D-13). S4-H1 đạt (0.840 / 0.823), S4-H2 đạt (0.977 / 0.983)."},
|
||||||
{id:"p6-s2", t:"S2: ba trục misspec ở R10, Rm5, c = 1, N ∈ {4, 16}", s:"todo", n:"T6 6/11 – T7 7/11. Bắt buộc (D-7): thiếu S2 thì bài gọi là controlled synthetic study, không gọi là benchmark."},
|
{id:"p6-s2", t:"S2: ba trục misspec ở R10, Rm5, c = 1, N ∈ {4, 16}", s:"done", n:"Xong 00:12 UTC 30/10: posterior 224/224, train 224/224 (tmux p6_s2, cuda:1, 6 worker). Bắt buộc (D-7): thiếu S2 thì bài gọi là controlled synthetic study, không gọi là benchmark. S2 đủ nên được gọi là benchmark. Summarize 02/11: S2-H1 đạt ở trục drift (0.862 / 0.798), không đạt ở rock physics (0.940 / 0.934) và wavelet (1.023 / 1.042), trái dự đoán; S2-H2 đạt (14/14 cặp ≤ 1.02)."},
|
||||||
{id:"p6-s8", t:"S8/T8: regime cycle-skip có kiểm soát", s:"todo", n:"T7 7/11."},
|
{id:"p6-s8", t:"S8/T8: regime cycle-skip có kiểm soát", s:"done", n:"Xong 00:58 UTC 30/10, chung job với S3, S4 (tmux p6_s348). Summarize 02/11: S8-H1 đạt (Ĥ trung bình −0.70 / −0.49 ở Δ = 32 ms), S8-H2 đạt (BK2/PM2 0.28–0.71 ở 4/4 ô)."},
|
||||||
{id:"p6-s7", t:"S7: đóng gói benchmark (một lệnh sinh, một lệnh chấm, bảng tham chiếu, README, hash, Zenodo)", s:"todo", n:"CN 8/11 – T3 10/11."},
|
{id:"p6-sum", t:"Summarize và đọc 11 verdict theo lời phát biểu (scripts/34 summarize, scripts/36)", s:"done", n:"Xong 02/11. Summarize theo code đã khoá 02:02 UTC (lock khớp, 8.799 file khớp sha256) → outputs/bench/summary/. scripts/36_bench_verdicts.py (ngoài lock, kiểm lock trước khi chạy) đọc lại đúng lời phát biểu → verdict_final.json, verdict_final.md: 9/11 đạt; S2-H1 trượt ở rock physics và wavelet. Ba chỗ code khác phát biểu (S1-H1, S2-H1, S3-H1), chỉ S3-H1 đổi kết luận (D-13)."},
|
||||||
{id:"p6-write", t:"Viết lại các mục kết quả theo số liệu mới", s:"todo", n:"CN 8/11 – T3 10/11."}
|
{id:"p6-s7", t:"S7: đóng gói benchmark (một lệnh sinh, một lệnh chấm, bảng tham chiếu, README, hash, Zenodo)", s:"done", n:"Xong sớm 02/11, trừ bước deposit Zenodo (cần tài khoản và danh sách tác giả của người dùng). scripts/37_bench_package.py (ngoài lock; generate và tables kiểm lock trước). generate: 630 task (test 8–15, dev 900–905; mỗi realization 45 task: 5 regime × 5 c, 14 setting S2, 6 setting S8), truth ẩn, input, analyst.json → outputs/bench/package/ (845 MB). Hash nội dung trong benchmark/MANIFEST.json; chạy lại tái lập 1.260/1.260 hash, check khớp 1.265/1.265 file. tables: 45.200 run tham chiếu, 21 phương pháp → benchmark/reference/. score áp luật ô H2a và luật better của summary.py. selftest đạt: bản chép dự đoán B3d-Sa/BK2 đã lưu cho lại metric (lệch ≤ 5e-10) và luật (S1-H1 0,8529 / 0,7964). Hướng dẫn: benchmark/README.md (tiếng Anh). Metadata Zenodo nháp: benchmark/zenodo_metadata.json (giấy phép nháp CC BY-SA 3.0 theo F3, cần kiểm). plan.md §12 ý 29."},
|
||||||
|
{id:"p6-write", t:"Viết lại các mục kết quả theo số liệu mới", s:"done", n:"Xong sớm 02/11 (plan §12 ý 30). Sec. 6.5 mới, Thí nghiệm 3: bảng thiết kế và bảng 11 verdict với cả hai cách đọc (D-13); hình phase diagram S1; bảng S2 ghi rõ hai trục trượt (rock physics, pha wavelet); S3, S4; bảng và hình S8; nhánh cùng budget. Sec. 6.4 (T2) thay todoblock. Sec. 3.2 thêm preset misspec; Sec. 5 thêm TCN và các dòng benchmark của tab:methods. Cập nhật abstract, intro, discussion, kết luận, availability; bỏ TODO ở tiêu đề. Hình vẽ bằng scripts/38_bench_figures.py (ngoài lock). Chữ 'calibrated' của S8-H2 chỉ theo nghĩa yếu (truth là thành viên); bài ghi rõ BK2 không phải bank hiệu chỉnh theo Mệnh đề 4 (D-14). Nguồn số: paper/README.md."}
|
||||||
]},
|
]},
|
||||||
{id:"P7", name:"P7 Review và nộp", start:"2026-11-11", end:"2026-11-14", weeks:"T4–T7 11–14/11",
|
{id:"P7", name:"P7 Review và nộp", start:"2026-11-11", end:"2026-11-14", weeks:"T4–T7 11–14/11",
|
||||||
out:"bản nộp", gate:null,
|
out:"bản nộp", gate:null,
|
||||||
tasks:[
|
tasks:[
|
||||||
{id:"p7-rev", t:"Review nội bộ; hình; phụ lục chứng minh; gói tái lập", s:"todo", n:"T4 11/11 – T5 12/11."},
|
{id:"p7-rev", t:"Review nội bộ; hình; phụ lục chứng minh; gói tái lập", s:"todo", n:"T4 11/11 – T5 12/11. Phụ lục chứng minh rà xong 02/11, gói tái lập dựng xong 02/11. Rà soát chống hallucination toàn bài xong sớm 04/11 (plan §12 ý 36; <a href=\"docs/research/paper-audit.md\">biên bản</a>): 87 phát hiện, 4 lỗi S1, đều đã sửa; không verdict nào đổi. Còn mở cho tác giả: G1-14, 7 PDF thiếu, licence Volve, null Rm5."},
|
||||||
{id:"p7-nov", t:"Kiểm tra tính mới lần cuối, tra quartile, đăng preprint", s:"todo", n:"T6 13/11."},
|
{id:"p7-nov", t:"Kiểm tra tính mới lần cuối, tra quartile, đăng preprint", s:"todo", n:"T6 13/11. Quét sơ bộ xong 02/11 (plan §12 ý 31): không bài nào đưa bất định tie vào huấn luyện; thêm Herrera 2014, Autotie 2026 (chỉ abstract) và Castagna 2026 (đọc toàn văn 02/11, plan §12 ý 33). Ngày 13/11: quét lại; abstract IMAGE 2026 của Palavicini Gurria; DOI Quesada 2024."},
|
||||||
{id:"p7-sub", t:"Nộp Computers & Geosciences", s:"todo", n:"T7 14/11."}
|
{id:"p7-sub", t:"Nộp Computers & Geosciences", s:"todo", n:"T7 14/11."}
|
||||||
]}
|
]}
|
||||||
];
|
];
|
||||||
@@ -336,9 +357,9 @@ const XM = [
|
|||||||
{name:"Mốc thời gian của SEG-Y (delay 4 ms)", where:"mục 1.2, phát hiện khi làm P0", s:"todo", r:"F3_entire.segy ghi DelayRecordingTime = 4 ms (mẫu đầu ở 4 ms), trong khi .survey ghi trục Z bắt đầu từ 0. Cần xác nhận marker và horizon dùng cùng mốc, nếu không sẽ lệch đều 1 mẫu. Kiểm 26/10: horizon − marker tại giếng có trung vị +1.6 ms (FS8, Truncation lệch ≤ 2 ms); dịch chung của tie tốt nhất ở F03-4, F06-1 là +1 đến +7 ms. Chưa đủ để kết luận ở mức 4 ms."},
|
{name:"Mốc thời gian của SEG-Y (delay 4 ms)", where:"mục 1.2, phát hiện khi làm P0", s:"todo", r:"F3_entire.segy ghi DelayRecordingTime = 4 ms (mẫu đầu ở 4 ms), trong khi .survey ghi trục Z bắt đầu từ 0. Cần xác nhận marker và horizon dùng cùng mốc, nếu không sẽ lệch đều 1 mẫu. Kiểm 26/10: horizon − marker tại giếng có trung vị +1.6 ms (FS8, Truncation lệch ≤ 2 ms); dịch chung của tie tốt nhất ở F03-4, F06-1 là +1 đến +7 ms. Chưa đủ để kết luận ở mức 4 ms."},
|
||||||
{name:"Kiểm kê NLOG", where:"D1, mục 5.1", s:"done", r:"F03-03 và F03-06 dùng được; F03-05-S1 không (dữ liệu thời gian–độ sâu bắt đầu ở 1295 ms)."},
|
{name:"Kiểm kê NLOG", where:"D1, mục 5.1", s:"done", r:"F03-03 và F03-06 dùng được; F03-05-S1 không (dữ liệu thời gian–độ sâu bắt đầu ở 1295 ms)."},
|
||||||
{name:"Kiểm kê Volve", where:"D3, mục 5.1", s:"done", r:"Xong phần cục bộ: toạ độ, quỹ đạo, ROI. Horizon và well picks tải ngày 26/10 (marker TWT cho cả 10 giếng). Cube ST10010 đã tải và kiểm tra."},
|
{name:"Kiểm kê Volve", where:"D3, mục 5.1", s:"done", r:"Xong phần cục bộ: toạ độ, quỹ đạo, ROI. Horizon và well picks tải ngày 26/10 (marker TWT cho cả 10 giếng). Cube ST10010 đã tải và kiểm tra."},
|
||||||
{name:"Quét SEG/EAGE 2024–2026", where:"mục 2.4 (4)", s:"done", r:"Xong ngày 28/10/2026. Thêm 10 bài chỉ có abstract (AWSM, BootNet, Quesada, Mirza, Guillon, Cordoba, Thiebaud, Rizzuti ×2, Huff) vào paper/refs.bib và §2. Không bài nào đưa posterior của tie vào huấn luyện; câu 'to our knowledge' giữ nguyên. Còn mở: abstract IMAGE 2026 của Palavicini Gurria et al., DOI của Quesada 2024."},
|
{name:"Quét SEG/EAGE 2024–2026", where:"mục 2.4 (4)", s:"done", r:"Xong ngày 28/10/2026. Thêm 10 bài chỉ có abstract (AWSM, BootNet, Quesada, Mirza, Guillon, Cordoba, Thiebaud, Rizzuti ×2, Huff) vào paper/refs.bib và §2. Không bài nào đưa posterior của tie vào huấn luyện; câu 'to our knowledge' giữ nguyên. Còn mở: abstract IMAGE 2026 của Palavicini Gurria et al., DOI của Quesada 2024 (ngày 02/11 vẫn chưa lấy được; quét sơ bộ 02/11 ở plan §12 ý 31). Ngày 02/11 đã có toàn văn hai bài Rizzuti (refs/), khớp với Bảng tab:positioning; các bài khác không có bản truy cập mở (refs/MISSING.md). Cùng ngày người dùng tải tay AWSM, BootNet, P05 và Guillon 2020: toàn văn khớp với bảng, AWSM có 44 giếng và không bước nào dùng posterior TD; bỏ chú thích ᵃ của sáu bài (plan §12 ý 33)."},
|
||||||
{name:"Đặt Google Scholar alert", where:"mục 2.4 (5)", s:"todo", r:"Làm cùng bước quét; nhắc lại trước khi nộp."},
|
{name:"Đặt Google Scholar alert", where:"mục 2.4 (5)", s:"todo", r:"Làm cùng bước quét; nhắc lại trước khi nộp."},
|
||||||
{name:"5 bài mới đọc được abstract (P03, P04, P05, P07, P09)", where:"mục 2.2", s:"done", r:"Đóng ngày 28/10/2026. P03 có toàn văn (refs/xu2024sts.pdf). P04, P05, P07, P09 không lấy được toàn văn; mọi chỗ trích trong bản thảo đã đối chiếu với abstract và đều khớp; giữ chú thích abstract-only."},
|
{name:"5 bài mới đọc được abstract (P03, P04, P05, P07, P09)", where:"mục 2.2", s:"done", r:"Đóng ngày 28/10/2026. P03 có toàn văn (refs/xu2024sts.pdf). P04, P05, P07, P09 không lấy được toàn văn; mọi chỗ trích trong bản thảo đã đối chiếu với abstract và đều khớp; giữ chú thích abstract-only. Ngày 02/11 người dùng tải tay được P05 (refs/li2024bpinn.pdf): toàn văn khớp, bỏ chú thích ᵃ (plan §12 ý 33)."},
|
||||||
{name:"Quartile SJR của venue", where:"dòng 28, mục 8", s:"todo", r:"Tra SCImago khi nộp bài."},
|
{name:"Quartile SJR của venue", where:"dòng 28, mục 8", s:"todo", r:"Tra SCImago khi nộp bài."},
|
||||||
{name:"Xếp hạng CORE của hội nghị", where:"mục 8", s:"todo", r:"Tra portal.core.edu.au (ICANN, ICONIP)."},
|
{name:"Xếp hạng CORE của hội nghị", where:"mục 8", s:"todo", r:"Tra portal.core.edu.au (ICANN, ICONIP)."},
|
||||||
{name:"Gunning & Glinsky (2006), Wavelet extractor", where:"mục 2.4 (2), mục 11", s:"done", r:"Đã đọc toàn văn ngày 26/10/2026 (refs/gunning2006waveletextractor.pdf). Tóm tắt ở plan mục 2.1 L1; bib gunning2006waveletextractor."},
|
{name:"Gunning & Glinsky (2006), Wavelet extractor", where:"mục 2.4 (2), mục 11", s:"done", r:"Đã đọc toàn văn ngày 26/10/2026 (refs/gunning2006waveletextractor.pdf). Tóm tắt ở plan mục 2.1 L1; bib gunning2006waveletextractor."},
|
||||||
@@ -357,7 +378,10 @@ const DECISIONS = [
|
|||||||
{id:"D-9", q:"Venue", p:"Computers & Geosciences; dự phòng Geophysical Prospecting.", n:"Nhận bài benchmark kèm code, yêu cầu code/data availability (khớp S7). Quartile tra lại khi nộp [XM]."},
|
{id:"D-9", q:"Venue", p:"Computers & Geosciences; dự phòng Geophysical Prospecting.", n:"Nhận bài benchmark kèm code, yêu cầu code/data availability (khớp S7). Quartile tra lại khi nộp [XM]."},
|
||||||
{id:"D-10", q:"Số phận P4x", p:"Bỏ hẳn. Không dùng trong bài, không chạy V3, không tổng hợp; exploratory/ và outputs/p4x/ giữ làm hồ sơ.", n:"Không phục vụ bài mới; biến thể chọn sau khi thấy nhãn test. Người dùng chốt."},
|
{id:"D-10", q:"Số phận P4x", p:"Bỏ hẳn. Không dùng trong bài, không chạy V3, không tổng hợp; exploratory/ và outputs/p4x/ giữ làm hồ sơ.", n:"Không phục vụ bài mới; biến thể chọn sau khi thấy nhãn test. Người dùng chốt."},
|
||||||
{id:"D-11", q:"Teapot Dome làm field test thứ ba?", p:"Không. Dừng Teapot, giữ Pivot 1 và lịch mức B; T3 và C1–C4 vào bài như phân tích exploratory về điều kiện cần của một field test, không phải claim.", n:"T0: chỉ 4 bảng TD, tối đa 2 giếng độc lập (cần ≥ 3 cho C3 cộng 11–18 cho C4). Pilot P-a (knot horizon–top, 37 giếng dev, chưa mở porosity): σ̂_knot 6,75 ms (CI 90% 4,1–9,4) so với dung sai 1,5 ms. Người dùng chốt: quay về lịch mức B."},
|
{id:"D-11", q:"Teapot Dome làm field test thứ ba?", p:"Không. Dừng Teapot, giữ Pivot 1 và lịch mức B; T3 và C1–C4 vào bài như phân tích exploratory về điều kiện cần của một field test, không phải claim.", n:"T0: chỉ 4 bảng TD, tối đa 2 giếng độc lập (cần ≥ 3 cho C3 cộng 11–18 cho C4). Pilot P-a (knot horizon–top, 37 giếng dev, chưa mở porosity): σ̂_knot 6,75 ms (CI 90% 4,1–9,4) so với dung sai 1,5 ms. Người dùng chốt: quay về lịch mức B."},
|
||||||
{id:"D-12", q:"Bản thảo dài hơn giới hạn của venue", p:"Bỏ lượt rút gọn độ dài cho venue. Rủi ro độ dài vẫn ghi lại (plan R9), chưa có biện pháp.", n:"Thân bài khoảng 14.750 từ (đếm thô sau A6); giới hạn Research Article khoảng 5.500 từ theo nguồn thứ cấp (trang chính thức không tải được). Agent đã đề xuất rút gọn ngày 30–31/10 (chứng minh, Thí nghiệm 1, H1 và Phụ lục B sang Supplementary); người dùng bỏ phương án này ngày 29/10 (plan §12 ý 25). Người dùng chốt."}
|
{id:"D-12", q:"Bản thảo dài hơn giới hạn của venue", p:"Bỏ lượt rút gọn độ dài cho venue. Rủi ro độ dài vẫn ghi lại (plan R9), chưa có biện pháp.", n:"Thân bài khoảng 14.750 từ (đếm thô sau A6); giới hạn Research Article khoảng 5.500 từ theo nguồn thứ cấp (trang chính thức không tải được). Agent đã đề xuất rút gọn ngày 30–31/10 (chứng minh, Thí nghiệm 1, H1 và Phụ lục B sang Supplementary); người dùng bỏ phương án này ngày 29/10 (plan §12 ý 25). Người dùng chốt."},
|
||||||
|
{id:"D-13", q:"Code tổng hợp đã khoá của protocol_bench khác lời phát biểu ở ba verdict", p:"Phán quyết theo lời phát biểu: S1-H1 lấy hai ô N ∈ {4, 16}; S2-H1 một verdict mỗi trục; S3-H1 đối thủ là {B3b, B3c, B3c-R, B4a–d}, không có Ctl-GP. Tính ở scripts/36_bench_verdicts.py (ngoài lock); không sửa code đã khoá; báo cáo cả hai cách đọc và ghi là deviation thực thi trong Methods.", n:"Phát hiện ngày 02/11, sau chạy chính và trước khi bài dùng số. Chỉ S3-H1 đổi kết luận: theo code không đạt ở mọi regime vì Ctl-GP (bank nhiễu GP cùng hai moment của posterior) gần trùng B3d-Sa; theo phát biểu đạt ở R10, R0, Rm5. S1-H1: code trả null vì S1 có 4 giá trị N. S2-H1: code tính đúng từng trục, chỉ summary.md in sai. Agent chốt theo bằng chứng."},
|
||||||
|
{id:"D-14", q:"Lời phát biểu đã khoá của S8-H2 gọi BK2 là 'calibrated bank'", p:"Giữ verdict, sửa cách diễn đạt trong bài: 'calibrated' ở đây chỉ nghĩa yếu (warp thật là một thành viên). Bài ghi rõ BK2 không phải bank hiệu chỉnh theo Mệnh đề 4, và đối chiếu transfer đo được với cos²(πfΔ) của Hệ quả 3 (a). Đây là post hoc, không phải verdict (scripts/38_bench_figures.py --flipband).", n:"02/11, khi viết Sec. 6.5 (plan §12 ý 30). Không sửa protocol đã khoá. Trong băng đảo dấu ở N = 16, BK2 có transfer 0,92–1,00, trong khi trung bình cos² là 0,05–0,59: BK2 làm tốt hơn trung bình hai thành viên của nó, khớp với tái đăng ký (Remark 1). Agent chốt theo bằng chứng."},
|
||||||
|
{id:"D-15", q:"Dùng tên gì cho kịch bản và phương pháp trong bài?", p:"Tên mô tả (10 dB, half-anchor, SMC mean, SMC bank, calibrated sonic...). Config, output và code giữ mã cũ; mapping ở paper/README.md.", n:"Người dùng thấy các mã tự đặt khó hiểu; các bài C&G đọc được đều dùng tên bằng lời. Cơ sở ở docs/research/paper-style-survey.md."},
|
||||||
];
|
];
|
||||||
|
|
||||||
const FINDS = [
|
const FINDS = [
|
||||||
@@ -392,9 +416,12 @@ const FINDS = [
|
|||||||
{h:"Tie trung bình posterior làm sắc, không làm mờ", p:"Mệnh đề 3 của bài: sai số classical (độc lập với nhãn thật) làm mờ predictor và nới phương sai học được; sai số <b>Berkson</b> (độc lập với dữ liệu, như tie trung bình posterior) làm sắc và thu hẹp. Bank hiệu chỉnh có cùng nghiệm quần thể với nhãn thật (Mệnh đề 4), nhưng lợi ích quần thể so với nhãn điểm chỉ là <b>bậc bốn</b> theo σ. Cận 1/B(σ_post) dùng cho H2b là ρ* dưới cấu trúc classical. Dưới Berkson, cận thấp hơn nhiều. Hệ số e^{4π²σ²f²} giữa hai tích phân là 1,10 ở 25 Hz nhưng 1,77 ở 60 Hz (σ = 2 ms), và méo có trọng số f⁴ nằm ở 67–72 Hz. Ở σ = 2 ms, tích phân Berkson vì thế gấp <b>2,1–2,6</b> lần. Nhận định trước đó \"hệ số dưới 1,17, cấu trúc gần như không đổi cận\" sai (chỉ xét ≤ 25 Hz) và đã được sửa ngày 29/10."},
|
{h:"Tie trung bình posterior làm sắc, không làm mờ", p:"Mệnh đề 3 của bài: sai số classical (độc lập với nhãn thật) làm mờ predictor và nới phương sai học được; sai số <b>Berkson</b> (độc lập với dữ liệu, như tie trung bình posterior) làm sắc và thu hẹp. Bank hiệu chỉnh có cùng nghiệm quần thể với nhãn thật (Mệnh đề 4), nhưng lợi ích quần thể so với nhãn điểm chỉ là <b>bậc bốn</b> theo σ. Cận 1/B(σ_post) dùng cho H2b là ρ* dưới cấu trúc classical. Dưới Berkson, cận thấp hơn nhiều. Hệ số e^{4π²σ²f²} giữa hai tích phân là 1,10 ở 25 Hz nhưng 1,77 ở 60 Hz (σ = 2 ms), và méo có trọng số f⁴ nằm ở 67–72 Hz. Ở σ = 2 ms, tích phân Berkson vì thế gấp <b>2,1–2,6</b> lần. Nhận định trước đó \"hệ số dưới 1,17, cấu trúc gần như không đổi cận\" sai (chỉ xét ≤ 25 Hz) và đã được sửa ngày 29/10."},
|
||||||
{h:"Lợi ích của bank: vượt cận classical, phần lớn trong cận Berkson (post hoc)", p:"scripts/31_p2r_posthoc.py, 8 ô rộng ở N = 16. Với cận classical đã đăng ký, M2-Sa/B3d-Sa thấp hơn cận ở <b>7/8</b> ô khi tính tại σ_post và <b>6/8</b> khi tính tại sai số warp RMS. R10tb c = 2 vượt mép lưới blur 6 ms, nên cận bị kẹp ở 1/B(6 ms) = 0,634; tính đúng tại σ_post là 0,481. Cận Berkson, cấu trúc tự nhiên cho nhãn tại warp trung bình, được tính post hoc. Với cận này chỉ <b>3/8</b> ô vượt tại σ_post (R0, R0h, R10tb ở c = 1; hai ô sau lề < 0,004), và tối đa 1/8 tại sai số warp. Hai biến thể (giữ hệ số ở 60 Hz; phổ chéo) cho cùng kết quả. Nhận định \"vượt cận\" ghi trước đó đã bị rút lại; chưa kiểm sai số thật có kiểu Berkson không (T2 test iv). M2-Sa không đạt Oracle ở ô rộng nào (kém 4–6% ở R0, R0h, Rm5 với c = 1; 17% ở R10tb c = 1; 63% ở R10tb c = 2) và chỉ đóng 27–46% khoảng cách tới Oracle ở c = 1, 39–65% ở c = 2. Nguồn lợi ích còn mở (T2)."},
|
{h:"Lợi ích của bank: vượt cận classical, phần lớn trong cận Berkson (post hoc)", p:"scripts/31_p2r_posthoc.py, 8 ô rộng ở N = 16. Với cận classical đã đăng ký, M2-Sa/B3d-Sa thấp hơn cận ở <b>7/8</b> ô khi tính tại σ_post và <b>6/8</b> khi tính tại sai số warp RMS. R10tb c = 2 vượt mép lưới blur 6 ms, nên cận bị kẹp ở 1/B(6 ms) = 0,634; tính đúng tại σ_post là 0,481. Cận Berkson, cấu trúc tự nhiên cho nhãn tại warp trung bình, được tính post hoc. Với cận này chỉ <b>3/8</b> ô vượt tại σ_post (R0, R0h, R10tb ở c = 1; hai ô sau lề < 0,004), và tối đa 1/8 tại sai số warp. Hai biến thể (giữ hệ số ở 60 Hz; phổ chéo) cho cùng kết quả. Nhận định \"vượt cận\" ghi trước đó đã bị rút lại; chưa kiểm sai số thật có kiểu Berkson không (T2 test iv). M2-Sa không đạt Oracle ở ô rộng nào (kém 4–6% ở R0, R0h, Rm5 với c = 1; 17% ở R10tb c = 1; 63% ở R10tb c = 2) và chỉ đóng 27–46% khoảng cách tới Oracle ở c = 1, 39–65% ở c = 2. Nguồn lợi ích còn mở (T2)."},
|
||||||
{h:"Coverage: độ dài huấn luyện lẫn với nguồn nhãn (T4, post hoc)", p:"Mọi ensemble quá hẹp: tỉ số ξ = E s²/E(y − μ)² chỉ <b>0,19</b> ở Oracle và tối đa 0,66 (B5) ở R10, c = 1, N = 16. B3c-R học 500 vòng lặp như Oracle và đạt cùng ξ với B3d-Sa ở 250 vòng. Trên dev, coverage90 của Oracle đơn lẻ giảm 0,47 → 0,23 → 0,10 sau 125/500/2000 vòng. Phần (b), (c) của Mệnh đề 5 chưa kiểm; không claim hiệu chỉnh."},
|
{h:"Coverage: độ dài huấn luyện lẫn với nguồn nhãn (T4, post hoc)", p:"Mọi ensemble quá hẹp: tỉ số ξ = E s²/E(y − μ)² chỉ <b>0,19</b> ở Oracle và tối đa 0,66 (B5) ở R10, c = 1, N = 16. B3c-R học 500 vòng lặp như Oracle và đạt cùng ξ với B3d-Sa ở 250 vòng. Trên dev, coverage90 của Oracle đơn lẻ giảm 0,47 → 0,23 → 0,10 sau 125/500/2000 vòng. Phần (b), (c) của Mệnh đề 5 chưa kiểm; không claim hiệu chỉnh."},
|
||||||
{h:"Reference ở giếng blind phải chính xác cỡ 1 ms (T3, exploratory)", p:"Chấm lại dự đoán P2r với reference lệch σ_ref: tỉ số band RMSE trung vị cắt 1 ở <b>3,6–4,3 ms</b> (Hệ quả 4 dự báo σ/√2 = 3,0/4,1/5,1 ms). Sign test α = 0,05 cần 5–18 giếng blind nếu reference chính xác (5/6 ô), 11–30 giếng ở 1 ms (4 ô); ở 2 ms chỉ R0 còn trong 40 giếng; từ 3 ms không ô nào. Luật k-of-n của G-C, G-D không phải phép kiểm: đạt ngẫu nhiên với xác suất 0,31 (n = 4) và 0,11 (n = 6)."},
|
{h:"Reference ở giếng blind phải chính xác cỡ 1 ms (T3, exploratory)", p:"Chấm lại dự đoán P2r với reference lệch σ_ref: tỉ số band RMSE trung vị cắt 1 ở <b>3,6–4,3 ms</b> (Hệ quả 4, sửa 02/11: không có shrinkage thì điểm cắt nằm dưới σ/√2 = 3,0/4,1/5,1 ms, và bằng σ/√2 ở bậc đầu; điều kiện này cần nhưng không đủ; R10 cao hơn 0,6 ms, điều shrinkage cho phép). Sign test α = 0,05 cần 5–18 giếng blind nếu reference chính xác (5/6 ô), 11–30 giếng ở 1 ms (4 ô); ở 2 ms chỉ R0 còn trong 40 giếng; từ 3 ms không ô nào. Luật k-of-n của G-C, G-D không phải phép kiểm: đạt ngẫu nhiên với xác suất 0,31 (n = 4) và 0,11 (n = 6)."},
|
||||||
{h:"F3 và Volve trượt điều kiện C1; Teapot không có reference TD độc lập", p:"Hồi cứu (scripts/26): band PCC ở giếng blind 0,15 (F3) và 0,13/0,04 (Volve), dưới ngưỡng 0,47 suy từ D2; cả hai đạt C2 (σ_post trung vị 2,8 và 4,3 ms). Teapot Dome: 152 giếng có density trong survey 3-D nhưng tối đa <b>2</b> giếng có TD độc lập; knot horizon–top cho σ̂_knot <b>6,75 ms</b> (CI 90% 4,1–9,4) so với dung sai 1,5 ms (D-11)."},
|
{h:"F3 và Volve trượt điều kiện C1; Teapot không có reference TD độc lập", p:"Hồi cứu (scripts/26): band PCC ở giếng blind 0,15 (F3) và 0,13/0,04 (Volve), dưới ngưỡng 0,47 suy từ D2; cả hai đạt C2 (σ_post trung vị 2,8 và 4,3 ms). Teapot Dome: 152 giếng có density trong survey 3-D nhưng tối đa <b>2</b> giếng có TD độc lập; knot horizon–top cho σ̂_knot <b>6,75 ms</b> (CI 90% 4,1–9,4) so với dung sai 1,5 ms (D-11)."},
|
||||||
{h:"Bản thảo dài gấp khoảng 2,7 lần giới hạn của venue", p:"Thân bài (mục 1–8) khoảng <b>14.750</b> từ (đếm thô sau A6); giới hạn Research Article của Computers & Geosciences khoảng 5.500 từ theo nguồn thứ cấp, chưa kiểm trên trang chính thức. Người dùng bỏ lượt rút gọn (D-12); rủi ro vẫn mở."}
|
{h:"Bản thảo dài gấp khoảng 3,3 lần giới hạn của venue", p:"Thân bài (mục 1–8) khoảng <b>18.100</b> từ (đếm thô sau lượt viết kết quả ngày 02/11; sau A6 là 14.750; lượt rà chứng minh cùng ngày thêm khoảng 350 từ, lượt đọc toàn văn Sec. 2 thêm khoảng 130 từ, ước tính; lượt rà soát chống hallucination ngày 04/11 thêm khoảng 600 từ), 69 trang; giới hạn Research Article của Computers & Geosciences khoảng 5.500 từ theo nguồn thứ cấp, chưa kiểm trên trang chính thức. Người dùng bỏ lượt rút gọn (D-12); rủi ro vẫn mở."},
|
||||||
|
{h:"T2: lợi ích bank ở c = 1 chủ yếu là tăng cường nhãn, không phải thông tin của posterior", p:"Exploratory, khai báo trước. Sai số nhãn của B3d-Sa là <b>Berkson</b> ở c = 1, nên cận áp dụng là 1/B_b và lợi ích H2b không vượt hiệu chỉnh quần thể. Một bank nhiễu GP có cùng trung bình và hiệp phương sai với posterior (không thêm thông tin) đạt phần lớn lợi ích ở c = 1; bank SMC chỉ hơn rõ ở c = 2. RML có tái định vị ngầm (warp trọng số responsibility tốt hơn 13–40 % ở 8/8 ô rộng). Khoảng một phần ba khoảng cách PM–Oracle là độ dài huấn luyện."},
|
||||||
|
{h:"P6: nhãn trung bình posterior đứng vững trước c = 1,5, backbone TCN và baseline B4, nhưng không trước sai pha wavelet", p:"protocol_bench, realization 8–15, R10. B3d-Sa hơn tie điểm tốt nhất ở c = 1,5 (<b>0,853 / 0,796</b> ở N = 4/16), với TCN ở c = 1 (0,840 / 0,823) và khi thêm B4a–d làm đối thủ (B4 không là đối thủ tốt nhất ở ô c ≤ 1 nào). Dưới sai mô hình mức L1: drift giữ lợi ích (0,862 / 0,798); rock physics thu hẹp xuống dưới ngưỡng (0,940 / 0,934); sai pha wavelet xoá hẳn (1,023 / 1,042 so với B3c) vì posterior SMC quá tự tin (cov90 0,17 / 0,10; warp RMSE 2,6 / 2,3 ms so với σ_post 0,7 ms). Dự đoán trước là đạt cho cả rock physics và wavelet."},
|
||||||
|
{h:"P6: bank hai mode sửa nhãn trung bình khi các mode tách được (S8)", p:"Posterior hai mode dựng từ warp thật. Ở Δ = 32 ms, R10, hàm truyền của nhãn trung bình (PM2) so với Oracle âm trong băng đảo dấu (<b>−0,70 / −0,49</b>), đúng Hệ quả 3. Bank hai thành viên (BK2) có band RMSE bằng 0,28–0,71 lần PM2 ở Δ ∈ {16, 32} ms; ở Δ = 8 ms (mô tả) 0,60–0,98. BK2 không phải bank hiệu chỉnh theo Mệnh đề 4: khi λ → 0, Hệ quả 3 cho transfer cos²(πfΔ), trung bình 0,05–0,59 trong băng đảo dấu, nhưng đo được 0,92–1,00 ở N = 16 (post hoc). Điều này khớp với tái đăng ký qua responsibility. S1-H2: lợi ích bank tăng theo N ở 13/13 họ rộng, ρ = −0,47."}
|
||||||
];
|
];
|
||||||
|
|
||||||
const DATA = [
|
const DATA = [
|
||||||
@@ -540,7 +567,33 @@ const LOG = [
|
|||||||
["2026-10-29","Đồng bộ tài liệu (A6): plan §0, §6, §6.1, §8, §9 (R9), §12 ý 23–24; AGENTS.md; README.md (scripts 26–31); paper/README.md (nguồn số liệu theo mục mới); docs/theory.md mục 6 và ghi chú sửa mục 1.4; tài liệu pivot. Chưa commit."],
|
["2026-10-29","Đồng bộ tài liệu (A6): plan §0, §6, §6.1, §8, §9 (R9), §12 ý 23–24; AGENTS.md; README.md (scripts 26–31); paper/README.md (nguồn số liệu theo mục mới); docs/theory.md mục 6 và ghi chú sửa mục 1.4; tài liệu pivot. Chưa commit."],
|
||||||
["2026-10-29","Tự sửa hai nhận định của chính mình (plan §12 ý 24). (1) Câu \"hai cấu trúc sai số gần như cho cùng cận (hệ số < 1,17)\" sai: méo nằm ở 67–72 Hz, nơi tích phân Berkson gấp 1,5–4,6 lần ở σ = 1,5–2,5 ms. (2) Câu \"lợi ích của bank vượt cận quần thể\" chỉ đúng với cận classical đã đăng ký (7/8 ô). Với cận Berkson tính post hoc, chỉ 3/8 ô vượt (cả ba ở c = 1) và tối đa 1/8 tại sai số warp. scripts/31 viết lại để tính cận (a), (b), b60 và phổ chéo (đọc npz của Oracle, khoảng 6 phút; tái lập đúng số đã đăng ký). Đã sửa bài mục 4.3, 6.3 (cột 1/B_b ở Bảng tab:h2b), 6.4, 7, tóm tắt, mở bài, kết luận, cùng tài liệu. Câu hỏi của T2 đổi thành: còn lợi ích nào vượt hiệu chỉnh Berkson không. Bài build sạch, 55 trang; thân bài khoảng 14.750 từ (đếm thô), tóm tắt 292 từ. Chưa commit."],
|
["2026-10-29","Tự sửa hai nhận định của chính mình (plan §12 ý 24). (1) Câu \"hai cấu trúc sai số gần như cho cùng cận (hệ số < 1,17)\" sai: méo nằm ở 67–72 Hz, nơi tích phân Berkson gấp 1,5–4,6 lần ở σ = 1,5–2,5 ms. (2) Câu \"lợi ích của bank vượt cận quần thể\" chỉ đúng với cận classical đã đăng ký (7/8 ô). Với cận Berkson tính post hoc, chỉ 3/8 ô vượt (cả ba ở c = 1) và tối đa 1/8 tại sai số warp. scripts/31 viết lại để tính cận (a), (b), b60 và phổ chéo (đọc npz của Oracle, khoảng 6 phút; tái lập đúng số đã đăng ký). Đã sửa bài mục 4.3, 6.3 (cột 1/B_b ở Bảng tab:h2b), 6.4, 7, tóm tắt, mở bài, kết luận, cùng tài liệu. Câu hỏi của T2 đổi thành: còn lợi ích nào vượt hiệu chỉnh Berkson không. Bài build sạch, 55 trang; thân bài khoảng 14.750 từ (đếm thô), tóm tắt 292 từ. Chưa commit."],
|
||||||
["2026-10-29","Người dùng bỏ lượt rút gọn độ dài cho venue (D-12, plan §12 ý 25). Thẻ p5-len thay bằng p5-cite (trích dẫn dataset F3, Volve; 30–31/10). Rủi ro độ dài (R9) vẫn ghi lại, chưa có biện pháp."],
|
["2026-10-29","Người dùng bỏ lượt rút gọn độ dài cho venue (D-12, plan §12 ý 25). Thẻ p5-len thay bằng p5-cite (trích dẫn dataset F3, Volve; 30–31/10). Rủi ro độ dài (R9) vẫn ghi lại, chưa có biện pháp."],
|
||||||
["2026-10-29","Commit và push lên main mọi thay đổi từ P4 đến A6 (code P4, configs/protocol_volve.*, scripts 26–31, docs/research, bản ghi P4x, bài và tài liệu), kèm tag protocol-volve. Hash code tính lại từ cây commit khớp configs/protocol_volve.lock.json. 190 test pass, 1 skip. logs/*.out vẫn không theo dõi như trước (plan §12 ý 25)."]
|
["2026-10-29","Commit và push lên main mọi thay đổi từ P4 đến A6 (code P4, configs/protocol_volve.*, scripts 26–31, docs/research, bản ghi P4x, bài và tài liệu), kèm tag protocol-volve. Hash code tính lại từ cây commit khớp configs/protocol_volve.lock.json. 190 test pass, 1 skip. logs/*.out vẫn không theo dõi như trước (plan §12 ý 25)."],
|
||||||
|
["2026-10-29","P6 bắt đầu sớm. p6-gen xong (misspec cho generator D2, đường mặc định tái lập P2r từng bit, 15 test mới). T2 đã khai báo trước và đang chạy trên hai GPU. Bắt đầu dựng runner benchmark và nháp protocol_bench (chưa khoá). Từ 13:00 UTC một project khác giữ khoảng 125–128 GB mỗi H200, nên chỉ còn vài GB trống; không mở thêm worker."],
|
||||||
|
["2026-10-29","T2 xong (exploratory, 12:39–13:27 UTC, hai GPU, không OOM): Berkson ở c = 1, cận 1/B_b áp dụng; bank nhiễu GP đạt phần lớn lợi ích c = 1; tái định vị ngầm có thật; không có bằng chứng cho cơ chế đa mode; một phần ba khoảng PM–Oracle là độ dài huấn luyện. Kết quả T2 không dùng để chọn lại budget."],
|
||||||
|
["2026-10-29","Runner benchmark xong; tái lập ô P2r qua runner mới khớp từng bit. Mức misspec S2 chốt trên dev 902–905. Nháp protocol_bench đã rà soát; sửa các chỗ không nhất quán rồi khoá sau khi chọn budget TCN trên dev."],
|
||||||
|
["2026-10-29","protocol_bench khoá lúc 14:39 UTC (sha256 aa763f0a…) sau 7 sửa theo rà soát; budget TCN 125 chọn trên dev. Chạy chính S1, S2, S3, S4, S8 khởi động 14:43 UTC trên cả hai GPU với ít worker (cuda:0 3, cuda:1 6) vì project khác giữ phần lớn bộ nhớ."],
|
||||||
|
["2026-10-29","15:27 UTC: cả bốn driver chạy chính bị SIGTERM khi phiên agent kết thúc, dù đã tách bằng setsid nohup (đã xong 17 posterior S1, 11 posterior S2, 12 job train). 15:41 UTC: chạy lại S2 (2 worker) và S3+S4+S8 (2 worker) trên cuda:0 trong tmux server của người dùng; job đã xong được bỏ qua theo fingerprint. S1 chờ bộ nhớ: project khác giữ khoảng 136 GB ở cuda:0 và 142 GB ở cuda:1."],
|
||||||
|
["2026-10-29","16:07 UTC: project khác đã trả GPU (cả hai card trống khoảng 138–143 GB). Bỏ watcher; chạy lại với 17 worker trong tmux: S2 cuda:1 6 worker, S1 nhóm A (R10, Rm5, R0) cuda:0 5 worker, S1 nhóm B (R0h, R10tb) cuda:1 2 worker, S3+S4+S8 cuda:0 4 worker. Giới hạn bởi 40 CPU (2 thread mỗi worker)."],
|
||||||
|
["2026-10-29","16:22 UTC: thêm operations/p6_supervisor.py (tmux p6_supervisor) kiểm tra GPU mỗi 5 phút, tự chạy lại driver chết và dồn worker khi một study xong; tổng 17 worker. Job dùng chung GPU là job vinhnt của chính người dùng (khoảng 80 GB mỗi card)."],
|
||||||
|
["2026-10-30","Lượt viết theo skill research-paper-writing (Master-cai/Research-Paper-Writing-Skills, cài ở ~/.claude/skills): câu chủ đề, tách đoạn nhiều ý, thuật ngữ (P2/P2r → Experiment 1/2 trong Sec. 5), hạ claim chưa đủ bằng chứng (H1 chỉ khớp 1% ở 4–16 ms; phần lớn lợi ích H2a có sẵn ở c = 0; H2b 8/8 chỉ ở N = 16). Không đổi số đăng ký, trích dẫn hay TODO đỏ nào; main.pdf 56 trang. Tự review: paper/self_review.md."],
|
||||||
|
["2026-10-30","01:02 UTC: người dùng báo server sắp bị thu hồi; tách S1 nhóm B thành hai driver (R0h cuda:0, R10tb cuda:1, mỗi driver 14 worker), nhóm A 8 worker, tổng 36 worker. S2 đã xong 00:12, S3+S4+S8 xong 00:58 UTC."],
|
||||||
|
["2026-10-30","02:16 UTC: xong toàn bộ chạy chính P6 (S1 560, S2 224 + 224, S3+S4+S8 384). Dừng supervisor. Bước tiếp theo: summarize, chưa chạy."],
|
||||||
|
["2026-10-30","Chuyển server: sync nguyên thư mục; git chỉ chứa code/docs. Khoảng 600 MB output lỡ push lúc 01:05–01:15 UTC đã bị gỡ bằng viết lại lịch sử và force-push theo yêu cầu (main = 381b5ff). Danh sách file ngoài git và sha256: docs/research/server-migration.md, docs/research/unpushed_outputs.sha256."],
|
||||||
|
["2026-11-02","Sửa lộ trình (Gantt) không hiện: thiếu dấu phẩy sau một mục của mảng LOG làm renderStatic() lỗi trước khi vẽ. Summarize P6 bằng code đã khoá (02:02 UTC; lock khớp, 8.799 file khớp sha256). scripts/36_bench_verdicts.py đọc lại 11 verdict đúng lời phát biểu: 9 đạt; S2-H1 không đạt ở rock physics và wavelet (dự đoán là đạt), đạt ở drift. S3-H1 đạt theo phát biểu ở R10, R0, Rm5, không đạt theo code vì code đưa Ctl-GP vào đối thủ (D-13). Bước tiếp theo: S7 đóng gói, viết lại mục kết quả."],
|
||||||
|
["2026-11-02","S7 đóng gói benchmark xong, trừ bước deposit Zenodo: scripts/37_bench_package.py (generate, check, tables, score, selftest; ngoài lock). 630 task (test 8–15, dev 900–905), 1.260 file, 845 MB trong outputs/bench/package/; chạy lại tái lập 1.260/1.260 hash nội dung (benchmark/MANIFEST.json). 45.200 run tham chiếu → benchmark/reference/. Selftest đạt (metric và luật khớp run tham chiếu). benchmark/README.md, benchmark/zenodo_metadata.json (nháp; chưa upload). Bước tiếp theo: viết lại các mục kết quả."],
|
||||||
|
["2026-11-02","Viết xong các mục kết quả và thêm trích dẫn dataset (plan §12 ý 30). Sec. 6.5 mới, Thí nghiệm 3: bảng thiết kế, bảng 11 verdict với cả hai cách đọc, S1 (hình), S2 (bảng; trượt ở rock physics và pha wavelet), S3, S4, S8 (bảng, hình), nhánh cùng budget. Sec. 6.4 (T2) thay todoblock. Sửa thêm Sec. 3.2, 5, abstract, intro, discussion, kết luận và availability; bỏ TODO ở tiêu đề. refs.bib thêm dgb2023f3demo, equinor2018volve. scripts/38_bench_figures.py vẽ hình, --flipband in bảng cos/cos² của S8 (D-14). tab:methods đổi sang [!tbp] vì bảng cao quá giới hạn của [t] khiến mọi bảng sau bị dồn về cuối. Bài 66 trang, biên dịch sạch; thân bài khoảng 18.100 từ (R9). Bước tiếp theo: review nội bộ và nộp; deposit Zenodo cần người dùng."],
|
||||||
|
["2026-11-02","Quét novelty sơ bộ cho todoblock Sec. 2 (plan §12 ý 31): Crossref, OpenAlex 2025–2026 (8 truy vấn) và web search. Không bài nào đưa posterior hay bất định của tie vào huấn luyện mô hình dự đoán thuộc tính; câu 'to our knowledge' giữ nguyên. Thêm, chỉ đọc abstract: Herrera & van der Baan 2014 (Geophysics, bản xuất bản của preprint 2012 đã đọc), Autotie (da Costa Silva et al., Geophysics 2026; thêm vào bảng positioning), Castagna, Kronberg & Gil (TLE 2026, độ đo chất lượng tie và dự đoán). Đọc lại toàn văn Sukar 2026 trong refs/: huấn luyện trên bản đồ 4D tổng hợp sinh từ mô hình mô phỏng, nhãn không qua well tie, nên cột UQ→train = -- là công bằng; Sec. 2 ghi rõ điều này. Còn mở cho ngày 13/11: abstract IMAGE 2026 của Palavicini Gurria (chưa được index), DOI của Quesada 2024. Todoblock rút gọn; bài 66 trang, biên dịch sạch."],
|
||||||
|
["2026-11-02","Kiểm tra bản toàn văn của các bài chỉ đọc abstract (OpenAlex, Unpaywall, web search). Tải được rizzuti2024waveletflows và rizzuti2025uhr (bản Shearwater đăng công khai) vào refs/; toàn văn khớp với cách xếp trong Bảng tab:positioning, chú thích ᵃ chưa bỏ. Các bài khác không có bản mở; castagna2026quality được Unpaywall báo là OA nhưng cần tải tay (refs/MISSING.md)."],
|
||||||
|
["2026-11-02","Rà phụ lục chứng minh và dựng gói tái lập (plan §12 ý 32). Chứng minh: 15 điểm từ một lượt đọc độc lập, sửa 14, sửa một phần 1 (Sec. 4, App. A, Bổ đề 5, abstract, Sec. 6.3, 6.6, docs/theory.md, docstring scripts/38); không đổi verdict hay số đã báo cáo; bài 67 trang, không warning. Gói tái lập: scripts/39_repro_package.py, repro/{README.md, MANIFEST.json, requirements-linux.txt, verify_report.md}; 5 archive theo giấy phép trong outputs/repro/ (chưa deposit); phòng sạch không có dữ liệu thô: 12/12 bước tái tạo đúng (63 file trùng byte, 3 trùng giá trị, 0 khác; không đọc ngoài phòng sạch), tests/test_d2_misspec.py qua 15/15. Sec. 8 thêm câu về các archive dữ liệu dẫn xuất (TODO DOI)."],
|
||||||
|
["2026-11-02","Đọc toàn văn bốn bài người dùng tải tay (AWSM, BootNet, P05 Li–Grana–Liu 2024, Guillon 2020; đổi tên theo key BibTeX trong refs/). Cách xếp trong Bảng tab:positioning không đổi; câu 'to our knowledge' giữ nguyên. AWSM: 44 giếng, giữ mô hình median/minimum-misfit, posterior TD chỉ báo cáo. Sửa Sec. 2 theo toàn văn, bỏ chú thích ᵃ của sáu bài (cả hai bài Rizzuti), cập nhật annote trong refs.bib. Bài biên dịch sạch, 68 trang (plan §12 ý 33)."],
|
||||||
|
["2026-11-02","Đóng việc tìm toàn văn (quyết định của người dùng): các bài còn chỉ có abstract giữ chú thích ᵃ; todoblock (2) Sec. 2 ghi là đã đóng. Còn castagna2026quality (CC BY) chờ người dùng tải tay tại doi.org/10.1190/tle-2025-1058 (plan §12 ý 33)."],
|
||||||
|
["2026-11-02","Đọc toàn văn castagna2026quality (người dùng tải tay; refs/castagna2026quality.pdf). Câu cũ ở Sec. 2 ('abstract không bàn sai số thời gian') sai: phần Discussion nói hàm time–depth không bao giờ chính xác và time shift làm hỏng chủ yếu tần số cao; các độ đo theo phân bố không nhạy với dịch nhỏ; sai số thời gian không được mô hình hóa hay đưa vào huấn luyện. Đã viết lại câu; 'to our knowledge' giữ nguyên; bài 68 trang. Việc tìm toàn văn đóng (plan §12 ý 33)."],
|
||||||
|
["2026-11-04","Chuyển sang máy thứ ba: outputs và data từ bản chụp 30/10, 21.987/21.987 sha256 khớp. Sinh lại các output ngày 02/11, khớp từng byte: bench summary và verdict (9/11 pass, không đổi), gói benchmark (1.260 hash khớp MANIFEST, selftest PASS), 5 archive tái lập (repro/MANIFEST.json không đổi); build lại paper (68 trang). .venv đưa về đúng lock (numpy 2.5.4, tabulate, segyio). Còn thiếu: 7 PDF trong refs/, outputs_thesis/, log thô (plan §12 ý 34)."],
|
||||||
|
["2026-11-04","Rà soát chống hallucination và viết lại bản thảo (plan §12 ý 36; docs/research/paper-audit.md), dùng các skill scientific-writing, literature-review, citation-management và academic-humanizer. Năm subagent truy mọi số, trích dẫn và claim về outputs, protocol, code và refs: 87 phát hiện, 4 lỗi S1. (1) Hai mô hình TD bị gộp thành 'lệch tới 36 ms'. (2) Prior warp ghi là type-II ML, trong khi thực tế là MAP-II với σ_a = 7 và σ_b = 50 ms cố định. (3) Protocol Thí nghiệm 1 chỉ khóa hash, không được tag trước lần chạy. (4) PHIE_DT tuyến tính theo sonic ở cả 4 giếng. Đã áp 106 thay thế chính xác; guard token xác nhận chỉ các số và trích dẫn đã duyệt thay đổi (tab:audit theo td_qc.csv; bỏ prabowo, tao và DILATE ở intro; giới hạn phạm vi claim; nhánh 500 vòng lặp không phải huấn luyện lại). Lượt academic-humanizer chỉ tách câu dài. Không verdict, gate hay ngưỡng nào đổi. PDF 69 trang, sạch."],
|
||||||
|
["2026-11-04","Dựng lại docs/technical_overview.md: bản tổng quan 27/10 đã bị bản bài giảng ghi đè trong commit 0cfe202 (29/10). Bản bài giảng chuyển sang docs/lecture.md; bản tổng quan khôi phục từ commit 9976abc và cập nhật đến 04/11 (khung Pivot 1, posterior SMC, Mệnh đề 3–6, kết quả P2r, P3, P4, P6, bản đồ code đến script 39). Không có kết quả mới (plan §12 ý 35)."],
|
||||||
|
["2026-11-09","Viết lại abstract cho người đọc ngoài dự án (plan §12 ý 37): còn 231 từ, bỏ mã nội bộ và số verdict; không có số mới, verdict không đổi. Sec. 7 nói rõ các ô danh nghĩa dùng đúng mô hình mà bước tie giả định."],
|
||||||
|
["2026-11-09","Viết lại toàn bộ bản thảo theo văn phong abstract (plan §12 ý 38): bỏ mã nội bộ, Methods trước Theory, thêm Phụ lục C và bảng bài học từ thất bại. Hai referee Fable: vòng 1 major revision, vòng 2 minor revision và đạt 5/5 tiêu chí. Không đổi verdict hay ngưỡng. Bài 68 trang; còn phải vẽ lại hình trên máy có outputs."],
|
||||||
|
["2026-11-09","Chuyển phát biểu hình thức của phần lý thuyết sang Phụ lục A, thêm ví dụ số ở Sec. 6.6 và Practical advice ở Sec. 7 (plan §12 ý 39). Referee vòng 3: cả hai accept sau sửa nhỏ, đạt 5/5 tiêu chí; đã áp dụng. Bài 69 trang, thân bài khoảng 15.400 từ. Không đổi verdict hay ngưỡng."],
|
||||||
];
|
];
|
||||||
/* ===================== HẾT DATA ===================== */
|
/* ===================== HẾT DATA ===================== */
|
||||||
|
|
||||||
|
|||||||
77838
repro/MANIFEST.json
Normal file
77838
repro/MANIFEST.json
Normal file
File diff suppressed because it is too large
Load Diff
196
repro/README.md
Normal file
196
repro/README.md
Normal file
@@ -0,0 +1,196 @@
|
|||||||
|
# Reproduction package
|
||||||
|
|
||||||
|
This directory documents how to reproduce the numbers, tables and figures of the manuscript *Label registration
|
||||||
|
error in sparse-well seismic property learning: theory, a registration-aware benchmark, and the limits of field
|
||||||
|
validation*. The package has four parts:
|
||||||
|
|
||||||
|
| part | where | what |
|
||||||
|
|---|---|---|
|
||||||
|
| code and locked protocols | this git repository (archive: `scripts/39_repro_package.py code --rev <commit>`) | `ml_porosity/`, `scripts/`, `operations/`, `tests/`, `configs/` (six locked protocols with `.sha256` and, from P3 on, `.lock.json`), `paper/` |
|
||||||
|
| derived data | five `tar.gz` archives, hashed in [`MANIFEST.json`](MANIFEST.json) | every output file that a number of the manuscript is computed from, split by data licence |
|
||||||
|
| benchmark package | separate deposit, documented in [`../benchmark/README.md`](../benchmark/README.md) | 630 synthetic tasks with hidden truth, 45,200 reference runs, a scorer |
|
||||||
|
| clean-room check | [`verify_report.md`](verify_report.md) | the summary, post hoc, table and figure stages rerun from the code and the archives only |
|
||||||
|
|
||||||
|
Archive DOI: TODO (not deposited yet). Code licence: TODO (to be chosen by the authors).
|
||||||
|
|
||||||
|
## 1. Derived-data archives and licences
|
||||||
|
|
||||||
|
Each archive stores its members as `outputs/<path>`. Extract every archive in the repository root to restore the
|
||||||
|
`outputs/` tree that the scripts read, then check it:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
for a in ML-Porosity_derived_*.tar.gz; do tar -xzf "$a"; done
|
||||||
|
.venv/bin/python scripts/39_repro_package.py check --root . # sha256 of all 11,112 files against MANIFEST.json
|
||||||
|
```
|
||||||
|
|
||||||
|
| archive | files | size (unpacked / packed) | licence | content |
|
||||||
|
|---|---|---|---|---|
|
||||||
|
| `ML-Porosity_derived_f3_results.tar.gz` | 9,044 | 431 MB / 164 MB | CC BY-SA 3.0 | summaries, verdicts, post hoc tables, run-level metric tables, posterior summaries, and the small derived inputs (F3 well file, tie QC, wavelets, warp prior, D2 horizon cache) |
|
||||||
|
| `ML-Porosity_derived_f3_predictions.tar.gz` | 1,950 | 2.13 GB / 2.11 GB | CC BY-SA 3.0 | saved test predictions of the registered runs (P1, P2, P2r, T2, protocol_bench, P3), and the P2r SMC particles of the S4 cells, which the protocol_bench lock hashes |
|
||||||
|
| `ML-Porosity_derived_f3_volume.tar.gz` | 10 | 627 MB / 505 MB | CC BY-SA 3.0 | descriptive F3 porosity volume of the 20 P3 deployment models (649 interior inlines) |
|
||||||
|
| `ML-Porosity_derived_volve.tar.gz` | 97 | 10.6 MB / 8.9 MB | CC BY-NC-SA 4.0 | Volve well data on seismic time, P4 summaries, post hoc tables, and the applicability tables (F3 and Volve) |
|
||||||
|
| `ML-Porosity_derived_teapot.tar.gz` | 11 | 0.6 MB / 0.1 MB | CC0 1.0 (to be verified) | Teapot Dome inventory (headers and curve coverage) and pilot P-a (knots, picks); no porosity |
|
||||||
|
|
||||||
|
`MANIFEST.json` lists, for each file, its archive, the script that produced it, its size and the sha256 of its
|
||||||
|
exact bytes. The archives are deterministic: `scripts/39_repro_package.py build` writes the same bytes from the same
|
||||||
|
`outputs/` tree (sorted members, fixed mtime and owner, gzip mtime 0).
|
||||||
|
|
||||||
|
Files left out of the archives: training checkpoints, the large SMC particle files (except those of the S4 cells),
|
||||||
|
smoke runs, superseded backups, `outputs/p4x/` (dropped exploratory study, never used in the manuscript), the
|
||||||
|
quick-look PNGs under `outputs/figures/` and the benchmark package `outputs/bench/package/` (deposited separately).
|
||||||
|
|
||||||
|
Licence notes for the authors (to settle before deposit):
|
||||||
|
|
||||||
|
- **F3.** The F3 Demo 2023 data are distributed by dGB Earth Sciences (TerraNubis) under CC BY-SA 3.0. The synthetic
|
||||||
|
D2 data use the F3 survey geometry, horizons, wavelet and warp prior, so their outputs are treated as F3-derived.
|
||||||
|
The repository itself tracks 102 F3 well files under `data/F3_Demo_2023/` (logs, checkshots, markers, the
|
||||||
|
`.survey` file); they are redistributed under the same licence.
|
||||||
|
- **Volve.** The licence files of the Volve release name CC BY-NC-SA 4.0. The data owners are Equinor,
|
||||||
|
ExxonMobil, Bayerngas and the Norwegian Petroleum Directorate.
|
||||||
|
- **F3 and Volve combined.** `outputs/applicability/` tabulates statistics of both fields. It is placed in the Volve
|
||||||
|
archive under the more restrictive licence. CC BY-SA 3.0 requires adaptations to carry a compatible
|
||||||
|
share-alike licence, and CC BY-NC-SA 4.0 is not one, so the authors should confirm that these tables of summary
|
||||||
|
statistics can be shared this way, or split them by field.
|
||||||
|
- **Teapot Dome.** Recorded as CC0 in the project notes (Texas Data Repository, doi:10.18738/T8/21WDU8); verify on
|
||||||
|
the repository page.
|
||||||
|
- **NLOG.** `outputs/d1/` (two small files of the D-1 label check, in the F3 archive) summarises NLOG well logs of the
|
||||||
|
F3 wells. Check the NLOG terms of use.
|
||||||
|
|
||||||
|
## 2. Environment
|
||||||
|
|
||||||
|
| used for | Python | key packages | install file |
|
||||||
|
|---|---|---|---|
|
||||||
|
| P2r, P4, T2, P6, the clean-room check (Linux, NVIDIA H200, CUDA 13.0) | 3.13.15 | torch 2.14.0+cu130, numpy 2.5.4, scipy 1.18.1, pandas 3.0.6, pylops 2.5.0, numba 0.67.0 | [`requirements-linux.txt`](requirements-linux.txt) |
|
||||||
|
| P3 F3 (Windows, NVIDIA RTX 3060 12 GB) | 3.12.16 | torch 2.11.0+cu128, pandas 3.1.0, pylops 2.8.0, numba 0.68.0 | `../requirements-windows-rtx3060.txt` |
|
||||||
|
| P0–P2 (Linux) | 3.13.15 | as the first row, but numpy 2.5.3 | `../requirements-lock.txt` |
|
||||||
|
|
||||||
|
The `environment` block of `configs/protocol_{volve,bench}.lock.json` records the first row and that of
|
||||||
|
`configs/protocol_f3.lock.json` the second; the locked stages refuse to run when the installed versions differ.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
python3.13 -m venv .venv
|
||||||
|
.venv/bin/pip install --extra-index-url https://download.pytorch.org/whl/cu130 -r repro/requirements-linux.txt
|
||||||
|
.venv/bin/pip install --no-deps -e .
|
||||||
|
```
|
||||||
|
|
||||||
|
The figure comparison of the clean-room check needs Ghostscript (`gs`; 10.02.1 was used). Set the thread variables
|
||||||
|
explicitly when running by hand: `OMP_NUM_THREADS=2 MKL_NUM_THREADS=2 OPENBLAS_NUM_THREADS=2`, and
|
||||||
|
`CUDA_VISIBLE_DEVICES=` for CPU-only stages.
|
||||||
|
|
||||||
|
## 3. Raw data
|
||||||
|
|
||||||
|
Only the stages that read seismic or field logs need raw data. Place them as follows and check them against the
|
||||||
|
recorded sha256 (`data_manifest/*.json`):
|
||||||
|
|
||||||
|
| dataset | source | place under | check |
|
||||||
|
|---|---|---|---|
|
||||||
|
| F3 Demo 2023 | dGB Earth Sciences, <https://terranubis.com/datainfo/F3-Demo-2023> | `data/F3_Demo_2023/F3_Demo_2023/` (or set `ML_POROSITY_F3_ROOT`) | `scripts/00_data_manifest.py --check --dataset f3` |
|
||||||
|
| Volve | Equinor, <https://www.equinor.com/energy/volve-data-sharing> (well data and the ST10010 post-stack cube) | `data/Volve/` | `scripts/00_data_manifest.py --check --dataset volve` |
|
||||||
|
| NLOG well logs | <https://www.nlog.nl> | `data/NLOG/` | `scripts/00_data_manifest.py --check --dataset nlog` |
|
||||||
|
| Teapot Dome | Texas Data Repository, doi:10.18738/T8/21WDU8 (RMOTC, U.S. Department of Energy) | `data/Teapot/raw/rmotc/` | none (inventory only) |
|
||||||
|
|
||||||
|
The protocol locks also hash their inputs, so a stage refuses to run on files that differ from the ones used.
|
||||||
|
|
||||||
|
## 4. Pipeline
|
||||||
|
|
||||||
|
Commands are run from the repository root. Run times are the wall times of the original runs (`logs/index.csv`).
|
||||||
|
Each registered phase is fixed by a protocol that was locked before its test data were generated or scored; the
|
||||||
|
locked code is that of the commit or tag in the table.
|
||||||
|
|
||||||
|
| phase (manuscript) | protocol, lock commit / tag | command | wall time, hardware | raw data |
|
||||||
|
|---|---|---|---|---|
|
||||||
|
| P0 audit (Sec. 3) | — | `scripts/run_p0.sh` (also rewrites `outputs/f3_wells.npz`, so skip it when the F3 archive is used) | under a minute, CPU | F3 SEG-Y |
|
||||||
|
| P1 field baselines (App. B) | `configs/protocol.yaml`, tag `protocol-v2` | `scripts/05_lowo.py --only B0a,B0b,B1`, `scripts/05_lowo.py --only B2,B3a,B3b --workers 12`, `scripts/06_summarize_p1.py` (the steps of `scripts/run_p1.sh` after 01 and 04) | 15 min, one GPU | none beyond the F3 archive |
|
||||||
|
| P2 first synthetic test (Sec. 6.1) | `configs/protocol_p2.yaml`, cee2ff0 | `scripts/run_p2.sh` | 1 h 29 min (main grid, 6 workers on one H200) | none beyond the F3 archive |
|
||||||
|
| P2r rerun (Sec. 6.2–6.3) | `configs/protocol_p2r.yaml`, tag `protocol-p2r` | `scripts/run_p2r_dev.sh`, then `scripts/run_p2r_main.sh` | dev 2 h 23 min; main 42 min to 1 h 38 min per regime on two H200 | none beyond the F3 archive |
|
||||||
|
| T2 mechanism, exploratory (Sec. 6.4) | declared in `docs/research/t2-mechanism.md` | `scripts/32_t2_mechanism.py` | training 18–25 min (GPU), particle tests 7 min (CPU) | none |
|
||||||
|
| Benchmark, protocol_bench (Sec. 6.5) | `configs/protocol_bench.yaml`, 381b5ff (no tag) | `scripts/run_bench.sh posterior train` per study, then `summarize`; `scripts/36_bench_verdicts.py`; `scripts/37_bench_package.py generate`, `tables` | 11.5 h in all (29/10 14:43 to 30/10 02:16 UTC), with S1, S2 and S3+S4+S8 running at once on two H200 (up to 36 workers); e.g. S2 training 3 h 8 min, S3+S4+S8 training 8 h 51 min | none |
|
||||||
|
| T3 detectability, T4 coverage, H2b bound (Sec. 6.3, 6.6) | post hoc | `scripts/27_t3_power.py`, `scripts/30_t4_coverage.py`, `scripts/31_p2r_posthoc.py` | minutes, CPU | none |
|
||||||
|
| P3 F3 field test (Sec. 6.7, App. B) | `configs/protocol_f3.yaml`, tag `protocol-f3` | `scripts/run_p3.ps1` (Windows) | 3 h 42 min on one RTX 3060 | F3 SEG-Y |
|
||||||
|
| P4 Volve field test (Sec. 6.7, App. B) | `configs/protocol_volve.yaml`, tag `protocol-volve` | `scripts/run_p4.sh` | registration 3–5 min, training 47–53 min per σ_a arm on one H200 | Volve |
|
||||||
|
| Applicability, Teapot (Sec. 6.7) | declared in `docs/research/applicability-teapot.md` | `scripts/25_p4_posthoc.py`, `scripts/26_applicability.py`, `python -P scripts/28_teapot_inventory.py`, `python -P scripts/29_teapot_pilot.py` | minutes, CPU | Teapot for 28/29 |
|
||||||
|
| Figures | — | `scripts/22_paper_figures.py`, `scripts/38_bench_figures.py` | about 2 min, CPU | none |
|
||||||
|
| Paper | — | `cd paper && pdflatex main && bibtex main && pdflatex main && pdflatex main` | seconds | — |
|
||||||
|
|
||||||
|
`../README.md` (in Vietnamese) describes every script, its options and its outputs. Stages that train resume by
|
||||||
|
skipping finished cells, so a stopped driver is restarted with the same command.
|
||||||
|
|
||||||
|
Do not rerun `scripts/01_build_wells.py`, `scripts/04_wavelet_tie.py` or `scripts/09_fit_warp_prior_f3.py` to
|
||||||
|
reproduce the manuscript: they wrote the well file, the tie files and the warp prior that the later protocols hash
|
||||||
|
(all in the F3 archive), and `scripts/run_p1.sh` and `scripts/run_p0.sh` rerun the first two. The synthetic phases
|
||||||
|
(P2, P2r, T2, protocol_bench) need no raw data: the D2 generator reads the tracked `.survey` file, the horizon
|
||||||
|
cache, the wavelet and the warp prior of the F3 archive, and `tests/test_d2_misspec.py` checks its fields against
|
||||||
|
fingerprints recorded before the benchmark was built.
|
||||||
|
|
||||||
|
**P3 and P4 from their tags.** The code-hash checks of `protocol_f3` and `protocol_volve` cover `ml_porosity/` and
|
||||||
|
`scripts/`, so every later file added to these folders makes the current tree fail them, by design. Rerun these phases
|
||||||
|
from a checkout of their tag (`git checkout protocol-f3`, `git checkout protocol-volve`) with the matching
|
||||||
|
environment. The P3 run stopped at 132/649 volume inlines on a Windows file lock; `operations/resume_f3_volume.py`
|
||||||
|
resumed only the inference (audit in `outputs/p3/volume_recovery.json` and `completion_checks.json`).
|
||||||
|
|
||||||
|
## 5. What reruns without raw data
|
||||||
|
|
||||||
|
`scripts/39_repro_package.py verify` copies the code (the tracked and untracked non-ignored files, without `logs/`,
|
||||||
|
`refs/`, `code_thesis/`, `outputs_thesis/` and `.agents/`) into an empty folder, extracts the five archives there,
|
||||||
|
deletes the paper figures and the benchmark reference tables, and runs twelve stages with that folder first on the
|
||||||
|
Python path. No SEG-Y, Volve or Teapot raw data are present; the tracked F3 well files are. An audit hook logs every
|
||||||
|
file each stage opens, and a read of the original repository counts as a failure. Each rewritten file is then
|
||||||
|
compared with the original: by bytes, then by value (csv, json, npz, md), and the figures pixel by pixel after
|
||||||
|
rasterising with Ghostscript.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
CUDA_VISIBLE_DEVICES= OMP_NUM_THREADS=2 MKL_NUM_THREADS=2 OPENBLAS_NUM_THREADS=2 \
|
||||||
|
.venv/bin/python scripts/39_repro_package.py verify [--only STEP …] [--keep]
|
||||||
|
```
|
||||||
|
|
||||||
|
| stage | command | reproduces |
|
||||||
|
|---|---|---|
|
||||||
|
| p1_summary | `scripts/06_summarize_p1.py` | P1 tables (App. B) |
|
||||||
|
| p2_summary | `scripts/13_summarize_p2.py --mode main` | gate G-B, H1, H3, H4 of P2 |
|
||||||
|
| p2r_summary | `scripts/18_summarize_p2r.py` | H2a, H2b, σ_a arm, H3, H4 of P2r |
|
||||||
|
| p2r_posthoc | `scripts/31_p2r_posthoc.py` | the classical and Berkson bounds of `tab:h2b` |
|
||||||
|
| t4_coverage | `scripts/30_t4_coverage.py` | ensemble dispersion ξ and coverage (T4) |
|
||||||
|
| t3_power | `scripts/27_t3_power.py` | detectability and the crossings of Sec. 6.6 |
|
||||||
|
| bench_summarize | `scripts/34_run_bench.py summarize` | protocol_bench summary, as implemented |
|
||||||
|
| bench_verdicts | `scripts/36_bench_verdicts.py` | the 11 verdicts as worded |
|
||||||
|
| bench_tables | `scripts/37_bench_package.py tables` | `benchmark/reference/{cells.csv,main_table.md}` |
|
||||||
|
| figures_main | `scripts/22_paper_figures.py` | the manuscript figures except those of Experiment 3 |
|
||||||
|
| figures_bench | `scripts/38_bench_figures.py` | `bench_s1.pdf`, `bench_s8.pdf` |
|
||||||
|
| s8_flipband | `scripts/38_bench_figures.py --flipband` | the cos/cos² table of the S8 discussion (stdout) |
|
||||||
|
|
||||||
|
Result of the run of 2026-11-02 (04:24–04:44 UTC, 20 min on CPU; working tree at 2e4f618 with the uncommitted
|
||||||
|
changes of that day), in [`verify_report.md`](verify_report.md): all twelve stages exit 0, and no stage reads a file
|
||||||
|
outside the clean room. Of the 66 files they rewrite, 63 are identical in bytes (the eight manuscript figures:
|
||||||
|
identical pixels at 110 dpi) and 3 are equal in value: two gzip tables with zero difference, and
|
||||||
|
`outputs/bench/summary/verdict.json`, which differs only in the clean-room path it records. The 8 new files are
|
||||||
|
quick-look PNGs and the copy of the reference tables inside the benchmark package; neither is archived (the package
|
||||||
|
is a separate deposit). In the same clean room, `pytest tests/test_d2_misspec.py` passes 15/15 with none skipped,
|
||||||
|
so the D2 generator reproduces the P2r fingerprints from the tracked F3 files and the archived inputs alone.
|
||||||
|
|
||||||
|
The training stages are not part of this check: they need GPUs for hours (Section 4). Their saved predictions
|
||||||
|
and metric tables are in the archives, so every reported number is recomputed from them.
|
||||||
|
|
||||||
|
## 6. Deviations to report with the results
|
||||||
|
|
||||||
|
- **P2r** was designed after P2 failed gate G-B, on new realizations (8–15) under a new protocol. It is a deviation,
|
||||||
|
not a confirmatory replication of P2.
|
||||||
|
- **protocol_bench verdicts (D-13).** The locked `scripts/34_run_bench.py summarize` differs from the locked
|
||||||
|
statements in three places: S1-H1 needs exactly two N values but S1 has four, so it returns null; S2-H1 has no
|
||||||
|
top-level pass; S3-H1 adds the disclosed Ctl-GP control to the competitor set. `scripts/36_bench_verdicts.py`
|
||||||
|
(outside the lock; checks the lock first) applies the statements as worded. Both readings are reported:
|
||||||
|
`outputs/bench/summary/verdict.json` (as run) and `verdict_final.{json,md}` (as worded, 9/11 pass).
|
||||||
|
- **Post hoc analyses** outside every lock: `scripts/25`, `26`, `27`, `30`, `31`, `38 --flipband`. They change no
|
||||||
|
registered verdict.
|
||||||
|
- **P3 volume recovery** (Section 4): inference only, registered code and completed rows kept.
|
||||||
|
|
||||||
|
## 7. Building the package
|
||||||
|
|
||||||
|
```bash
|
||||||
|
.venv/bin/python scripts/39_repro_package.py build [--dry-run] # archives → outputs/repro/, manifest → repro/MANIFEST.json
|
||||||
|
.venv/bin/python scripts/39_repro_package.py verify # clean room → repro/verify_report.md
|
||||||
|
.venv/bin/python scripts/39_repro_package.py code --rev HEAD # git archive of a committed revision
|
||||||
|
```
|
||||||
|
|
||||||
|
`build` selects files by the first matching rule of `RULES` in the script; files without a rule stay out. `code`
|
||||||
|
refuses when the tracked files differ from the requested revision. Nothing is uploaded: the deposit (archives, code
|
||||||
|
snapshot, benchmark package) needs the authors' account, author list and licence decisions.
|
||||||
24
repro/requirements-linux.txt
Normal file
24
repro/requirements-linux.txt
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
# Linux environment of the protocol_volve and protocol_bench locks (configs/protocol_{volve,bench}.lock.json,
|
||||||
|
# "environment"), used for P2r, P4, T2, P6 and the clean-room check of repro/verify_report.md.
|
||||||
|
# Python 3.13.15, Linux x86_64, CUDA 13.0. Install:
|
||||||
|
# python3.13 -m venv .venv
|
||||||
|
# .venv/bin/pip install --extra-index-url https://download.pytorch.org/whl/cu130 -r repro/requirements-linux.txt
|
||||||
|
# .venv/bin/pip install --no-deps -e .
|
||||||
|
# The first 13 pins are the packages that the locks record; the rest are imported by the code or the tests.
|
||||||
|
# requirements-lock.txt is the older P0 environment (numpy 2.5.3); requirements-windows-rtx3060.txt is that of
|
||||||
|
# protocol_f3 (P3, Windows, Python 3.12.16).
|
||||||
|
torch==2.14.0+cu130
|
||||||
|
numpy==2.5.4
|
||||||
|
scipy==1.18.1
|
||||||
|
pandas==3.0.6
|
||||||
|
matplotlib==3.11.2
|
||||||
|
segyio==1.9.14
|
||||||
|
lasio==0.32
|
||||||
|
pylops==2.5.0
|
||||||
|
numba==0.67.0
|
||||||
|
scikit-learn==1.9.1
|
||||||
|
PyYAML==6.0.3
|
||||||
|
tabulate==0.10.0
|
||||||
|
psutil==7.2.2
|
||||||
|
pillow==12.3.0
|
||||||
|
pytest==9.1.1
|
||||||
84
repro/verify_report.md
Normal file
84
repro/verify_report.md
Normal file
@@ -0,0 +1,84 @@
|
|||||||
|
# Clean-room verification of the reproduction package
|
||||||
|
|
||||||
|
Written by `scripts/39_repro_package.py verify` (2026-11-02T04:24:29+00:00 → 2026-11-02T04:44:15+00:00). Code: 332 files of the working tree at 2e4f618947 with uncommitted changes; package: 11112 files from the archives listed in `repro/MANIFEST.json`; Python 3.13.15, CPU only. No SEG-Y, Volve or Teapot raw data in the clean room; the F3 well files tracked in git are present.
|
||||||
|
|
||||||
|
Status of a rewritten file: identical = same bytes as the original; equal = same values (csv/json/npz within 1e-9 relative, or bytes equal once the clean-room path is replaced by the original one; figures with < 0.01% differing pixels at 110 dpi); differs = see detail; missing = expected but not rewritten; new = written by the step but not part of the package. Reads are those of files under outputs/ (package) and data/ (tracked F3 well files); a read of the original repository would mean the clean room leaked.
|
||||||
|
|
||||||
|
| step | command | exit | s | identical | equal | differs | missing | new | reads outside package | reads of original repo |
|
||||||
|
|---|---|---|---|---|---|---|---|---|---|---|
|
||||||
|
| p1_summary | `python scripts/06_summarize_p1.py` | 0 | 2 | 2 | 0 | 0 | 0 | 1 | 0 | 0 |
|
||||||
|
| p2_summary | `python scripts/13_summarize_p2.py --mode main` | 0 | 8 | 9 | 0 | 0 | 0 | 4 | 0 | 0 |
|
||||||
|
| p2r_summary | `python scripts/18_summarize_p2r.py` | 0 | 220 | 9 | 0 | 0 | 0 | 0 | 0 | 0 |
|
||||||
|
| p2r_posthoc | `python scripts/31_p2r_posthoc.py` | 0 | 92 | 3 | 0 | 0 | 0 | 0 | 0 | 0 |
|
||||||
|
| t4_coverage | `python scripts/30_t4_coverage.py` | 0 | 26 | 4 | 1 | 0 | 0 | 0 | 0 | 0 |
|
||||||
|
| t3_power | `python scripts/27_t3_power.py` | 0 | 758 | 4 | 1 | 0 | 0 | 0 | 0 | 0 |
|
||||||
|
| bench_summarize | `python scripts/34_run_bench.py summarize` | 0 | 24 | 18 | 1 | 0 | 0 | 0 | 0 | 0 |
|
||||||
|
| bench_verdicts | `python scripts/36_bench_verdicts.py` | 0 | 9 | 3 | 0 | 0 | 0 | 0 | 0 | 0 |
|
||||||
|
| bench_tables | `python scripts/37_bench_package.py tables --out outputs/bench/package` | 0 | 13 | 2 | 0 | 0 | 0 | 3 | 0 | 0 |
|
||||||
|
| figures_main | `python scripts/22_paper_figures.py` | 0 | 5 | 6 | 0 | 0 | 0 | 0 | 0 | 0 |
|
||||||
|
| figures_bench | `python scripts/38_bench_figures.py` | 0 | 8 | 2 | 0 | 0 | 0 | 0 | 0 | 0 |
|
||||||
|
| s8_flipband | `python scripts/38_bench_figures.py --flipband` | 0 | 8 | 1 | 0 | 0 | 0 | 0 | 0 | 0 |
|
||||||
|
|
||||||
|
Paper figures deleted from the clean room and not regenerated: none.
|
||||||
|
|
||||||
|
## Details
|
||||||
|
|
||||||
|
### p1_summary
|
||||||
|
- package files read: 5
|
||||||
|
- new: `outputs/figures/p1_lowo.png`
|
||||||
|
- identical: 2 file(s)
|
||||||
|
|
||||||
|
### p2_summary
|
||||||
|
- package files read: 293
|
||||||
|
- new: `outputs/figures/p2_band_lines.png`
|
||||||
|
- new: `outputs/figures/p2_h1.png`
|
||||||
|
- new: `outputs/figures/p2_h3.png`
|
||||||
|
- new: `outputs/figures/p2_phase.png`
|
||||||
|
- identical: 9 file(s)
|
||||||
|
|
||||||
|
### p2r_summary
|
||||||
|
- package files read: 524
|
||||||
|
- identical: 9 file(s)
|
||||||
|
|
||||||
|
### p2r_posthoc
|
||||||
|
- package files read: 244
|
||||||
|
- identical: 3 file(s)
|
||||||
|
|
||||||
|
### t4_coverage
|
||||||
|
- package files read: 274
|
||||||
|
- equal: `outputs/t4/wells.csv.gz` (max rel. diff 0.0e+00)
|
||||||
|
- identical: 4 file(s)
|
||||||
|
|
||||||
|
### t3_power
|
||||||
|
- package files read: 49
|
||||||
|
- equal: `outputs/t3/indicators.csv.gz` (max rel. diff 0.0e+00)
|
||||||
|
- identical: 4 file(s)
|
||||||
|
|
||||||
|
### bench_summarize
|
||||||
|
- package files read: 3226
|
||||||
|
- equal: `outputs/bench/summary/verdict.json` (differs only in the clean-room path)
|
||||||
|
- identical: 18 file(s)
|
||||||
|
|
||||||
|
### bench_verdicts
|
||||||
|
- package files read: 589; tracked data read: data/F3_Demo_2023/F3_Demo_2023
|
||||||
|
- identical: 3 file(s)
|
||||||
|
|
||||||
|
### bench_tables
|
||||||
|
- package files read: 3226; tracked data read: data/F3_Demo_2023/F3_Demo_2023
|
||||||
|
- new: `outputs/bench/package/reference/cells.csv`
|
||||||
|
- new: `outputs/bench/package/reference/main_table.md`
|
||||||
|
- new: `outputs/bench/package/reference/runs.csv.gz`
|
||||||
|
- identical: 2 file(s)
|
||||||
|
|
||||||
|
### figures_main
|
||||||
|
- package files read: 12; tracked data read: data/F3_Demo_2023/F3_Demo_2023
|
||||||
|
- identical: 6 file(s)
|
||||||
|
|
||||||
|
### figures_bench
|
||||||
|
- package files read: 156; tracked data read: data/F3_Demo_2023/F3_Demo_2023
|
||||||
|
- identical: 2 file(s)
|
||||||
|
|
||||||
|
### s8_flipband
|
||||||
|
- package files read: 203; tracked data read: data/F3_Demo_2023/F3_Demo_2023
|
||||||
|
- identical: 1 file(s)
|
||||||
|
|
||||||
@@ -33,7 +33,10 @@ WHITE = "#ffffff"
|
|||||||
SEQ_BLUE = LinearSegmentedColormap.from_list("seq_blue", ["#f0f5fc", "#86b6ef", "#2a78d6", "#104281"])
|
SEQ_BLUE = LinearSegmentedColormap.from_list("seq_blue", ["#f0f5fc", "#86b6ef", "#2a78d6", "#104281"])
|
||||||
RAMP4 = ["#86b6ef", "#5598e7", "#256abf", "#104281"] # ordinal ramp for σ (as in scripts/13)
|
RAMP4 = ["#86b6ef", "#5598e7", "#256abf", "#104281"] # ordinal ramp for σ (as in scripts/13)
|
||||||
REGIMES = ["R10", "R0", "Rm5", "R0h", "R10tb"]
|
REGIMES = ["R10", "R0", "Rm5", "R0h", "R10tb"]
|
||||||
METHODS = [("B3b", "B3b"), ("B3c", "B3c"), ("B3c-R", "B3c-R"), ("B3d", "B3d"), ("B3d-Sa", "B3d-Sa"), ("M2-Sa", "M2-Sa")]
|
REGIME_LABELS = {"R10": "10 dB", "R0": "0 dB", "Rm5": "\u22125 dB", "R0h": "half-anchor", "R10tb": "two-anchor"} # names used in the paper
|
||||||
|
METHODS = [("B3b", "Calibrated sonic"), ("B3c", "Correlation tie"), ("B3c-R", "Phase-est. correlation"), ("B3d", "Anchor mean"),
|
||||||
|
("B3d-Sa", "SMC mean"), ("M2-Sa", "SMC bank")]
|
||||||
|
METHOD_LABELS = {"B3a": "sonic", "B3b": "cal. sonic", "B3c": "corr. tie", "B3c-R": "phase corr.", "B3d": "anchor mean"} # short names in cells
|
||||||
|
|
||||||
|
|
||||||
def load_script(name: str):
|
def load_script(name: str):
|
||||||
@@ -159,7 +162,7 @@ def p2_phase() -> None:
|
|||||||
ax.text(j, i - 0.12, f"[{fci.format(r[k + '_lo'])}, {fci.format(r[k + '_hi'])}]", ha="center",
|
ax.text(j, i - 0.12, f"[{fci.format(r[k + '_lo'])}, {fci.format(r[k + '_hi'])}]", ha="center",
|
||||||
va="center", fontsize=6, color=col)
|
va="center", fontsize=6, color=col)
|
||||||
if k == "ratio":
|
if k == "ratio":
|
||||||
ax.text(j, i - 0.36, f"{r.best}, {'pass' if r.cell_pass else 'fail'}", ha="center", va="center",
|
ax.text(j, i - 0.36, f"{METHOD_LABELS.get(r.best, r.best)}, {'pass' if r.cell_pass else 'fail'}", ha="center", va="center",
|
||||||
fontsize=5.5, color=col)
|
fontsize=5.5, color=col)
|
||||||
ax.set_xticks(range(len(Ns)), [str(n) for n in Ns])
|
ax.set_xticks(range(len(Ns)), [str(n) for n in Ns])
|
||||||
ax.set_yticks(range(len(cs)), [f"{c:g}" for c in cs])
|
ax.set_yticks(range(len(cs)), [f"{c:g}" for c in cs])
|
||||||
@@ -198,14 +201,14 @@ def h2b() -> None:
|
|||||||
ax.set_xscale("log")
|
ax.set_xscale("log")
|
||||||
ax.set_xticks([0.3, 0.5, 1, 2, 5, 10], ["0.3", "0.5", "1", "2", "5", "10"])
|
ax.set_xticks([0.3, 0.5, 1, 2, 5, 10], ["0.3", "0.5", "1", "2", "5", "10"])
|
||||||
ax.minorticks_off()
|
ax.minorticks_off()
|
||||||
ax.set(xlabel=r"posterior width $\sigma_{\mathrm{post}}$ (ms)", ylabel="band RMSE ratio, M2-Sa / B3d-Sa",
|
ax.set(xlabel=r"posterior width $\sigma_{\mathrm{post}}$ (ms)", ylabel="band RMSE ratio, SMC bank / SMC mean",
|
||||||
ylim=(0.6, 1.05))
|
ylim=(0.6, 1.05))
|
||||||
panel(ax, "a")
|
panel(ax, "a")
|
||||||
lo, hi = 0.6, 1.05
|
lo, hi = 0.6, 1.05
|
||||||
bx.plot([lo, hi], [lo, hi], color=fs.AXIS, lw=0.9)
|
bx.plot([lo, hi], [lo, hi], color=fs.AXIS, lw=0.9)
|
||||||
bx.text(0.74, 0.695, "ratio = bound", rotation=45, rotation_mode="anchor", fontsize=7, color=fs.INK2)
|
bx.text(0.74, 0.695, "ratio = bound", rotation=45, rotation_mode="anchor", fontsize=7, color=fs.INK2)
|
||||||
bx.set(xlim=(lo, hi), ylim=(lo, hi), aspect="equal", xlabel=r"population bound $1/B(\sigma_{\mathrm{post}})$",
|
bx.set(xlim=(lo, hi), ylim=(lo, hi), aspect="equal", xlabel=r"classical bound $\rho^\star_{\mathrm{cl}}(\sigma_{\mathrm{post}})$",
|
||||||
ylabel="band RMSE ratio, M2-Sa / B3d-Sa")
|
ylabel="band RMSE ratio, SMC bank / SMC mean")
|
||||||
panel(bx, "b")
|
panel(bx, "b")
|
||||||
handles = [Line2D([], [], ls="", marker="o", color=fs.BLUE, mew=0, label=r"$N = 16$"),
|
handles = [Line2D([], [], ls="", marker="o", color=fs.BLUE, mew=0, label=r"$N = 16$"),
|
||||||
Line2D([], [], ls="", marker="o", mfc="none", mec=fs.ORANGE, label=r"$N = 4$")]
|
Line2D([], [], ls="", marker="o", mfc="none", mec=fs.ORANGE, label=r"$N = 4$")]
|
||||||
@@ -237,7 +240,7 @@ def p2r_grid() -> None:
|
|||||||
ax.set_yticks(range(len(METHODS)), [lab for _, lab in METHODS])
|
ax.set_yticks(range(len(METHODS)), [lab for _, lab in METHODS])
|
||||||
ax.set_xticks(range(len(cols)), [f"{c:g}" for _, c in cols])
|
ax.set_xticks(range(len(cols)), [f"{c:g}" for _, c in cols])
|
||||||
sec = ax.secondary_xaxis("top")
|
sec = ax.secondary_xaxis("top")
|
||||||
sec.set_xticks([len(cs) * k + (len(cs) - 1) / 2 for k in range(len(REGIMES))], REGIMES)
|
sec.set_xticks([len(cs) * k + (len(cs) - 1) / 2 for k in range(len(REGIMES))], [REGIME_LABELS[r] for r in REGIMES])
|
||||||
sec.tick_params(length=0, labelsize=7.5, labelcolor=fs.INK)
|
sec.tick_params(length=0, labelsize=7.5, labelcolor=fs.INK)
|
||||||
sec.spines["top"].set_visible(False)
|
sec.spines["top"].set_visible(False)
|
||||||
for k in range(1, len(REGIMES)):
|
for k in range(1, len(REGIMES)):
|
||||||
|
|||||||
846
scripts/32_t2_mechanism.py
Normal file
846
scripts/32_t2_mechanism.py
Normal file
@@ -0,0 +1,846 @@
|
|||||||
|
"""T2 (exploratory): mechanism of the bank gain on the P2r SMC bank (realizations 8–15).
|
||||||
|
|
||||||
|
Declared before any computation in docs/research/t2-mechanism.md (SHA-256 in docs/research/t2-mechanism.sha256; byte
|
||||||
|
copy outputs/t2/declaration_v1.md). Everything under outputs/p2r/ is read-only here; nothing changes a registered
|
||||||
|
number and no locked protocol is touched. Five tests (declaration §3):
|
||||||
|
i responsibility-weighted warp error of M2-Sa at the end of training (λ of the protocol; λ ∈ {1, 3} as a declared
|
||||||
|
diagnostic) against the uniform mean warp of the same 64-member bank (primary) and of all 1024 particles;
|
||||||
|
ii control bank: 64 Gaussian-process warps with the particles' mean and covariance on the warp grid (no other
|
||||||
|
information), trained like M2-Sa (RML, λ = 1/τ_c, uniform π, 250 iterations), scored on the test wells;
|
||||||
|
iii posterior multimodality (2- vs 1-component Gaussian mixture of the per-particle window offset) and the
|
||||||
|
M2-Sa/B3d-Sa ratio of multimodal vs unimodal (regime, c, rid) units, from the saved predictions;
|
||||||
|
iv Berkson-vs-classical covariance test of the window offset of B3d-Sa and B3c-R (raw, and anchored to B3b);
|
||||||
|
v B3d-Sa, M2-Sa and Oracle retrained with budgets [250, 500] on one trajectory.
|
||||||
|
Stages (--tests): "i", "ii", "v" run the training stage (one job per cell-realization; 6 networks × 5 seeds on the
|
||||||
|
GPU, with the training set rebuilt exactly as scripts/15 run_cell); "iii", "iv" run the particle stage (CPU, all 30
|
||||||
|
cells); "summary" aggregates (tables, figures, reproduction check). A job is skipped when its output CSV exists.
|
||||||
|
|
||||||
|
scripts/runlog.sh -n t2_train -- scripts/32_t2_mechanism.py --tests i ii v --device cuda:0 --workers 4
|
||||||
|
scripts/runlog.sh -n t2_particles -- scripts/32_t2_mechanism.py --tests iii iv --workers 4
|
||||||
|
scripts/runlog.sh -n t2_summary -- scripts/32_t2_mechanism.py --tests summary
|
||||||
|
→ outputs/t2/
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import argparse
|
||||||
|
import importlib.util
|
||||||
|
import json
|
||||||
|
import os
|
||||||
|
import time
|
||||||
|
from concurrent.futures import ProcessPoolExecutor, as_completed
|
||||||
|
from multiprocessing import get_context
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
import numpy as np
|
||||||
|
import pandas as pd
|
||||||
|
import yaml
|
||||||
|
|
||||||
|
from ml_porosity.paths import REPO_ROOT, outputs_dir
|
||||||
|
|
||||||
|
|
||||||
|
def load_script(name: str):
|
||||||
|
spec = importlib.util.spec_from_file_location("s" + name[:2], REPO_ROOT / "scripts" / name)
|
||||||
|
mod = importlib.util.module_from_spec(spec)
|
||||||
|
spec.loader.exec_module(mod)
|
||||||
|
return mod
|
||||||
|
|
||||||
|
|
||||||
|
run_d2 = load_script("11_run_d2.py")
|
||||||
|
sp13 = load_script("13_summarize_p2.py")
|
||||||
|
|
||||||
|
RIDS = list(range(8, 16))
|
||||||
|
SEEDS = [0, 1, 2, 3, 4]
|
||||||
|
REGIMES = ["R10", "R0", "Rm5", "R0h", "R10tb"]
|
||||||
|
WIDE16 = [("R0", 1.0), ("R0h", 1.0), ("R10tb", 1.0), ("Rm5", 1.0), ("R0", 2.0), ("Rm5", 2.0), ("R0h", 2.0), ("R10tb", 2.0)]
|
||||||
|
NARROW16 = [("R10", 0.0), ("R0", 0.0), ("Rm5", 0.0)]
|
||||||
|
TRAIN_CELLS = [(r, c, 16) for r, c in WIDE16 + NARROW16]
|
||||||
|
ALL_CELLS = [(r, c, n) for r in REGIMES for c in (0.0, 1.0, 2.0) for n in (4, 16)]
|
||||||
|
LAM_DIAG = {"1": 1.0, "3": 3.0}
|
||||||
|
B_PM, B_O = 250, 500
|
||||||
|
MIN_SLOPE_MS, MAX_ATTEMPTS = 0.05, 1280
|
||||||
|
MAIN_MS = (600.0, 1100.0)
|
||||||
|
P2R = outputs_dir() / "p2r"
|
||||||
|
N_BOOT = 2000
|
||||||
|
TRAIN_METHODS = ["Oracle", "B3d-Sa", "M2-Sa", "M2-Sa@1", "M2-Sa@3", "Control"]
|
||||||
|
REG_BUDGET = {"Oracle": 500, "B3d-Sa": 250, "M2-Sa": 250}
|
||||||
|
|
||||||
|
|
||||||
|
def tag(regime: str, rid: int, c: float, N: int) -> str:
|
||||||
|
return f"{regime}_r{rid}_c{c:g}_n{N}"
|
||||||
|
|
||||||
|
|
||||||
|
def regime_settings() -> dict:
|
||||||
|
reg = yaml.safe_load((REPO_ROOT / "configs" / "d2_synth_p2r.yaml").read_text())["regimes"]
|
||||||
|
return {k: (v["snr_db"], v["anchor_density"]) for k, v in reg.items()}
|
||||||
|
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------------------------------------------------
|
||||||
|
# cell construction (as scripts/15 run_cell)
|
||||||
|
# ----------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
def build_cell(regime: str, rid: int, c: float, N: int, P: dict, with_register: bool) -> dict:
|
||||||
|
from ml_porosity.data.synth_d2 import D2Realization, load_horizon_grid
|
||||||
|
from ml_porosity.data.wavelet import statistical_wavelet
|
||||||
|
from ml_porosity.models.bank_train import zscore_patch
|
||||||
|
from ml_porosity.registration.labels import antialias, labels_for_warps
|
||||||
|
from ml_porosity.registration.smc import phase_basis, phase_wavelet
|
||||||
|
from ml_porosity.registration.tie_likelihood import synth_for_warps
|
||||||
|
from ml_porosity.registration.ties import tie_b3b, tie_b3c, warp_mean
|
||||||
|
from ml_porosity.registration.warp_prior import WarpHyper
|
||||||
|
|
||||||
|
snr, dens = regime_settings()[regime]
|
||||||
|
cfg = yaml.safe_load((REPO_ROOT / P["inputs"]["d2_config"]["path"]).read_text())
|
||||||
|
hg = load_horizon_grid(cfg["horizons"], REPO_ROOT / cfg["horizon_cache"])
|
||||||
|
prior = json.loads((REPO_ROOT / P["inputs"]["warp_prior"]["path"]).read_text())["fits"][P["inputs"]["warp_prior"]["fit"]]
|
||||||
|
wav = np.load(REPO_ROOT / P["inputs"]["wavelet"]["path"])[P["inputs"]["wavelet"]["key"]]
|
||||||
|
R = D2Realization(cfg, rid, hg, WarpHyper(**prior["hyper"]), wav)
|
||||||
|
sa = cfg["anchors"]["sigma_a_ms"]
|
||||||
|
obs = [R.observe(w, c, snr, sa, dens) for w in R.pool[:N]]
|
||||||
|
test = [R.observe(w, c, snr, sa) for w in R.test]
|
||||||
|
reg = run_d2.reg_settings(P)
|
||||||
|
post = P2R / "posterior" / regime
|
||||||
|
t = f"r{rid}_c{c:g}_n{N}_s0"
|
||||||
|
ph = json.loads((post / f"{t}_phase.json").read_text())
|
||||||
|
smc = np.load(post / f"{t}_particles.npz")
|
||||||
|
f, fac = cfg["fine_dt_ms"], int(round(R.dt / cfg["fine_dt_ms"]))
|
||||||
|
seis = [o["seis"][o["seis"].shape[0] // 2].astype(float) for o in obs]
|
||||||
|
wR = phase_wavelet(phase_basis(statistical_wavelet(np.stack(seis), R.dt, reg["wavelet_ms"]), fac), ph["phase_R"])
|
||||||
|
lab = lambda y, T: labels_for_warps(R.tau_fine, y, np.atleast_2d(T), R.t_main)
|
||||||
|
wells = []
|
||||||
|
for i, o in enumerate(obs):
|
||||||
|
y_aa = antialias(o["phi_log"], f, R.dt)
|
||||||
|
t_b3b = tie_b3b(o["tau_k"], o["t_k"], R.tau_fine)
|
||||||
|
syn_b = synth_for_warps(R.tau_fine, o["ai_log"], t_b3b, R.t_fine, R.t_ext, wR)[0]
|
||||||
|
t3c = tie_b3c(t_b3b, R.tau_fine, syn_b, seis[i], R.t_ext, R.dt)
|
||||||
|
U = smc[f"{o['name']}/estR/g_acf"].astype(float)
|
||||||
|
Tg = R.grid.t_of_tau(U[:, 0], U[:, 1:]) # (P, n_grid), warp-grid nodes
|
||||||
|
Tf = R.grid.t_of_tau(U[:, 0], U[:, 1:], tau=R.tau_fine) # (P, n_fine)
|
||||||
|
tm = warp_mean(Tf, np.zeros(len(Tf))) # the B3d-Sa warp
|
||||||
|
sub = np.random.default_rng([0, i, 29]).choice(len(Tf), reg["S"], replace=False)
|
||||||
|
Y = lab(y_aa, Tf[sub])
|
||||||
|
ok = np.all(np.isfinite(Y), 1)
|
||||||
|
Y[~ok] = Y[ok][0]
|
||||||
|
logpi = np.where(ok, 0.0, -np.inf) - np.log(ok.sum())
|
||||||
|
tb_nodes = np.interp(R.grid.tau, R.tau_fine, t_b3b)
|
||||||
|
K = np.flatnonzero((tb_nodes >= MAIN_MS[0]) & (tb_nodes <= MAIN_MS[1]))
|
||||||
|
wells.append(dict(i=i, name=o["name"], o=o, y_aa=y_aa, t_b3b=t_b3b, t3c=t3c, U=U, Tg=Tg, Tf=Tf, tm=tm,
|
||||||
|
sub=sub, Y=Y, ok=ok, logpi=logpi, K=K))
|
||||||
|
cell = dict(R=R, obs=obs, test=test, reg=reg, ph=ph, wells=wells, lab=lab, snr=snr, dens=dens,
|
||||||
|
X=np.stack([zscore_patch(o["seis"], R.main) for o in obs]),
|
||||||
|
Xte=np.stack([zscore_patch(o["seis"], R.main) for o in test]),
|
||||||
|
yt=100 * np.stack([o["y_true"] for o in test]))
|
||||||
|
if with_register:
|
||||||
|
from ml_porosity.registration.pipeline import register
|
||||||
|
out = register(R, obs, reg, 0)
|
||||||
|
if ph["phase0"] != out["phase"]:
|
||||||
|
raise RuntimeError(f"{tag(regime, rid, c, N)}: register phase {out['phase']} differs from scripts/14 {ph['phase0']}")
|
||||||
|
cell["out"] = out
|
||||||
|
return cell
|
||||||
|
|
||||||
|
|
||||||
|
def window_offsets(w: dict, R) -> dict:
|
||||||
|
"""Window-mean offsets (ms) over the nodes K of the well: per particle (a_s) and per method; the node-wise
|
||||||
|
offsets d_m(τ_k) = t_m(τ_k) − τ_k for the per-sample sensitivity of test iv."""
|
||||||
|
K = w["K"]
|
||||||
|
tau_k = R.grid.tau[K]
|
||||||
|
at = lambda t: np.interp(tau_k, R.tau_fine, t) - tau_k
|
||||||
|
d = {"true": at(w["o"]["t_of_tau_true"]), "B3b": at(w["t_b3b"]), "B3d-Sa": at(w["tm"]), "B3c-R": at(w["t3c"])}
|
||||||
|
a_s = (w["Tg"][:, K] - tau_k[None, :]).mean(1)
|
||||||
|
return {"nodes": d, "a_particles": a_s, "b_particles": w["U"][:, 0], "n_K": len(K),
|
||||||
|
"a": {m: float(v.mean()) for m, v in d.items()}}
|
||||||
|
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------------------------------------------------
|
||||||
|
# training stage (tests i, ii, v)
|
||||||
|
# ----------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
def control_bank(w: dict, R, S: int) -> tuple[np.ndarray, dict]:
|
||||||
|
"""64 warps T̄ + η_s, η_s ~ GP with the particles' covariance on the warp grid (declaration §3 ii)."""
|
||||||
|
Tg = w["Tg"]
|
||||||
|
Tbar = Tg.mean(0)
|
||||||
|
lam, V = np.linalg.eigh(np.cov(Tg.T, ddof=0))
|
||||||
|
Lm = V * np.sqrt(np.clip(lam, 0.0, None))[None, :]
|
||||||
|
rng = np.random.default_rng([0, w["i"], 2029])
|
||||||
|
members, n_rej, attempts = [], 0, 0
|
||||||
|
while len(members) < S and attempts < MAX_ATTEMPTS:
|
||||||
|
t = Tbar + Lm @ rng.standard_normal(len(Tbar))
|
||||||
|
attempts += 1
|
||||||
|
if np.all(np.diff(t) > MIN_SLOPE_MS):
|
||||||
|
members.append(t)
|
||||||
|
else:
|
||||||
|
n_rej += 1
|
||||||
|
fallback = len(members) < S
|
||||||
|
if fallback: # u-space Gaussian draw (monotone by construction)
|
||||||
|
U = w["U"]
|
||||||
|
lu, Vu = np.linalg.eigh(np.cov(U.T, ddof=0))
|
||||||
|
Lu = Vu * np.sqrt(np.clip(lu, 0.0, None))[None, :]
|
||||||
|
ubar = U.mean(0)
|
||||||
|
while len(members) < S:
|
||||||
|
u = ubar + Lu @ rng.standard_normal(len(ubar))
|
||||||
|
members.append(R.grid.t_of_tau(u[0], u[1:])[0])
|
||||||
|
Tc_grid = np.stack(members)
|
||||||
|
Tc = np.stack([np.interp(R.tau_fine, R.grid.tau, t) for t in Tc_grid])
|
||||||
|
K = w["K"]
|
||||||
|
info = {"ctl_n_rejected": n_rej, "ctl_attempts": attempts, "ctl_fallback_u": bool(fallback),
|
||||||
|
"ctl_sd_ratio": float(Tc_grid[:, K].std(0).mean() / Tg[:, K].std(0).mean()),
|
||||||
|
"ctl_sd_mean_ms": float(Tc_grid[:, K].std(0).mean()), "post_sd_mean_ms": float(Tg[:, K].std(0).mean())}
|
||||||
|
return Tc, info
|
||||||
|
|
||||||
|
|
||||||
|
def member_errors(T: np.ndarray, R, o: dict) -> tuple[np.ndarray, np.ndarray, np.ndarray]:
|
||||||
|
"""τ_s(t) on t_main for every warp of T (NaN outside the domain), τ_true(t) and the per-member RMSE (ms)."""
|
||||||
|
from ml_porosity.registration.labels import invert_warps
|
||||||
|
|
||||||
|
tau_s = invert_warps(T, R.tau_fine, R.t_main)
|
||||||
|
tau_true = invert_warps(o["t_of_tau_true"][None], R.tau_fine, R.t_main)[0]
|
||||||
|
e = np.sqrt(np.nanmean((tau_s - tau_true[None]) ** 2, 1))
|
||||||
|
return tau_s, tau_true, e
|
||||||
|
|
||||||
|
|
||||||
|
def train_job(job) -> tuple[str, float]:
|
||||||
|
regime, rid, c, N, seeds, device, out_dir, P = job
|
||||||
|
import torch
|
||||||
|
|
||||||
|
torch.set_num_threads(2)
|
||||||
|
from ml_porosity.losses.rml import responsibilities
|
||||||
|
from ml_porosity.models.bank_train import WIN, train_predict, window_starts_fixed
|
||||||
|
from ml_porosity.registration.ties import warp_errors, warp_mean
|
||||||
|
|
||||||
|
t0 = time.time()
|
||||||
|
cell = build_cell(regime, rid, c, N, P, with_register=True)
|
||||||
|
R, out, wells = cell["R"], cell["out"], cell["wells"]
|
||||||
|
stem = tag(regime, rid, c, N)
|
||||||
|
key = dict(regime=regime, rid=rid, c=c, n_train=N)
|
||||||
|
m0, s0 = out["norm"]
|
||||||
|
lam = out["lam"]
|
||||||
|
tcfg = P["training"]["model"] | P["training"]["optimizer"]
|
||||||
|
f_c = P["metrics"]["bands"]["f_c_hz"]
|
||||||
|
nb = lambda a: ((np.asarray(a) - m0) / s0).astype(np.float32)
|
||||||
|
err = lambda t, o: warp_errors(t[None], R.tau_fine, o["t_of_tau_true"], R.t_main)["warp_rmse_ms"]
|
||||||
|
|
||||||
|
# banks: Oracle (register), B3d-Sa, M2-Sa (SMC), Control (GP)
|
||||||
|
spec_oracle = run_d2.method_specs(out, P, ["Oracle"])["Oracle"]
|
||||||
|
Y_pm = nb(np.stack([cell["lab"](w["y_aa"], w["tm"]) for w in wells]))
|
||||||
|
Y_rml = nb(np.stack([w["Y"] for w in wells]))
|
||||||
|
logpi = np.stack([w["logpi"] for w in wells]).astype(np.float32)
|
||||||
|
ctl_rows, Yc = [], []
|
||||||
|
for w in wells:
|
||||||
|
Tc, info = control_bank(w, R, cell["reg"]["S"])
|
||||||
|
Y = cell["lab"](w["y_aa"], Tc)
|
||||||
|
ok = np.all(np.isfinite(Y), 1)
|
||||||
|
Y[~ok] = Y[ok][0]
|
||||||
|
Yc.append(Y)
|
||||||
|
_, _, e_ctl = member_errors(Tc, R, w["o"])
|
||||||
|
_, _, e_smc = member_errors(w["Tf"][w["sub"]], R, w["o"])
|
||||||
|
ctl_rows.append(key | {"well": w["name"], "lam": lam} | info | {
|
||||||
|
"ctl_n_valid": int(ok.sum()), "ctl_mean_warp_rmse_ms": err(warp_mean(Tc, np.zeros(len(Tc))), w["o"]),
|
||||||
|
"ctl_member_err_mean_ms": float(np.nanmean(e_ctl[ok])), "smc_member_err_mean_ms": float(np.nanmean(e_smc[w["ok"]])),
|
||||||
|
"B3d-Sa_warp_rmse_ms": err(w["tm"], w["o"]), "M2-Sa_n_valid": int(w["ok"].sum())})
|
||||||
|
w["ctl_logpi"] = np.where(ok, 0.0, -np.inf) - np.log(ok.sum())
|
||||||
|
Y_ctl = nb(np.stack(Yc))
|
||||||
|
logpi_ctl = np.stack([w["ctl_logpi"] for w in wells]).astype(np.float32)
|
||||||
|
bank = lambda Y, lp, lam_: {"kind": "bank", "Y": Y, "logpi": lp, "lam": lam_}
|
||||||
|
specs = {"Oracle": (spec_oracle, [B_PM, B_O]),
|
||||||
|
"B3d-Sa": (bank(Y_pm, np.zeros((N, 1), np.float32), lam), [B_PM, B_O]),
|
||||||
|
"M2-Sa": (bank(Y_rml, logpi, lam), [B_PM, B_O]),
|
||||||
|
**{f"M2-Sa@{k}": (bank(Y_rml, logpi, v), [B_PM]) for k, v in LAM_DIAG.items()},
|
||||||
|
"Control": (bank(Y_ctl, logpi_ctl, lam), [B_PM])}
|
||||||
|
|
||||||
|
# per-well warp quantities of test i (independent of the network)
|
||||||
|
starts_np = window_starts_fixed(R.t_main.size)
|
||||||
|
M = np.zeros((len(starts_np), R.t_main.size))
|
||||||
|
for j, s in enumerate(starts_np):
|
||||||
|
M[j, s: s + WIN] = 1.0
|
||||||
|
cnt = M.sum(0)
|
||||||
|
geo = []
|
||||||
|
for w in wells:
|
||||||
|
tau_s, tau_true, e_s = member_errors(w["Tf"][w["sub"]], R, w["o"])
|
||||||
|
geo.append(dict(tau_s=np.nan_to_num(tau_s), tau_true=tau_true, e_s=e_s,
|
||||||
|
E_64=err(warp_mean(w["Tf"][w["sub"]], w["logpi"]), w["o"]), E_1024=err(w["tm"], w["o"]),
|
||||||
|
ebar_u=float(np.nanmean(e_s[w["ok"]]))))
|
||||||
|
|
||||||
|
T = lambda a: torch.as_tensor(np.asarray(a), dtype=torch.float32, device=device)
|
||||||
|
X_t, starts_t = T(cell["X"]), torch.as_tensor(np.tile(starts_np, (N, 1)), device=device)
|
||||||
|
rows, resp_rows = [], []
|
||||||
|
for seed in seeds:
|
||||||
|
for m, (sp, bud) in specs.items():
|
||||||
|
store = {}
|
||||||
|
cb = None
|
||||||
|
if m.startswith("M2-Sa"):
|
||||||
|
Y_t, lp_t = T(sp["Y"]), T(sp["logpi"])
|
||||||
|
|
||||||
|
def cb(step, model, Y_t=Y_t, lp_t=lp_t, lam_=sp["lam"], store=store):
|
||||||
|
with torch.no_grad():
|
||||||
|
mu, s = model(X_t)
|
||||||
|
r = responsibilities(mu[:, 0], s[:, 0], Y_t, lp_t, starts_t, WIN, lam_)
|
||||||
|
store[step] = r.cpu().numpy().astype(np.float64)
|
||||||
|
preds = train_predict(cell["X"], cell["Xte"], sp, tcfg, seed, bud, device, on_budget=cb)
|
||||||
|
for b, (mu, sg) in preds.items():
|
||||||
|
mu_p, sg_p = 100 * (mu * s0 + m0), 100 * sg * s0
|
||||||
|
for wt, r in zip(R.test, run_d2.evaluate(cell["yt"], mu_p, sg_p, f_c)):
|
||||||
|
rows.append(key | {"seed": seed, "method": m, "budget": b, "test_well": wt.name} | r)
|
||||||
|
for b, r in store.items(): # (N, J, S)
|
||||||
|
rbar = r.mean(1) # (N, S)
|
||||||
|
r_i = np.einsum("ji,njs->nis", M, r) / cnt[None, :, None] # (N, L, S)
|
||||||
|
for w, g in zip(wells, geo):
|
||||||
|
rb, rs = rbar[w["i"]], r_i[w["i"]]
|
||||||
|
with np.errstate(divide="ignore"):
|
||||||
|
logw = np.log(rb)
|
||||||
|
E_r = err(warp_mean(w["Tf"][w["sub"]], logw), w["o"])
|
||||||
|
tau_r = np.einsum("is,si->i", rs, g["tau_s"])
|
||||||
|
E_r_win = float(np.sqrt(np.mean((tau_r - g["tau_true"]) ** 2)))
|
||||||
|
rj = r[w["i"]]
|
||||||
|
resp_rows.append(key | {
|
||||||
|
"seed": seed, "method": m, "lam": sp["lam"], "budget": b, "well": w["name"],
|
||||||
|
"E_r": E_r, "E_r_win": E_r_win, "E_64": g["E_64"], "E_1024": g["E_1024"],
|
||||||
|
"ebar_r": float(np.nansum(rb * np.nan_to_num(g["e_s"]))), "ebar_u": g["ebar_u"],
|
||||||
|
"S_eff": float(1.0 / np.sum(rb ** 2)), "entropy": float(-np.sum(rb[rb > 0] * np.log(rb[rb > 0]))),
|
||||||
|
"S_eff_win": float(np.mean(1.0 / np.sum(rj ** 2, 1))), "rmax_win": float(np.mean(rj.max(1))),
|
||||||
|
"n_valid": int(w["ok"].sum())})
|
||||||
|
pd.DataFrame(ctl_rows).to_csv(out_dir / f"{stem}_ctl.csv", index=False)
|
||||||
|
pd.DataFrame(resp_rows).to_csv(out_dir / f"{stem}_resp.csv", index=False)
|
||||||
|
pd.DataFrame(rows).to_csv(out_dir / f"{stem}.csv", index=False) # written last: marks the job as complete
|
||||||
|
return stem, time.time() - t0
|
||||||
|
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------------------------------------------------
|
||||||
|
# particle stage (tests iii, iv)
|
||||||
|
# ----------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
def gmm_stats(x: np.ndarray) -> dict:
|
||||||
|
from sklearn.mixture import GaussianMixture
|
||||||
|
|
||||||
|
x = x[:, None]
|
||||||
|
fit = lambda k: GaussianMixture(k, covariance_type="full", n_init=5, random_state=0, reg_covar=1e-6).fit(x)
|
||||||
|
g1, g2 = fit(1), fit(2)
|
||||||
|
mu = g2.means_.ravel()
|
||||||
|
w = g2.weights_
|
||||||
|
dbic = float(g1.bic(x) - g2.bic(x))
|
||||||
|
sep = float(abs(mu[0] - mu[1]))
|
||||||
|
return {"dbic": dbic, "sep_ms": sep, "w_min": float(w.min()), "sd_ms": float(x.std()),
|
||||||
|
"multimodal": bool(dbic > 10 and sep > 4.0 and w.min() >= 0.1)}
|
||||||
|
|
||||||
|
|
||||||
|
def particle_job(job) -> tuple[str, float]:
|
||||||
|
regime, rid, c, N, out_dir, P = job
|
||||||
|
t0 = time.time()
|
||||||
|
cell = build_cell(regime, rid, c, N, P, with_register=False)
|
||||||
|
R = cell["R"]
|
||||||
|
stem = tag(regime, rid, c, N)
|
||||||
|
key = dict(regime=regime, rid=rid, c=c, n_train=N)
|
||||||
|
rows3, rows4, nodes = [], [], {}
|
||||||
|
for w in cell["wells"]:
|
||||||
|
off = window_offsets(w, R)
|
||||||
|
ga, gb = gmm_stats(off["a_particles"]), gmm_stats(off["b_particles"])
|
||||||
|
rows3.append(key | {"well": w["name"], "n_K": off["n_K"]} | {f"a_{k}": v for k, v in ga.items()}
|
||||||
|
| {f"b_{k}": v for k, v in gb.items()})
|
||||||
|
rows4.append(key | {"well": w["name"], "n_K": off["n_K"]} | {f"a_{m}": v for m, v in off["a"].items()})
|
||||||
|
for m, v in off["nodes"].items():
|
||||||
|
nodes[f"{w['name']}/{m}"] = v.astype(np.float32)
|
||||||
|
np.savez_compressed(out_dir / "iv" / f"{stem}.npz", **nodes)
|
||||||
|
pd.DataFrame(rows3).to_csv(out_dir / "iii" / f"{stem}.csv", index=False)
|
||||||
|
pd.DataFrame(rows4).to_csv(out_dir / "iv" / f"{stem}.csv", index=False)
|
||||||
|
return stem, time.time() - t0
|
||||||
|
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------------------------------------------------
|
||||||
|
# summary
|
||||||
|
# ----------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
def ci(rng, num: np.ndarray, den: np.ndarray | None = None) -> list[float]:
|
||||||
|
return sp13.boot(np.asarray(num, float), None if den is None else np.asarray(den, float), N_BOOT, rng)
|
||||||
|
|
||||||
|
|
||||||
|
def per_rid(df: pd.DataFrame, col: str = "band_rmse") -> pd.Series:
|
||||||
|
"""Mean over seeds and test wells per realization (index: rid)."""
|
||||||
|
return df.groupby("rid")[col].mean()
|
||||||
|
|
||||||
|
|
||||||
|
def registered_cells(cells: list[tuple[str, float, int]]) -> pd.DataFrame:
|
||||||
|
rows = []
|
||||||
|
for regime, c, N in cells:
|
||||||
|
for rid in RIDS:
|
||||||
|
f = P2R / "train" / regime / "cells" / f"r{rid}_c{c:g}_n{N}.csv"
|
||||||
|
d = pd.read_csv(f)
|
||||||
|
d = d[d.budget == d.method.map(REG_BUDGET).fillna(-1)]
|
||||||
|
rows.append(d.assign(regime=regime))
|
||||||
|
return pd.concat(rows, ignore_index=True)
|
||||||
|
|
||||||
|
|
||||||
|
def ratio_row(rng, num: pd.DataFrame, den: pd.DataFrame, col: str = "band_rmse") -> dict:
|
||||||
|
a, b = per_rid(num, col), per_rid(den, col)
|
||||||
|
a, b = a.align(b, join="inner")
|
||||||
|
lo, hi = ci(rng, a.to_numpy(), b.to_numpy())
|
||||||
|
return {"ratio": float(a.mean() / b.mean()), "lo": lo, "hi": hi, "n_rid": int(len(a))}
|
||||||
|
|
||||||
|
|
||||||
|
def diff_row(rng, num: pd.DataFrame, den: pd.DataFrame, col: str = "band_rmse") -> dict:
|
||||||
|
a, b = per_rid(num, col), per_rid(den, col)
|
||||||
|
a, b = a.align(b, join="inner")
|
||||||
|
d = (a - b).to_numpy()
|
||||||
|
lo, hi = ci(rng, d)
|
||||||
|
return {"diff": float(d.mean()), "diff_lo": lo, "diff_hi": hi}
|
||||||
|
|
||||||
|
|
||||||
|
def cluster_corr(rng, df: pd.DataFrame, x: str, y: str) -> dict:
|
||||||
|
"""Pearson correlation with a cluster bootstrap over realizations (declaration §3 iv)."""
|
||||||
|
r = float(np.corrcoef(df[x], df[y])[0, 1]) if len(df) > 2 else np.nan
|
||||||
|
rids = df.rid.unique()
|
||||||
|
groups = {k: g[[x, y]].to_numpy() for k, g in df.groupby("rid")}
|
||||||
|
boots = []
|
||||||
|
for _ in range(N_BOOT):
|
||||||
|
pick = rng.choice(rids, len(rids), replace=True)
|
||||||
|
v = np.concatenate([groups[k] for k in pick])
|
||||||
|
boots.append(np.corrcoef(v[:, 0], v[:, 1])[0, 1] if v[:, 0].std() > 0 and v[:, 1].std() > 0 else np.nan)
|
||||||
|
lo, hi = np.nanpercentile(boots, [2.5, 97.5])
|
||||||
|
return {"r": r, "lo": float(lo), "hi": float(hi), "n": int(len(df))}
|
||||||
|
|
||||||
|
|
||||||
|
def verdict_iv(rB: dict, rC: dict) -> str:
|
||||||
|
b0, c0 = rB["lo"] <= 0 <= rB["hi"], rC["lo"] <= 0 <= rC["hi"]
|
||||||
|
if b0 and not c0:
|
||||||
|
return "Berkson"
|
||||||
|
if c0 and not b0:
|
||||||
|
return "classical"
|
||||||
|
return "neither (no power)" if b0 and c0 else "neither (no structure)"
|
||||||
|
|
||||||
|
|
||||||
|
def summarize(out: Path, device_note: str) -> None:
|
||||||
|
import matplotlib
|
||||||
|
matplotlib.use("Agg")
|
||||||
|
import matplotlib.pyplot as plt
|
||||||
|
from ml_porosity.eval import figstyle
|
||||||
|
|
||||||
|
figstyle.apply()
|
||||||
|
fig_dir = out / "figures"
|
||||||
|
fig_dir.mkdir(exist_ok=True)
|
||||||
|
rng = np.random.default_rng(0)
|
||||||
|
meta = {"declaration_sha256": (REPO_ROOT / "docs/research/t2-mechanism.sha256").read_text().strip().splitlines(),
|
||||||
|
"n_boot": N_BOOT, "device": device_note}
|
||||||
|
md = ["# T2 (exploratory): summary of outputs/t2\n",
|
||||||
|
"Declared in docs/research/t2-mechanism.md before any computation; nothing here changes a registered number.\n"]
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------- training outputs and reproduction check
|
||||||
|
cell_files = sorted(f for f in (out / "cells").glob("*_n16.csv") if not f.name.endswith(("_ctl.csv", "_resp.csv")))
|
||||||
|
have_train = len(cell_files) > 0
|
||||||
|
if have_train:
|
||||||
|
tr = pd.concat([pd.read_csv(f) for f in cell_files], ignore_index=True)
|
||||||
|
done = sorted({(r, c, 16) for r, c in tr[["regime", "c"]].drop_duplicates().itertuples(index=False)})
|
||||||
|
reg = registered_cells(done)
|
||||||
|
# reproduction: retrained at the registered budget vs registered, per (cell, rid, seed, test_well)
|
||||||
|
rep = tr[tr.method.isin(REG_BUDGET) & (tr.budget == tr.method.map(REG_BUDGET))]
|
||||||
|
keys = ["regime", "c", "rid", "seed", "method", "test_well"]
|
||||||
|
mg = rep.merge(reg[keys + ["band_rmse", "rmse"]], on=keys, suffixes=("", "_reg"))
|
||||||
|
mg["dev"] = (mg.band_rmse - mg.band_rmse_reg).abs()
|
||||||
|
sc = {"n_rows": int(len(mg)), "band_rmse_abs_dev_max": float(mg.dev.max()), "band_rmse_abs_dev_mean": float(mg.dev.mean()),
|
||||||
|
"band_rmse_abs_dev_median": float(mg.dev.median()),
|
||||||
|
"by_method": {m: {"max": float(d.dev.max()), "mean": float(d.dev.mean())} for m, d in mg.groupby("method")}}
|
||||||
|
one = mg[(mg.regime == "R0") & (mg.c == 1.0) & (mg.rid == 8) & (mg.seed == 0)]
|
||||||
|
sc["R0_r8_c1_n16_seed0"] = {m: {"max_abs_dev": float(d.dev.max()), "band_rmse_retrained": float(d.band_rmse.mean()),
|
||||||
|
"band_rmse_registered": float(d.band_rmse_reg.mean())} for m, d in one.groupby("method")}
|
||||||
|
# cell-level: retrained vs registered cell means
|
||||||
|
cm = mg.groupby(["regime", "c", "method"])[["band_rmse", "band_rmse_reg"]].mean()
|
||||||
|
sc["cell_mean_rel_dev_max"] = float(((cm.band_rmse - cm.band_rmse_reg) / cm.band_rmse_reg).abs().max())
|
||||||
|
# warp diagnostics vs registered _diag.csv
|
||||||
|
ctl = pd.concat([pd.read_csv(f) for f in sorted((out / "cells").glob("*_ctl.csv"))], ignore_index=True)
|
||||||
|
dg = []
|
||||||
|
for regime, c, N in done:
|
||||||
|
for rid in RIDS:
|
||||||
|
d = pd.read_csv(P2R / "train" / regime / "cells" / f"r{rid}_c{c:g}_n{N}_diag.csv")
|
||||||
|
dg.append(d.assign(regime=regime))
|
||||||
|
dg = pd.concat(dg, ignore_index=True)
|
||||||
|
wd = ctl.merge(dg[["regime", "c", "rid", "well", "B3d-Sa_warp_rmse_ms", "M2-Sa_n_valid", "lam"]],
|
||||||
|
on=["regime", "c", "rid", "well"], suffixes=("", "_diag"))
|
||||||
|
sc["warp_rmse_abs_dev_max"] = float((wd["B3d-Sa_warp_rmse_ms"] - wd["B3d-Sa_warp_rmse_ms_diag"]).abs().max())
|
||||||
|
sc["n_valid_mismatch"] = int((wd["M2-Sa_n_valid"] != wd["M2-Sa_n_valid_diag"]).sum())
|
||||||
|
sc["lam_abs_dev_max"] = float((wd["lam"] - wd["lam_diag"]).abs().max())
|
||||||
|
(out / "selfcheck.json").write_text(json.dumps(sc, indent=1))
|
||||||
|
meta["selfcheck"] = sc
|
||||||
|
md.append("## Reproduction check (retrained vs registered band RMSE per seed and test well)\n")
|
||||||
|
md.append(f"rows {sc['n_rows']}; max |dev| {sc['band_rmse_abs_dev_max']:.3e}, mean {sc['band_rmse_abs_dev_mean']:.3e}, "
|
||||||
|
f"median {sc['band_rmse_abs_dev_median']:.3e}; cell-mean relative dev max {sc['cell_mean_rel_dev_max']:.3e}; "
|
||||||
|
f"warp RMSE max dev {sc['warp_rmse_abs_dev_max']:.1e} ms; n_valid mismatches {sc['n_valid_mismatch']}; "
|
||||||
|
f"lambda max dev {sc['lam_abs_dev_max']:.1e}\n")
|
||||||
|
md.append("R0 r8 c1 n16 seed 0: " + "; ".join(f"{m}: max |dev| {v['max_abs_dev']:.3e}" for m, v in sc["R0_r8_c1_n16_seed0"].items()) + "\n")
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------- test ii
|
||||||
|
rows = []
|
||||||
|
for regime, c, N in done:
|
||||||
|
cell = dict(regime=regime, c=c, n_train=N, wide=(regime, c) in WIDE16)
|
||||||
|
sel = lambda df, m, b: df[(df.regime == regime) & (df.c == c) & (df.method == m) & (df.budget == b)]
|
||||||
|
ctl_df, pm_reg, rml_reg = sel(tr, "Control", B_PM), sel(reg, "B3d-Sa", B_PM), sel(reg, "M2-Sa", B_PM)
|
||||||
|
pm_new, rml_new = sel(tr, "B3d-Sa", B_PM), sel(tr, "M2-Sa", B_PM)
|
||||||
|
r = cell | {f"ctl_pm_{k}": v for k, v in ratio_row(rng, ctl_df, pm_reg).items()}
|
||||||
|
r |= {f"rml_pm_{k}": v for k, v in ratio_row(rng, rml_reg, pm_reg).items()}
|
||||||
|
r |= {f"ctl_rml_{k}": v for k, v in ratio_row(rng, ctl_df, rml_reg).items()}
|
||||||
|
r |= {f"ctl_pm_new_{k}": v for k, v in ratio_row(rng, ctl_df, pm_new).items()}
|
||||||
|
r |= {f"rml_pm_new_{k}": v for k, v in ratio_row(rng, rml_new, pm_new).items()}
|
||||||
|
r |= {f"ctl_rml_new_{k}": v for k, v in ratio_row(rng, ctl_df, rml_new).items()}
|
||||||
|
r |= {f"D_ctl_rml_{k}": v for k, v in diff_row(rng, ctl_df, rml_reg).items()}
|
||||||
|
r |= {f"ctl_pm_pcc_{k}": v for k, v in ratio_row(rng, ctl_df, pm_reg, "band_pcc").items()}
|
||||||
|
cd = ctl[(ctl.regime == regime) & (ctl.c == c)]
|
||||||
|
r |= {"ctl_sd_ratio": float(cd.ctl_sd_ratio.mean()), "ctl_rejected_total": int(cd.ctl_n_rejected.sum()),
|
||||||
|
"ctl_fallback_wells": int(cd.ctl_fallback_u.sum()), "ctl_member_err_ms": float(cd.ctl_member_err_mean_ms.mean()),
|
||||||
|
"smc_member_err_ms": float(cd.smc_member_err_mean_ms.mean()), "ctl_mean_warp_rmse_ms": float(cd.ctl_mean_warp_rmse_ms.mean()),
|
||||||
|
"pm_warp_rmse_ms": float(cd["B3d-Sa_warp_rmse_ms"].mean())}
|
||||||
|
ctl_gain, ctl_null = r["ctl_pm_hi"] < 1, r["ctl_pm_lo"] <= 1 <= r["ctl_pm_hi"]
|
||||||
|
rml_gain = r["rml_pm_hi"] < 1
|
||||||
|
d0, dpos = r["D_ctl_rml_diff_lo"] <= 0 <= r["D_ctl_rml_diff_hi"], r["D_ctl_rml_diff_lo"] > 0
|
||||||
|
if ctl_gain and d0:
|
||||||
|
v = "A: consistent with (a)"
|
||||||
|
elif ctl_null and rml_gain:
|
||||||
|
v = "B: against (a)"
|
||||||
|
elif ctl_gain and dpos:
|
||||||
|
v = "C: partial (a)"
|
||||||
|
else:
|
||||||
|
v = "D: undetermined"
|
||||||
|
r["verdict"] = v
|
||||||
|
rows.append(r)
|
||||||
|
t2 = pd.DataFrame(rows)
|
||||||
|
t2.to_csv(out / "test_ii.csv", index=False)
|
||||||
|
wide = t2[t2.wide]
|
||||||
|
meta["test_ii"] = {"verdict_counts_wide": wide.verdict.value_counts().to_dict(),
|
||||||
|
"narrow_ctl_pm": t2[~t2.wide][["regime", "ctl_pm_ratio", "ctl_pm_lo", "ctl_pm_hi"]].to_dict("records")}
|
||||||
|
md.append("## Test ii: control bank (GP noise with the posterior covariance) vs B3d-Sa and M2-Sa\n")
|
||||||
|
md.append(sp13.md(t2[["regime", "c", "wide", "ctl_pm_ratio", "ctl_pm_lo", "ctl_pm_hi", "rml_pm_ratio", "rml_pm_lo", "rml_pm_hi",
|
||||||
|
"ctl_rml_ratio", "ctl_rml_lo", "ctl_rml_hi", "D_ctl_rml_diff", "D_ctl_rml_diff_lo", "D_ctl_rml_diff_hi",
|
||||||
|
"ctl_pm_new_ratio", "ctl_sd_ratio", "ctl_member_err_ms", "smc_member_err_ms", "ctl_fallback_wells", "verdict"]]) + "\n")
|
||||||
|
md.append(f"Wide-cell verdicts: {meta['test_ii']['verdict_counts_wide']}\n")
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------- test v
|
||||||
|
rows = []
|
||||||
|
for regime, c, N in done:
|
||||||
|
cell = dict(regime=regime, c=c, n_train=N, wide=(regime, c) in WIDE16)
|
||||||
|
sel = lambda df, m, b: df[(df.regime == regime) & (df.c == c) & (df.method == m) & (df.budget == b)]
|
||||||
|
pairs = {"o500_pm500": (sel(tr, "Oracle", B_O), sel(tr, "B3d-Sa", B_O)),
|
||||||
|
"pm500_pm250": (sel(tr, "B3d-Sa", B_O), sel(tr, "B3d-Sa", B_PM)),
|
||||||
|
"pm500_pm250reg": (sel(tr, "B3d-Sa", B_O), sel(reg, "B3d-Sa", B_PM)),
|
||||||
|
"rml500_pm500": (sel(tr, "M2-Sa", B_O), sel(tr, "B3d-Sa", B_O)),
|
||||||
|
"rml500_rml250": (sel(tr, "M2-Sa", B_O), sel(tr, "M2-Sa", B_PM)),
|
||||||
|
"o250_pm250": (sel(tr, "Oracle", B_PM), sel(tr, "B3d-Sa", B_PM)),
|
||||||
|
"o500_o250": (sel(tr, "Oracle", B_O), sel(tr, "Oracle", B_PM)),
|
||||||
|
"rml250_pm250": (sel(tr, "M2-Sa", B_PM), sel(tr, "B3d-Sa", B_PM)),
|
||||||
|
"o500_pm250": (sel(tr, "Oracle", B_O), sel(tr, "B3d-Sa", B_PM)),
|
||||||
|
"o500_pm250reg": (sel(reg, "Oracle", B_O), sel(reg, "B3d-Sa", B_PM)),
|
||||||
|
"rml250_pm250reg": (sel(reg, "M2-Sa", B_PM), sel(reg, "B3d-Sa", B_PM))}
|
||||||
|
r = dict(cell)
|
||||||
|
for k, (a, b) in pairs.items():
|
||||||
|
r |= {f"{k}_{kk}": v for kk, v in ratio_row(rng, a, b).items() if kk != "n_rid"}
|
||||||
|
r[f"{k}_pcc"] = ratio_row(rng, a, b, "band_pcc")["ratio"]
|
||||||
|
g500, g250 = 1 - r["o500_pm500_ratio"], 1 - r["o500_pm250_ratio"]
|
||||||
|
r["gap_share_training_length"] = float(1 - g500 / g250) if g250 > 0 and g500 > 0 else np.nan
|
||||||
|
rows.append(r)
|
||||||
|
t5 = pd.DataFrame(rows)
|
||||||
|
t5.to_csv(out / "test_v.csv", index=False)
|
||||||
|
md.append("## Test v: retrained with budgets [250, 500] (ratios of cell-mean band RMSE; CI over realizations)\n")
|
||||||
|
md.append(sp13.md(t5[["regime", "c", "wide", "o500_pm500_ratio", "o500_pm500_lo", "o500_pm500_hi", "pm500_pm250_ratio", "pm500_pm250_lo",
|
||||||
|
"pm500_pm250_hi", "rml500_pm500_ratio", "rml500_pm500_lo", "rml500_pm500_hi", "o250_pm250_ratio", "o250_pm250_lo",
|
||||||
|
"o250_pm250_hi", "rml250_pm250_ratio", "rml250_pm250reg_ratio", "o500_pm250_ratio", "o500_pm250reg_ratio",
|
||||||
|
"gap_share_training_length"]]) + "\n")
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------- test i
|
||||||
|
rs = pd.concat([pd.read_csv(f) for f in sorted((out / "cells").glob("*_resp.csv"))], ignore_index=True)
|
||||||
|
rs["d_r"] = rs.E_r - rs.E_64
|
||||||
|
rs["d_r1024"] = rs.E_r - rs.E_1024
|
||||||
|
rs["d_win"] = rs.E_r_win - rs.E_64
|
||||||
|
rs["d_e"] = rs.ebar_r - rs.ebar_u
|
||||||
|
rows = []
|
||||||
|
for (regime, c, m, b), d in rs.groupby(["regime", "c", "method", "budget"]):
|
||||||
|
r = dict(regime=regime, c=c, n_train=16, wide=(regime, c) in WIDE16, method=m, lam=float(d.lam.iloc[0]), budget=b,
|
||||||
|
n_units=int(len(d)))
|
||||||
|
for q in ["d_r", "d_r1024", "d_win", "d_e"]:
|
||||||
|
pr = d.groupby("rid")[q].mean().to_numpy()
|
||||||
|
lo, hi = ci(rng, pr)
|
||||||
|
r |= {q: float(pr.mean()), f"{q}_lo": lo, f"{q}_hi": hi, f"share_{q}_neg": float((d[q] < 0).mean())}
|
||||||
|
r |= {k: float(d[k].mean()) for k in ["E_r", "E_r_win", "E_64", "E_1024", "ebar_r", "ebar_u", "S_eff", "entropy", "S_eff_win", "rmax_win"]}
|
||||||
|
r["cell_c"] = bool(r["share_d_r_neg"] > 0.5 and r["d_r_hi"] < 0)
|
||||||
|
rows.append(r)
|
||||||
|
t1 = pd.DataFrame(rows)
|
||||||
|
t1.to_csv(out / "test_i.csv", index=False)
|
||||||
|
v1 = {}
|
||||||
|
for m, d in t1[t1.wide & (t1.budget == B_PM)].groupby("method"):
|
||||||
|
v1[m] = {"cells_with_c": int(d.cell_c.sum()), "n_wide_cells": int(len(d)), "evidence_for_c": bool(d.cell_c.sum() >= 5)}
|
||||||
|
meta["test_i"] = v1
|
||||||
|
md.append("## Test i: responsibility-weighted warp error (ms) vs the uniform mean warp of the same 64 members\n")
|
||||||
|
md.append(sp13.md(t1[t1.budget == B_PM][["regime", "c", "wide", "method", "lam", "E_r", "E_64", "E_1024", "E_r_win", "d_r", "d_r_lo", "d_r_hi",
|
||||||
|
"share_d_r_neg", "d_r1024", "d_win", "d_e", "d_e_lo", "d_e_hi", "S_eff", "entropy", "S_eff_win",
|
||||||
|
"rmax_win", "cell_c"]]) + "\n")
|
||||||
|
md.append(f"Wide cells with (c) at budget 250: {v1}\n")
|
||||||
|
if (t1.budget == B_O).any():
|
||||||
|
md.append("M2-Sa at 500 iterations (descriptive):\n" + sp13.md(t1[t1.budget == B_O][["regime", "c", "d_r", "d_r_lo", "d_r_hi", "S_eff", "entropy"]]) + "\n")
|
||||||
|
|
||||||
|
# figures i, ii, v
|
||||||
|
fig, axes = plt.subplots(1, 3, figsize=(11, 3.4))
|
||||||
|
lab_cells = [f"{r} c={c:g}" for r, c in WIDE16 + NARROW16]
|
||||||
|
for ax, (m, title) in zip(axes, [("M2-Sa", "λ = 1/τ_c (protocol)"), ("M2-Sa@1", "λ = 1"), ("M2-Sa@3", "λ = 3")]):
|
||||||
|
d = t1[(t1.method == m) & (t1.budget == B_PM)].set_index(t1[(t1.method == m) & (t1.budget == B_PM)].apply(lambda r: f"{r.regime} c={r.c:g}", axis=1))
|
||||||
|
d = d.reindex([k for k in lab_cells if k in d.index])
|
||||||
|
y = np.arange(len(d))
|
||||||
|
ax.errorbar(d.d_r, y, xerr=[d.d_r - d.d_r_lo, d.d_r_hi - d.d_r], fmt="o", color=figstyle.BLUE, label="E_r − E_64")
|
||||||
|
ax.errorbar(d.d_r1024, y + 0.25, xerr=0, fmt="s", color=figstyle.ORANGE, ms=3, label="E_r − E_1024")
|
||||||
|
ax.axvline(0, color=figstyle.AXIS, lw=0.8)
|
||||||
|
ax.set_yticks(y)
|
||||||
|
ax.set_yticklabels(d.index, fontsize=7)
|
||||||
|
ax.set_title(title)
|
||||||
|
ax.set_xlabel("warp error difference (ms)")
|
||||||
|
axes[0].legend(loc="lower left")
|
||||||
|
fig.suptitle("Test i: responsibility-weighted warp vs uniform mean warp (95% CI over realizations)", fontsize=9)
|
||||||
|
fig.tight_layout()
|
||||||
|
fig.savefig(fig_dir / "t2_i_responsibility.pdf")
|
||||||
|
plt.close(fig)
|
||||||
|
|
||||||
|
fig, ax = plt.subplots(figsize=(6.5, 3.6))
|
||||||
|
d = t2.set_index(t2.apply(lambda r: f"{r.regime} c={r.c:g}", axis=1)).reindex(lab_cells)
|
||||||
|
x = np.arange(len(d))
|
||||||
|
ax.errorbar(x - 0.15, d.rml_pm_ratio, yerr=[d.rml_pm_ratio - d.rml_pm_lo, d.rml_pm_hi - d.rml_pm_ratio], fmt="o", color=figstyle.BLUE, label="M2-Sa / B3d-Sa (registered)")
|
||||||
|
ax.errorbar(x + 0.15, d.ctl_pm_ratio, yerr=[d.ctl_pm_ratio - d.ctl_pm_lo, d.ctl_pm_hi - d.ctl_pm_ratio], fmt="s", color=figstyle.ORANGE, label="Control bank / B3d-Sa")
|
||||||
|
ax.axhline(1, color=figstyle.AXIS, lw=0.8)
|
||||||
|
ax.set_xticks(x)
|
||||||
|
ax.set_xticklabels(d.index, rotation=45, ha="right", fontsize=7)
|
||||||
|
ax.set_ylabel("band RMSE ratio")
|
||||||
|
ax.set_title("Test ii: GP-noise control bank (N = 16; 95% CI over realizations)")
|
||||||
|
ax.legend()
|
||||||
|
fig.tight_layout()
|
||||||
|
fig.savefig(fig_dir / "t2_ii_control.pdf")
|
||||||
|
plt.close(fig)
|
||||||
|
|
||||||
|
fig, ax = plt.subplots(figsize=(6.5, 3.6))
|
||||||
|
d = t5.set_index(t5.apply(lambda r: f"{r.regime} c={r.c:g}", axis=1)).reindex(lab_cells)
|
||||||
|
for k, off, col, lab, mk in [("o500_pm250", -0.2, figstyle.BLUE, "Oracle(500) / B3d-Sa(250)", "o"), ("o500_pm500", 0.0, figstyle.ORANGE, "Oracle(500) / B3d-Sa(500)", "s"),
|
||||||
|
("rml500_pm500", 0.2, figstyle.AQUA, "M2-Sa(500) / B3d-Sa(500)", "^")]:
|
||||||
|
ax.errorbar(x + off, d[f"{k}_ratio"], yerr=[d[f"{k}_ratio"] - d[f"{k}_lo"], d[f"{k}_hi"] - d[f"{k}_ratio"]], fmt=mk, color=col, label=lab, ms=4)
|
||||||
|
ax.axhline(1, color=figstyle.AXIS, lw=0.8)
|
||||||
|
ax.set_xticks(x)
|
||||||
|
ax.set_xticklabels(d.index, rotation=45, ha="right", fontsize=7)
|
||||||
|
ax.set_ylabel("band RMSE ratio")
|
||||||
|
ax.set_title("Test v: training length vs label error (retrained; 95% CI over realizations)")
|
||||||
|
ax.legend(fontsize=7)
|
||||||
|
fig.tight_layout()
|
||||||
|
fig.savefig(fig_dir / "t2_v_budget.pdf")
|
||||||
|
plt.close(fig)
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------- test iii
|
||||||
|
f3 = sorted((out / "iii").glob("*.csv"))
|
||||||
|
if f3:
|
||||||
|
m3 = pd.concat([pd.read_csv(f) for f in f3], ignore_index=True)
|
||||||
|
share = m3.groupby(["regime", "c", "n_train", "rid"]).agg(m_u=("a_multimodal", "mean"), m_u_b=("b_multimodal", "mean"),
|
||||||
|
sd_a_ms=("a_sd_ms", "mean"), n_wells=("well", "size")).reset_index()
|
||||||
|
share.to_csv(out / "test_iii_units.csv", index=False)
|
||||||
|
cell_share = share.groupby(["regime", "c", "n_train"]).agg(m_u=("m_u", "mean"), m_u_b=("m_u_b", "mean"), units_multimodal=("m_u", lambda s: int((s >= 0.25).sum())),
|
||||||
|
units_any=("m_u", lambda s: int((s > 0).sum())), sd_a_ms=("sd_a_ms", "mean")).reset_index()
|
||||||
|
rows, groups = [], None
|
||||||
|
if have_train:
|
||||||
|
reg_w = registered_cells([(r, c, 16) for r, c in WIDE16])
|
||||||
|
u = reg_w[reg_w.method.isin(["M2-Sa", "B3d-Sa"])].groupby(["regime", "c", "rid", "method"]).band_rmse.mean().unstack("method")
|
||||||
|
u["log_ratio"] = np.log(u["M2-Sa"] / u["B3d-Sa"])
|
||||||
|
u = u.reset_index().merge(share[share.n_train == 16], on=["regime", "c", "rid"])
|
||||||
|
u.to_csv(out / "test_iii_wide_units.csv", index=False)
|
||||||
|
|
||||||
|
def D_stats(u, thr):
|
||||||
|
u = u.assign(grp=(u.m_u >= thr) if thr > 0 else (u.m_u > 0))
|
||||||
|
g1, g0 = u[u.grp], u[~u.grp]
|
||||||
|
res = {"n_multi": int(len(g1)), "n_uni": int(len(g0)),
|
||||||
|
"D_unadj": float(g1.log_ratio.mean() - g0.log_ratio.mean()) if len(g1) and len(g0) else np.nan}
|
||||||
|
both = [k for k, d in u.groupby(["regime", "c"]) if d.grp.any() and (~d.grp).any()]
|
||||||
|
res["cells_with_both_groups"] = len(both)
|
||||||
|
|
||||||
|
def adj(u):
|
||||||
|
num = den = 0.0
|
||||||
|
for k, d in u.groupby(["regime", "c"]):
|
||||||
|
a, b = d[d.grp], d[~d.grp]
|
||||||
|
if len(a) and len(b):
|
||||||
|
w = len(a) * len(b) / (len(a) + len(b))
|
||||||
|
num += w * (a.log_ratio.mean() - b.log_ratio.mean())
|
||||||
|
den += w
|
||||||
|
return num / den if den > 0 else np.nan
|
||||||
|
|
||||||
|
res["D_adj"] = float(adj(u))
|
||||||
|
boots_u, boots_a = [], []
|
||||||
|
for _ in range(N_BOOT):
|
||||||
|
ub = pd.concat([d.iloc[rng.integers(0, len(d), len(d))] for _, d in u.groupby(["regime", "c"])])
|
||||||
|
a1, a0 = ub[ub.grp], ub[~ub.grp]
|
||||||
|
boots_u.append(a1.log_ratio.mean() - a0.log_ratio.mean() if len(a1) and len(a0) else np.nan)
|
||||||
|
boots_a.append(adj(ub))
|
||||||
|
res["D_unadj_lo"], res["D_unadj_hi"] = [float(v) for v in np.nanpercentile(boots_u, [2.5, 97.5])] if np.isfinite(boots_u).any() else (np.nan, np.nan)
|
||||||
|
res["D_adj_lo"], res["D_adj_hi"] = [float(v) for v in np.nanpercentile(boots_a, [2.5, 97.5])] if np.isfinite(boots_a).any() else (np.nan, np.nan)
|
||||||
|
from scipy import stats
|
||||||
|
res["spearman_mu_logratio"] = float(stats.spearmanr(u.m_u, u.log_ratio)[0]) if u.m_u.std() > 0 else np.nan
|
||||||
|
if np.isnan(res["D_adj"]):
|
||||||
|
res["verdict"] = "confounded with cell (no cell has both groups)" if res["n_multi"] else "no multimodal unit: (b) not testable"
|
||||||
|
elif res["D_adj_hi"] < 0:
|
||||||
|
res["verdict"] = "evidence for (b)"
|
||||||
|
else:
|
||||||
|
res["verdict"] = "no evidence for (b)"
|
||||||
|
return res
|
||||||
|
|
||||||
|
groups = {"thr0.25": D_stats(u, 0.25), "any": D_stats(u, 0.0)}
|
||||||
|
within = [{"regime": k[0], "c": k[1], "spearman": float(__import__("scipy").stats.spearmanr(d.m_u, d.log_ratio)[0]) if d.m_u.std() > 0 else np.nan,
|
||||||
|
"n_multi_0.25": int((d.m_u >= 0.25).sum()), "n_any": int((d.m_u > 0).sum())} for k, d in u.groupby(["regime", "c"])]
|
||||||
|
pd.DataFrame(within).to_csv(out / "test_iii_within_cells.csv", index=False)
|
||||||
|
meta["test_iii"] = groups
|
||||||
|
cell_share.to_csv(out / "test_iii.csv", index=False)
|
||||||
|
md.append("## Test iii: posterior multimodality (GMM on the window offset; ΔBIC > 10, separation > 4 ms, min weight ≥ 0.1)\n")
|
||||||
|
md.append(sp13.md(cell_share) + "\n")
|
||||||
|
if groups:
|
||||||
|
md.append("Wide cells, N = 16, M2-Sa/B3d-Sa log-ratio of multimodal minus unimodal units:\n")
|
||||||
|
md.append(sp13.md(pd.DataFrame(groups).T.reset_index().rename(columns={"index": "grouping"})) + "\n")
|
||||||
|
fig, ax = plt.subplots(figsize=(5.5, 3.4))
|
||||||
|
if have_train and groups:
|
||||||
|
for (regime, c), d in u.groupby(["regime", "c"]):
|
||||||
|
ax.scatter(d.m_u + rng.normal(0, 0.005, len(d)), d.log_ratio, s=14, label=f"{regime} c={c:g}")
|
||||||
|
ax.axhline(0, color=figstyle.AXIS, lw=0.8)
|
||||||
|
ax.set_xlabel("share of multimodal training wells in the unit")
|
||||||
|
ax.set_ylabel("log(band RMSE M2-Sa / B3d-Sa)")
|
||||||
|
ax.set_title("Test iii: gain vs posterior multimodality (wide cells, N = 16)")
|
||||||
|
ax.legend(fontsize=6, ncol=2)
|
||||||
|
fig.tight_layout()
|
||||||
|
fig.savefig(fig_dir / "t2_iii_multimodal.pdf")
|
||||||
|
plt.close(fig)
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------- test iv
|
||||||
|
f4 = sorted((out / "iv").glob("*.csv"))
|
||||||
|
if f4:
|
||||||
|
m4 = pd.concat([pd.read_csv(f) for f in f4], ignore_index=True)
|
||||||
|
for m in ["B3d-Sa", "B3c-R"]:
|
||||||
|
m4[f"e_{m}"] = m4[f"a_{m}"] - m4["a_true"]
|
||||||
|
m4[f"ah_{m}"] = m4[f"a_{m}"] - m4["a_B3b"]
|
||||||
|
m4["at_anch"] = m4["a_true"] - m4["a_B3b"]
|
||||||
|
rows = []
|
||||||
|
cells = [(r, c, n) for (r, c, n), _ in m4.groupby(["regime", "c", "n_train"])] + [("all", 1.0, 0), ("wide16", 1.0, 16)]
|
||||||
|
for regime, c, N in cells:
|
||||||
|
if regime == "all":
|
||||||
|
d = m4[m4.c == c]
|
||||||
|
elif regime == "wide16":
|
||||||
|
d = m4[(m4.n_train == 16) & (m4.c == 1.0) & m4.regime.isin([r for r, cc in WIDE16 if cc == 1.0])]
|
||||||
|
else:
|
||||||
|
d = m4[(m4.regime == regime) & (m4.c == c) & (m4.n_train == N)]
|
||||||
|
for m in ["B3d-Sa", "B3c-R"]:
|
||||||
|
r = dict(regime=regime, c=c, n_train=N, method=m, n_wells=int(len(d)),
|
||||||
|
sd_e_ms=float(d[f"e_{m}"].std()), sd_atrue_ms=float(d.a_true.std()), sd_atrue_anch_ms=float(d.at_anch.std()),
|
||||||
|
rmse_e_ms=float(np.sqrt((d[f"e_{m}"] ** 2).mean())))
|
||||||
|
rC, rB = cluster_corr(rng, d, f"e_{m}", "a_true"), cluster_corr(rng, d, f"e_{m}", f"a_{m}")
|
||||||
|
rCa, rBa = cluster_corr(rng, d, f"e_{m}", "at_anch"), cluster_corr(rng, d, f"e_{m}", f"ah_{m}")
|
||||||
|
r |= {f"raw_rC_{k}": v for k, v in rC.items() if k != "n"} | {f"raw_rB_{k}": v for k, v in rB.items() if k != "n"}
|
||||||
|
r |= {f"anch_rC_{k}": v for k, v in rCa.items() if k != "n"} | {f"anch_rB_{k}": v for k, v in rBa.items() if k != "n"}
|
||||||
|
r["raw_var_ratio"] = float(d[f"a_{m}"].var() / d.a_true.var()) if d.a_true.var() > 0 else np.nan
|
||||||
|
r["anch_var_ratio"] = float(d[f"ah_{m}"].var() / d.at_anch.var()) if d.at_anch.var() > 0 else np.nan
|
||||||
|
r["verdict_anch"] = verdict_iv(rBa, rCa) if c > 0 else "not used (c = 0)"
|
||||||
|
r["verdict_raw"] = verdict_iv(rB, rC) if c > 0 else "not used (c = 0)"
|
||||||
|
rows.append(r)
|
||||||
|
t4 = pd.DataFrame(rows)
|
||||||
|
# per-sample sensitivity (node-wise offsets) for the N = 16 cells and the pooled c = 1 set
|
||||||
|
srows = []
|
||||||
|
for regime, c, N in [(r, c, n) for r, c, n in ALL_CELLS if n == 16]:
|
||||||
|
parts = []
|
||||||
|
for rid in RIDS:
|
||||||
|
f = out / "iv" / f"{tag(regime, rid, c, N)}.npz"
|
||||||
|
if not f.exists():
|
||||||
|
continue
|
||||||
|
with np.load(f) as z:
|
||||||
|
wells = sorted({k.split("/")[0] for k in z.files})
|
||||||
|
for w in wells:
|
||||||
|
parts.append(pd.DataFrame({"rid": rid, "true": z[f"{w}/true"], "B3b": z[f"{w}/B3b"], "B3d-Sa": z[f"{w}/B3d-Sa"], "B3c-R": z[f"{w}/B3c-R"]}))
|
||||||
|
if not parts:
|
||||||
|
continue
|
||||||
|
d = pd.concat(parts, ignore_index=True)
|
||||||
|
for m in ["B3d-Sa", "B3c-R"]:
|
||||||
|
d["e"], d["ah"], d["at"] = d[m] - d["true"], d[m] - d["B3b"], d["true"] - d["B3b"]
|
||||||
|
rC, rB = cluster_corr(rng, d, "e", "true"), cluster_corr(rng, d, "e", m)
|
||||||
|
rCa, rBa = cluster_corr(rng, d, "e", "at"), cluster_corr(rng, d, "e", "ah")
|
||||||
|
srows.append(dict(regime=regime, c=c, n_train=N, method=m, n_samples=int(len(d)),
|
||||||
|
**{f"raw_rC_{k}": v for k, v in rC.items() if k != "n"}, **{f"raw_rB_{k}": v for k, v in rB.items() if k != "n"},
|
||||||
|
**{f"anch_rC_{k}": v for k, v in rCa.items() if k != "n"}, **{f"anch_rB_{k}": v for k, v in rBa.items() if k != "n"},
|
||||||
|
verdict_anch=verdict_iv(rBa, rCa) if c > 0 else "not used (c = 0)",
|
||||||
|
verdict_raw=verdict_iv(rB, rC) if c > 0 else "not used (c = 0)"))
|
||||||
|
t4s = pd.DataFrame(srows)
|
||||||
|
t4.to_csv(out / "test_iv.csv", index=False)
|
||||||
|
t4s.to_csv(out / "test_iv_persample.csv", index=False)
|
||||||
|
key_cells = t4[(t4.c == 1.0) & (t4.n_train == 16) | (t4.regime == "all") | (t4.regime == "wide16")]
|
||||||
|
meta["test_iv"] = {f"{r.regime} c={r.c:g} N={r.n_train} {r.method}": {"anchored": r.verdict_anch, "raw": r.verdict_raw}
|
||||||
|
for r in key_cells.itertuples()}
|
||||||
|
md.append("## Test iv: Berkson vs classical (window offset; cluster bootstrap over realizations). anch = anchored to B3b (primary)\n")
|
||||||
|
md.append(sp13.md(t4[["regime", "c", "n_train", "method", "n_wells", "sd_e_ms", "sd_atrue_ms", "sd_atrue_anch_ms", "anch_rB_r", "anch_rB_lo", "anch_rB_hi",
|
||||||
|
"anch_rC_r", "anch_rC_lo", "anch_rC_hi", "anch_var_ratio", "verdict_anch", "raw_rB_r", "raw_rB_lo", "raw_rB_hi", "raw_rC_r",
|
||||||
|
"raw_rC_lo", "raw_rC_hi", "raw_var_ratio", "verdict_raw"]]) + "\n")
|
||||||
|
md.append("Per-sample sensitivity (node-wise offsets, N = 16):\n")
|
||||||
|
md.append(sp13.md(t4s[["regime", "c", "method", "n_samples", "anch_rB_r", "anch_rB_lo", "anch_rB_hi", "anch_rC_r", "anch_rC_lo", "anch_rC_hi", "verdict_anch",
|
||||||
|
"raw_rB_r", "raw_rC_r", "verdict_raw"]]) + "\n")
|
||||||
|
fig, axes = plt.subplots(1, 2, figsize=(9, 3.6), sharey=True)
|
||||||
|
d16 = t4[(t4.n_train == 16) & (t4.c > 0) & ~t4.regime.isin(["all", "wide16"])]
|
||||||
|
for ax, m in zip(axes, ["B3d-Sa", "B3c-R"]):
|
||||||
|
d = d16[d16.method == m]
|
||||||
|
labels = [f"{r} c={c:g}" for r, c in zip(d.regime, d.c)]
|
||||||
|
y = np.arange(len(d))
|
||||||
|
ax.errorbar(d.anch_rB_r, y - 0.15, xerr=[d.anch_rB_r - d.anch_rB_lo, d.anch_rB_hi - d.anch_rB_r], fmt="o", color=figstyle.BLUE, label="corr(e, â′): 0 under Berkson")
|
||||||
|
ax.errorbar(d.anch_rC_r, y + 0.15, xerr=[d.anch_rC_r - d.anch_rC_lo, d.anch_rC_hi - d.anch_rC_r], fmt="s", color=figstyle.ORANGE, label="corr(e, a*′): 0 under classical")
|
||||||
|
ax.axvline(0, color=figstyle.AXIS, lw=0.8)
|
||||||
|
ax.set_yticks(y)
|
||||||
|
ax.set_yticklabels(labels, fontsize=7)
|
||||||
|
ax.set_title(m)
|
||||||
|
ax.set_xlabel("correlation (anchored offsets)")
|
||||||
|
axes[0].legend(fontsize=7, loc="lower left")
|
||||||
|
fig.suptitle("Test iv: error structure of the window offset (N = 16; 95% cluster-bootstrap CI)", fontsize=9)
|
||||||
|
fig.tight_layout()
|
||||||
|
fig.savefig(fig_dir / "t2_iv_covariance.pdf")
|
||||||
|
plt.close(fig)
|
||||||
|
|
||||||
|
(out / "meta.json").write_text(json.dumps(meta, indent=1, default=float))
|
||||||
|
(out / "summary.md").write_text("\n".join(md))
|
||||||
|
print("\n".join(md))
|
||||||
|
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
def main() -> None:
|
||||||
|
ap = argparse.ArgumentParser()
|
||||||
|
ap.add_argument("--tests", nargs="+", default=["i", "ii", "iii", "iv", "v", "summary"],
|
||||||
|
choices=["i", "ii", "iii", "iv", "v", "summary"])
|
||||||
|
ap.add_argument("--device", default="cuda:0")
|
||||||
|
ap.add_argument("--workers", type=int, default=4)
|
||||||
|
ap.add_argument("--out-dir", type=Path, default=None, help="default: outputs/t2")
|
||||||
|
ap.add_argument("--seeds", type=int, nargs="+", default=SEEDS)
|
||||||
|
ap.add_argument("--cells", nargs="+", default=None, help="restrict the training stage to these cell tags (regime_c), e.g. R0_1")
|
||||||
|
ap.add_argument("--rids", type=int, nargs="+", default=RIDS)
|
||||||
|
args = ap.parse_args()
|
||||||
|
for k, v in {"OMP_NUM_THREADS": "2", "MKL_NUM_THREADS": "2", "OPENBLAS_NUM_THREADS": "2", "NUMBA_NUM_THREADS": "2",
|
||||||
|
"NUMEXPR_NUM_THREADS": "2"}.items():
|
||||||
|
os.environ.setdefault(k, v)
|
||||||
|
out = args.out_dir or outputs_dir() / "t2"
|
||||||
|
for sub in ("cells", "iii", "iv", "figures"):
|
||||||
|
(out / sub).mkdir(parents=True, exist_ok=True)
|
||||||
|
P = run_d2.load_protocol(check=True)
|
||||||
|
if run_d2.check_rids(RIDS, P) is None:
|
||||||
|
raise SystemExit("protocol_p2r main grid expected")
|
||||||
|
print("protocol_p2 and protocol_p2r (with inputs) match their locked SHA-256", flush=True)
|
||||||
|
|
||||||
|
jobs, fn, workers = [], None, args.workers
|
||||||
|
if {"i", "ii", "v"} & set(args.tests):
|
||||||
|
cells = TRAIN_CELLS if args.cells is None else [(r, c, n) for r, c, n in TRAIN_CELLS if f"{r}_{c:g}" in args.cells]
|
||||||
|
for regime, c, N in cells:
|
||||||
|
for rid in args.rids:
|
||||||
|
if not (out / "cells" / f"{tag(regime, rid, c, N)}.csv").exists():
|
||||||
|
jobs.append((regime, rid, c, N, args.seeds, args.device, out / "cells", P))
|
||||||
|
fn = train_job
|
||||||
|
elif {"iii", "iv"} & set(args.tests):
|
||||||
|
for regime, c, N in ALL_CELLS:
|
||||||
|
for rid in args.rids:
|
||||||
|
if not ((out / "iii" / f"{tag(regime, rid, c, N)}.csv").exists() and (out / "iv" / f"{tag(regime, rid, c, N)}.csv").exists()):
|
||||||
|
jobs.append((regime, rid, c, N, out, P))
|
||||||
|
fn = particle_job
|
||||||
|
if fn is not None:
|
||||||
|
print(f"{len(jobs)} jobs, {workers} workers, device {args.device}", flush=True)
|
||||||
|
t0 = time.time()
|
||||||
|
if jobs:
|
||||||
|
with ProcessPoolExecutor(workers, mp_context=get_context("spawn")) as ex:
|
||||||
|
futs = {ex.submit(fn, j): j[:4] for j in jobs}
|
||||||
|
for i, f in enumerate(as_completed(futs), 1):
|
||||||
|
stem, dt = f.result()
|
||||||
|
print(f"[{i}/{len(jobs)}] {stem} done ({dt:.0f} s; total {time.time() - t0:.0f} s)", flush=True)
|
||||||
|
if "summary" in args.tests:
|
||||||
|
summarize(out, args.device)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
os.environ.setdefault("PYTHONHASHSEED", "0")
|
||||||
|
main()
|
||||||
496
scripts/33_bench_generator_qc.py
Normal file
496
scripts/33_bench_generator_qc.py
Normal file
@@ -0,0 +1,496 @@
|
|||||||
|
"""Generator QC for the S2 misspecification presets (phase P6, item p6-gen; CPU only, about one minute).
|
||||||
|
|
||||||
|
For one dev realization (default 902) and every preset of configs/d2_synth_bench.yaml, quantify what the preset changes
|
||||||
|
relative to the nominal generator (common random numbers, so every difference is the misspecification itself):
|
||||||
|
|
||||||
|
rock physics relative RMS change of the clean seismic and of the true AI log (main window), per-unit shifts;
|
||||||
|
wavelet stationary true wavelet vs nominal: best constant-phase fit (1° grid) and its correlation, peak
|
||||||
|
frequency, 90 % power band; for constant Q the effective wavelet at 600 / 850 / 1100 ms;
|
||||||
|
drift RMS and maximum of t_true,misspec − t_true,nominal over the main window, achieved jump at the step
|
||||||
|
horizon, jitter RMS, monotone repairs; anchor-only Laplace tie (MAP-II hyperparameters as in
|
||||||
|
protocol_p2, N = 4, c = 1, σ_a = 7 ms) warp RMSE against the truth;
|
||||||
|
all axes model error seen by the registration at the TRUE warp: RMS of (seismic predicted by the nominal
|
||||||
|
forward model − actual clean seismic) relative to the signal RMS, after the profiled amplitude α,
|
||||||
|
(i) with the nominal F3 wavelet and (ii) with the best member of the registration's wavelet family
|
||||||
|
(statistical wavelet from the clean train traces + constant phase on the 15° grid), as SNR-equivalent
|
||||||
|
dB next to the regime noise levels (R10: 10 dB, Rm5: −5 dB).
|
||||||
|
|
||||||
|
Outputs: <out>/generator_qc.json and <out>/generator_qc.png (default outputs/bench/dev/). Dev realizations only.
|
||||||
|
|
||||||
|
CUDA_VISIBLE_DEVICES= OMP_NUM_THREADS=4 .venv/bin/python scripts/33_bench_generator_qc.py --rid 902 [--sweep]
|
||||||
|
|
||||||
|
--smc (GPU, or --device cpu as a fallback when the GPUs are full): the registration itself for every preset, as in protocol_p2r (pipeline.register → statistical wavelet,
|
||||||
|
MAP-II hyperparameters, B3c/B3d ties; SMC tie posterior with the phase_R wavelet, γ = 1/κ, P particles) on the first
|
||||||
|
N train wells at the given regimes, c = 1. Reports phase_R, SMC warp RMSE / 90 % coverage / width, posterior residual
|
||||||
|
correlation and the B3c/B3d warp RMSE per preset → <out>/smc_qc_rid<rid>.json. One worker; about 1–3 min per cell.
|
||||||
|
|
||||||
|
OMP_NUM_THREADS=4 .venv/bin/python scripts/33_bench_generator_qc.py --rid 902 --skip-qc --smc --device cuda:1 \
|
||||||
|
--regimes R10 Rm5 --n-train 4 --particles 1024
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import argparse
|
||||||
|
import datetime as dt
|
||||||
|
import hashlib
|
||||||
|
import importlib.util
|
||||||
|
import json
|
||||||
|
import platform
|
||||||
|
import sys
|
||||||
|
import time
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
import numpy as np
|
||||||
|
import scipy
|
||||||
|
import yaml
|
||||||
|
|
||||||
|
REPO_ROOT = Path(__file__).resolve().parents[1]
|
||||||
|
sys.path.insert(0, str(REPO_ROOT))
|
||||||
|
|
||||||
|
from ml_porosity.data.synth_d2 import D2Realization, load_horizon_grid, preset_misspec # noqa: E402
|
||||||
|
from ml_porosity.data.wavelet import rotate_phase, statistical_wavelet # noqa: E402
|
||||||
|
from ml_porosity.registration.pipeline import PHASES, fit_cell_hyper # noqa: E402
|
||||||
|
from ml_porosity.registration.tie_likelihood import fine_wavelet, synth_for_warps # noqa: E402
|
||||||
|
from ml_porosity.registration.ties import warp_errors # noqa: E402
|
||||||
|
from ml_porosity.registration.warp_prior import WarpHyper, laplace_posterior # noqa: E402
|
||||||
|
|
||||||
|
DEV_RIDS = (902, 903, 904, 905)
|
||||||
|
C, SIGMA_A, N_LAPLACE = 1.0, 7.0, 4
|
||||||
|
NOISE_REL = {"R10": 10 ** (-10 / 20), "Rm5": 10 ** (5 / 20)} # noise RMS / signal RMS at the regime SNR
|
||||||
|
PALETTE = {"nominal": "#52514e", "rp": "#2a78d6", "wv": "#eb6834", "dr": "#1baf7a"}
|
||||||
|
SERIES = ["#2a78d6", "#eb6834", "#1baf7a", "#eda100"]
|
||||||
|
|
||||||
|
|
||||||
|
def sha256(p: Path) -> str:
|
||||||
|
return hashlib.sha256(p.read_bytes()).hexdigest()
|
||||||
|
|
||||||
|
|
||||||
|
def rel_rms(a: np.ndarray, ref: np.ndarray) -> float:
|
||||||
|
return float(np.sqrt(np.mean((a - ref) ** 2)) / np.sqrt(np.mean(ref ** 2)))
|
||||||
|
|
||||||
|
|
||||||
|
def snr_db(rel: float) -> float:
|
||||||
|
return float(-20.0 * np.log10(max(rel, 1e-12)))
|
||||||
|
|
||||||
|
|
||||||
|
def wavelet_stats(w: np.ndarray, dt_ms: float, w_ref: np.ndarray) -> dict:
|
||||||
|
"""Peak frequency, 90 % power band and the best constant-phase fit of w_ref to w (1° grid)."""
|
||||||
|
f = np.fft.rfftfreq(8192, dt_ms / 1000.0)
|
||||||
|
p = np.abs(np.fft.rfft(w, 8192)) ** 2
|
||||||
|
cum = np.cumsum(p) / p.sum()
|
||||||
|
if len(w_ref) != len(w): # centre-pad the shorter one (Q kernels are longer than the wavelet)
|
||||||
|
n = max(len(w), len(w_ref))
|
||||||
|
pad = lambda v: np.pad(v, ((n - len(v)) // 2, (n - len(v)) // 2))
|
||||||
|
w, w_ref = pad(w), pad(w_ref)
|
||||||
|
phases = np.arange(-180.0, 180.0, 1.0)
|
||||||
|
cc = np.array([np.corrcoef(rotate_phase(w_ref, ph), w)[0, 1] for ph in phases])
|
||||||
|
k = int(np.argmax(cc))
|
||||||
|
return {"peak_hz": float(f[np.argmax(p)]), "f05_hz": float(f[np.searchsorted(cum, 0.05)]),
|
||||||
|
"f95_hz": float(f[np.searchsorted(cum, 0.95)]), "best_const_phase_deg": float(phases[k]),
|
||||||
|
"corr_at_best_phase": float(cc[k]), "resid_after_best_phase": float(np.sqrt(max(0.0, 1 - cc[k] ** 2)))}
|
||||||
|
|
||||||
|
|
||||||
|
def model_errors(R, obs: list[dict], w_fine: np.ndarray) -> np.ndarray:
|
||||||
|
"""Per well: relative RMS of (clean centre trace − α·synthetic) at the true warp, α ≥ 0 profiled."""
|
||||||
|
out = []
|
||||||
|
for o in obs:
|
||||||
|
s = o["seis"][o["seis"].shape[0] // 2].astype(float)
|
||||||
|
syn = synth_for_warps(R.tau_fine, o["ai_log"], o["t_of_tau_true"], R.t_fine, R.t_ext, w_fine)[0]
|
||||||
|
a = max(float(syn @ s / max(syn @ syn, 1e-30)), 0.0)
|
||||||
|
out.append(rel_rms(a * syn, s))
|
||||||
|
return np.array(out)
|
||||||
|
|
||||||
|
|
||||||
|
def in_family_error(R, obs: list[dict], wavelet_ms: float) -> dict:
|
||||||
|
"""Best member of the registration's wavelet family at the true warp: statistical wavelet from the clean train
|
||||||
|
traces, constant phase on the 15° grid chosen as in pipeline.register (maximal profiled likelihood summed over
|
||||||
|
wells), then the per-well model error."""
|
||||||
|
fac = int(round(R.dt / R.cfg["fine_dt_ms"]))
|
||||||
|
seis = np.stack([o["seis"][o["seis"].shape[0] // 2].astype(float) for o in obs])
|
||||||
|
w0 = statistical_wavelet(seis, R.dt, wavelet_ms)
|
||||||
|
errs = {float(ph): model_errors(R, obs, fine_wavelet(rotate_phase(w0, ph), fac)) for ph in PHASES}
|
||||||
|
score = {ph: -0.5 * len(R.t_ext) * np.sum(np.log(e ** 2)) for ph, e in errs.items()}
|
||||||
|
best = max(score, key=score.get)
|
||||||
|
e = errs[best]
|
||||||
|
return {"phase_deg": best, "err_mean": float(e.mean()), "err_min": float(e.min()), "err_max": float(e.max()),
|
||||||
|
"snr_equiv_db": snr_db(float(e.mean())), "statistical_wavelet": wavelet_stats(w0, R.dt, R.wavelet_nominal)}
|
||||||
|
|
||||||
|
|
||||||
|
def laplace_tie(R, obs: list[dict], reg: dict) -> dict:
|
||||||
|
"""Anchor-only tie under the registration's prior (MAP-II for m_g, σ_g, ℓ; σ_a, σ_b fixed): Laplace mean warp
|
||||||
|
RMSE against the truth over the main window, per well."""
|
||||||
|
h, info = fit_cell_hyper(R, obs, reg, seed=0)
|
||||||
|
rmse, z = [], []
|
||||||
|
for o in obs:
|
||||||
|
mu, S, _, _ = laplace_posterior(R.grid, h, o["tau_k"], o["t_k"] - o["tau_k"])
|
||||||
|
T = R.grid.t_of_tau(mu[0], mu[1:], tau=R.tau_fine)
|
||||||
|
rmse.append(warp_errors(T, R.tau_fine, o["t_of_tau_true"], R.t_main)["warp_rmse_ms"])
|
||||||
|
# standardised error of the warp on the grid nodes inside the main window (posterior sd from S)
|
||||||
|
sel = (R.grid.tau >= R.t_main[0]) & (R.grid.tau <= R.t_main[-1])
|
||||||
|
A = np.hstack([np.ones((R.grid.n, 1)), R.grid.Q]) # linearised t(τ) − τ ≈ A u on the grid
|
||||||
|
sd = np.sqrt(np.maximum(np.einsum("ij,jk,ik->i", A, S, A), 1e-12))
|
||||||
|
t_true = R.true_warp_grid(next(w for w in R.wells if w.name == o["name"]), C)
|
||||||
|
z.append(float(np.sqrt(np.mean(((R.grid.t_of_tau(mu[0], mu[1:])[0] - t_true) / sd)[sel] ** 2))))
|
||||||
|
return {"hyper_fit": h.as_dict(), "log_marginal": float(info["log_marginal"]), "at_bound": info["at_bound"],
|
||||||
|
"warp_rmse_ms_mean": float(np.mean(rmse)), "warp_rmse_ms_max": float(np.max(rmse)),
|
||||||
|
"z_rms_mean": float(np.mean(z))}
|
||||||
|
|
||||||
|
|
||||||
|
def qc_preset(R, R0, reg: dict, wavelet_ms: float) -> dict:
|
||||||
|
obs = [R.observe(w, C, None, SIGMA_A) for w in R.pool]
|
||||||
|
obs0 = [R0.observe(w, C, None, SIGMA_A) for w in R0.pool]
|
||||||
|
main_tau = (R.tau_fine >= R.t_main[0]) & (R.tau_fine <= R.t_main[-1])
|
||||||
|
out = {"active": R.misspec_active, "misspec_info": R.misspec_info}
|
||||||
|
# seismic and model error (all axes)
|
||||||
|
out["seis_rel_change_main"] = float(np.mean([rel_rms(o["seis"][4][R.main], o0["seis"][4][R.main])
|
||||||
|
for o, o0 in zip(obs, obs0)]))
|
||||||
|
e_nom = model_errors(R, obs, R.w_fine_nominal)
|
||||||
|
out["model_err_nominal_wavelet"] = {"err_mean": float(e_nom.mean()), "err_max": float(e_nom.max()),
|
||||||
|
"snr_equiv_db": snr_db(float(e_nom.mean()))}
|
||||||
|
out["model_err_in_family"] = in_family_error(R, obs, wavelet_ms)
|
||||||
|
# rock physics
|
||||||
|
if "rock_physics" in R.misspec_active:
|
||||||
|
ai_rel, lnai = [], []
|
||||||
|
for w, o in zip(R.pool, obs):
|
||||||
|
ai_t = R.ai_log_true(w, o)
|
||||||
|
ai_rel.append(rel_rms(ai_t[main_tau], o["ai_log"][main_tau]))
|
||||||
|
lnai.append(float(np.sqrt(np.mean((np.log(ai_t) - np.log(o["ai_log"]))[main_tau] ** 2))))
|
||||||
|
out["rock_physics"] = {"ai_rel_rms_change_main": float(np.mean(ai_rel)), "ln_ai_rms_change_main": float(np.mean(lnai)),
|
||||||
|
"unit_dt_intercept_shift": None if R.unit_dt_shift is None else
|
||||||
|
[float(v) for v in R.unit_dt_shift]}
|
||||||
|
# wavelet
|
||||||
|
if "wavelet" in R.misspec_active:
|
||||||
|
d = R.cfg["fine_dt_ms"]
|
||||||
|
wv = {"stationary": wavelet_stats(R.w_fine, d, R.w_fine_nominal)}
|
||||||
|
if R.misspec["wavelet"]["Q"] is not None:
|
||||||
|
wv["Q_at_t"] = {str(int(t)): wavelet_stats(R.true_wavelet_at(t), d, R.w_fine_nominal) for t in (600, 850, 1100)}
|
||||||
|
out["wavelet"] = wv
|
||||||
|
# drift
|
||||||
|
if "drift" in R.misspec_active:
|
||||||
|
dr = R.misspec["drift"]
|
||||||
|
diff = np.array([o["t_of_tau_true"] - o0["t_of_tau_true"] for o, o0 in zip(obs, obs0)])
|
||||||
|
tau_main = (R.tau_fine >= 600) & (R.tau_fine <= 1100)
|
||||||
|
d = {"warp_diff_rms_main_ms": float(np.sqrt(np.mean(diff[:, tau_main] ** 2))),
|
||||||
|
"warp_diff_max_ms": float(np.abs(diff).max()),
|
||||||
|
"true_hyper": R.drift_true.as_dict(), "nominal_hyper": R.drift.as_dict()}
|
||||||
|
if dr["step_ms"] != 0.0:
|
||||||
|
k = R.cfg["horizons"].index(dr["step_horizon"])
|
||||||
|
jumps, tau_hs = [], []
|
||||||
|
for w, o, o0, df in zip(R.pool, obs, obs0, diff):
|
||||||
|
t_h = R.hg.at(w.il, w.xl)[k]
|
||||||
|
tau_h = np.interp(t_h, o0["t_of_tau_true"], R.tau_fine)
|
||||||
|
jumps.append(float(np.interp(tau_h + dr["step_width_ms"] + 12, R.tau_fine, df) - np.interp(tau_h - 8, R.tau_fine, df)))
|
||||||
|
tau_hs.append(float(tau_h))
|
||||||
|
d["step"] = {"jump_ms_mean": float(np.mean(jumps)), "jump_ms_min": float(np.min(jumps)), "jump_ms_max": float(np.max(jumps)),
|
||||||
|
"tau_h_ms_range": [float(np.min(tau_hs)), float(np.max(tau_hs))],
|
||||||
|
"g_anomaly_mean": float(np.mean([np.max(o["g"] - o0["g"]) for o, o0 in zip(obs, obs0)]))}
|
||||||
|
if dr["jitter_sd_ms"] > 0:
|
||||||
|
jit = np.array([o["t_of_tau_true"] - np.interp(R.tau_fine, R.grid.tau, R.grid.t_of_tau(o["b"], o["g"])[0]) for o in obs])
|
||||||
|
d["jitter_rms_ms"] = float(np.sqrt(np.mean(jit ** 2)))
|
||||||
|
d["laplace_tie_N4"] = laplace_tie(R, obs[:N_LAPLACE], reg)
|
||||||
|
out["drift"] = d
|
||||||
|
return out
|
||||||
|
|
||||||
|
|
||||||
|
SWEEP = { # single-knob settings for the level choice on dev (--sweep)
|
||||||
|
"rock_physics.unit_dt_intercept_sd": [0.025, 0.05, 0.1, 0.15],
|
||||||
|
"rock_physics.dt_slope_factor": [0.85, 1.3],
|
||||||
|
"wavelet.minphase_frac": [0.25, 0.5, 0.75, 1.0],
|
||||||
|
"wavelet.Q": [40.0, 80.0, 160.0],
|
||||||
|
"wavelet.peak_freq_factor": [0.8, 1.2],
|
||||||
|
"wavelet.delay_ms": [2.0, 4.0],
|
||||||
|
"drift.step_ms": [4.0, 8.0, 16.0],
|
||||||
|
"drift.jitter_sd_ms": [0.5, 1.0, 2.0],
|
||||||
|
"drift.sigma_b_factor": [2.0, 3.0, 5.0],
|
||||||
|
"drift.sigma_g_factor": [1.5, 2.0],
|
||||||
|
"drift.ell_factor": [0.5, 0.25],
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def run_sweep(build, R0, reg: dict, out: Path) -> None:
|
||||||
|
"""Model error and (for drift) the anchor-only tie for each single-knob setting of SWEEP; one line per setting."""
|
||||||
|
rows = []
|
||||||
|
for key, values in SWEEP.items():
|
||||||
|
axis, k = key.split(".")
|
||||||
|
for v in values:
|
||||||
|
t1 = time.time()
|
||||||
|
R = build({axis: {k: v}})
|
||||||
|
r = qc_preset(R, R0, reg, reg["wavelet_ms"])
|
||||||
|
row = {"axis": axis, "key": k, "value": v, "seis_rel_change_main": r["seis_rel_change_main"],
|
||||||
|
"model_err_nominal_wavelet": r["model_err_nominal_wavelet"]["err_mean"],
|
||||||
|
"model_err_in_family": r["model_err_in_family"]["err_mean"],
|
||||||
|
"snr_equiv_db": r["model_err_in_family"]["snr_equiv_db"], "phase_deg": r["model_err_in_family"]["phase_deg"]}
|
||||||
|
if axis == "drift":
|
||||||
|
d = r["drift"]
|
||||||
|
row |= {"warp_diff_rms_main_ms": d["warp_diff_rms_main_ms"], "laplace_warp_rmse_ms": d["laplace_tie_N4"]["warp_rmse_ms_mean"],
|
||||||
|
"laplace_z_rms": d["laplace_tie_N4"]["z_rms_mean"], "monotone_repairs": r["misspec_info"]["monotone_repairs"]}
|
||||||
|
if axis == "wavelet":
|
||||||
|
row |= {"corr_best_const_phase": r["wavelet"]["stationary"]["corr_at_best_phase"]}
|
||||||
|
rows.append(row)
|
||||||
|
extra = (f" warp diff {row['warp_diff_rms_main_ms']:.2f} ms, Laplace RMSE {row['laplace_warp_rmse_ms']:.2f} ms, z {row['laplace_z_rms']:.2f}"
|
||||||
|
if axis == "drift" else "")
|
||||||
|
print(f"sweep {key} = {v:<6g} in-family error {row['model_err_in_family']:.3f} ({row['snr_equiv_db']:.1f} dB, phase {row['phase_deg']:.0f}°)"
|
||||||
|
f"{extra} | {time.time() - t1:.1f} s", flush=True)
|
||||||
|
(out / "generator_sweep.json").write_text(json.dumps({"rid": R0.rid, "c": C, "sigma_a_ms": SIGMA_A, "rows": rows}, indent=1) + "\n")
|
||||||
|
|
||||||
|
|
||||||
|
def smc_cell(R, reg: dict, st: dict, N: int, n_part: int, device: str, mem_gb: float, seed: int = 0) -> dict:
|
||||||
|
"""Registration of one cell (first N train wells, c = 1) as in protocol_p2r: pipeline.register (CPU), then the SMC
|
||||||
|
tie posterior on `device` with the phase_R wavelet and γ = 1/κ (g_acf). Returns per-well diagnostics."""
|
||||||
|
from ml_porosity.registration.pipeline import register
|
||||||
|
from ml_porosity.registration.sampler import sample_warps
|
||||||
|
from ml_porosity.registration.smc import TiePosterior, gamma_acf, phase_basis, phase_wavelet, residual_kappa
|
||||||
|
|
||||||
|
if device == "cpu": # numpy SMC (as scripts/14 with --device cpu)
|
||||||
|
from ml_porosity.registration.smc import smc_fit_phase, smc_tie_posterior
|
||||||
|
wrap = lambda T: T
|
||||||
|
else:
|
||||||
|
import torch
|
||||||
|
from ml_porosity.registration.smc_torch import TiePosteriorTorch, smc_fit_phase, smc_tie_posterior
|
||||||
|
|
||||||
|
dev = torch.device(device)
|
||||||
|
if dev.type == "cuda": # cap: exceeding it makes this job OOM rather than others
|
||||||
|
total = torch.cuda.get_device_properties(dev).total_memory
|
||||||
|
torch.cuda.set_per_process_memory_fraction(min(1.0, mem_gb * 2**30 / total), dev)
|
||||||
|
wrap = lambda T: TiePosteriorTorch(T, device)
|
||||||
|
obs = [R.observe(w, C, st["snr_db"], SIGMA_A, st["anchor_density"]) for w in R.pool[:N]]
|
||||||
|
t0 = time.time()
|
||||||
|
out = register(R, obs, reg, seed)
|
||||||
|
t_reg = time.time() - t0
|
||||||
|
h = WarpHyper(**out["hyper"])
|
||||||
|
seis = [o["seis"][o["seis"].shape[0] // 2].astype(float) for o in obs]
|
||||||
|
mm = (R.t_ext >= R.t_main[0]) & (R.t_ext <= R.t_main[-1])
|
||||||
|
ncc = lambda a, b: float(np.corrcoef(a[mm], b[mm])[0, 1])
|
||||||
|
B = phase_basis(statistical_wavelet(np.stack(seis), R.dt, reg["wavelet_ms"]), int(round(R.dt / R.cfg["fine_dt_ms"])))
|
||||||
|
Ts, Z0s = [], []
|
||||||
|
for i, o in enumerate(obs):
|
||||||
|
smp = sample_warps(R.grid, h, o["tau_k"], o["t_k"], n_part, reg["g_max"], np.random.default_rng([seed, i, 13]))
|
||||||
|
Ts.append(wrap(TiePosterior(R.grid, h, o["tau_k"], o["t_k"], reg["g_max"], R.tau_fine, o["ai_log"], R.t_fine,
|
||||||
|
R.t_ext, phase_wavelet(B, out["phase"]), seis[i], (R.t_main[0], R.t_main[-1]))))
|
||||||
|
Z0s.append(Ts[-1].z(smp["u"]))
|
||||||
|
t0 = time.time()
|
||||||
|
phase_r, ph = smc_fit_phase(Ts, Z0s, B, out["phase"], [seed, 19])
|
||||||
|
t_phase = time.time() - t0
|
||||||
|
rows = []
|
||||||
|
t0 = time.time()
|
||||||
|
for i, o in enumerate(obs):
|
||||||
|
T = Ts[i].with_wavelet(phase_wavelet(B, phase_r))
|
||||||
|
_, l0 = T.parts(Z0s[i])
|
||||||
|
gk = gamma_acf(T, Z0s[i], l0)
|
||||||
|
res = smc_tie_posterior(T, Z0s[i], [gk], np.random.default_rng([seed, i, 17]))
|
||||||
|
U = T.u(res["Z"][float(gk)])
|
||||||
|
Tf = R.grid.t_of_tau(U[:, 0], U[:, 1:], tau=R.tau_fine)
|
||||||
|
e = warp_errors(Tf, R.tau_fine, o["t_of_tau_true"], R.t_main)
|
||||||
|
syn_m = T.synth(U.mean(0)[None])[0]
|
||||||
|
d = out["diag"][i]
|
||||||
|
rows.append({"well": o["name"], "gamma": float(gk), "kappa0": float(1.0 / gk), "logZ": float(res["logZ"][float(gk)]),
|
||||||
|
"n_stages": len(res["stages"]), "r_post": ncc(syn_m, seis[i]), "kappa_post": float(residual_kappa(syn_m, seis[i])),
|
||||||
|
"B3c_warp_rmse_ms": d["B3c_warp_rmse_ms"], "B3d_warp_rmse_ms": d["B3d_warp_rmse_ms"],
|
||||||
|
"M2old_warp_rmse_ms": d["M2_warp_rmse_ms"]} | {f"SMC_{k}": float(v) for k, v in e.items()})
|
||||||
|
keys = ["SMC_warp_rmse_ms", "SMC_warp_cov90", "SMC_warp_width90_ms", "r_post", "kappa_post", "B3c_warp_rmse_ms", "B3d_warp_rmse_ms"]
|
||||||
|
return {"phase0": out["phase"], "phase_R": phase_r, "phase_edge": ph["edge"], "hyper": out["hyper"], "lam": out["lam"],
|
||||||
|
"tau_c": out["tau_c"], "wells": rows, "mean": {k: float(np.mean([r[k] for r in rows])) for k in keys},
|
||||||
|
"time_s": {"register": t_reg, "phase": t_phase, "smc": time.time() - t0}}
|
||||||
|
|
||||||
|
|
||||||
|
def run_smc(build, cfg: dict, reg: dict, names: list[str], regimes: list[str], N: int, n_part: int, device: str,
|
||||||
|
mem_gb: float, out: Path, rid: int) -> None:
|
||||||
|
path = out / f"smc_qc_rid{rid}.json"
|
||||||
|
results = json.loads(path.read_text()) if path.exists() else {}
|
||||||
|
results["meta"] = {"rid": rid, "c": C, "sigma_a_ms": SIGMA_A, "n_train": N, "particles": n_part, "device": device,
|
||||||
|
"arm": "estR (statistical wavelet, phase_R), gamma = 1/kappa (g_acf)", "updated": dt.datetime.now().isoformat(timespec="seconds")}
|
||||||
|
for regime in regimes:
|
||||||
|
st = cfg["regimes"][regime]
|
||||||
|
results.setdefault(regime, {})
|
||||||
|
for name in ["nominal"] + names:
|
||||||
|
if name in results[regime]:
|
||||||
|
continue # resume
|
||||||
|
t1 = time.time()
|
||||||
|
R = build(preset_misspec(cfg, name))
|
||||||
|
r = smc_cell(R, reg, st, N, n_part, device, mem_gb)
|
||||||
|
r["active"] = R.misspec_active
|
||||||
|
results[regime][name] = r
|
||||||
|
path.write_text(json.dumps(results, indent=1) + "\n")
|
||||||
|
m = r["mean"]
|
||||||
|
print(f"smc {regime} {name:8s} phase0 {r['phase0']:5.0f}° phase_R {r['phase_R']:5.0f}° | SMC warp RMSE {m['SMC_warp_rmse_ms']:.2f} ms "
|
||||||
|
f"cov90 {m['SMC_warp_cov90']:.2f} width90 {m['SMC_warp_width90_ms']:.1f} ms r_post {m['r_post']:.3f} | B3c {m['B3c_warp_rmse_ms']:.2f} "
|
||||||
|
f"B3d {m['B3d_warp_rmse_ms']:.2f} ms | {time.time() - t1:.0f} s", flush=True)
|
||||||
|
|
||||||
|
|
||||||
|
def make_figure(R0, builds: dict, results: dict, out_png: Path) -> None:
|
||||||
|
import matplotlib
|
||||||
|
matplotlib.use("Agg")
|
||||||
|
import matplotlib.pyplot as plt
|
||||||
|
|
||||||
|
plt.rcParams.update({"font.size": 8.5, "axes.titlesize": 9, "axes.labelsize": 8.5, "legend.fontsize": 7.5,
|
||||||
|
"axes.edgecolor": "#c3c2b7", "axes.spines.top": False, "axes.spines.right": False,
|
||||||
|
"text.color": "#0b0b0b", "axes.labelcolor": "#0b0b0b", "xtick.color": "#52514e", "ytick.color": "#52514e"})
|
||||||
|
fig, axes = plt.subplots(2, 3, figsize=(13, 7.4), constrained_layout=True)
|
||||||
|
names = list(results["presets"])
|
||||||
|
by_axis = {ax: [n for n in names if n.startswith(ax)] for ax in ("rp", "wv", "dr")}
|
||||||
|
w0 = R0.pool[0]
|
||||||
|
o0 = R0.observe(w0, C, None, SIGMA_A)
|
||||||
|
main_tau = (R0.tau_fine >= 600) & (R0.tau_fine <= 1100)
|
||||||
|
|
||||||
|
# (a) rock physics: ln(AI_true / AI_nominal) along the log (pool well 0)
|
||||||
|
ax = axes[0, 0]
|
||||||
|
for col, n in zip(SERIES, by_axis["rp"]):
|
||||||
|
R = builds[n]
|
||||||
|
o = R.observe(R.pool[0], C, None, SIGMA_A)
|
||||||
|
ax.plot(R.tau_fine[main_tau], np.log(R.ai_log_true(R.pool[0], o) / o["ai_log"])[main_tau], color=col, lw=1.2, label=n)
|
||||||
|
ax.axhline(0, color="#c3c2b7", lw=0.8)
|
||||||
|
ax.set(xlabel="τ (ms)", ylabel="ln(AI_true / AI_nominal)", title=f"(a) Rock physics: true vs nominal AI along the log ({w0.name})")
|
||||||
|
ax.legend(frameon=False)
|
||||||
|
|
||||||
|
# (b) wavelets in time
|
||||||
|
ax = axes[0, 1]
|
||||||
|
tf = (np.arange(len(R0.w_fine)) - len(R0.w_fine) // 2) * R0.cfg["fine_dt_ms"]
|
||||||
|
ax.plot(tf, R0.w_fine, color=PALETTE["nominal"], lw=1.6, label="nominal (zero phase)")
|
||||||
|
for col, n in zip(SERIES, by_axis["wv"]):
|
||||||
|
R = builds[n]
|
||||||
|
if R.misspec["wavelet"]["Q"] is not None:
|
||||||
|
k = R.true_wavelet_at(1100.0)
|
||||||
|
tk = (np.arange(len(k)) - len(k) // 2) * R.cfg["fine_dt_ms"]
|
||||||
|
ax.plot(tk, k / np.abs(k).max(), color=col, lw=1.2, ls="--", label=f"{n} at 1100 ms")
|
||||||
|
else:
|
||||||
|
ax.plot(tf, R.w_fine, color=col, lw=1.2, label=n)
|
||||||
|
ax.set(xlim=(-70, 70), xlabel="time (ms)", ylabel="amplitude (unit peak)", title="(b) Stationary true wavelets (and Q kernel)")
|
||||||
|
ax.legend(frameon=False)
|
||||||
|
|
||||||
|
# (c) amplitude spectra
|
||||||
|
ax = axes[0, 2]
|
||||||
|
f = np.fft.rfftfreq(8192, R0.cfg["fine_dt_ms"] / 1000.0)
|
||||||
|
spec = lambda w: np.abs(np.fft.rfft(w, 8192)) / np.abs(np.fft.rfft(w, 8192)).max()
|
||||||
|
ax.plot(f, spec(R0.w_fine), color=PALETTE["nominal"], lw=1.6, label="nominal")
|
||||||
|
for col, n in zip(SERIES, by_axis["wv"]):
|
||||||
|
R = builds[n]
|
||||||
|
if R.misspec["wavelet"]["Q"] is not None:
|
||||||
|
for t, ls in ((600.0, ":"), (1100.0, "--")):
|
||||||
|
ax.plot(f, spec(R.true_wavelet_at(t)), color=col, lw=1.2, ls=ls, label=f"{n} at {int(t)} ms")
|
||||||
|
else:
|
||||||
|
ax.plot(f, spec(R.w_fine), color=col, lw=1.2, label=n)
|
||||||
|
ax.set(xlim=(0, 125), xlabel="frequency (Hz)", ylabel="normalised amplitude", title="(c) Amplitude spectra")
|
||||||
|
ax.legend(frameon=False)
|
||||||
|
|
||||||
|
# (d) drift: warp change
|
||||||
|
ax = axes[1, 0]
|
||||||
|
for col, n in zip(SERIES, by_axis["dr"]):
|
||||||
|
R = builds[n]
|
||||||
|
o = R.observe(R.pool[0], C, None, SIGMA_A)
|
||||||
|
ax.plot(R.tau_fine, o["t_of_tau_true"] - o0["t_of_tau_true"], color=col, lw=1.2, label=n)
|
||||||
|
ax.axvspan(600, 1100, color="#f0efec", zorder=0)
|
||||||
|
ax.set(xlabel="τ (ms)", ylabel="t_true,misspec − t_true,nominal (ms)", title=f"(d) Drift: change of the true warp ({w0.name}, c = 1)")
|
||||||
|
ax.legend(frameon=False)
|
||||||
|
|
||||||
|
# (e) model error at the true warp, in-family best (SNR-equivalent dB)
|
||||||
|
ax = axes[1, 1]
|
||||||
|
labels = ["nominal"] + names
|
||||||
|
vals = [results["nominal"]["model_err_in_family"]["snr_equiv_db"]] + [results["presets"][n]["model_err_in_family"]["snr_equiv_db"] for n in names]
|
||||||
|
cols = [PALETTE["nominal"]] + [SERIES[0]] * len(names)
|
||||||
|
x = np.arange(len(labels))
|
||||||
|
ax.bar(x, vals, color=cols, width=0.7)
|
||||||
|
for xi, v in zip(x, vals):
|
||||||
|
ax.text(xi, v + 0.6, f"{v:.1f}", ha="center", va="bottom", fontsize=7, color="#0b0b0b")
|
||||||
|
for reg, ls in (("R10", "--"), ("Rm5", ":")):
|
||||||
|
ax.axhline(snr_db(NOISE_REL[reg]), color="#52514e", lw=0.9, ls=ls)
|
||||||
|
ax.text(len(labels) - 0.5, snr_db(NOISE_REL[reg]) + 0.4, f"{reg} noise", ha="right", fontsize=7, color="#52514e")
|
||||||
|
ax.set(xticks=x, xticklabels=labels, ylabel="SNR-equivalent of the model error (dB)",
|
||||||
|
title="(e) Model error at the true warp, best in-family wavelet")
|
||||||
|
ax.tick_params(axis="x", rotation=45)
|
||||||
|
|
||||||
|
# (f) anchor-only Laplace tie (N = 4)
|
||||||
|
ax = axes[1, 2]
|
||||||
|
lab = ["nominal"] + by_axis["dr"]
|
||||||
|
rm = [results["nominal"]["laplace_tie_N4"]["warp_rmse_ms_mean"]] + [results["presets"][n]["drift"]["laplace_tie_N4"]["warp_rmse_ms_mean"] for n in by_axis["dr"]]
|
||||||
|
zr = [results["nominal"]["laplace_tie_N4"]["z_rms_mean"]] + [results["presets"][n]["drift"]["laplace_tie_N4"]["z_rms_mean"] for n in by_axis["dr"]]
|
||||||
|
x = np.arange(len(lab))
|
||||||
|
ax.bar(x, rm, color=[PALETTE["nominal"]] + [SERIES[0]] * len(by_axis["dr"]), width=0.6)
|
||||||
|
for xi, v, z in zip(x, rm, zr):
|
||||||
|
ax.text(xi, v + 0.05, f"{v:.2f} ms\nz RMS {z:.1f}", ha="center", va="bottom", fontsize=7, color="#0b0b0b")
|
||||||
|
ax.set(xticks=x, xticklabels=lab, ylabel="warp RMSE of the Laplace mean (ms)", ylim=(0, max(rm) * 1.35),
|
||||||
|
title="(f) Anchor-only tie under the registration prior (N = 4)")
|
||||||
|
fig.suptitle(f"D2 generator QC, dev realization {R0.rid}: misspecification presets vs nominal (common random numbers)", fontsize=10)
|
||||||
|
fig.savefig(out_png, dpi=160)
|
||||||
|
plt.close(fig)
|
||||||
|
|
||||||
|
|
||||||
|
def main() -> None:
|
||||||
|
ap = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)
|
||||||
|
ap.add_argument("--rid", type=int, default=902, help="dev realization (902–905)")
|
||||||
|
ap.add_argument("--config", default="configs/d2_synth_bench.yaml")
|
||||||
|
ap.add_argument("--inputs-from", default="configs/protocol_p2r.yaml", help="protocol whose inputs (warp prior, wavelet) are used")
|
||||||
|
ap.add_argument("--reg-from", default="configs/protocol_p2.yaml", help="protocol whose registration block is used for the anchor-only tie")
|
||||||
|
ap.add_argument("--out", default="outputs/bench/dev")
|
||||||
|
ap.add_argument("--presets", nargs="*", default=None, help="subset of preset names (default: all)")
|
||||||
|
ap.add_argument("--sweep", action="store_true", help="also evaluate the single-knob settings of SWEEP → generator_sweep.json")
|
||||||
|
ap.add_argument("--skip-qc", action="store_true", help="skip the light QC and the figure")
|
||||||
|
ap.add_argument("--smc", action="store_true", help="run the registration + SMC tie posterior per preset (GPU) → smc_qc_rid<rid>.json")
|
||||||
|
ap.add_argument("--device", default="cuda:1")
|
||||||
|
ap.add_argument("--regimes", nargs="*", default=["R10", "Rm5"])
|
||||||
|
ap.add_argument("--n-train", type=int, default=4)
|
||||||
|
ap.add_argument("--particles", type=int, default=1024)
|
||||||
|
ap.add_argument("--gpu-mem-gb", type=float, default=2.0, help="per-process GPU memory cap (GiB)")
|
||||||
|
a = ap.parse_args()
|
||||||
|
if a.rid not in DEV_RIDS:
|
||||||
|
raise SystemExit(f"generator QC runs on dev realizations {DEV_RIDS} only (got {a.rid})")
|
||||||
|
|
||||||
|
cfg = yaml.safe_load((REPO_ROOT / a.config).read_text())
|
||||||
|
P = yaml.safe_load((REPO_ROOT / a.inputs_from).read_text())
|
||||||
|
spec = importlib.util.spec_from_file_location("run_d2", REPO_ROOT / "scripts" / "11_run_d2.py")
|
||||||
|
run_d2 = importlib.util.module_from_spec(spec)
|
||||||
|
spec.loader.exec_module(run_d2)
|
||||||
|
reg = run_d2.reg_settings(yaml.safe_load((REPO_ROOT / a.reg_from).read_text()))
|
||||||
|
hg = load_horizon_grid(cfg["horizons"], REPO_ROOT / cfg["horizon_cache"])
|
||||||
|
prior = json.loads((REPO_ROOT / P["inputs"]["warp_prior"]["path"]).read_text())["fits"][P["inputs"]["warp_prior"]["fit"]]
|
||||||
|
wav = np.load(REPO_ROOT / P["inputs"]["wavelet"]["path"])[P["inputs"]["wavelet"]["key"]]
|
||||||
|
build = lambda ms: D2Realization(cfg, a.rid, hg, WarpHyper(**prior["hyper"]), wav, misspec=ms)
|
||||||
|
|
||||||
|
out = REPO_ROOT / a.out
|
||||||
|
out.mkdir(parents=True, exist_ok=True)
|
||||||
|
names = a.presets or list(cfg["misspec_presets"])
|
||||||
|
if a.smc:
|
||||||
|
run_smc(build, cfg, reg, names, a.regimes, a.n_train, a.particles, a.device, a.gpu_mem_gb, out, a.rid)
|
||||||
|
if a.skip_qc:
|
||||||
|
return
|
||||||
|
t0 = time.time()
|
||||||
|
R0 = build(None)
|
||||||
|
obs0 = [R0.observe(w, C, None, SIGMA_A) for w in R0.pool]
|
||||||
|
e_nom = model_errors(R0, obs0, R0.w_fine_nominal)
|
||||||
|
results = {"nominal": {"model_err_nominal_wavelet": {"err_mean": float(e_nom.mean()), "err_max": float(e_nom.max()),
|
||||||
|
"snr_equiv_db": snr_db(float(e_nom.mean()))},
|
||||||
|
"model_err_in_family": in_family_error(R0, obs0, reg["wavelet_ms"]),
|
||||||
|
"laplace_tie_N4": laplace_tie(R0, obs0[:N_LAPLACE], reg),
|
||||||
|
"wavelet": wavelet_stats(R0.w_fine, cfg["fine_dt_ms"], R0.w_fine_nominal)},
|
||||||
|
"presets": {}}
|
||||||
|
builds = {}
|
||||||
|
for name in names:
|
||||||
|
t1 = time.time()
|
||||||
|
R = build(preset_misspec(cfg, name))
|
||||||
|
builds[name] = R
|
||||||
|
results["presets"][name] = {"spec": cfg["misspec_presets"][name]} | qc_preset(R, R0, reg, reg["wavelet_ms"])
|
||||||
|
results["presets"][name]["time_s"] = time.time() - t1
|
||||||
|
r = results["presets"][name]
|
||||||
|
print(f"{name:6s} seis change {r['seis_rel_change_main']:.3f} | model error nominal-wavelet {r['model_err_nominal_wavelet']['err_mean']:.3f} "
|
||||||
|
f"({r['model_err_nominal_wavelet']['snr_equiv_db']:.1f} dB), in-family {r['model_err_in_family']['err_mean']:.3f} "
|
||||||
|
f"({r['model_err_in_family']['snr_equiv_db']:.1f} dB, phase {r['model_err_in_family']['phase_deg']:.0f}°) | {r['time_s']:.1f} s", flush=True)
|
||||||
|
results["meta"] = {
|
||||||
|
"created": dt.datetime.now().isoformat(timespec="seconds"), "rid": a.rid, "c": C, "sigma_a_ms": SIGMA_A,
|
||||||
|
"wells": "16 pool wells (train pool); Laplace tie on the first 4", "snr": "clean seismic (snr_db = None)",
|
||||||
|
"config": {"path": a.config, "sha256": sha256(REPO_ROOT / a.config)},
|
||||||
|
"inputs": {k: {"path": P["inputs"][k]["path"], "sha256": sha256(REPO_ROOT / P["inputs"][k]["path"])} for k in ("warp_prior", "wavelet")},
|
||||||
|
"registration": {"from": a.reg_from, **{k: reg[k] for k in ("sigma_a_ms", "sigma_b_ms", "hyperprior", "wavelet_ms", "g_max")}},
|
||||||
|
"noise_rel_rms": NOISE_REL, "noise_snr_equiv_db": {k: snr_db(v) for k, v in NOISE_REL.items()},
|
||||||
|
"env": {"numpy": np.__version__, "scipy": scipy.__version__, "python": platform.python_version()},
|
||||||
|
"time_s": time.time() - t0,
|
||||||
|
}
|
||||||
|
(out / "generator_qc.json").write_text(json.dumps(results, indent=1) + "\n")
|
||||||
|
make_figure(R0, builds, results, out / "generator_qc.png")
|
||||||
|
if a.sweep:
|
||||||
|
run_sweep(build, R0, reg, out)
|
||||||
|
print(f"nominal: model error nominal-wavelet {e_nom.mean():.3f}, in-family {results['nominal']['model_err_in_family']['err_mean']:.3f} "
|
||||||
|
f"({results['nominal']['model_err_in_family']['snr_equiv_db']:.1f} dB); Laplace N=4 warp RMSE "
|
||||||
|
f"{results['nominal']['laplace_tie_N4']['warp_rmse_ms_mean']:.2f} ms; total {time.time() - t0:.0f} s → {out}")
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
86
scripts/34_run_bench.py
Normal file
86
scripts/34_run_bench.py
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
"""protocol_bench runner (configs/protocol_bench.yaml): status | lock | posterior | train | summarize | repro | dev-budgets.
|
||||||
|
|
||||||
|
python scripts/34_run_bench.py lock # first lock (refuses if results exist)
|
||||||
|
python scripts/34_run_bench.py posterior --studies S1 S2 --device cuda:0 --workers 4 --gpu-mem-gb 6
|
||||||
|
python scripts/34_run_bench.py train --studies S1 S2 S3 S4 S8 --device cuda:1 --workers 4
|
||||||
|
python scripts/34_run_bench.py summarize # outputs/bench/summary/
|
||||||
|
python scripts/34_run_bench.py repro --device cuda:0 # P2r reproduction cell → outputs/bench/repro/
|
||||||
|
python scripts/34_run_bench.py posterior train --dev --rids 902 903 --studies S2 --presets rp_L1 ... # dev only
|
||||||
|
python scripts/34_run_bench.py dev-budgets --device cuda:0 # TCN budgets on dev 902–905 (R10, c = 1)
|
||||||
|
|
||||||
|
Main realizations 8–15 run only after the lock; --dev restricts to realizations 900–905 and writes under
|
||||||
|
outputs/bench/dev; repro writes under outputs/bench/repro. --regimes / --presets / --rids filter the planned cells
|
||||||
|
(a partial run is resumed, never a different design). Threads default to 2 per worker (OMP/MKL/OPENBLAS).
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import argparse
|
||||||
|
import os
|
||||||
|
import traceback
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
for _k, _v in {"OMP_NUM_THREADS": "2", "MKL_NUM_THREADS": "2", "OPENBLAS_NUM_THREADS": "2", "NUMEXPR_NUM_THREADS": "2",
|
||||||
|
"NUMBA_NUM_THREADS": "2", "PYTHONHASHSEED": "0", "PYTHONUTF8": "1", "CUBLAS_WORKSPACE_CONFIG": ":4096:8"}.items():
|
||||||
|
os.environ.setdefault(_k, _v)
|
||||||
|
|
||||||
|
STAGES = ["status", "lock", "posterior", "train", "summarize", "repro", "dev-budgets", "all"]
|
||||||
|
|
||||||
|
|
||||||
|
def main() -> None:
|
||||||
|
from ml_porosity.benchmark.cells import bench_root
|
||||||
|
from ml_porosity.benchmark.protocol import freeze, load_protocol
|
||||||
|
from ml_porosity.benchmark.runner import run, status
|
||||||
|
|
||||||
|
ap = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)
|
||||||
|
ap.add_argument("stages", nargs="+", choices=STAGES)
|
||||||
|
ap.add_argument("--studies", nargs="+", default=["S1", "S2", "S3", "S4", "S8"], choices=["S1", "S2", "S3", "S4", "S8"])
|
||||||
|
ap.add_argument("--device", default="cuda:0")
|
||||||
|
ap.add_argument("--workers", type=int, default=4)
|
||||||
|
ap.add_argument("--threads", type=int, default=int(os.environ.get("THREADS", "2")))
|
||||||
|
ap.add_argument("--gpu-mem-gb", type=float, default=6.0, help="per-worker CUDA allocation cap for the SMC (GiB)")
|
||||||
|
ap.add_argument("--dev", action="store_true", help="dev realizations only → outputs/bench/dev")
|
||||||
|
ap.add_argument("--rids", type=int, nargs="+", default=None)
|
||||||
|
ap.add_argument("--regimes", nargs="+", default=None)
|
||||||
|
ap.add_argument("--presets", nargs="+", default=None, help="S2 presets to run (default: all main presets)")
|
||||||
|
ap.add_argument("--controls", action="store_true", help="S2: also the control presets rp_C, wv_C")
|
||||||
|
ap.add_argument("--seeds", type=int, nargs="+", default=None, help="dev only: network seeds (default: protocol)")
|
||||||
|
ap.add_argument("--drift", type=float, nargs="+", default=None, help="dev only: drift factors c (overrides the study grid)")
|
||||||
|
ap.add_argument("--n-train", type=int, nargs="+", default=None, help="dev only: N (overrides the study grid)")
|
||||||
|
ap.add_argument("--n-boot", type=int, default=2000)
|
||||||
|
args = ap.parse_args()
|
||||||
|
if args.workers < 1:
|
||||||
|
ap.error("--workers must be positive")
|
||||||
|
if (args.seeds or args.drift or args.n_train) and not args.dev:
|
||||||
|
ap.error("--seeds, --drift and --n-train are dev options")
|
||||||
|
grid = {"drift_factors": args.drift, "n_train": args.n_train} if (args.drift or args.n_train) else None
|
||||||
|
p = load_protocol()
|
||||||
|
mode = "dev" if args.dev else "main"
|
||||||
|
stages = ["posterior", "train", "summarize"] if args.stages == ["all"] else args.stages
|
||||||
|
try:
|
||||||
|
for stage in stages:
|
||||||
|
if stage == "status":
|
||||||
|
print(status(bench_root(dev=args.dev)))
|
||||||
|
elif stage == "lock":
|
||||||
|
print(freeze())
|
||||||
|
elif stage in ("posterior", "train"):
|
||||||
|
run(stage, p, args.studies, args.device, args.workers, args.gpu_mem_gb, args.threads, mode, rids=args.rids,
|
||||||
|
regimes=args.regimes, presets=args.presets, controls=args.controls, seeds=args.seeds, grid=grid)
|
||||||
|
elif stage == "repro":
|
||||||
|
from ml_porosity.benchmark.repro import compare
|
||||||
|
for st in ("posterior", "train"):
|
||||||
|
run(st, p, [], args.device, 1, args.gpu_mem_gb, args.threads, "repro")
|
||||||
|
print(compare(p))
|
||||||
|
elif stage == "summarize":
|
||||||
|
from ml_porosity.benchmark.summary import summarize
|
||||||
|
summarize(p, bench_root(dev=args.dev), args.n_boot, dev=args.dev)
|
||||||
|
elif stage == "dev-budgets":
|
||||||
|
from ml_porosity.benchmark.devbudgets import dev_budgets
|
||||||
|
print(dev_budgets(p, args.device, args.workers, args.gpu_mem_gb, args.threads, rids=args.rids))
|
||||||
|
except Exception:
|
||||||
|
traceback.print_exc()
|
||||||
|
raise SystemExit(1)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
135
scripts/35_bench_calibration.py
Normal file
135
scripts/35_bench_calibration.py
Normal file
@@ -0,0 +1,135 @@
|
|||||||
|
"""S2 level calibration table (phase P6, protocol_bench): tabulate the dev SMC diagnostics of every candidate preset.
|
||||||
|
|
||||||
|
CUDA_VISIBLE_DEVICES= .venv/bin/python scripts/35_bench_calibration.py [--rids 902 903 904 905] [--out outputs/bench/dev]
|
||||||
|
|
||||||
|
Reads outputs/bench/dev/smc_qc_rid<rid>.json (scripts/33 --smc: N = 4, c = 1, R10 and Rm5, P = 1024, estR, γ = 1/κ,
|
||||||
|
single-checkpoint SMC) and outputs/bench/dev/generator_qc.json / generator_sweep.json (in-family model error), and
|
||||||
|
writes calibration.csv (one row per preset × regime, mean over the listed realizations and wells) and calibration.md.
|
||||||
|
Columns: in-family model error (relative RMS; ratio to the regime noise), SMC warp RMSE, coverage90, σ_post
|
||||||
|
(width90/3.29), overconfidence (warp RMSE / σ_post), phase_R, |phase_R − phase0|, B3c and B3d warp RMSE, r_post,
|
||||||
|
and the declared L1/L2 targets of configs/protocol_bench.yaml calibration.procedure. Dev only; no main realization.
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import argparse
|
||||||
|
import json
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
import numpy as np
|
||||||
|
import pandas as pd
|
||||||
|
import yaml
|
||||||
|
|
||||||
|
from ml_porosity.paths import REPO_ROOT
|
||||||
|
|
||||||
|
NOISE = {"R10": 10 ** (-10 / 20), "Rm5": 10 ** (5 / 20), "R0": 1.0} # relative noise RMS of the regimes
|
||||||
|
Z90 = 3.29
|
||||||
|
|
||||||
|
|
||||||
|
def in_family_errors(out: Path) -> dict[str, float]:
|
||||||
|
"""Best in-family model error keyed by the json of the active knobs (generator_qc.json presets, the nominal entry
|
||||||
|
and the single-knob rows of generator_sweep.json when they carry a spec/active block)."""
|
||||||
|
from ml_porosity.data.synth_d2 import active_axes, normalize_misspec
|
||||||
|
|
||||||
|
err = {}
|
||||||
|
f = out / "generator_qc.json"
|
||||||
|
if f.exists():
|
||||||
|
q = json.loads(f.read_text())
|
||||||
|
err["{}"] = float(q["nominal"]["model_err_in_family"]["err_mean"])
|
||||||
|
for d in q.get("presets", {}).values():
|
||||||
|
if "active" in d and "model_err_in_family" in d:
|
||||||
|
err[json.dumps(d["active"], sort_keys=True)] = float(d["model_err_in_family"]["err_mean"])
|
||||||
|
f = out / "generator_sweep.json"
|
||||||
|
if f.exists():
|
||||||
|
for r in json.loads(f.read_text()).get("rows", []):
|
||||||
|
if "model_err_in_family" not in r:
|
||||||
|
continue
|
||||||
|
act = r.get("active")
|
||||||
|
if act is None and "spec" in r:
|
||||||
|
act = active_axes(normalize_misspec({k: v for k, v in r["spec"].items() if k != "note"}))
|
||||||
|
if act is None and {"axis", "key", "value"} <= set(r):
|
||||||
|
act = active_axes(normalize_misspec({r["axis"]: {r["key"]: r["value"]}}))
|
||||||
|
if act is not None:
|
||||||
|
e = r["model_err_in_family"]
|
||||||
|
err.setdefault(json.dumps(act, sort_keys=True), float(e["err_mean"] if isinstance(e, dict) else e))
|
||||||
|
return err
|
||||||
|
|
||||||
|
|
||||||
|
def load_smc(out: Path, rids: list[int]) -> pd.DataFrame:
|
||||||
|
rows = []
|
||||||
|
for rid in rids:
|
||||||
|
f = out / f"smc_qc_rid{rid}.json"
|
||||||
|
if not f.exists():
|
||||||
|
continue
|
||||||
|
q = json.loads(f.read_text())
|
||||||
|
for regime, presets in q.items():
|
||||||
|
if regime == "meta":
|
||||||
|
continue
|
||||||
|
for name, r in presets.items():
|
||||||
|
m = r["mean"]
|
||||||
|
rows.append({"rid": rid, "regime": regime, "preset": name, "phase0": r["phase0"], "phase_R": r["phase_R"],
|
||||||
|
"dphase": abs(r["phase_R"] - r["phase0"]), "phase_edge": r["phase_edge"],
|
||||||
|
"smc_warp_rmse_ms": m["SMC_warp_rmse_ms"], "cov90": m["SMC_warp_cov90"],
|
||||||
|
"sigma_post_ms": m["SMC_warp_width90_ms"] / Z90, "r_post": m["r_post"], "kappa_post": m["kappa_post"],
|
||||||
|
"b3c_warp_rmse_ms": m["B3c_warp_rmse_ms"], "b3d_warp_rmse_ms": m["B3d_warp_rmse_ms"],
|
||||||
|
"lam": r["lam"], "time_s": sum(r["time_s"].values()), "active": json.dumps(r.get("active", {}), sort_keys=True)})
|
||||||
|
return pd.DataFrame(rows)
|
||||||
|
|
||||||
|
|
||||||
|
def main() -> None:
|
||||||
|
ap = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)
|
||||||
|
ap.add_argument("--rids", type=int, nargs="+", default=[902, 903, 904, 905])
|
||||||
|
ap.add_argument("--out", type=Path, default=REPO_ROOT / "outputs" / "bench" / "dev")
|
||||||
|
a = ap.parse_args()
|
||||||
|
if any(r < 900 for r in a.rids):
|
||||||
|
raise SystemExit("dev realizations only")
|
||||||
|
df = load_smc(a.out, a.rids)
|
||||||
|
if df.empty:
|
||||||
|
raise SystemExit("no smc_qc_rid*.json found")
|
||||||
|
err = in_family_errors(a.out)
|
||||||
|
cfg = yaml.safe_load((REPO_ROOT / "configs" / "d2_synth_bench.yaml").read_text())
|
||||||
|
presets = cfg["misspec_presets"]
|
||||||
|
# Rows are identified by their active knobs, not by the name stored in the json: preset names were redefined on
|
||||||
|
# 29/10 (e.g. wv_L1 was minphase 1.0 on rid 902 and is minphase 0.5 now). Main-preset names win, then cand_*.
|
||||||
|
from ml_porosity.data.synth_d2 import active_axes, normalize_misspec, preset_misspec
|
||||||
|
main = [n for n in presets if not n.startswith("cand_")]
|
||||||
|
by_active = {}
|
||||||
|
for n in main + [n for n in presets if n.startswith("cand_")]:
|
||||||
|
by_active.setdefault(json.dumps(active_axes(normalize_misspec(preset_misspec(cfg, n))), sort_keys=True), n)
|
||||||
|
df["stored_name"] = df.preset
|
||||||
|
df["preset"] = [("nominal" if a == "{}" else by_active.get(a, f"{n} (old definition)")) for a, n in zip(df.active, df.stored_name)]
|
||||||
|
df = df.drop_duplicates(["rid", "regime", "active"]) # the same knobs run twice on one rid under two names
|
||||||
|
df["overconfidence"] = df.smc_warp_rmse_ms / df.sigma_post_ms
|
||||||
|
nom = df[df.preset == "nominal"].set_index(["rid", "regime"])
|
||||||
|
df = df.join(nom[["smc_warp_rmse_ms", "cov90", "sigma_post_ms"]].rename(columns=lambda c: c + "_nom"), on=["rid", "regime"])
|
||||||
|
df["warp_rmse_ratio_to_nominal"] = df.smc_warp_rmse_ms / df.smc_warp_rmse_ms_nom
|
||||||
|
df["smc_beats_b3c"] = df.smc_warp_rmse_ms < df.b3c_warp_rmse_ms
|
||||||
|
agg = df.groupby(["preset", "regime", "active"]).agg(n_rid=("rid", "nunique"), smc_warp_rmse_ms=("smc_warp_rmse_ms", "mean"),
|
||||||
|
ratio_to_nominal=("warp_rmse_ratio_to_nominal", "mean"), cov90=("cov90", "mean"),
|
||||||
|
sigma_post_ms=("sigma_post_ms", "mean"), overconfidence=("overconfidence", "mean"),
|
||||||
|
dphase_deg=("dphase", "mean"), phase_R=("phase_R", "mean"),
|
||||||
|
b3c_warp_rmse_ms=("b3c_warp_rmse_ms", "mean"), b3d_warp_rmse_ms=("b3d_warp_rmse_ms", "mean"),
|
||||||
|
smc_beats_b3c_frac=("smc_beats_b3c", "mean"), r_post=("r_post", "mean"),
|
||||||
|
time_s=("time_s", "mean")).reset_index()
|
||||||
|
agg["in_family_err"] = agg.active.map(lambda a: err.get(a, np.nan))
|
||||||
|
agg["err_over_noise"] = agg.in_family_err / agg.regime.map(NOISE)
|
||||||
|
agg["note"] = agg.preset.map(lambda n: presets.get(n, {}).get("note", "nominal" if n == "nominal" else ""))
|
||||||
|
agg["axis"] = agg.preset.map(lambda n: "nominal" if n == "nominal" else next((p for p in n.split("_") if p in ("rp", "wv", "dr")), "?"))
|
||||||
|
agg = agg.sort_values(["regime", "axis", "preset"]).reset_index(drop=True)
|
||||||
|
agg.to_csv(a.out / "calibration.csv", index=False)
|
||||||
|
cols = ["regime", "axis", "preset", "active", "n_rid", "in_family_err", "err_over_noise", "smc_warp_rmse_ms", "ratio_to_nominal", "cov90",
|
||||||
|
"sigma_post_ms", "overconfidence", "dphase_deg", "b3c_warp_rmse_ms", "smc_beats_b3c_frac", "r_post"]
|
||||||
|
L = ["# S2 level calibration (dev; N = 4, c = 1, P = 1024, estR, γ = 1/κ; single-checkpoint SMC of scripts/33)", "",
|
||||||
|
f"Realizations: {sorted(df.rid.unique().tolist())}. Means over realizations × 4 train wells. in_family_err from generator_qc.json "
|
||||||
|
"(rid 902; NaN for presets without a light-QC entry). Declared targets (protocol calibration.procedure): L1 — err/noise(R10) "
|
||||||
|
"0.5–1.0 and SMC still ahead of B3c at R10; L2 — err/noise(R10) 1.5–2 with coverage90 < 0.5 at R10 or warp RMSE ≥ 2 × nominal.", "",
|
||||||
|
agg[cols].to_markdown(index=False, floatfmt=".3f"), "", "## Per realization", "",
|
||||||
|
df[["rid", "regime", "preset", "stored_name", "smc_warp_rmse_ms", "cov90", "sigma_post_ms", "dphase", "b3c_warp_rmse_ms", "r_post"]]
|
||||||
|
.sort_values(["regime", "preset", "rid"]).to_markdown(index=False, floatfmt=".3f"), ""]
|
||||||
|
(a.out / "calibration.md").write_text("\n".join(L))
|
||||||
|
pd.set_option("display.width", 250)
|
||||||
|
print(agg[cols].round(3).to_string())
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
149
scripts/36_bench_verdicts.py
Normal file
149
scripts/36_bench_verdicts.py
Normal file
@@ -0,0 +1,149 @@
|
|||||||
|
"""Final verdicts of protocol_bench (phase P6): the 11 pre-declared verdicts read exactly as their statements are worded.
|
||||||
|
|
||||||
|
CUDA_VISIBLE_DEVICES= .venv/bin/python scripts/36_bench_verdicts.py
|
||||||
|
|
||||||
|
Runs after `scripts/34_run_bench.py summarize` and never edits its outputs. The locked summary code
|
||||||
|
(ml_porosity/benchmark/summary.py) computes every cell correctly, but three verdict extractions differ from the
|
||||||
|
statements of configs/protocol_bench.yaml (found after the main runs, before any paper text used them):
|
||||||
|
|
||||||
|
S1-H1 the statement names N ∈ {4, 16}; the code requires exactly two R10 c = 1.5 rows, but S1 has four N values
|
||||||
|
(2, 4, 8, 16), so it returns pass = null. Here: the two rows N ∈ {4, 16} of s1_h2a.csv.
|
||||||
|
S2-H1 the code stores one verdict per axis (per_axis) and no top-level `pass`, so summary.md prints
|
||||||
|
"not available". Here: per axis from s2_h2a.csv (R10, preset *_L1, c = 1, N ∈ {4, 16}).
|
||||||
|
S3-H1 the statement fixes the competitors {B3b, B3c, B3c-R, B4a, B4b, B4c, B4d}; the code uses POINT_TIES + every
|
||||||
|
S3 method, which adds the disclosed control bank Ctl-GP (T2-1). Ctl-GP uses the posterior mean and
|
||||||
|
covariance, so it is not a point tie or an anchor-free baseline. Here: h2a_cells of the locked code with the
|
||||||
|
stated set (bootstrap rng 0, 2000 resamples, one generator per regime in the summary's regime order).
|
||||||
|
|
||||||
|
The other eight verdicts are copied from verdict.json. Both readings are written side by side; the as-run S3-H1
|
||||||
|
result (with Ctl-GP) stays reported. The lock is checked first (code, protocol, inputs).
|
||||||
|
→ outputs/bench/summary/verdict_final.json, verdict_final.md, s3_h2a_stated.csv
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import json
|
||||||
|
|
||||||
|
import numpy as np
|
||||||
|
import pandas as pd
|
||||||
|
|
||||||
|
from ml_porosity.benchmark import summary as S
|
||||||
|
from ml_porosity.benchmark.cells import bench_root
|
||||||
|
from ml_porosity.benchmark.protocol import freeze, load_protocol
|
||||||
|
|
||||||
|
S3_COMP = S.POINT_TIES + ["B4a", "B4b", "B4c", "B4d"]
|
||||||
|
H2A_REGIMES = ["R10", "R0", "Rm5"]
|
||||||
|
ORDER = ["S1-H1", "S1-H2", "S2-H1/rock_physics", "S2-H1/wavelet", "S2-H1/drift", "S2-H2", "S3-H1", "S4-H1", "S4-H2",
|
||||||
|
"S8-H1", "S8-H2"]
|
||||||
|
PRED_S2 = {"rock_physics": "pass", "wavelet": "pass (phase sub-axis wv_L1)", "drift": "uncertain"} # S2-H1.prediction
|
||||||
|
|
||||||
|
|
||||||
|
def _cell(r) -> dict:
|
||||||
|
return {"best": r.best, "ratio": float(r.ratio), "ci": [float(r.ratio_lo), float(r.ratio_hi)], "dpcc": float(r.dpcc),
|
||||||
|
"seeds_improve": int(r.seeds_improve), "rids_improve": int(r.rids_improve), "cell_pass": bool(r.cell_pass)}
|
||||||
|
|
||||||
|
|
||||||
|
def s1_h1(out, n_rid: int) -> dict:
|
||||||
|
t = pd.read_csv(out / "s1_h2a.csv")
|
||||||
|
t = t[(t.regime == "R10") & (t.c == 1.5) & t.n_train.isin([4, 16])]
|
||||||
|
ok = len(t) == 2 and bool((t.n_rid == n_rid).all())
|
||||||
|
return {"cells": {int(r.n_train): _cell(r) for r in t.itertuples()}, "complete": ok,
|
||||||
|
"pass": bool(t.cell_pass.all()) if ok else None}
|
||||||
|
|
||||||
|
|
||||||
|
def s2_h1(out, n_rid: int) -> dict:
|
||||||
|
t = pd.read_csv(out / "s2_h2a.csv")
|
||||||
|
t = t[(t.regime == "R10") & t.preset.str.endswith("_L1") & (t.c == 1) & t.n_train.isin([4, 16])]
|
||||||
|
res = {}
|
||||||
|
for axis, g in t.groupby("axis"):
|
||||||
|
ok = len(g) == 2 and bool((g.n_rid == n_rid).all())
|
||||||
|
res[axis] = {"preset": g.preset.iloc[0], "cells": {int(r.n_train): _cell(r) for r in g.itertuples()},
|
||||||
|
"complete": ok, "pass": bool(g.cell_pass.all()) if ok else None}
|
||||||
|
return res
|
||||||
|
|
||||||
|
|
||||||
|
def s3_h1(p: dict, n_boot: int) -> tuple[dict, pd.DataFrame]:
|
||||||
|
_, run_b4, _ = S.load_study(p, bench_root(dev=False), "S3")
|
||||||
|
run = pd.concat([S.p2r_runs(p), run_b4], ignore_index=True)
|
||||||
|
assert set(S3_COMP) <= set(run.method), sorted(run.method.unique())
|
||||||
|
rows, per = [], {}
|
||||||
|
for reg, g in run.groupby("regime"):
|
||||||
|
cells = S.h2a_cells(g, "B3d-Sa", S3_COMP, np.random.default_rng(0), n_boot)
|
||||||
|
rows.append(cells.assign(regime=reg, flag=np.where(cells.c == 2, "unstable posterior", "")))
|
||||||
|
c1, c0 = cells[cells.c == 1], cells[cells.c == 0]
|
||||||
|
macro = float(c0.m2_band_rmse.mean() / c0.best_band_rmse.mean())
|
||||||
|
guard = bool(len(c0) == 2 and macro <= S.sp13.GUARD and (c0.ratio <= S.sp13.GUARD).all())
|
||||||
|
per[reg] = {"c1_cells": {int(r.n_train): _cell(r) for r in c1.itertuples()},
|
||||||
|
"zero_drift_ratios": {int(r.n_train): float(r.ratio) for r in c0.itertuples()},
|
||||||
|
"zero_drift_macro_ratio": macro, "zero_drift_guard": guard,
|
||||||
|
"regime_pass": bool(len(c1) == 2 and c1.cell_pass.all() and guard),
|
||||||
|
"b4_best_anywhere": sorted({f"c{r.c:g}/N{r.n_train}:{r.best}" for r in cells.itertuples() if r.best.startswith("B4")}),
|
||||||
|
"complete": bool(len(cells) == 6 and (cells.n_rid == len(p["grid"]["realizations"])).all())}
|
||||||
|
v = {"competitors": S3_COMP, "per_regime": per, "pass": per.get("R10", {}).get("regime_pass"),
|
||||||
|
"regimes_pass": [r for r in H2A_REGIMES if per.get(r, {}).get("regime_pass")]}
|
||||||
|
return v, pd.concat(rows, ignore_index=True)
|
||||||
|
|
||||||
|
|
||||||
|
def main() -> None:
|
||||||
|
freeze(check=True)
|
||||||
|
p = load_protocol()
|
||||||
|
out = bench_root(dev=False) / "summary"
|
||||||
|
raw = json.loads((out / "verdict.json").read_text())
|
||||||
|
n_rid, n_boot = len(p["grid"]["realizations"]), 2000
|
||||||
|
|
||||||
|
s3, s3_tab = s3_h1(p, n_boot)
|
||||||
|
s3_tab.to_csv(out / "s3_h2a_stated.csv", index=False)
|
||||||
|
s2 = s2_h1(out, n_rid)
|
||||||
|
as_run = {"S1-H1": raw["S1"]["S1-H1"].get("pass"), "S1-H2": raw["S1"]["S1-H2"]["pass"],
|
||||||
|
**{f"S2-H1/{a}": raw["S2"]["S2-H1"]["per_axis"][a]["pass"] for a in ("rock_physics", "wavelet", "drift")},
|
||||||
|
"S2-H2": raw["S2"]["S2-H2"]["pass"], "S3-H1": raw["S3"]["pass"], "S4-H1": raw["S4"]["S4-H1"]["pass"],
|
||||||
|
"S4-H2": raw["S4"]["S4-H2"]["pass"], "S8-H1": raw["S8"]["S8-H1"]["pass"], "S8-H2": raw["S8"]["S8-H2"]["pass"]}
|
||||||
|
detail = {"S1-H1": s1_h1(out, n_rid), "S1-H2": raw["S1"]["S1-H2"],
|
||||||
|
**{f"S2-H1/{a}": s2[a] for a in ("rock_physics", "wavelet", "drift")},
|
||||||
|
"S2-H2": raw["S2"]["S2-H2"], "S3-H1": s3, "S4-H1": raw["S4"]["S4-H1"], "S4-H2": raw["S4"]["S4-H2"],
|
||||||
|
"S8-H1": raw["S8"]["S8-H1"], "S8-H2": raw["S8"]["S8-H2"]}
|
||||||
|
final = {k: detail[k]["pass"] for k in ORDER}
|
||||||
|
for a in ("rock_physics", "wavelet", "drift"): # the per-axis extraction of the code is correct
|
||||||
|
assert final[f"S2-H1/{a}"] == as_run[f"S2-H1/{a}"], a
|
||||||
|
note = {"S1-H1": "code filter: exactly 2 rows at R10 c = 1.5 (S1 has N = 2, 4, 8, 16) → null; statement: N ∈ {4, 16}",
|
||||||
|
"S3-H1": "code competitors include Ctl-GP (POINT_TIES + S3 methods); statement: {B3b, B3c, B3c-R, B4a–d}"}
|
||||||
|
verdict = {"protocol_sha256": raw["protocol_sha256"], "source": "outputs/bench/summary/verdict.json (scripts/34 summarize)",
|
||||||
|
"final": final, "as_run": as_run, "differences": note, "detail": detail,
|
||||||
|
"passed": [k for k in ORDER if final[k]], "failed": [k for k in ORDER if final[k] is False],
|
||||||
|
"S2_axes_pass": [a for a in ("rock_physics", "wavelet", "drift") if final[f"S2-H1/{a}"]]}
|
||||||
|
(out / "verdict_final.json").write_text(json.dumps(verdict, indent=1, default=float))
|
||||||
|
|
||||||
|
hyp = p["hypotheses"]
|
||||||
|
fmt = lambda x: "PASS" if x else "FAIL" if x is False else "null"
|
||||||
|
L = ["# protocol_bench final verdicts (scripts/36_bench_verdicts.py)", "",
|
||||||
|
f"Protocol sha256 {raw['protocol_sha256'][:12]}…; lock checked. Statements of configs/protocol_bench.yaml applied as "
|
||||||
|
"written; `as run` is verdict.json of scripts/34 summarize (locked code). No family-wise correction (11 verdicts).", "",
|
||||||
|
"| verdict | final | as run | prediction | note |", "|---|---|---|---|---|"]
|
||||||
|
for k in ORDER:
|
||||||
|
pred = PRED_S2[k.split("/")[1]] if k.startswith("S2-H1") else str(hyp[k]["prediction"]).split(";")[0].strip()
|
||||||
|
L.append(f"| {k} | **{fmt(final[k])}** | {fmt(as_run[k])} | {pred} | {note.get(k, '')} |")
|
||||||
|
L += ["", "## S1-H1 (R10, c = 1.5)", ""]
|
||||||
|
L += [f"- N = {n}: best {c['best']}, ratio {c['ratio']:.3f} [{c['ci'][0]:.3f}, {c['ci'][1]:.3f}], ΔPCC {c['dpcc']:+.3f}, "
|
||||||
|
f"seeds {c['seeds_improve']}/5, rids {c['rids_improve']}/{n_rid}, cell_pass {c['cell_pass']}" for n, c in detail["S1-H1"]["cells"].items()]
|
||||||
|
L += ["", "## S2-H1 per axis (R10, L1, c = 1)", ""]
|
||||||
|
for a in ("rock_physics", "wavelet", "drift"):
|
||||||
|
d = detail[f"S2-H1/{a}"]
|
||||||
|
L += [f"- {a} ({d['preset']}), N = {n}: best {c['best']}, ratio {c['ratio']:.3f} [{c['ci'][0]:.3f}, {c['ci'][1]:.3f}], "
|
||||||
|
f"ΔPCC {c['dpcc']:+.3f}, seeds {c['seeds_improve']}/5, rids {c['rids_improve']}/{n_rid} → {fmt(c['cell_pass'])}"
|
||||||
|
for n, c in d["cells"].items()]
|
||||||
|
L += ["", "## S3-H1 with the stated competitors", "", "| regime | c = 1, N = 4 | c = 1, N = 16 | c = 0 guard (macro) | regime | B4 best in |",
|
||||||
|
"|---|---|---|---|---|---|"]
|
||||||
|
for reg, d in s3["per_regime"].items():
|
||||||
|
cc = [f"{d['c1_cells'][n]['ratio']:.3f} ({d['c1_cells'][n]['best']}) {fmt(d['c1_cells'][n]['cell_pass'])}" for n in (4, 16)]
|
||||||
|
L.append(f"| {reg} | {cc[0]} | {cc[1]} | {fmt(d['zero_drift_guard'])} ({d['zero_drift_macro_ratio']:.3f}) | "
|
||||||
|
f"{fmt(d['regime_pass'])} | {', '.join(d['b4_best_anywhere']) or '—'} |")
|
||||||
|
r = raw["S3"]["per_regime"]
|
||||||
|
L += ["", f"As run (with Ctl-GP): best at c = 1 is Ctl-GP in {sum(v['best_at_c1'] == {'4': 'Ctl-GP', '16': 'Ctl-GP'} for v in r.values())}/{len(r)} "
|
||||||
|
f"regimes; R10 zero-drift macro ratio {r['R10']['zero_drift_macro_ratio']:.4f} → regime fail. Kept as a disclosed reading "
|
||||||
|
"(see T2-1 in verdict.json).", ""]
|
||||||
|
(out / "verdict_final.md").write_text("\n".join(L))
|
||||||
|
print("\n".join(L))
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
490
scripts/37_bench_package.py
Normal file
490
scripts/37_bench_package.py
Normal file
@@ -0,0 +1,490 @@
|
|||||||
|
"""S7 packaging of protocol_bench (phase P6): the registration-aware benchmark as files, with one command to generate
|
||||||
|
the tasks and one command to score predictions against the reference methods.
|
||||||
|
|
||||||
|
CUDA_VISIBLE_DEVICES= .venv/bin/python scripts/37_bench_package.py generate [--out DIR] [--split test dev]
|
||||||
|
CUDA_VISIBLE_DEVICES= .venv/bin/python scripts/37_bench_package.py tables [--out DIR]
|
||||||
|
CUDA_VISIBLE_DEVICES= .venv/bin/python scripts/37_bench_package.py score --pred DIR --name NAME [--out DIR]
|
||||||
|
CUDA_VISIBLE_DEVICES= .venv/bin/python scripts/37_bench_package.py selftest [--out DIR]
|
||||||
|
CUDA_VISIBLE_DEVICES= .venv/bin/python scripts/37_bench_package.py check [--out DIR]
|
||||||
|
|
||||||
|
DIR defaults to outputs/bench/package. Documentation for users of the benchmark: benchmark/README.md.
|
||||||
|
|
||||||
|
generate One npz per task (setting, c, realization) in DIR/tasks/<split>/<setting>/, the hidden truth in
|
||||||
|
DIR/truth/<split>/<setting>/, the generator inputs and the analyst's knowledge in DIR/inputs/, an index
|
||||||
|
(DIR/tasks/index.csv) and DIR/MANIFEST.json. The manifest records the sha256 of the array content of each
|
||||||
|
file (key, dtype, shape, bytes; independent of zip metadata). The first run writes benchmark/MANIFEST.json
|
||||||
|
(tracked in git); later runs must reproduce it exactly or fail (--update-manifest overwrites it).
|
||||||
|
Observations are those of the runner (ml_porosity.benchmark.data.Inputs.observe): the 16 pool wells (a
|
||||||
|
task with N training wells uses the first N) and the 8 test wells at the regime SNR.
|
||||||
|
tables Reference runs of every method of protocol_p2r and protocol_bench at its registered budget, one row per
|
||||||
|
(setting, c, N, realization, seed, method) → DIR/reference/runs.csv.gz, and the per-cell means with σ_post
|
||||||
|
→ benchmark/reference/cells.csv and benchmark/reference/main_table.md (and copies in DIR/reference/).
|
||||||
|
score Predictions <pred>/<split>/<setting>/r{rid}_c{c}_n{N}_s{seed}.npz with `mu` (8, 126) and optionally `sigma`
|
||||||
|
(8, 126), porosity in p.u., test wells in task order. Metrics are those of the runner (scripts/11 evaluate).
|
||||||
|
On the test split the locked rules of ml_porosity/benchmark/summary.py are applied per cell: the H2a cell
|
||||||
|
rule against the best point tie {B3b, B3c, B3c-R}, and the `better` rule against B3d-Sa, M2-Sa, Oracle
|
||||||
|
(PM2, BK2, Oracle in the two-mode settings). Reference rows are restricted to the submitted realizations and
|
||||||
|
seeds. Bootstrap CIs use one generator (rng 0) per cell, so they can differ slightly from the summary
|
||||||
|
tables; no rule uses a CI. → <pred>/score/
|
||||||
|
selftest Writes saved predictions of reference methods as a submission (S1 R10 c = 1.5, S2 R10 wv_L1, P2r R10 c = 1,
|
||||||
|
S8 R10 Δ = 16), scores it, and checks that metrics and rule outputs equal those of the reference runs and
|
||||||
|
that the package truth equals the y_true saved by the runner.
|
||||||
|
check Recomputes the content hashes of DIR against benchmark/MANIFEST.json (for a downloaded copy).
|
||||||
|
|
||||||
|
Outside the code hash of the protocol_bench lock (scripts/34 and ml_porosity/ only); generate and tables check the
|
||||||
|
lock first. Nothing here trains a model or changes a locked output.
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import argparse
|
||||||
|
import hashlib
|
||||||
|
import json
|
||||||
|
import math
|
||||||
|
import re
|
||||||
|
import shutil
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
import numpy as np
|
||||||
|
import pandas as pd
|
||||||
|
|
||||||
|
from ml_porosity.benchmark import summary as S
|
||||||
|
from ml_porosity.benchmark.cells import bench_root
|
||||||
|
from ml_porosity.benchmark.data import load_inputs, load_script
|
||||||
|
from ml_porosity.benchmark.protocol import freeze, load_protocol
|
||||||
|
from ml_porosity.benchmark.training import SIDE_STREAM
|
||||||
|
from ml_porosity.data import synth_d2
|
||||||
|
from ml_porosity.paths import REPO_ROOT, outputs_dir
|
||||||
|
|
||||||
|
PKG = outputs_dir() / "bench" / "package"
|
||||||
|
DOC = REPO_ROOT / "benchmark"
|
||||||
|
GAUSS = ["nll", "crps", "mean_sigma", "coverage_50", "coverage_80", "coverage_90", "coverage_95"]
|
||||||
|
CELL = ["setting", "c", "n_train"]
|
||||||
|
RUN = ["setting", "c", "n_train", "rid", "seed", "method"]
|
||||||
|
PRED = re.compile(r"r(\d+)_c([\d.]+)_n(\d+)_s(\d+)")
|
||||||
|
WIDE_MS = 1.5 # rules.wide of protocol_bench
|
||||||
|
N_BOOT = 2000
|
||||||
|
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------- tasks
|
||||||
|
|
||||||
|
def settings(p: dict) -> list[dict]:
|
||||||
|
"""Every (regime, preset, Δ) of the benchmark with its drift factors: S1 (nominal), S2 (presets), S8 (two-mode)."""
|
||||||
|
st = p["studies"]
|
||||||
|
out = [dict(setting=r, regime=r, preset="nominal", delta_ms=None, cs=st["S1"]["drift_factors"]) for r in p["grid"]["regimes"]]
|
||||||
|
out += [dict(setting=f"{r}__{pr}", regime=r, preset=pr, delta_ms=None, cs=st["S2"]["drift_factors"])
|
||||||
|
for r in st["S2"]["regimes"] for axis in st["S2"]["presets"].values() for pr in axis]
|
||||||
|
out += [dict(setting=f"{r}__s8d{d:g}", regime=r, preset="nominal", delta_ms=float(d), cs=st["S8"]["drift_factors"])
|
||||||
|
for r in st["S8"]["regimes"] for d in st["S8"]["delta_ms"]]
|
||||||
|
return out
|
||||||
|
|
||||||
|
|
||||||
|
def task_arrays(inp, R, s: dict, c: float) -> tuple[dict, dict]:
|
||||||
|
reg = inp.regime(s["regime"])
|
||||||
|
obs, test = inp.observe(R, c, s["regime"], len(R.pool))
|
||||||
|
task = {"rid": np.int64(R.rid), "c": np.float64(c), "snr_db": np.float64(reg["snr_db"]),
|
||||||
|
"anchor_density": np.array(reg["anchor_density"]), "sigma_a_ms": np.float64(inp.sigma_a),
|
||||||
|
"t_seis_ms": R.t_ext, "t_label_ms": R.t_main, "tau_ms": R.tau_fine,
|
||||||
|
"train_names": np.array([o["name"] for o in obs]), "train_seis": np.stack([o["seis"] for o in obs]),
|
||||||
|
"train_phi_log": np.stack([o["phi_log"] for o in obs]), "train_ai_log": np.stack([o["ai_log"] for o in obs]),
|
||||||
|
"train_ilxl": np.array([[w.il, w.xl] for w in R.pool]), "train_xy": np.array([[w.x, w.y] for w in R.pool]),
|
||||||
|
"anchor_well": np.concatenate([np.full(len(o["tau_k"]), i) for i, o in enumerate(obs)]),
|
||||||
|
"anchor_tau_ms": np.concatenate([o["tau_k"] for o in obs]), "anchor_t_ms": np.concatenate([o["t_k"] for o in obs]),
|
||||||
|
"test_names": np.array([o["name"] for o in test]), "test_seis": np.stack([o["seis"] for o in test]),
|
||||||
|
"test_ilxl": np.array([[w.il, w.xl] for w in R.test]), "test_xy": np.array([[w.x, w.y] for w in R.test])}
|
||||||
|
truth = {"y_test": 100 * np.stack([o["y_true"] for o in test]), "test_names": task["test_names"],
|
||||||
|
"train_t_of_tau_ms": np.stack([o["t_of_tau_true"] for o in obs]),
|
||||||
|
"train_b_ms": np.array([o["b"] for o in obs]), "train_g": np.stack([o["g"] for o in obs])}
|
||||||
|
if s["delta_ms"] is not None: # S8: modes t_true and t_true + s·Δ (training.two_mode_banks)
|
||||||
|
d = s["delta_ms"]
|
||||||
|
side = np.array([int(np.random.default_rng([R.rid, SIDE_STREAM, 8, i]).integers(2)) * 2 - 1 for i in range(len(obs))])
|
||||||
|
task |= {"delta_ms": np.float64(d),
|
||||||
|
"two_mode_t_of_tau_ms": np.stack([np.stack([o["t_of_tau_true"], o["t_of_tau_true"] + si * d])
|
||||||
|
for o, si in zip(obs, side)])}
|
||||||
|
truth["two_mode_side"] = side
|
||||||
|
return task, truth
|
||||||
|
|
||||||
|
|
||||||
|
def content_sha(arrs: dict) -> str:
|
||||||
|
h = hashlib.sha256()
|
||||||
|
for k in sorted(arrs):
|
||||||
|
a = np.ascontiguousarray(np.asarray(arrs[k]))
|
||||||
|
h.update(f"{k}|{a.dtype.str}|{a.shape}|".encode())
|
||||||
|
h.update(a.tobytes())
|
||||||
|
return h.hexdigest()
|
||||||
|
|
||||||
|
|
||||||
|
def npz_sha(f: Path) -> str:
|
||||||
|
with np.load(f) as z:
|
||||||
|
return content_sha({k: z[k] for k in z.files})
|
||||||
|
|
||||||
|
|
||||||
|
def file_sha(f: Path) -> str:
|
||||||
|
return hashlib.sha256(f.read_bytes()).hexdigest()
|
||||||
|
|
||||||
|
|
||||||
|
def analyst(p: dict, inp) -> dict:
|
||||||
|
"""What a method may assume: the analyst's (nominal) wavelet, warp prior, anchor noise and rock physics."""
|
||||||
|
cfg, wp = inp.cfg, p["inputs"]["warp_prior"]
|
||||||
|
return {
|
||||||
|
"units": {"time": "ms two-way time", "tau": "ms sonic time τ of the logs (0.5 ms grid)",
|
||||||
|
"labels": "porosity in percent (p.u.) = 100 × fraction", "phi_log": "porosity fraction"},
|
||||||
|
"seismic": {"dt_ms": cfg["dt_ms"], "window_ms": cfg["ext_window_ms"], "label_window_ms": cfg["main_window_ms"],
|
||||||
|
"patch": "3 × 3 traces around each well: inline offset −1..1 (outer) × crossline offset −1..1 "
|
||||||
|
"(inner); the centre trace is index 4; labels refer to the centre trace"},
|
||||||
|
"anchors": {"sigma_a_ms": inp.sigma_a,
|
||||||
|
"model": "unit-boundary picks: anchor_tau_ms exact on the log, anchor_t_ms = true time + N(0, σ_a²)"},
|
||||||
|
"rock_physics_nominal": {"phi_dt": [synth_d2.PHI_DT_A, synth_d2.PHI_DT_B], "rhob": [synth_d2.RHO_0, synth_d2.RHO_1],
|
||||||
|
"formula": "DT = (φ − A)/B µs/m; RHOB = ρ0 − ρ1·φ kg/m³; AI = RHOB·1e6/DT; "
|
||||||
|
"train_ai_log = AI(train_phi_log)"},
|
||||||
|
"wavelet_nominal": {"file": "inputs/wavelets.npz", "key": p["inputs"]["wavelet"]["key"], "dt_ms": cfg["dt_ms"],
|
||||||
|
"note": "zero phase; the reference registrations re-estimate a constant phase on a 15° grid"},
|
||||||
|
"warp_prior": {"file": "inputs/warp_prior_f3.json", "fit": wp["fit"], "hyper": inp.prior_hyper,
|
||||||
|
"sigma_b_ms": inp.reg["sigma_b_ms"],
|
||||||
|
"model": "t(τ) = b + ∫ exp(g) dτ on a 4 ms τ grid; g a stationary GP (fit), b ~ N(0, σ_b²)"},
|
||||||
|
"metric": {"primary": "band RMSE: RMSE after a 4th-order zero-phase Butterworth high-pass at f_c, mean over "
|
||||||
|
"the 8 test wells", "f_c_hz": inp.f_c, "secondary": "band PCC"},
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def generate(a) -> None:
|
||||||
|
if not a.skip_lock_check:
|
||||||
|
freeze(check=True)
|
||||||
|
p = load_protocol()
|
||||||
|
inp = load_inputs(p)
|
||||||
|
out = Path(a.out)
|
||||||
|
rids = {"test": p["grid"]["realizations"], "dev": p["grid"]["dev_realizations"]}
|
||||||
|
for d in ("tasks", "truth"):
|
||||||
|
for sp in a.split:
|
||||||
|
shutil.rmtree(out / d / sp, ignore_errors=True)
|
||||||
|
rows, files = [], {}
|
||||||
|
for sp in a.split:
|
||||||
|
for rid in rids[sp]:
|
||||||
|
cache = {}
|
||||||
|
for s in settings(p):
|
||||||
|
R = cache.get(s["preset"]) or cache.setdefault(s["preset"], inp.realization(rid, None if s["preset"] == "nominal" else s["preset"]))
|
||||||
|
for c in s["cs"]:
|
||||||
|
task, truth = task_arrays(inp, R, s, float(c))
|
||||||
|
rel = Path(sp) / s["setting"] / f"r{rid}_c{float(c):g}.npz"
|
||||||
|
for d, arr in (("tasks", task), ("truth", truth)):
|
||||||
|
(out / d / rel).parent.mkdir(parents=True, exist_ok=True)
|
||||||
|
np.savez_compressed(out / d / rel, **arr)
|
||||||
|
files[f"{d}/{rel}"] = content_sha(arr)
|
||||||
|
rows.append({"split": sp, "setting": s["setting"], "regime": s["regime"], "preset": s["preset"],
|
||||||
|
"delta_ms": s["delta_ms"], "c": float(c), "rid": rid, "snr_db": float(task["snr_db"]),
|
||||||
|
"anchor_density": str(task["anchor_density"]), "n_pool": len(task["train_names"]),
|
||||||
|
"n_test": len(task["test_names"]), "n_anchors": len(task["anchor_tau_ms"]),
|
||||||
|
"task": f"tasks/{rel}", "truth": f"truth/{rel}"})
|
||||||
|
print(f"{sp} r{rid}: {sum(r['rid'] == rid and r['split'] == sp for r in rows)} tasks", flush=True)
|
||||||
|
idx = pd.DataFrame(rows)
|
||||||
|
if (out / "tasks" / "index.csv").exists(): # keep the rows of splits not regenerated
|
||||||
|
old = pd.read_csv(out / "tasks" / "index.csv")
|
||||||
|
idx = pd.concat([old[~old.split.isin(a.split)], idx], ignore_index=True)
|
||||||
|
idx.to_csv(out / "tasks" / "index.csv", index=False)
|
||||||
|
|
||||||
|
src = out / "inputs"
|
||||||
|
src.mkdir(parents=True, exist_ok=True)
|
||||||
|
for k in ("d2_config", "warp_prior", "wavelet", "horizon_cache"):
|
||||||
|
shutil.copy2(REPO_ROOT / p["inputs"][k]["path"], src / Path(p["inputs"][k]["path"]).name)
|
||||||
|
shutil.copy2(REPO_ROOT / "configs" / "protocol_bench.yaml", src / "protocol_bench.yaml")
|
||||||
|
(src / "analyst.json").write_text(json.dumps(analyst(p, inp), indent=1, ensure_ascii=False, default=float))
|
||||||
|
|
||||||
|
old = json.loads((out / "MANIFEST.json").read_text()) if (out / "MANIFEST.json").exists() else {}
|
||||||
|
keep = {k: v for k, v in old.get("files", {}).items() if k.split("/")[1] not in a.split}
|
||||||
|
lock = json.loads((REPO_ROOT / "configs" / "protocol_bench.lock.json").read_text())
|
||||||
|
man = {"benchmark": "protocol_bench v1 (registration-aware D2 benchmark)", "protocol_sha256": lock["protocol_sha256"],
|
||||||
|
"code_sha256_at_lock": lock["code_sha256"], "hash": "sha256 of array content: for each key in sorted order, "
|
||||||
|
"'key|dtype|shape|' then the C-order bytes (scripts/37_bench_package.py content_sha)",
|
||||||
|
"inputs": {f"inputs/{f.name}": file_sha(f) for f in sorted(src.iterdir()) if f.name != "analyst.json"},
|
||||||
|
"splits": {sp: rids[sp] for sp in sorted(set(old.get("splits", {})) | set(a.split))},
|
||||||
|
"n_tasks": int(len(idx)), "files": dict(sorted((keep | files).items()))}
|
||||||
|
(out / "MANIFEST.json").write_text(json.dumps(man, indent=1))
|
||||||
|
ref = DOC / "MANIFEST.json"
|
||||||
|
if ref.exists() and not a.update_manifest:
|
||||||
|
want = json.loads(ref.read_text())
|
||||||
|
bad = [k for k, v in man["files"].items() if want["files"].get(k) != v]
|
||||||
|
bad += [k for k in want["files"] if k.split("/")[1] in a.split and k not in man["files"]]
|
||||||
|
if bad or want["inputs"] != man["inputs"]:
|
||||||
|
raise SystemExit(f"generated content differs from benchmark/MANIFEST.json: {len(bad)} files, e.g. {bad[:3]}; "
|
||||||
|
f"inputs equal: {want['inputs'] == man['inputs']}")
|
||||||
|
print(f"content hashes equal to benchmark/MANIFEST.json ({len(man['files'])} files)")
|
||||||
|
else:
|
||||||
|
DOC.mkdir(exist_ok=True)
|
||||||
|
shutil.copy2(out / "MANIFEST.json", ref)
|
||||||
|
print(f"wrote benchmark/MANIFEST.json ({len(man['files'])} files)")
|
||||||
|
if (DOC / "README.md").exists():
|
||||||
|
shutil.copy2(DOC / "README.md", out / "README.md")
|
||||||
|
print(f"{len(idx)} tasks → {out}")
|
||||||
|
|
||||||
|
|
||||||
|
def check(a) -> None:
|
||||||
|
out, want = Path(a.out), json.loads((DOC / "MANIFEST.json").read_text())
|
||||||
|
bad = [k for k, v in want["files"].items() if not (out / k).exists() or npz_sha(out / k) != v]
|
||||||
|
bad += [k for k, v in want["inputs"].items() if not (out / k).exists() or file_sha(out / k) != v]
|
||||||
|
print(f"{len(want['files']) + len(want['inputs']) - len(bad)}/{len(want['files']) + len(want['inputs'])} files match")
|
||||||
|
if bad:
|
||||||
|
raise SystemExit(f"mismatch: {bad[:10]}")
|
||||||
|
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------- reference tables
|
||||||
|
|
||||||
|
def setting_of(df: pd.DataFrame) -> pd.Series:
|
||||||
|
preset = df["preset"].fillna("nominal")
|
||||||
|
d = df["delta_ms"] if "delta_ms" in df else pd.Series(np.nan, index=df.index)
|
||||||
|
s8 = df["regime"] + "__s8d" + d.map(lambda x: f"{x:g}" if pd.notna(x) else "")
|
||||||
|
return pd.Series(np.where(d.notna(), s8, np.where(preset == "nominal", df["regime"], df["regime"] + "__" + preset)),
|
||||||
|
index=df.index)
|
||||||
|
|
||||||
|
|
||||||
|
def reference_runs(p: dict) -> pd.DataFrame:
|
||||||
|
parts = [S.p2r_runs(p).assign(study="P2r")]
|
||||||
|
for st in ("S1", "S2", "S3", "S4", "S8"):
|
||||||
|
parts.append(S.load_study(p, bench_root(), st)[1].assign(study=st))
|
||||||
|
df = pd.concat(parts, ignore_index=True)
|
||||||
|
df["preset"] = df["preset"].fillna("nominal")
|
||||||
|
df["setting"] = setting_of(df)
|
||||||
|
dup = df.duplicated(RUN)
|
||||||
|
if dup.any():
|
||||||
|
raise RuntimeError(f"{int(dup.sum())} duplicated reference runs, e.g. {df[dup][RUN].head(3).to_dict('records')}")
|
||||||
|
return df[["study", "regime", "preset", "delta_ms", *RUN, *S.METRICS]].sort_values(RUN).reset_index(drop=True)
|
||||||
|
|
||||||
|
|
||||||
|
def sigma_post(p: dict) -> pd.DataFrame:
|
||||||
|
a = pd.read_csv(REPO_ROOT / p["reference"]["p2r"]["root"] / "summary" / "sigma_post.csv")
|
||||||
|
d = bench_root() / "posterior"
|
||||||
|
b = S.sigma_post_table({x.name: x for x in sorted(d.iterdir()) if x.is_dir()})
|
||||||
|
cols = ["setting", "c", "n_train", "sigma_post_ms", "warp_rmse_ms", "warp_cov90"]
|
||||||
|
return pd.concat([a[cols], b[cols]], ignore_index=True)
|
||||||
|
|
||||||
|
|
||||||
|
def tables(a) -> None:
|
||||||
|
freeze(check=True)
|
||||||
|
p = load_protocol()
|
||||||
|
out = Path(a.out) / "reference"
|
||||||
|
out.mkdir(parents=True, exist_ok=True)
|
||||||
|
runs = reference_runs(p)
|
||||||
|
runs.to_csv(out / "runs.csv.gz", index=False, float_format="%.10g")
|
||||||
|
g = runs.groupby(["setting", "regime", "preset", "delta_ms", "c", "n_train", "method"], dropna=False)
|
||||||
|
cells = g.agg(n_rid=("rid", "nunique"), n_seed=("seed", "nunique"), band_rmse=("band_rmse", "mean"),
|
||||||
|
band_pcc=("band_pcc", "mean"), rmse=("rmse", "mean"), pcc=("pcc", "mean"), crps=("crps", "mean"),
|
||||||
|
coverage_90=("coverage_90", "mean")).reset_index()
|
||||||
|
sp = sigma_post(p)
|
||||||
|
if sp.duplicated(CELL).any():
|
||||||
|
raise RuntimeError("duplicated σ_post cells")
|
||||||
|
cells = cells.merge(sp, on=CELL, how="left")
|
||||||
|
cells["wide"] = np.where(cells.sigma_post_ms.notna(), cells.sigma_post_ms >= WIDE_MS, np.nan)
|
||||||
|
rdoc = DOC / "reference"
|
||||||
|
rdoc.mkdir(parents=True, exist_ok=True)
|
||||||
|
cells.to_csv(rdoc / "cells.csv", index=False, float_format="%.6g")
|
||||||
|
shutil.copy2(rdoc / "cells.csv", out / "cells.csv")
|
||||||
|
|
||||||
|
main = cells[(cells.preset == "nominal") & cells.delta_ms.isna() & (cells.c == 1) & cells.n_train.isin([4, 16])]
|
||||||
|
order = ["Oracle", "B3b", "B3c", "B3c-R", "B3d", "B4a", "B4b", "B4c", "B4d", "B3d-Sa", "M2-Sa", "Ctl-GP"]
|
||||||
|
t = main.pivot_table(index="method", columns=["setting", "n_train"], values="band_rmse").reindex(order).dropna(how="all")
|
||||||
|
regs = [r for r in p["grid"]["regimes"] if r in t.columns.get_level_values(0)]
|
||||||
|
head = "| method | " + " | ".join(f"{r} N={n}" for r in regs for n in (4, 16)) + " |"
|
||||||
|
L = ["# Reference band RMSE (p.u.), nominal settings, c = 1", "",
|
||||||
|
"Mean over 8 test realizations × 5 network seeds at the registered budgets (CNN–GRU). σ_post (ms) is the "
|
||||||
|
"SMC posterior width over the training wells; 'wide' means σ_post ≥ 1.5 ms. Full table: cells.csv.", "",
|
||||||
|
head, "|" + "---|" * (1 + 2 * len(regs))]
|
||||||
|
for m, r in t.iterrows():
|
||||||
|
L.append(f"| {m} | " + " | ".join(f"{r.get((g, n), np.nan):.3f}" for g in regs for n in (4, 16)) + " |")
|
||||||
|
s1 = main.drop_duplicates(CELL).set_index(["setting", "n_train"])["sigma_post_ms"]
|
||||||
|
L.append("| σ_post | " + " | ".join(f"{s1.get((g, n), np.nan):.2f}" for g in regs for n in (4, 16)) + " |")
|
||||||
|
(rdoc / "main_table.md").write_text("\n".join(L) + "\n")
|
||||||
|
shutil.copy2(rdoc / "main_table.md", out / "main_table.md")
|
||||||
|
print("\n".join(L))
|
||||||
|
print(f"{len(runs)} reference runs, {len(cells)} cell rows → {out}, {rdoc}")
|
||||||
|
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------- scoring
|
||||||
|
|
||||||
|
def read_predictions(pred: Path, pkg: Path, name: str, f_c: float) -> pd.DataFrame:
|
||||||
|
run_d2 = load_script("11_run_d2.py")
|
||||||
|
rows = []
|
||||||
|
files = sorted(f for f in pred.glob("*/*/r*_c*_n*_s*.npz") if f.parent.parent.name in ("test", "dev"))
|
||||||
|
if not files:
|
||||||
|
raise SystemExit(f"no predictions under {pred}/<split>/<setting>/r<rid>_c<c>_n<N>_s<seed>.npz")
|
||||||
|
for f in files:
|
||||||
|
m = PRED.fullmatch(f.stem)
|
||||||
|
if m is None:
|
||||||
|
raise SystemExit(f"{f}: name must be r<rid>_c<c>_n<N>_s<seed>.npz")
|
||||||
|
rid, c, N, seed = int(m[1]), float(m[2]), int(m[3]), int(m[4])
|
||||||
|
split, setting = f.parent.parent.name, f.parent.name
|
||||||
|
tf = pkg / "truth" / split / setting / f"r{rid}_c{c:g}.npz"
|
||||||
|
if not tf.exists():
|
||||||
|
raise SystemExit(f"{f}: no task {tf.relative_to(pkg)}")
|
||||||
|
if not 1 <= N <= 16:
|
||||||
|
raise SystemExit(f"{f}: N = {N} outside 1..16")
|
||||||
|
with np.load(tf) as t:
|
||||||
|
yt, names = t["y_test"], t["test_names"]
|
||||||
|
with np.load(f) as z:
|
||||||
|
mu = z["mu"].astype(float)
|
||||||
|
sg = z["sigma"].astype(float) if "sigma" in z.files else None
|
||||||
|
if mu.shape != yt.shape or not np.isfinite(mu).all():
|
||||||
|
raise SystemExit(f"{f}: mu must be finite with shape {yt.shape}, got {mu.shape}")
|
||||||
|
if sg is not None and (sg.shape != yt.shape or not (np.isfinite(sg).all() and (sg > 0).all())):
|
||||||
|
raise SystemExit(f"{f}: sigma must be finite, positive, shape {yt.shape}")
|
||||||
|
with np.errstate(all="ignore"):
|
||||||
|
res = run_d2.evaluate(yt, mu, np.ones_like(mu) if sg is None else sg, f_c)
|
||||||
|
for w, r in zip(names, res):
|
||||||
|
if sg is None:
|
||||||
|
r = r | {k: np.nan for k in GAUSS}
|
||||||
|
rows.append({"split": split, "setting": setting, "c": c, "n_train": N, "rid": rid, "seed": seed,
|
||||||
|
"method": name, "test_well": str(w)} | r)
|
||||||
|
return pd.DataFrame(rows)
|
||||||
|
|
||||||
|
|
||||||
|
def rule_tables(run: pd.DataFrame, ref: pd.DataFrame, name: str) -> tuple[pd.DataFrame, pd.DataFrame, pd.DataFrame]:
|
||||||
|
rules, pairs, means = [], [], []
|
||||||
|
for (setting, c, N), sub in run.groupby(CELL):
|
||||||
|
r = ref[(ref.setting == setting) & (ref.c == c) & (ref.n_train == N) & ref.rid.isin(sub.rid) & ref.seed.isin(sub.seed)]
|
||||||
|
both = pd.concat([sub[RUN + S.METRICS], r[RUN + S.METRICS]], ignore_index=True)
|
||||||
|
key = {"setting": setting, "c": c, "n_train": N, "n_rid": sub.rid.nunique(), "n_seed": sub.seed.nunique()}
|
||||||
|
means.append(key | both.groupby("method").band_rmse.mean().add_prefix("band_rmse_").to_dict())
|
||||||
|
if set(S.POINT_TIES) <= set(r.method):
|
||||||
|
cells = S.h2a_cells(both, name, S.POINT_TIES, np.random.default_rng(0), N_BOOT)
|
||||||
|
rules.append(cells.drop(columns=["c", "n_train", "n_rid", "n_seed"]).assign(**key))
|
||||||
|
for m in ("B3d-Sa", "M2-Sa", "PM2", "BK2", "Oracle"):
|
||||||
|
if m in set(r.method):
|
||||||
|
d = S.pair(both, name, m, np.random.default_rng(0), N_BOOT)
|
||||||
|
pairs.append(key | {"reference": m} | d)
|
||||||
|
first = lambda df, cols: df[[*cols, *[k for k in df.columns if k not in cols]]] if len(df) else df
|
||||||
|
k = ["setting", "c", "n_train", "n_rid", "n_seed"]
|
||||||
|
rules = pd.concat(rules, ignore_index=True) if rules else pd.DataFrame()
|
||||||
|
return first(rules, k), first(pd.DataFrame(pairs), k + ["reference"]), first(pd.DataFrame(means), k)
|
||||||
|
|
||||||
|
|
||||||
|
def score(a) -> None:
|
||||||
|
pkg, pred = Path(a.out), Path(a.pred)
|
||||||
|
ref = pd.read_csv(pkg / "reference" / "runs.csv.gz")
|
||||||
|
if a.name in set(ref.method) or a.name == "M2":
|
||||||
|
raise SystemExit(f"--name {a.name} is a reference method name; choose another")
|
||||||
|
f_c = float(json.loads((pkg / "inputs" / "analyst.json").read_text())["metric"]["f_c_hz"])
|
||||||
|
well = read_predictions(pred, pkg, a.name, f_c)
|
||||||
|
run = well.groupby(["split", *RUN], as_index=False)[S.METRICS].mean()
|
||||||
|
out = pred / "score"
|
||||||
|
out.mkdir(exist_ok=True)
|
||||||
|
well.to_csv(out / "per_well.csv", index=False)
|
||||||
|
run.to_csv(out / "runs.csv", index=False)
|
||||||
|
test = run[run.split == "test"].drop(columns="split")
|
||||||
|
L = [f"# Score of `{a.name}` (scripts/37_bench_package.py score)", "",
|
||||||
|
f"{len(well.groupby(['split', *RUN]))} predictions; test split: {len(test)} runs in {test.groupby(CELL).ngroups} cells.",
|
||||||
|
"Rules: protocol_bench (improves: band RMSE ≤ 0.90 × best point tie or band PCC ≥ +0.05; cell_pass: ≥ 4/5 seeds "
|
||||||
|
"and > 1/2 of realizations; better: lower band RMSE in ≥ 4/5 seeds and > 1/2 of realizations).", ""]
|
||||||
|
if len(test):
|
||||||
|
rules, pairs, means = rule_tables(test, ref, a.name)
|
||||||
|
for f, df in (("rule_point_ties.csv", rules), ("pairs.csv", pairs), ("cells.csv", means)):
|
||||||
|
df.to_csv(out / f, index=False)
|
||||||
|
complete = lambda df: df[(df.n_rid == 8) & (df.n_seed == 5)] if len(df) else df
|
||||||
|
if len(rules):
|
||||||
|
rc = complete(rules)
|
||||||
|
L += [f"- H2a cell rule vs best point tie: {int(rules.cell_pass.sum())}/{len(rules)} cells pass "
|
||||||
|
f"({int(rc.cell_pass.sum())}/{len(rc)} among complete cells: 8 realizations × 5 seeds)."]
|
||||||
|
for m in ("B3d-Sa", "M2-Sa", "PM2", "BK2", "Oracle"):
|
||||||
|
q = pairs[pairs.reference == m] if len(pairs) else pairs
|
||||||
|
if len(q):
|
||||||
|
L += [f"- better than {m}: {int(q.better.sum())}/{len(q)} cells; median ratio {q.ratio.median():.3f}."]
|
||||||
|
L += ["", "| setting | c | N | n_rid × n_seed | ratio vs best point tie (best) | cell_pass | ratio vs B3d-Sa |",
|
||||||
|
"|---|---|---|---|---|---|---|"]
|
||||||
|
rr = rules.set_index(CELL) if len(rules) else None
|
||||||
|
pb = pairs[pairs.reference == "B3d-Sa"].set_index(CELL) if len(pairs) else None
|
||||||
|
for row in means.itertuples():
|
||||||
|
k = (row.setting, row.c, row.n_train)
|
||||||
|
h = f"{rr.loc[k, 'ratio']:.3f} ({rr.loc[k, 'best']})" if rr is not None and k in rr.index else "—"
|
||||||
|
cp = str(bool(rr.loc[k, "cell_pass"])) if rr is not None and k in rr.index else "—"
|
||||||
|
b = f"{pb.loc[k, 'ratio']:.3f}" if pb is not None and k in pb.index else "—"
|
||||||
|
L.append(f"| {row.setting} | {row.c:g} | {row.n_train} | {row.n_rid} × {row.n_seed} | {h} | {cp} | {b} |")
|
||||||
|
dev = run[run.split == "dev"]
|
||||||
|
if len(dev):
|
||||||
|
L += ["", f"Dev split: {len(dev)} runs, metrics only (runs.csv); dev labels may be used for design."]
|
||||||
|
(out / "score.md").write_text("\n".join(L) + "\n")
|
||||||
|
print("\n".join(L[:12]))
|
||||||
|
print(f"→ {out}")
|
||||||
|
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------- self-test
|
||||||
|
|
||||||
|
SELFTEST = [ # (setting, train dir relative to outputs/, tag suffix, c, method)
|
||||||
|
("R10", "bench/s1/train/R10/cells", "", 1.5, "B3d-Sa"),
|
||||||
|
("R10__wv_L1", "bench/s2/train/R10__wv_L1/cells", "", 1.0, "B3d-Sa"),
|
||||||
|
("R10", "p2r/train/R10/cells", "", 1.0, "B3d-Sa"),
|
||||||
|
("R10__s8d16", "bench/s8/train/R10/cells", "_d16", 1.0, "BK2"),
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
def selftest(a) -> None:
|
||||||
|
p = load_protocol()
|
||||||
|
pkg = Path(a.out)
|
||||||
|
sub = pkg / "selftest_submission"
|
||||||
|
shutil.rmtree(sub, ignore_errors=True)
|
||||||
|
bud, name = p["training"]["budgets"], "SelfTest"
|
||||||
|
worst_y = 0.0
|
||||||
|
for setting, d, suf, c, m in SELFTEST:
|
||||||
|
for N in (4, 16):
|
||||||
|
for rid in p["grid"]["realizations"]:
|
||||||
|
with np.load(outputs_dir() / d / f"r{rid}_c{c:g}_n{N}{suf}.npz") as z, \
|
||||||
|
np.load(pkg / "truth" / "test" / setting / f"r{rid}_c{c:g}.npz") as t:
|
||||||
|
worst_y = max(worst_y, float(np.abs(z["y_true"] - t["y_test"]).max()))
|
||||||
|
if not (z["test_wells"] == t["test_names"]).all():
|
||||||
|
raise SystemExit(f"{setting} r{rid}: test well order differs")
|
||||||
|
for seed in p["grid"]["seeds"]:
|
||||||
|
f = sub / "test" / setting / f"r{rid}_c{c:g}_n{N}_s{seed}.npz"
|
||||||
|
f.parent.mkdir(parents=True, exist_ok=True)
|
||||||
|
k = f"{m}/s{seed}/b{bud[m]}"
|
||||||
|
np.savez(f, mu=z[f"{k}/mu"], sigma=z[f"{k}/sigma"])
|
||||||
|
score(argparse.Namespace(out=str(pkg), pred=str(sub), name=name))
|
||||||
|
ref = pd.read_csv(pkg / "reference" / "runs.csv.gz")
|
||||||
|
got = pd.read_csv(sub / "score" / "runs.csv")
|
||||||
|
rules = pd.read_csv(sub / "score" / "rule_point_ties.csv")
|
||||||
|
pairs = pd.read_csv(sub / "score" / "pairs.csv")
|
||||||
|
msg, ok = [f"max |y_true(runner, float32) − y_test(package)| = {worst_y:.2e} p.u."], worst_y < 1e-4
|
||||||
|
for setting, _, _, c, m in SELFTEST:
|
||||||
|
g = got[(got.setting == setting) & (got.c == c)].set_index(["n_train", "rid", "seed"])
|
||||||
|
r = ref[(ref.setting == setting) & (ref.c == c) & (ref.method == m)].set_index(["n_train", "rid", "seed"]).reindex(g.index)
|
||||||
|
dm = float(np.abs(g.band_rmse - r.band_rmse).max())
|
||||||
|
ok &= dm < 1e-4 and len(g) == 2 * 8 * 5
|
||||||
|
line = f"{setting} c={c:g} copy of {m}: {len(g)} runs, max |Δ band RMSE| = {dm:.1e}"
|
||||||
|
cell = ref[(ref.setting == setting) & (ref.c == c)]
|
||||||
|
for N in (4, 16):
|
||||||
|
cr = cell[cell.n_train == N]
|
||||||
|
if set(S.POINT_TIES) <= set(cr.method):
|
||||||
|
want = S.h2a_cells(cr, m, S.POINT_TIES, np.random.default_rng(0), N_BOOT).iloc[0]
|
||||||
|
have = rules[(rules.setting == setting) & (rules.c == c) & (rules.n_train == N)].iloc[0]
|
||||||
|
same = want.best == have.best and bool(want.cell_pass) == bool(have.cell_pass) and abs(want.ratio - have.ratio) < 1e-4
|
||||||
|
line += f"; N={N} ratio {have.ratio:.4f} vs {want.ratio:.4f} ({want.best}, pass {bool(want.cell_pass)})"
|
||||||
|
else:
|
||||||
|
want = S.pair(cr, m, "PM2", np.random.default_rng(0), N_BOOT)
|
||||||
|
have = pairs[(pairs.setting == setting) & (pairs.c == c) & (pairs.n_train == N) & (pairs.reference == "PM2")].iloc[0]
|
||||||
|
same = bool(want["better"]) == bool(have.better) and abs(want["ratio"] - have.ratio) < 1e-4
|
||||||
|
line += f"; N={N} ratio vs PM2 {have.ratio:.4f} vs {want['ratio']:.4f}"
|
||||||
|
ok &= same
|
||||||
|
msg.append(line)
|
||||||
|
print("\n".join(msg))
|
||||||
|
(pkg / "selftest.json").write_text(json.dumps({"pass": bool(ok), "checks": msg}, indent=1))
|
||||||
|
shutil.rmtree(sub)
|
||||||
|
if not ok:
|
||||||
|
raise SystemExit("selftest FAILED")
|
||||||
|
print("selftest PASS")
|
||||||
|
|
||||||
|
|
||||||
|
def main() -> None:
|
||||||
|
ap = argparse.ArgumentParser(description=__doc__.split("\n")[0])
|
||||||
|
sp = ap.add_subparsers(dest="cmd", required=True)
|
||||||
|
g = sp.add_parser("generate")
|
||||||
|
g.add_argument("--split", nargs="+", default=["test", "dev"], choices=["test", "dev"])
|
||||||
|
g.add_argument("--update-manifest", action="store_true")
|
||||||
|
g.add_argument("--skip-lock-check", action="store_true")
|
||||||
|
s = sp.add_parser("score")
|
||||||
|
s.add_argument("--pred", required=True)
|
||||||
|
s.add_argument("--name", required=True)
|
||||||
|
for name in ("tables", "selftest", "check"):
|
||||||
|
sp.add_parser(name)
|
||||||
|
for x in sp.choices.values():
|
||||||
|
x.add_argument("--out", default=str(PKG))
|
||||||
|
a = ap.parse_args()
|
||||||
|
{"generate": generate, "tables": tables, "score": score, "selftest": selftest, "check": check}[a.cmd](a)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
170
scripts/38_bench_figures.py
Normal file
170
scripts/38_bench_figures.py
Normal file
@@ -0,0 +1,170 @@
|
|||||||
|
"""Manuscript figures of Experiment 3 (protocol_bench, phase P6), drawn from the locked summary outputs only.
|
||||||
|
|
||||||
|
CUDA_VISIBLE_DEVICES= .venv/bin/python scripts/38_bench_figures.py [--only bench_s1,bench_s8] [--flipband]
|
||||||
|
|
||||||
|
Outside the protocol_bench code hash (like scripts/36 and 37); checks the lock first and never writes under outputs/.
|
||||||
|
Reads outputs/bench/summary/s1_cells.csv (S1 phase diagram) and outputs/bench/summary/s8_transfer_curves.json; the
|
||||||
|
S8 usable band (Oracle cross-spectrum ≥ 0.1 × its maximum above 6 Hz) is recomputed from the S8 prediction files
|
||||||
|
exactly as ml_porosity/benchmark/summary.py does, because the curves file does not store it.
|
||||||
|
Style, palette and output folder are those of scripts/22_paper_figures.py (→ paper/figures/{bench_s1,bench_s8}.pdf).
|
||||||
|
--flipband prints (stdout only) the Section 6.5 S8 comparison: mean cos(πfΔ), mean cos²(πfΔ) (Corollary 3, the λ → 0
|
||||||
|
transfer of the equal-weight two-member bank, which contains the true warp but is not calibrated) and the measured
|
||||||
|
PM2/BK2/HM2 transfer over the usable frequencies of the band 1/(2Δ) < f < 3/(2Δ), for every S8 cell.
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import argparse
|
||||||
|
import importlib.util
|
||||||
|
import json
|
||||||
|
|
||||||
|
import numpy as np
|
||||||
|
import pandas as pd
|
||||||
|
from matplotlib.lines import Line2D
|
||||||
|
from matplotlib.patches import Rectangle
|
||||||
|
|
||||||
|
from ml_porosity.benchmark import summary as S
|
||||||
|
from ml_porosity.benchmark.cells import Cell, bench_root, train_paths
|
||||||
|
from ml_porosity.benchmark.protocol import freeze, load_protocol
|
||||||
|
from ml_porosity.eval import figstyle as fs
|
||||||
|
from ml_porosity.paths import REPO_ROOT
|
||||||
|
|
||||||
|
_spec = importlib.util.spec_from_file_location("s22", REPO_ROOT / "scripts" / "22_paper_figures.py")
|
||||||
|
F = importlib.util.module_from_spec(_spec) # style(), save(), text_on(), WIDTH of the other manuscript figures
|
||||||
|
_spec.loader.exec_module(F)
|
||||||
|
plt = F.plt
|
||||||
|
SUMMARY = bench_root(dev=False) / "summary"
|
||||||
|
REGIMES = ["R10", "R0", "Rm5", "R0h", "R10tb"]
|
||||||
|
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------- Fig. S1 phase diagram (Section 6.5)
|
||||||
|
def bench_s1() -> None:
|
||||||
|
d = pd.read_csv(SUMMARY / "s1_cells.csv")
|
||||||
|
cs, Ns = sorted(d.c.unique()), sorted(d.n_train.unique())
|
||||||
|
norm, cmap = fs.diverging_norm(0.65, 1.0, 1.15), fs.DIVERGING
|
||||||
|
rows = [("pm_best", r"SMC mean / best point tie"), ("m2_pm", r"SMC bank / SMC mean")]
|
||||||
|
fig, axes = plt.subplots(2, len(REGIMES), figsize=(F.WIDTH, 3.55), sharex=True, sharey=True, layout="constrained")
|
||||||
|
for i, (k, lab) in enumerate(rows):
|
||||||
|
for j, reg in enumerate(REGIMES):
|
||||||
|
ax = axes[i, j]
|
||||||
|
t = d[d.regime == reg].set_index(["c", "n_train"])
|
||||||
|
Z = t[f"{k}_ratio"].unstack("n_train").reindex(index=cs, columns=Ns).to_numpy()
|
||||||
|
im = ax.imshow(Z, cmap=cmap, norm=norm, origin="lower", aspect="auto")
|
||||||
|
for a, c in enumerate(cs):
|
||||||
|
for b, N in enumerate(Ns):
|
||||||
|
r = t.loc[(c, N)]
|
||||||
|
txt = f"{r[k + '_ratio']:.2f}"
|
||||||
|
ax.text(b, a, txt if r[k + "_better"] else f"({txt})", ha="center", va="center", fontsize=6,
|
||||||
|
color=F.text_on(cmap(norm(r[k + "_ratio"]))))
|
||||||
|
if k == "m2_pm" and r.sigma_post_ms >= 1.5:
|
||||||
|
ax.add_patch(Rectangle((b - 0.42, a - 0.42), 0.84, 0.84, fill=False, ec=fs.INK, lw=0.6))
|
||||||
|
ax.set_xticks(range(len(Ns)), [str(n) for n in Ns])
|
||||||
|
ax.set_yticks(range(len(cs)), [f"{c:g}" for c in cs])
|
||||||
|
ax.grid(False)
|
||||||
|
for s in ax.spines.values():
|
||||||
|
s.set_visible(False)
|
||||||
|
ax.tick_params(length=0)
|
||||||
|
ax.set_title(f"({'ab'[i]}{j + 1}) {F.REGIME_LABELS[reg]}", loc="left", fontsize=8, color=fs.INK, pad=3)
|
||||||
|
if i == 1:
|
||||||
|
ax.set_xlabel(r"wells $N$")
|
||||||
|
if j == 0:
|
||||||
|
ax.set_ylabel(r"drift factor $c$")
|
||||||
|
cb = fig.colorbar(im, ax=axes[i, :], shrink=0.95, pad=0.01, extend="both")
|
||||||
|
cb.ax.axhline(1.0, color=fs.INK, lw=0.9)
|
||||||
|
cb.set_label(lab, color=fs.INK2, fontsize=7)
|
||||||
|
cb.outline.set_visible(False)
|
||||||
|
F.save(fig, "bench_s1")
|
||||||
|
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------- Fig. S8 two-mode transfer functions (Section 6.5)
|
||||||
|
def oracle_spectrum(p: dict, reg: str, d: float, N: int) -> tuple[np.ndarray, np.ndarray]:
|
||||||
|
"""Usable-frequency mask of an S8 cell, as in summary.s8 (Oracle cross-spectrum pooled over rids/seeds/wells)."""
|
||||||
|
f = np.fft.rfftfreq(S.NFFT, 4.0 / 1000.0)
|
||||||
|
b = S.study_budgets(p, "S8")["Oracle"]
|
||||||
|
so = np.zeros(len(f))
|
||||||
|
for rid in p["grid"]["realizations"]:
|
||||||
|
cell = Cell("S8", reg, None, 1.0, int(N), int(rid), tuple(p["studies"]["S8"]["methods"]), posterior="none",
|
||||||
|
delta_ms=float(d))
|
||||||
|
with np.load(train_paths(cell, bench_root(dev=False))["npz"]) as z:
|
||||||
|
Y = z["y_true"].astype(float)
|
||||||
|
for k in (k for k in z.files if k.startswith("Oracle/s") and k.endswith(f"/b{b}/mu")):
|
||||||
|
so += S.cross_spectrum(Y, z[k].astype(float))
|
||||||
|
band = f >= 6.0
|
||||||
|
return f, band & (so >= 0.1 * so[band].max())
|
||||||
|
|
||||||
|
|
||||||
|
STYLE_S8 = {"PM2": dict(lw=1.3, marker="o", ms=1.6), "BK2": dict(lw=1.8, marker="o", ms=2.0),
|
||||||
|
"HM2": dict(lw=0.9, ls=(0, (3, 1.5)))} # BK2 and HM2 nearly coincide: HM2 dashed on top
|
||||||
|
|
||||||
|
|
||||||
|
def bench_s8(N: int = 16) -> None:
|
||||||
|
p = load_protocol()
|
||||||
|
curves = [c for c in json.loads((SUMMARY / "s8_transfer_curves.json").read_text()) if c["n_train"] == N]
|
||||||
|
deltas = sorted({c["delta_ms"] for c in curves})
|
||||||
|
cols = {"PM2": fs.ORANGE, "BK2": fs.BLUE, "HM2": fs.AQUA}
|
||||||
|
fig, axes = plt.subplots(2, len(deltas), figsize=(F.WIDTH, 3.5), sharey=True, layout="constrained")
|
||||||
|
for i, reg in enumerate(["R10", "Rm5"]):
|
||||||
|
for j, d in enumerate(deltas):
|
||||||
|
ax = axes[i, j]
|
||||||
|
f, use = oracle_spectrum(p, reg, d, N)
|
||||||
|
fmax = f[use].max()
|
||||||
|
lo, hi = 1000.0 / (2 * d), 3000.0 / (2 * d)
|
||||||
|
ax.axvspan(lo, min(hi, fmax + 5), color=fs.GRID, alpha=0.7, lw=0)
|
||||||
|
ax.axhline(0.0, color=fs.AXIS, lw=0.8)
|
||||||
|
ax.plot(f, np.cos(np.pi * f * d / 1000.0), color=fs.INK2, lw=0.9, ls="--")
|
||||||
|
for m, col in cols.items():
|
||||||
|
c = next(c for c in curves if c["regime"] == reg and c["delta_ms"] == d and c["method"] == m)
|
||||||
|
H = np.where(use, np.asarray(c["H"], float), np.nan)
|
||||||
|
ax.plot(f, H, color=col, **STYLE_S8[m])
|
||||||
|
ax.set(xlim=(0, fmax + 5), ylim=(-1.4, 1.6))
|
||||||
|
ax.set_title(f"({'ab'[i]}{j + 1}) {F.REGIME_LABELS[reg]}, " + rf"$\Delta = {d:g}$ ms", loc="left", fontsize=8, color=fs.INK, pad=3)
|
||||||
|
if i == 1:
|
||||||
|
ax.set_xlabel("frequency (Hz)")
|
||||||
|
if j == 0:
|
||||||
|
ax.set_ylabel(r"transfer $\hat H(f)$ vs. Oracle")
|
||||||
|
S8_LABELS = {"PM2": "midpoint label", "BK2": "two-member bank", "HM2": "two-member hard-min"}
|
||||||
|
handles = [Line2D([], [], color=col, label=S8_LABELS[m], **STYLE_S8[m]) for m, col in cols.items()]
|
||||||
|
handles.append(Line2D([], [], color=fs.INK2, lw=0.9, ls="--", label=r"$\cos(\pi f \Delta)$"))
|
||||||
|
fig.legend(handles=handles, loc="outside lower center", ncol=4)
|
||||||
|
F.save(fig, "bench_s8")
|
||||||
|
|
||||||
|
|
||||||
|
def flipband() -> None:
|
||||||
|
p = load_protocol()
|
||||||
|
curves = json.loads((SUMMARY / "s8_transfer_curves.json").read_text())
|
||||||
|
print("regime delta_ms N n_freq mean_cos mean_cos2 PM2 BK2 HM2")
|
||||||
|
for reg in ["R10", "Rm5"]:
|
||||||
|
for d in sorted({c["delta_ms"] for c in curves}):
|
||||||
|
for N in sorted({c["n_train"] for c in curves}):
|
||||||
|
f, use = oracle_spectrum(p, reg, d, N)
|
||||||
|
fl = use & (f > 1000.0 / (2 * d)) & (f < 3000.0 / (2 * d))
|
||||||
|
if not fl.any():
|
||||||
|
print(f"{reg:6s} {d:8g} {N:2d} {0:6d} (no usable frequency in the band)")
|
||||||
|
continue
|
||||||
|
c = np.cos(np.pi * f[fl] * d / 1000.0)
|
||||||
|
H = {m: np.asarray(next(x for x in curves if x["regime"] == reg and x["delta_ms"] == d
|
||||||
|
and x["n_train"] == N and x["method"] == m)["H"], float)[fl].mean()
|
||||||
|
for m in ("PM2", "BK2", "HM2")}
|
||||||
|
print(f"{reg:6s} {d:8g} {N:2d} {int(fl.sum()):6d} {c.mean():8.3f} {(c ** 2).mean():9.3f} "
|
||||||
|
+ " ".join(f"{H[m]:5.3f}" for m in ("PM2", "BK2", "HM2")))
|
||||||
|
|
||||||
|
|
||||||
|
FIGURES = {"bench_s1": bench_s1, "bench_s8": bench_s8}
|
||||||
|
|
||||||
|
|
||||||
|
def main() -> None:
|
||||||
|
ap = argparse.ArgumentParser()
|
||||||
|
ap.add_argument("--only", default="", help="comma-separated subset of " + ",".join(FIGURES))
|
||||||
|
ap.add_argument("--flipband", action="store_true", help="print the S8 flip-band table instead of drawing")
|
||||||
|
args = ap.parse_args()
|
||||||
|
freeze(check=True)
|
||||||
|
if args.flipband:
|
||||||
|
flipband()
|
||||||
|
return
|
||||||
|
F.style()
|
||||||
|
for k in (args.only.split(",") if args.only else FIGURES):
|
||||||
|
FIGURES[k]()
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
627
scripts/39_repro_package.py
Normal file
627
scripts/39_repro_package.py
Normal file
@@ -0,0 +1,627 @@
|
|||||||
|
"""Reproduction package of the manuscript (phase P5): derived-data archives, a manifest and a clean-room check.
|
||||||
|
|
||||||
|
CUDA_VISIBLE_DEVICES= .venv/bin/python scripts/39_repro_package.py build [--out DIR] [--dry-run]
|
||||||
|
CUDA_VISIBLE_DEVICES= .venv/bin/python scripts/39_repro_package.py check --root DIR
|
||||||
|
CUDA_VISIBLE_DEVICES= .venv/bin/python scripts/39_repro_package.py verify [--out DIR] [--work DIR] [--only STEP …] [--keep]
|
||||||
|
.venv/bin/python scripts/39_repro_package.py code --rev REV [--out DIR]
|
||||||
|
|
||||||
|
DIR defaults to outputs/repro (gitignored). Documentation for readers: repro/README.md.
|
||||||
|
|
||||||
|
build Selects files of outputs/ by the first matching rule of RULES (anything without a rule stays out) and writes
|
||||||
|
one deterministic tar.gz per archive of ARCHIVES (sorted members, fixed mtime and owner, gzip mtime 0) to DIR,
|
||||||
|
and repro/MANIFEST.json (tracked in git): per archive its licence, size and sha256, per file its archive,
|
||||||
|
producing script, size and sha256 (exact bytes). Members are stored as outputs/<path>, so extracting an
|
||||||
|
archive in the repository root restores the original layout. The archives split by data licence (F3-derived
|
||||||
|
CC BY-SA 3.0; Volve-derived CC BY-NC-SA 4.0; Teapot, licence to be verified) and, within F3, by size.
|
||||||
|
--dry-run prints the selection and sizes without writing.
|
||||||
|
check Recomputes the sha256 of every manifest file under DIR (a tree in which the archives were extracted, i.e.
|
||||||
|
DIR/outputs/...) and reports missing and differing files.
|
||||||
|
verify Clean-room check that the archives and the code suffice. Copies the code (git ls-files -co --exclude-standard,
|
||||||
|
without logs/, refs/, code_thesis/, outputs_thesis/, .agents/; the tracked F3 well files under data/ are part
|
||||||
|
of the repository) into WORK/repo, extracts the archives there, deletes the copied paper figures, and runs the
|
||||||
|
steps of STEPS with WORK/repo first on PYTHONPATH (so `ml_porosity` and the default outputs/ and data/ roots
|
||||||
|
are those of the copy; no SEG-Y, Volve or Teapot raw data). A sitecustomize audit hook logs the files each
|
||||||
|
step opens and flags any read of the original repository. Afterwards every file a step rewrote is compared
|
||||||
|
with the original: by sha256, and, if the bytes differ, by value (csv, json, npz, md); paper figures are
|
||||||
|
rasterised with Ghostscript and compared pixel by pixel with paper/figures/; stdout steps are compared with the
|
||||||
|
same command run on the original outputs. → repro/verify_report.md (git) and WORK/verify.json.
|
||||||
|
WORK defaults to DIR/work and is deleted afterwards unless --keep.
|
||||||
|
code git archive of REV → DIR/ML-Porosity_code_<rev>.tar.gz; refuses when tracked files differ from REV.
|
||||||
|
|
||||||
|
Outside every protocol lock (protocol_bench hashes ml_porosity/ and scripts/34 only). Nothing here trains, edits a
|
||||||
|
locked output or touches the original outputs/: verify writes only inside WORK.
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import argparse
|
||||||
|
import difflib
|
||||||
|
import fnmatch
|
||||||
|
import gzip
|
||||||
|
import hashlib
|
||||||
|
import io
|
||||||
|
import json
|
||||||
|
import os
|
||||||
|
import shutil
|
||||||
|
import subprocess
|
||||||
|
import sys
|
||||||
|
import tarfile
|
||||||
|
import time
|
||||||
|
from datetime import datetime, timezone
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
import numpy as np
|
||||||
|
import pandas as pd
|
||||||
|
|
||||||
|
from ml_porosity.paths import REPO_ROOT, outputs_dir
|
||||||
|
|
||||||
|
DOC = REPO_ROOT / "repro"
|
||||||
|
MANIFEST = DOC / "MANIFEST.json"
|
||||||
|
MTIME = int(datetime(2026, 11, 2, tzinfo=timezone.utc).timestamp()) # fixed member mtime of the archives
|
||||||
|
|
||||||
|
F3 = "CC-BY-SA-3.0"
|
||||||
|
VOLVE = "CC-BY-NC-SA-4.0"
|
||||||
|
TEAPOT = "CC0-1.0 (as recorded in the project notes; verify on the Texas Data Repository page before deposit)"
|
||||||
|
ARCHIVES = {
|
||||||
|
"f3_results": (F3, "Summaries, verdicts, post hoc tables, run-level metric tables and the small derived inputs "
|
||||||
|
"behind every number of the manuscript; F3-derived and synthetic (D2 generator on F3 geometry)"),
|
||||||
|
"f3_predictions": (F3, "Saved test predictions of the registered runs (P1, P2, P2r, T2, protocol_bench, P3) and "
|
||||||
|
"the P2r SMC particles of the S4 cells, which the protocol_bench lock hashes"),
|
||||||
|
"f3_volume": (F3, "Descriptive F3 porosity volume of the 20 P3 deployment models (649 interior inlines)"),
|
||||||
|
"volve": (VOLVE, "Volve-derived well data, P4 summaries and post hoc tables, and the applicability tables that "
|
||||||
|
"combine F3 and Volve (licence of the combination to be confirmed by the authors)"),
|
||||||
|
"teapot": (TEAPOT, "Teapot Dome inventory (headers and curve coverage) and pilot P-a (knots, picks); no porosity"),
|
||||||
|
}
|
||||||
|
|
||||||
|
# (pattern relative to outputs/, archive, producer). First match wins; fnmatch `*` also matches `/`; archive None
|
||||||
|
# excludes. Files that match no rule stay out (large SMC particle files, training checkpoints, P3/P4 training runs,
|
||||||
|
# smoke runs, superseded backups, the separately deposited benchmark package outputs/bench/package, and outputs/p4x,
|
||||||
|
# which the manuscript never uses).
|
||||||
|
RULES = [
|
||||||
|
# F3 audit, tie and well inputs (historical artifacts of scripts 01, 02, 04: never rerun, hashes protected)
|
||||||
|
("td_qc.csv", "f3_results", "scripts/02_td_qc.py"),
|
||||||
|
("tie_qc.csv", "f3_results", "scripts/04_wavelet_tie.py"),
|
||||||
|
("marker_vs_horizon.csv", "f3_results", "scripts/04_wavelet_tie.py"),
|
||||||
|
("tie_local_shifts.csv", "f3_results", "scripts/04_wavelet_tie.py"),
|
||||||
|
("wavelets.npz", "f3_results", "scripts/04_wavelet_tie.py"),
|
||||||
|
("f3_wells.npz", "f3_results", "scripts/01_build_wells.py"),
|
||||||
|
("f3_wells_summary.json", "f3_results", "scripts/01_build_wells.py"),
|
||||||
|
# P1 LOWO baselines
|
||||||
|
("p1/*.npz", "f3_predictions", "scripts/05_lowo.py"),
|
||||||
|
("p1/*", "f3_results", "scripts/05_lowo.py, scripts/06_summarize_p1.py"),
|
||||||
|
# D2 generator QC and horizon cache, warp prior
|
||||||
|
("d2/qc.json", "f3_results", "scripts/10_build_d2.py"),
|
||||||
|
("d2/horizon_grid.npz", "f3_results", "ml_porosity/data/synth_d2.py (horizon cache)"),
|
||||||
|
("p2/warp_prior_f3.json", "f3_results", "scripts/09_fit_warp_prior_f3.py"),
|
||||||
|
# P2 (protocol_p2)
|
||||||
|
("p2/summary/*", "f3_results", "scripts/13_summarize_p2.py"),
|
||||||
|
("p2/h1/*.npz", "f3_predictions", "scripts/12_h1_blur.py"),
|
||||||
|
("p2/h1/*", "f3_results", "scripts/12_h1_blur.py"),
|
||||||
|
("p2/main/*.npz", "f3_predictions", "scripts/11_run_d2.py --main"),
|
||||||
|
("p2/main/*", "f3_results", "scripts/11_run_d2.py --main"),
|
||||||
|
("p2/dev/*.npz", "f3_predictions", "scripts/11_run_d2.py --dev"),
|
||||||
|
("p2/dev/*", "f3_results", "scripts/11_run_d2.py --dev"),
|
||||||
|
("p2/diag/train/budgets.json", "f3_results", "scripts/15_diag_train.py (P2r dev budgets)"),
|
||||||
|
("p2/diag/p2rdev/*", "f3_results", "scripts/17_summarize_p2r_dev.py"),
|
||||||
|
("p2/diag/f3_posterior/*.npz", None, ""),
|
||||||
|
("p2/diag/f3_posterior/*", "f3_results", "scripts/16_f3_posterior.py"),
|
||||||
|
("p2/diag/*.csv", "f3_results", "scripts/run_p2r_dev.sh (dev realizations 900/901)"),
|
||||||
|
("p2/diag/*.json", "f3_results", "scripts/run_p2r_dev.sh (dev realizations 900/901)"),
|
||||||
|
("d1/*", "f3_results", "scripts/08_d1_label_check.py"),
|
||||||
|
# P2r (protocol_p2r) and its post hoc analyses
|
||||||
|
("p2r/summary/*", "f3_results", "scripts/18_summarize_p2r.py"),
|
||||||
|
("p2r/posthoc/*", "f3_results", "scripts/31_p2r_posthoc.py"),
|
||||||
|
("p2r/train/*.npz", "f3_predictions", "scripts/run_p2r_main.sh (scripts/15_diag_train.py)"),
|
||||||
|
("p2r/train/*", "f3_results", "scripts/run_p2r_main.sh (scripts/15_diag_train.py)"),
|
||||||
|
("p2r/posterior/*.csv", "f3_results", "scripts/run_p2r_main.sh (scripts/14_diag_posterior.py)"),
|
||||||
|
("p2r/posterior/*.json", "f3_results", "scripts/run_p2r_main.sh (scripts/14_diag_posterior.py)"),
|
||||||
|
("t2/*.npz", "f3_predictions", "scripts/32_t2_mechanism.py"),
|
||||||
|
("t2/*", "f3_results", "scripts/32_t2_mechanism.py"),
|
||||||
|
("t3/*", "f3_results", "scripts/27_t3_power.py"),
|
||||||
|
("t4/*", "f3_results", "scripts/30_t4_coverage.py"),
|
||||||
|
# protocol_bench (Experiment 3)
|
||||||
|
("bench/summary/verdict_final.*", "f3_results", "scripts/36_bench_verdicts.py"),
|
||||||
|
("bench/summary/s3_h2a_stated.csv", "f3_results", "scripts/36_bench_verdicts.py"),
|
||||||
|
("bench/summary/*", "f3_results", "scripts/34_run_bench.py summarize"),
|
||||||
|
("bench/repro/comparison.json", "f3_results", "scripts/34_run_bench.py repro"),
|
||||||
|
("bench/repro/*", "f3_predictions", "scripts/34_run_bench.py repro"),
|
||||||
|
("bench/dev/calibration.*", "f3_results", "scripts/35_bench_calibration.py"),
|
||||||
|
("bench/dev/generator_*", "f3_results", "scripts/33_bench_generator_qc.py"),
|
||||||
|
("bench/dev/smc_qc_rid*.json", "f3_results", "scripts/33_bench_generator_qc.py --smc"),
|
||||||
|
("bench/dev/budgets_tcn.json", "f3_results", "scripts/34_run_bench.py dev-budgets"),
|
||||||
|
("bench/dev/progress.json", None, ""),
|
||||||
|
("bench/dev/summary/*", "f3_results", "scripts/34_run_bench.py summarize --dev"),
|
||||||
|
("bench/dev/*.csv", "f3_results", "scripts/34_run_bench.py posterior train --dev"),
|
||||||
|
("bench/dev/*.json", "f3_results", "scripts/34_run_bench.py posterior train --dev"),
|
||||||
|
("bench/s[12348]/train/*.npz", "f3_predictions", "scripts/34_run_bench.py train"),
|
||||||
|
("bench/s[12348]/train/*.csv", "f3_results", "scripts/34_run_bench.py train"),
|
||||||
|
("bench/s[12348]/train/*.json", "f3_results", "scripts/34_run_bench.py train"),
|
||||||
|
("bench/posterior/*.csv", "f3_results", "scripts/34_run_bench.py posterior"),
|
||||||
|
("bench/posterior/*.json", "f3_results", "scripts/34_run_bench.py posterior"),
|
||||||
|
# P3 F3 field test (protocol_f3; reproduce from tag protocol-f3)
|
||||||
|
("p3/summary/predictions.npz", "f3_predictions", "scripts/20_summarize_f3.py"),
|
||||||
|
("p3/summary/*", "f3_results", "scripts/20_summarize_f3.py"),
|
||||||
|
("p3/diagnostics/*.npz", "f3_predictions", "scripts/19_run_f3.py diagnostics"),
|
||||||
|
("p3/diagnostics/*", "f3_results", "scripts/19_run_f3.py diagnostics"),
|
||||||
|
("p3/registration/*.npz", "f3_predictions", "scripts/19_run_f3.py register"),
|
||||||
|
("p3/registration/*.json", "f3_results", "scripts/19_run_f3.py register"),
|
||||||
|
("p3/volume/metadata.json", "f3_results", "scripts/21_predict_f3.py"),
|
||||||
|
("p3/volume/state.json", "f3_results", "scripts/21_predict_f3.py"),
|
||||||
|
("p3/volume/*", "f3_volume", "scripts/21_predict_f3.py"),
|
||||||
|
("p3/completion_checks.json", "f3_results", "operations/check_f3_completion.py"),
|
||||||
|
("p3/volume_recovery.json", "f3_results", "operations/resume_f3_volume.py"),
|
||||||
|
("p3/deployment.json", "f3_results", "scripts/21_predict_f3.py"),
|
||||||
|
("p3/benchmark.json", "f3_results", "scripts/19_run_f3.py benchmark"),
|
||||||
|
("p3/registration_benchmark.json", "f3_results", "scripts/19_run_f3.py benchmark"),
|
||||||
|
("p3/review_checks.json", "f3_results", "scripts/19_run_f3.py (review checks)"),
|
||||||
|
# Volve (P4, protocol_volve; reproduce from tag protocol-volve) and the applicability study
|
||||||
|
("volve/*", "volve", "scripts/07_volve_interp_qc.py, scripts/23_build_volve_wells.py"),
|
||||||
|
("p4/summary/*", "volve", "scripts/24_run_volve.py summarize"),
|
||||||
|
("p4/posthoc/*", "volve", "scripts/25_p4_posthoc.py"),
|
||||||
|
("p4/registration/*.json", "volve", "scripts/24_run_volve.py register"),
|
||||||
|
("p4/benchmark.json", "volve", "scripts/24_run_volve.py benchmark"),
|
||||||
|
("applicability/*", "volve", "scripts/26_applicability.py"),
|
||||||
|
# Teapot Dome (stopped at T0 and pilot P-a)
|
||||||
|
("teapot/inventory/*", "teapot", "python -P scripts/28_teapot_inventory.py"),
|
||||||
|
("teapot/pilot_pa/*", "teapot", "python -P scripts/29_teapot_pilot.py"),
|
||||||
|
]
|
||||||
|
S4_PRODUCER = "scripts/run_p2r_main.sh (scripts/14_diag_posterior.py); hashed by the protocol_bench lock"
|
||||||
|
|
||||||
|
# Clean-room steps: (name, argv after the interpreter, kind). kind: "files" (compare rewritten outputs), "figures"
|
||||||
|
# (also compare paper/figures/<name>.pdf), "stdout" (compare stdout with the same command on the original outputs).
|
||||||
|
STEPS = [
|
||||||
|
("p1_summary", ["scripts/06_summarize_p1.py"], "files"),
|
||||||
|
("p2_summary", ["scripts/13_summarize_p2.py", "--mode", "main"], "files"),
|
||||||
|
("p2r_summary", ["scripts/18_summarize_p2r.py"], "files"),
|
||||||
|
("p2r_posthoc", ["scripts/31_p2r_posthoc.py"], "files"),
|
||||||
|
("t4_coverage", ["scripts/30_t4_coverage.py"], "files"),
|
||||||
|
("t3_power", ["scripts/27_t3_power.py"], "files"),
|
||||||
|
("bench_summarize", ["scripts/34_run_bench.py", "summarize"], "files"),
|
||||||
|
("bench_verdicts", ["scripts/36_bench_verdicts.py"], "files"),
|
||||||
|
("bench_tables", ["scripts/37_bench_package.py", "tables", "--out", "outputs/bench/package"], "files"),
|
||||||
|
("figures_main", ["scripts/22_paper_figures.py"], "figures"),
|
||||||
|
("figures_bench", ["scripts/38_bench_figures.py"], "figures"),
|
||||||
|
("s8_flipband", ["scripts/38_bench_figures.py", "--flipband"], "stdout"),
|
||||||
|
]
|
||||||
|
# Files outside outputs/ that a step rewrites in the repository, compared with the original repository files.
|
||||||
|
REPO_OUTPUTS = {"bench_tables": ["benchmark/reference/cells.csv", "benchmark/reference/main_table.md"]}
|
||||||
|
NO_CODE = ("logs/", "refs/", "code_thesis/", "outputs_thesis/", ".agents/")
|
||||||
|
|
||||||
|
SITECUSTOMIZE = '''
|
||||||
|
import os, sys
|
||||||
|
_log = os.environ.get("REPRO_AUDIT_LOG")
|
||||||
|
if _log:
|
||||||
|
_W = os.O_WRONLY | os.O_RDWR | os.O_CREAT | os.O_APPEND
|
||||||
|
def _hook(event, args, _f=open(_log, "a", buffering=1), _seen=set()):
|
||||||
|
if event == "open" and args and isinstance(args[0], (str, bytes, os.PathLike)):
|
||||||
|
try:
|
||||||
|
p = os.path.abspath(os.fsdecode(args[0]))
|
||||||
|
except Exception:
|
||||||
|
return
|
||||||
|
mode = args[1] if len(args) > 1 else None
|
||||||
|
flags = args[2] if len(args) > 2 and isinstance(args[2], int) else 0
|
||||||
|
w = any(c in mode for c in "wax+") if isinstance(mode, str) else bool(flags & _W)
|
||||||
|
key = ("W " if w else "R ") + p
|
||||||
|
if key not in _seen:
|
||||||
|
_seen.add(key)
|
||||||
|
_f.write(key + "\\n")
|
||||||
|
sys.addaudithook(_hook)
|
||||||
|
'''
|
||||||
|
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------- selection and manifest
|
||||||
|
def sha256(path: Path, bufsize: int = 1 << 22) -> str:
|
||||||
|
h = hashlib.sha256()
|
||||||
|
with open(path, "rb") as f:
|
||||||
|
while b := f.read(bufsize):
|
||||||
|
h.update(b)
|
||||||
|
return h.hexdigest()
|
||||||
|
|
||||||
|
|
||||||
|
def s4_reference_files() -> list[Path]:
|
||||||
|
from ml_porosity.benchmark.protocol import load_protocol, p2r_reference_files
|
||||||
|
return [f for f in p2r_reference_files(load_protocol()) if "/posterior/" in f.as_posix()]
|
||||||
|
|
||||||
|
|
||||||
|
def select(root: Path) -> list[dict]:
|
||||||
|
"""Every file of the package: path (outputs/...), archive, producer."""
|
||||||
|
s4 = {f.resolve() for f in s4_reference_files()}
|
||||||
|
rows, seen = [], set()
|
||||||
|
for f in sorted(root.rglob("*")):
|
||||||
|
if not f.is_file() or f.is_symlink():
|
||||||
|
continue
|
||||||
|
rel = f.relative_to(root).as_posix()
|
||||||
|
if f.resolve() in s4:
|
||||||
|
rows.append({"path": f"outputs/{rel}", "archive": "f3_predictions", "producer": S4_PRODUCER})
|
||||||
|
seen.add(f.resolve())
|
||||||
|
continue
|
||||||
|
if rel.startswith(("p2r/posterior/", "bench/posterior/", "bench/dev/")) and rel.endswith(".npz"):
|
||||||
|
continue # other particles and dev predictions: no table reads them
|
||||||
|
for pat, arc, prod in RULES:
|
||||||
|
if fnmatch.fnmatchcase(rel, pat):
|
||||||
|
if arc:
|
||||||
|
rows.append({"path": f"outputs/{rel}", "archive": arc, "producer": prod})
|
||||||
|
break
|
||||||
|
if missing := s4 - seen:
|
||||||
|
raise FileNotFoundError(f"{len(missing)} S4 reference files missing under {root}")
|
||||||
|
return rows
|
||||||
|
|
||||||
|
|
||||||
|
def tar_gz(path: Path, members: list[tuple[str, Path]]) -> None:
|
||||||
|
tmp = path.with_suffix(path.suffix + ".part")
|
||||||
|
with open(tmp, "wb") as raw, gzip.GzipFile(filename="", mode="wb", fileobj=raw, mtime=0, compresslevel=6) as gz, \
|
||||||
|
tarfile.open(fileobj=gz, mode="w", format=tarfile.PAX_FORMAT) as tar:
|
||||||
|
for arc, src in sorted(members):
|
||||||
|
ti = tarfile.TarInfo(arc)
|
||||||
|
ti.size, ti.mtime, ti.mode = src.stat().st_size, MTIME, 0o644
|
||||||
|
ti.uid = ti.gid = 0
|
||||||
|
ti.uname = ti.gname = ""
|
||||||
|
with open(src, "rb") as f:
|
||||||
|
tar.addfile(ti, f)
|
||||||
|
tmp.replace(path)
|
||||||
|
|
||||||
|
|
||||||
|
def build(a) -> None:
|
||||||
|
root, out = outputs_dir(), Path(a.out)
|
||||||
|
rows = select(root)
|
||||||
|
for r in rows:
|
||||||
|
r["bytes"] = (root / r["path"][len("outputs/"):]).stat().st_size
|
||||||
|
df = pd.DataFrame(rows)
|
||||||
|
print(df.groupby("archive").agg(files=("path", "size"), MB=("bytes", lambda b: round(b.sum() / 1e6, 1))).to_string())
|
||||||
|
if a.dry_run:
|
||||||
|
for arc, g in df.groupby("archive"):
|
||||||
|
top = g.assign(top=g.path.str.split("/").str[1:3].str.join("/")).groupby("top").bytes.agg(["size", "sum"])
|
||||||
|
print(f"\n{arc}\n" + (top.assign(MB=(top["sum"] / 1e6).round(2)).drop(columns="sum")).to_string())
|
||||||
|
return
|
||||||
|
out.mkdir(parents=True, exist_ok=True)
|
||||||
|
t0 = time.time()
|
||||||
|
for r in rows:
|
||||||
|
r["sha256"] = sha256(root / r["path"][len("outputs/"):])
|
||||||
|
archives = {}
|
||||||
|
for arc, (lic, desc) in ARCHIVES.items():
|
||||||
|
sel = [r for r in rows if r["archive"] == arc]
|
||||||
|
name = f"ML-Porosity_derived_{arc}.tar.gz"
|
||||||
|
tar_gz(out / name, [(r["path"], root / r["path"][len("outputs/"):]) for r in sel])
|
||||||
|
archives[arc] = {"file": name, "licence": lic, "description": desc, "n_files": len(sel),
|
||||||
|
"bytes_uncompressed": int(sum(r["bytes"] for r in sel)),
|
||||||
|
"bytes": (out / name).stat().st_size, "sha256": sha256(out / name)}
|
||||||
|
print(f"wrote {out / name}: {len(sel)} files, {archives[arc]['bytes'] / 1e6:.1f} MB ({time.time() - t0:.0f} s)")
|
||||||
|
DOC.mkdir(exist_ok=True)
|
||||||
|
man = {"package": "ML-Porosity derived data for the manuscript (reproduction package, phase P5)",
|
||||||
|
"layout": "members are outputs/<path>; extract each archive in the repository root",
|
||||||
|
"hash": "sha256 of the exact file bytes", "archives": archives,
|
||||||
|
"files": [{k: r[k] for k in ("path", "archive", "producer", "bytes", "sha256")} for r in rows]}
|
||||||
|
MANIFEST.write_text(json.dumps(man, indent=1, ensure_ascii=False) + "\n", encoding="utf-8")
|
||||||
|
print(f"wrote {MANIFEST} ({len(rows)} files)")
|
||||||
|
|
||||||
|
|
||||||
|
def check_tree(root: Path, man: dict) -> dict:
|
||||||
|
res = {"ok": [], "missing": [], "differs": []}
|
||||||
|
for r in man["files"]:
|
||||||
|
f = root / r["path"]
|
||||||
|
if not f.exists():
|
||||||
|
res["missing"].append(r["path"])
|
||||||
|
elif f.stat().st_size != r["bytes"] or sha256(f) != r["sha256"]:
|
||||||
|
res["differs"].append(r["path"])
|
||||||
|
else:
|
||||||
|
res["ok"].append(r["path"])
|
||||||
|
return res
|
||||||
|
|
||||||
|
|
||||||
|
def check(a) -> None:
|
||||||
|
man = json.loads(MANIFEST.read_text(encoding="utf-8"))
|
||||||
|
res = check_tree(Path(a.root), man)
|
||||||
|
print(f"{len(res['ok'])}/{len(man['files'])} files match; {len(res['missing'])} missing, {len(res['differs'])} differ")
|
||||||
|
for k in ("missing", "differs"):
|
||||||
|
for p in res[k][:20]:
|
||||||
|
print(f" {k}: {p}")
|
||||||
|
if res["missing"] or res["differs"]:
|
||||||
|
raise SystemExit(1)
|
||||||
|
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------- comparison helpers
|
||||||
|
def _num_equal(x, y, tol=1e-12) -> float:
|
||||||
|
"""Max relative difference of two numeric arrays (NaN-aware); inf if shapes or NaN patterns differ."""
|
||||||
|
x, y = np.asarray(x, float), np.asarray(y, float)
|
||||||
|
if x.shape != y.shape or not np.array_equal(np.isnan(x), np.isnan(y)):
|
||||||
|
return float("inf")
|
||||||
|
m = ~np.isnan(x)
|
||||||
|
if not m.any():
|
||||||
|
return 0.0
|
||||||
|
return float(np.max(np.abs(x[m] - y[m]) / np.maximum(1.0, np.abs(y[m]))))
|
||||||
|
|
||||||
|
|
||||||
|
def _json_diff(a, b, path="", out=None, tol=1e-9):
|
||||||
|
out = [] if out is None else out
|
||||||
|
if isinstance(a, dict) and isinstance(b, dict):
|
||||||
|
for k in sorted(set(a) | set(b), key=str):
|
||||||
|
if k not in a or k not in b:
|
||||||
|
out.append(f"{path}/{k}: only in {'new' if k in a else 'original'}")
|
||||||
|
else:
|
||||||
|
_json_diff(a[k], b[k], f"{path}/{k}", out, tol)
|
||||||
|
elif isinstance(a, list) and isinstance(b, list) and len(a) == len(b):
|
||||||
|
for i, (x, y) in enumerate(zip(a, b)):
|
||||||
|
_json_diff(x, y, f"{path}[{i}]", out, tol)
|
||||||
|
elif isinstance(a, (int, float)) and isinstance(b, (int, float)) and not isinstance(a, bool):
|
||||||
|
if not (a == b or (np.isnan(a) and np.isnan(b)) or abs(a - b) <= tol * max(1.0, abs(b))):
|
||||||
|
out.append(f"{path}: {b!r} → {a!r}")
|
||||||
|
elif a != b:
|
||||||
|
out.append(f"{path}: {str(b)[:60]!r} → {str(a)[:60]!r}")
|
||||||
|
return out
|
||||||
|
|
||||||
|
|
||||||
|
def compare_file(new: Path, orig: Path, root: Path | None = None) -> dict:
|
||||||
|
"""identical (bytes) | equal (values within 1e-9 relative, or bytes equal once the clean-room root `root` is
|
||||||
|
replaced by the original repository root) | differs (with a short detail) | missing."""
|
||||||
|
if not new.exists():
|
||||||
|
return {"status": "missing", "detail": "not regenerated"}
|
||||||
|
if sha256(new) == sha256(orig):
|
||||||
|
return {"status": "identical"}
|
||||||
|
suf = "".join(new.suffixes[-2:]) if new.name.endswith(".csv.gz") else new.suffix
|
||||||
|
text = None
|
||||||
|
if root is not None and suf in (".csv", ".json", ".md", ".txt"):
|
||||||
|
text = new.read_text(encoding="utf-8").replace(str(root), str(REPO_ROOT))
|
||||||
|
if text.encode("utf-8") == orig.read_bytes():
|
||||||
|
return {"status": "equal", "detail": "differs only in the clean-room path"}
|
||||||
|
try:
|
||||||
|
if suf in (".csv", ".csv.gz"):
|
||||||
|
x, y = pd.read_csv(io.StringIO(text) if text is not None else new), pd.read_csv(orig)
|
||||||
|
if list(x.columns) != list(y.columns) or x.shape != y.shape:
|
||||||
|
return {"status": "differs", "detail": f"shape/columns {x.shape} vs {y.shape}"}
|
||||||
|
worst, cols = 0.0, []
|
||||||
|
for c in x.columns:
|
||||||
|
if pd.api.types.is_numeric_dtype(x[c]) and pd.api.types.is_numeric_dtype(y[c]):
|
||||||
|
d = _num_equal(x[c], y[c])
|
||||||
|
if d > 1e-9:
|
||||||
|
cols.append(f"{c} ({d:.2g})")
|
||||||
|
worst = max(worst, d)
|
||||||
|
elif not x[c].astype(str).equals(y[c].astype(str)):
|
||||||
|
cols.append(f"{c} (text)")
|
||||||
|
return ({"status": "equal", "detail": f"max rel. diff {worst:.1e}"} if not cols else
|
||||||
|
{"status": "differs", "detail": "columns " + ", ".join(cols[:6])})
|
||||||
|
if suf == ".json":
|
||||||
|
d = _json_diff(json.loads(text if text is not None else new.read_text(encoding="utf-8")),
|
||||||
|
json.loads(orig.read_text(encoding="utf-8")))
|
||||||
|
return {"status": "equal"} if not d else {"status": "differs", "detail": "; ".join(d[:4]) + (f" (+{len(d) - 4})" if len(d) > 4 else "")}
|
||||||
|
if suf == ".npz":
|
||||||
|
with np.load(new, allow_pickle=False) as x, np.load(orig, allow_pickle=False) as y:
|
||||||
|
if sorted(x.files) != sorted(y.files):
|
||||||
|
return {"status": "differs", "detail": "keys"}
|
||||||
|
bad = [k for k in x.files if not np.array_equal(x[k], y[k], equal_nan=x[k].dtype.kind == "f")]
|
||||||
|
return {"status": "equal"} if not bad else {"status": "differs", "detail": "arrays " + ", ".join(bad[:5])}
|
||||||
|
if suf in (".md", ".txt"):
|
||||||
|
d = [l for l in difflib.unified_diff(orig.read_text().splitlines(),
|
||||||
|
(text if text is not None else new.read_text()).splitlines(), lineterm="", n=0)
|
||||||
|
if l[:1] in "+-" and not l.startswith(("+++", "---"))]
|
||||||
|
return {"status": "differs", "detail": f"{len(d)} changed lines, e.g. {d[0][:80]!r}" if d else "whitespace"}
|
||||||
|
except Exception as e: # noqa: BLE001 - reported, not fatal
|
||||||
|
return {"status": "differs", "detail": f"compare failed: {e}"}
|
||||||
|
return {"status": "differs", "detail": "bytes differ"}
|
||||||
|
|
||||||
|
|
||||||
|
def raster(pdf: Path, png: Path) -> np.ndarray:
|
||||||
|
from PIL import Image
|
||||||
|
subprocess.run(["gs", "-q", "-dSAFER", "-dBATCH", "-dNOPAUSE", "-sDEVICE=png16m", "-r110", f"-sOutputFile={png}",
|
||||||
|
str(pdf)], check=True)
|
||||||
|
return np.asarray(Image.open(png).convert("RGB"), dtype=np.int16)
|
||||||
|
|
||||||
|
|
||||||
|
def compare_pdf(new: Path, orig: Path, tmp: Path) -> dict:
|
||||||
|
x, y = raster(new, tmp / f"{new.stem}_new.png"), raster(orig, tmp / f"{new.stem}_orig.png")
|
||||||
|
if x.shape != y.shape:
|
||||||
|
return {"status": "differs", "detail": f"page size {x.shape} vs {y.shape}"}
|
||||||
|
d = np.abs(x - y).max(axis=2)
|
||||||
|
frac = float((d > 0).mean())
|
||||||
|
return {"status": "identical" if frac == 0 else ("equal" if frac < 1e-4 else "differs"),
|
||||||
|
"detail": f"{100 * frac:.3f}% pixels differ (max {int(d.max())}/255) at 110 dpi"}
|
||||||
|
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------- clean room
|
||||||
|
def code_files() -> list[str]:
|
||||||
|
out = subprocess.run(["git", "ls-files", "-co", "--exclude-standard", "-z"], cwd=REPO_ROOT, check=True,
|
||||||
|
capture_output=True).stdout.decode().split("\0")
|
||||||
|
return sorted(f for f in out if f and not f.startswith(NO_CODE) and (REPO_ROOT / f).is_file())
|
||||||
|
|
||||||
|
|
||||||
|
def run_step(name, argv, repo: Path, logs: Path, audit: Path) -> dict:
|
||||||
|
env = {k: v for k, v in os.environ.items() if not k.startswith("ML_POROSITY_")}
|
||||||
|
env |= {"CUDA_VISIBLE_DEVICES": "", "OMP_NUM_THREADS": "2", "MKL_NUM_THREADS": "2", "OPENBLAS_NUM_THREADS": "2",
|
||||||
|
"MPLBACKEND": "Agg", "PYTHONPATH": f"{audit}{os.pathsep}{repo}", "PYTHONDONTWRITEBYTECODE": "1",
|
||||||
|
"REPRO_AUDIT_LOG": str(logs / f"{name}.opens"), "REPRO_ORIGINAL_ROOT": str(REPO_ROOT)}
|
||||||
|
t0 = time.time()
|
||||||
|
with open(logs / f"{name}.log", "w") as log:
|
||||||
|
rc = subprocess.run([sys.executable, *argv], cwd=repo, env=env, stdout=log, stderr=subprocess.STDOUT).returncode
|
||||||
|
return {"rc": rc, "seconds": round(time.time() - t0, 1)}
|
||||||
|
|
||||||
|
|
||||||
|
def audit_summary(opens: Path, repo: Path, work: Path) -> dict:
|
||||||
|
"""Files under the clean room's outputs/ and data/ that a step read or wrote, and reads of the original repository
|
||||||
|
(anything under REPO_ROOT except the clean room itself and the shared interpreter REPO_ROOT/.venv)."""
|
||||||
|
rd, wr, leak = set(), set(), set()
|
||||||
|
allowed = (str(work) + os.sep, str(REPO_ROOT / ".venv") + os.sep)
|
||||||
|
if opens.exists():
|
||||||
|
for line in opens.read_text().splitlines():
|
||||||
|
mode, p = line[:1], line[2:]
|
||||||
|
if p.startswith(str(REPO_ROOT) + os.sep) and not p.startswith(allowed):
|
||||||
|
leak.add(p)
|
||||||
|
elif p.startswith(str(repo / "outputs") + os.sep) or p.startswith(str(repo / "data") + os.sep):
|
||||||
|
(wr if mode == "W" else rd).add(Path(p).relative_to(repo).as_posix())
|
||||||
|
return {"read": sorted(rd - wr), "written": sorted(wr), "original_repo_reads": sorted(leak)}
|
||||||
|
|
||||||
|
|
||||||
|
def verify(a) -> None:
|
||||||
|
man = json.loads(MANIFEST.read_text(encoding="utf-8"))
|
||||||
|
out = Path(a.out)
|
||||||
|
work = Path(a.work) if a.work else out / "work"
|
||||||
|
if work.exists():
|
||||||
|
shutil.rmtree(work)
|
||||||
|
repo, logs, audit, tmp = work / "repo", work / "logs", work / "audit", work / "raster"
|
||||||
|
for d in (repo, logs, audit, tmp):
|
||||||
|
d.mkdir(parents=True)
|
||||||
|
(audit / "sitecustomize.py").write_text(SITECUSTOMIZE)
|
||||||
|
t0 = time.time()
|
||||||
|
files = code_files()
|
||||||
|
for f in files:
|
||||||
|
(repo / f).parent.mkdir(parents=True, exist_ok=True)
|
||||||
|
shutil.copy2(REPO_ROOT / f, repo / f)
|
||||||
|
figs = sorted(f.name for f in (repo / "paper" / "figures").glob("*.pdf"))
|
||||||
|
for f in figs: # regenerated by the figure steps, never copied
|
||||||
|
(repo / "paper" / "figures" / f).unlink()
|
||||||
|
for rel in (r for rels in REPO_OUTPUTS.values() for r in rels):
|
||||||
|
(repo / rel).unlink()
|
||||||
|
for arc, info in man["archives"].items():
|
||||||
|
if sha256(out / info["file"]) != info["sha256"]:
|
||||||
|
raise SystemExit(f"archive {info['file']} does not match the manifest")
|
||||||
|
with tarfile.open(out / info["file"], "r:gz") as tar:
|
||||||
|
tar.extractall(repo, filter="data")
|
||||||
|
(repo / "outputs" / "figures").mkdir(parents=True, exist_ok=True) # quick-look PNGs (06, 13) are not packaged
|
||||||
|
pre = check_tree(repo, man)
|
||||||
|
print(f"clean room {repo}: {len(files)} code files, {len(pre['ok'])}/{len(man['files'])} package files "
|
||||||
|
f"({time.time() - t0:.0f} s)", flush=True)
|
||||||
|
if pre["missing"] or pre["differs"]:
|
||||||
|
raise SystemExit("extracted package does not match the manifest")
|
||||||
|
probe = subprocess.run([sys.executable, "-c", "import ml_porosity, ml_porosity.paths as p; print(ml_porosity.__file__, p.outputs_dir())"],
|
||||||
|
cwd=repo, env={**os.environ, "PYTHONPATH": str(repo)}, capture_output=True, text=True).stdout.split()
|
||||||
|
if not probe or not probe[0].startswith(str(repo)):
|
||||||
|
raise SystemExit(f"ml_porosity resolves outside the clean room: {probe}")
|
||||||
|
|
||||||
|
by_path = {r["path"]: r for r in man["files"]}
|
||||||
|
report = {"git_head": subprocess.run(["git", "rev-parse", "HEAD"], cwd=REPO_ROOT, capture_output=True, text=True).stdout.strip(),
|
||||||
|
"git_dirty": bool(subprocess.run(["git", "status", "--porcelain", "--untracked-files=no"], cwd=REPO_ROOT,
|
||||||
|
capture_output=True, text=True).stdout.strip()),
|
||||||
|
"python": sys.version.split()[0], "started_utc": datetime.now(timezone.utc).isoformat(timespec="seconds"),
|
||||||
|
"code_files": len(files), "package_files": len(man["files"]), "steps": []}
|
||||||
|
steps = [s for s in STEPS if not a.only or s[0] in a.only]
|
||||||
|
for name, argv, kind in steps:
|
||||||
|
before = set(p.relative_to(repo).as_posix() for p in (repo / "outputs").rglob("*") if p.is_file())
|
||||||
|
t_step = time.time()
|
||||||
|
r = run_step(name, argv, repo, logs, audit)
|
||||||
|
au = audit_summary(logs / f"{name}.opens", repo, work)
|
||||||
|
cmp_ = []
|
||||||
|
for rel in au["written"]:
|
||||||
|
f = repo / rel
|
||||||
|
if rel.startswith("outputs/") and f.is_file():
|
||||||
|
if rel in by_path:
|
||||||
|
cmp_.append({"path": rel, **compare_file(f, REPO_ROOT / rel, repo)})
|
||||||
|
else:
|
||||||
|
cmp_.append({"path": rel, "status": "new" if rel not in before else "not in package"})
|
||||||
|
for rel in REPO_OUTPUTS.get(name, []):
|
||||||
|
cmp_.append({"path": rel, **compare_file(repo / rel, REPO_ROOT / rel, repo)})
|
||||||
|
if kind == "figures":
|
||||||
|
for f in sorted((repo / "paper" / "figures").glob("*.pdf")):
|
||||||
|
if f.stat().st_mtime >= t_step:
|
||||||
|
cmp_.append({"path": f"paper/figures/{f.name}", **compare_pdf(f, REPO_ROOT / "paper" / "figures" / f.name, tmp)})
|
||||||
|
if kind == "stdout":
|
||||||
|
env = {**os.environ, "CUDA_VISIBLE_DEVICES": "", "OMP_NUM_THREADS": "2", "MKL_NUM_THREADS": "2",
|
||||||
|
"OPENBLAS_NUM_THREADS": "2"}
|
||||||
|
ref = subprocess.run([sys.executable, *argv], cwd=REPO_ROOT, env=env, capture_output=True, text=True).stdout
|
||||||
|
new = (logs / f"{name}.log").read_text()
|
||||||
|
same = new.strip() == ref.strip()
|
||||||
|
nd = sum(1 for l in difflib.unified_diff(ref.splitlines(), new.splitlines(), lineterm="", n=0)
|
||||||
|
if l[:1] in "+-" and not l.startswith(("+++", "---")))
|
||||||
|
cmp_.append({"path": "stdout (vs. the same command on the original outputs)",
|
||||||
|
"status": "identical" if same else "differs", "detail": "" if same else f"{nd} changed lines"})
|
||||||
|
rec = {"name": name, "command": "python " + " ".join(argv), "kind": kind, **r,
|
||||||
|
"n_read_package": sum(1 for p in au["read"] if p in by_path),
|
||||||
|
"read_outside_package": [p for p in au["read"] if p not in by_path and not p.startswith("data/")][:20],
|
||||||
|
"read_data": sorted({"/".join(p.split("/")[:3]) for p in au["read"] if p.startswith("data/")}),
|
||||||
|
"original_repo_reads": au["original_repo_reads"][:20], "compared": cmp_}
|
||||||
|
if r["rc"]:
|
||||||
|
rec["log_tail"] = (logs / f"{name}.log").read_text(errors="replace").splitlines()[-15:]
|
||||||
|
n = {s: sum(c["status"] == s for c in cmp_) for s in ("identical", "equal", "differs", "missing", "new", "not in package")}
|
||||||
|
print(f"[{name}] rc={r['rc']} {r['seconds']:.0f} s; rewritten: {n}; outside reads: "
|
||||||
|
f"{len(rec['read_outside_package'])}; original-repo reads: {len(rec['original_repo_reads'])}", flush=True)
|
||||||
|
report["steps"].append(rec)
|
||||||
|
(work / "verify.json").write_text(json.dumps(report, indent=1))
|
||||||
|
if not a.only:
|
||||||
|
report["figures_not_regenerated"] = [f for f in figs if not (repo / "paper" / "figures" / f).exists()]
|
||||||
|
report["finished_utc"] = datetime.now(timezone.utc).isoformat(timespec="seconds")
|
||||||
|
(work / "verify.json").write_text(json.dumps(report, indent=1))
|
||||||
|
write_report(report, work, DOC / "verify_report.md" if not a.only else work / "verify_report.md")
|
||||||
|
if not a.keep and not a.only:
|
||||||
|
shutil.rmtree(work)
|
||||||
|
|
||||||
|
|
||||||
|
def write_report(rep: dict, work: Path, dest: Path) -> None:
|
||||||
|
L = ["# Clean-room verification of the reproduction package", "",
|
||||||
|
f"Written by `scripts/39_repro_package.py verify` ({rep['started_utc']} → {rep['finished_utc']}). Code: "
|
||||||
|
f"{rep['code_files']} files of the working tree at {rep['git_head'][:10]}"
|
||||||
|
f"{' with uncommitted changes' if rep['git_dirty'] else ''}; package: {rep['package_files']} files from the "
|
||||||
|
"archives listed in `repro/MANIFEST.json`; Python " + rep["python"] + ", CPU only. No SEG-Y, Volve or "
|
||||||
|
"Teapot raw data in the clean room; the F3 well files tracked in git are present.", "",
|
||||||
|
"Status of a rewritten file: identical = same bytes as the original; equal = same values (csv/json/npz "
|
||||||
|
"within 1e-9 relative, or bytes equal once the clean-room path is replaced by the original one; figures with "
|
||||||
|
"< 0.01% differing pixels at 110 dpi); differs = see detail; missing = expected but not rewritten; new = "
|
||||||
|
"written by the step but not part of the package. Reads are those of files under outputs/ (package) and "
|
||||||
|
"data/ (tracked F3 well files); a read of the original repository would mean the clean room leaked.", "",
|
||||||
|
"| step | command | exit | s | identical | equal | differs | missing | new | reads outside package | reads of original repo |",
|
||||||
|
"|---|---|---|---|---|---|---|---|---|---|---|"]
|
||||||
|
keys = ("identical", "equal", "differs", "missing")
|
||||||
|
for s in rep["steps"]:
|
||||||
|
c = s["compared"]
|
||||||
|
n = {k: sum(x["status"] == k for x in c) for k in keys}
|
||||||
|
n["new"] = sum(x["status"] in ("new", "not in package") for x in c)
|
||||||
|
L.append(f"| {s['name']} | `{s['command']}` | {s['rc']} | {s['seconds']:.0f} | "
|
||||||
|
+ " | ".join(str(n[k]) for k in (*keys, "new"))
|
||||||
|
+ f" | {len(s['read_outside_package'])} | {len(s['original_repo_reads'])} |")
|
||||||
|
if "figures_not_regenerated" in rep:
|
||||||
|
L += ["", "Paper figures deleted from the clean room and not regenerated: "
|
||||||
|
+ (", ".join(rep["figures_not_regenerated"]) or "none") + "."]
|
||||||
|
L += ["", "## Details", ""]
|
||||||
|
for s in rep["steps"]:
|
||||||
|
L.append(f"### {s['name']}")
|
||||||
|
L.append(f"- package files read: {s['n_read_package']}"
|
||||||
|
+ (f"; tracked data read: {', '.join(s['read_data'])}" if s["read_data"] else ""))
|
||||||
|
for p in s["read_outside_package"]:
|
||||||
|
L.append(f"- read outside the package: `{p}`")
|
||||||
|
for p in s["original_repo_reads"]:
|
||||||
|
L.append(f"- read of the original repository: `{p}`")
|
||||||
|
for k in ("differs", "missing", "new", "not in package", "equal"):
|
||||||
|
xs = [x for x in s["compared"] if x["status"] == k]
|
||||||
|
for x in xs[:25]:
|
||||||
|
L.append(f"- {k}: `{x['path']}`" + (f" ({x['detail']})" if x.get("detail") else ""))
|
||||||
|
if len(xs) > 25:
|
||||||
|
L.append(f"- … {len(xs) - 25} more {k}")
|
||||||
|
L.append(f"- identical: {sum(x['status'] == 'identical' for x in s['compared'])} file(s)")
|
||||||
|
if s.get("log_tail"):
|
||||||
|
L += ["- log tail:", "", "```", *s["log_tail"], "```"]
|
||||||
|
L.append("")
|
||||||
|
dest.write_text("\n".join(L) + "\n", encoding="utf-8")
|
||||||
|
print(f"wrote {dest}")
|
||||||
|
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------- code snapshot
|
||||||
|
def code(a) -> None:
|
||||||
|
if subprocess.run(["git", "diff", "--quiet", a.rev, "--"], cwd=REPO_ROOT).returncode:
|
||||||
|
raise SystemExit(f"tracked files differ from {a.rev}: commit first, then archive that commit")
|
||||||
|
rev = subprocess.run(["git", "rev-parse", "--short=10", a.rev], cwd=REPO_ROOT, check=True, capture_output=True,
|
||||||
|
text=True).stdout.strip()
|
||||||
|
out = Path(a.out) / f"ML-Porosity_code_{rev}.tar.gz"
|
||||||
|
out.parent.mkdir(parents=True, exist_ok=True)
|
||||||
|
with open(out, "wb") as f:
|
||||||
|
subprocess.run(["git", "archive", "--format=tar.gz", f"--prefix=ML-Porosity-{rev}/", a.rev], cwd=REPO_ROOT,
|
||||||
|
check=True, stdout=f)
|
||||||
|
print(f"wrote {out} ({out.stat().st_size / 1e6:.1f} MB, sha256 {sha256(out)})")
|
||||||
|
|
||||||
|
|
||||||
|
def main() -> None:
|
||||||
|
ap = argparse.ArgumentParser(description=__doc__.split("\n")[0])
|
||||||
|
sub = ap.add_subparsers(dest="cmd", required=True)
|
||||||
|
b = sub.add_parser("build")
|
||||||
|
b.add_argument("--dry-run", action="store_true")
|
||||||
|
c = sub.add_parser("check")
|
||||||
|
c.add_argument("--root", required=True)
|
||||||
|
v = sub.add_parser("verify")
|
||||||
|
v.add_argument("--work", default=None)
|
||||||
|
v.add_argument("--only", nargs="+", default=None, choices=[s[0] for s in STEPS])
|
||||||
|
v.add_argument("--keep", action="store_true")
|
||||||
|
k = sub.add_parser("code")
|
||||||
|
k.add_argument("--rev", required=True)
|
||||||
|
for x in (b, v, k):
|
||||||
|
x.add_argument("--out", default=str(outputs_dir() / "repro"))
|
||||||
|
a = ap.parse_args()
|
||||||
|
{"build": build, "check": check, "verify": verify, "code": code}[a.cmd](a)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
41
scripts/run_bench.sh
Executable file
41
scripts/run_bench.sh
Executable file
@@ -0,0 +1,41 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# protocol_bench (configs/protocol_bench.yaml) driver on the Linux GPU server: every stage is wrapped by
|
||||||
|
# ml_porosity.runlog (logs/runs/<ts>_bench_<stage>/, logs/index.csv) and is restartable (completed jobs are skipped
|
||||||
|
# by fingerprint and checksum). Long runs: detach with `setsid nohup scripts/run_bench.sh ... > logs/bench_<x>.out 2>&1 &`.
|
||||||
|
# scripts/run_bench.sh lock # first lock (after the review of the draft)
|
||||||
|
# STUDIES="S1" DEVICE=cuda:0 WORKERS=4 scripts/run_bench.sh posterior train
|
||||||
|
# STUDIES="S3 S4 S8" DEVICE=cuda:1 scripts/run_bench.sh train
|
||||||
|
# scripts/run_bench.sh summarize | status | repro
|
||||||
|
# DEV=1 RIDS="902 903" STUDIES="S2" PRESETS="rp_L1 wv_L1" scripts/run_bench.sh posterior train # dev (never a result)
|
||||||
|
# Env: DEVICE (default cuda:0), WORKERS (4), THREADS per worker (2), MEM_GB per SMC worker (6), STUDIES, REGIMES,
|
||||||
|
# PRESETS, RIDS, DEV (1 → --dev), CONTROLS (1 → S2 controls), EXTRA (extra arguments).
|
||||||
|
set -euo pipefail
|
||||||
|
cd "$(dirname "$0")/.."
|
||||||
|
PY="${PY:-.venv/bin/python}"
|
||||||
|
DEVICE="${DEVICE:-cuda:0}"
|
||||||
|
WORKERS="${WORKERS:-4}"
|
||||||
|
THREADS="${THREADS:-2}"
|
||||||
|
MEM_GB="${MEM_GB:-6}"
|
||||||
|
STUDIES="${STUDIES:-S1 S2 S3 S4 S8}"
|
||||||
|
export OMP_NUM_THREADS=$THREADS MKL_NUM_THREADS=$THREADS OPENBLAS_NUM_THREADS=$THREADS NUMEXPR_NUM_THREADS=$THREADS \
|
||||||
|
NUMBA_NUM_THREADS=$THREADS PYTHONHASHSEED=0 PYTHONUTF8=1 CUBLAS_WORKSPACE_CONFIG=:4096:8
|
||||||
|
args=(--device "$DEVICE" --workers "$WORKERS" --threads "$THREADS" --gpu-mem-gb "$MEM_GB")
|
||||||
|
# shellcheck disable=SC2206
|
||||||
|
args+=(--studies $STUDIES)
|
||||||
|
[[ -n "${REGIMES:-}" ]] && args+=(--regimes $REGIMES)
|
||||||
|
[[ -n "${PRESETS:-}" ]] && args+=(--presets $PRESETS)
|
||||||
|
[[ -n "${RIDS:-}" ]] && args+=(--rids $RIDS)
|
||||||
|
[[ "${DEV:-0}" == "1" ]] && args+=(--dev)
|
||||||
|
[[ "${CONTROLS:-0}" == "1" ]] && args+=(--controls)
|
||||||
|
[[ -n "${EXTRA:-}" ]] && args+=($EXTRA)
|
||||||
|
tag="$(echo "$STUDIES" | tr ' ' '+')"
|
||||||
|
[[ "${DEV:-0}" == "1" ]] && tag="dev_$tag"
|
||||||
|
for stage in "${@:-status}"; do
|
||||||
|
case "$stage" in
|
||||||
|
status|lock|summarize|repro)
|
||||||
|
"$PY" -m ml_porosity.runlog -n "bench_${stage}" -- "$PY" scripts/34_run_bench.py "$stage" "${args[@]}" ;;
|
||||||
|
posterior|train|dev-budgets)
|
||||||
|
"$PY" -m ml_porosity.runlog -n "bench_${stage}_${tag}_${DEVICE//:/}" -- "$PY" scripts/34_run_bench.py "$stage" "${args[@]}" ;;
|
||||||
|
*) echo "unknown stage: $stage" >&2; exit 2 ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
127
tests/data/d2_fingerprints.json
Normal file
127
tests/data/d2_fingerprints.json
Normal file
@@ -0,0 +1,127 @@
|
|||||||
|
{
|
||||||
|
"meta": {
|
||||||
|
"created": "2026-10-29",
|
||||||
|
"purpose": "SHA-256 fingerprints of the D2 default path before misspecification parameters were added (phase P6, item p6-gen); recomputed by tests/test_d2_misspec.py",
|
||||||
|
"generator": "ml_porosity/data/synth_d2.py at commit 0cfe202",
|
||||||
|
"inputs": {
|
||||||
|
"d2_config": "57b676f0fc569ebe44f6253426fe42a218fb06272323b949932e9f8d597ff0d3",
|
||||||
|
"warp_prior": "55cda573c06b3a7275bdb4ac5f169fb4e5af329e1d199acc3d4daffe15624d27",
|
||||||
|
"wavelet": "b689ea12578e580d8c2305c8f7219be05ff6e339884fa30b694111e968c0fc64"
|
||||||
|
},
|
||||||
|
"input_paths": {
|
||||||
|
"d2_config": "configs/d2_synth_p2r.yaml",
|
||||||
|
"warp_prior": "outputs/p2/warp_prior_f3.json",
|
||||||
|
"wavelet": "outputs/wavelets.npz"
|
||||||
|
},
|
||||||
|
"warp_prior_fit": "matern32",
|
||||||
|
"wavelet_key": "statistical",
|
||||||
|
"rids": [
|
||||||
|
900,
|
||||||
|
8,
|
||||||
|
902
|
||||||
|
],
|
||||||
|
"drift_factors": [
|
||||||
|
0.0,
|
||||||
|
1.0,
|
||||||
|
2.0
|
||||||
|
],
|
||||||
|
"snr_db": 10,
|
||||||
|
"sigma_a_ms": 7.0,
|
||||||
|
"anchor_density": "full",
|
||||||
|
"obs_wells": "8 test wells + first 4 pool wells, concatenated over drift factors then wells",
|
||||||
|
"well_fields": [
|
||||||
|
"seis_clean",
|
||||||
|
"noise_unit",
|
||||||
|
"phi_t",
|
||||||
|
"z_g",
|
||||||
|
"z_b",
|
||||||
|
"boundaries_t",
|
||||||
|
"eps_a"
|
||||||
|
],
|
||||||
|
"obs_keys": [
|
||||||
|
"seis",
|
||||||
|
"phi_log",
|
||||||
|
"ai_log",
|
||||||
|
"tau_k",
|
||||||
|
"t_k",
|
||||||
|
"b",
|
||||||
|
"g",
|
||||||
|
"t_of_tau_true",
|
||||||
|
"y_true"
|
||||||
|
],
|
||||||
|
"env": {
|
||||||
|
"numpy": "2.5.4",
|
||||||
|
"scipy": "1.18.1",
|
||||||
|
"python": "3.13.15",
|
||||||
|
"platform": "Linux-6.8.0-136-generic-x86_64-with-glibc2.39"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"realizations": {
|
||||||
|
"900": {
|
||||||
|
"wells": {
|
||||||
|
"seis_clean": "e460372264253280218c769a4b2f65f4b531f3142fee5d5b595e90b5ee04914f",
|
||||||
|
"noise_unit": "259ccc2614faeab0d496f0e17605105990ecfe4d26a512148e1aa3829ea64a54",
|
||||||
|
"phi_t": "b07358ee2077dc844c995588966e7d539d007dd5315e24b7e0702dbdf59639ab",
|
||||||
|
"z_g": "d42a6e15f2f13715b0adb65dadc4a26b1e15bf8cb82053c9148ae7abd6f1e61d",
|
||||||
|
"z_b": "dcebebc51a5356182578dfe37f3957e8f84cf5b8bd1c0c419faa3d221eceb52e",
|
||||||
|
"boundaries_t": "093d53cd27316aa07fb1e3c93b3fd080a228dd18071abaf380e23bf8b0622108",
|
||||||
|
"eps_a": "5a3d87cdbace9cbeb6ca7884c6f55511c80506964099e2a2e28deac0e36503b3"
|
||||||
|
},
|
||||||
|
"obs": {
|
||||||
|
"seis": "b096fac64e04ce61bcc8cf22bfe7d65538ba2a060b42e53fb236a52dbc5a7c78",
|
||||||
|
"phi_log": "734bc3e4926415b40c3fd4127ba3e064be9ff139ebe3e08e7181bd90bc573956",
|
||||||
|
"ai_log": "3204dbd982535fc9a5668156b57c44065dbc9cae20cc8027c8a448f5b62fa0e0",
|
||||||
|
"tau_k": "35e971e2cd0a052ea99758c5409b9368c0e152f0eb7143f4a225945bdc0c8ffd",
|
||||||
|
"t_k": "1cbb0f63cbebe841f393f03a4b44f0a736f3c442729e140ca82c1c0d2263ed61",
|
||||||
|
"b": "288fdad9c7bb60b647c2d32f0db339e1158c53c6cfa6b9de9c114dbd4aa73e4d",
|
||||||
|
"g": "50e489f199452348585a232b688037c76a3176fa311f1315d23d0ff1aec45075",
|
||||||
|
"t_of_tau_true": "8615f79f1c306ce46ace0dbaf5e3d449d3ac25eadf97645492742ea422f90deb",
|
||||||
|
"y_true": "9a96e7ff339bd6eff9cc113217679dc365e5d8116901972a6ad940ae92b10471"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"8": {
|
||||||
|
"wells": {
|
||||||
|
"seis_clean": "cfca2356612b93197b614b4e3d5154fa4bae1586375fbc25280591edb5384ad0",
|
||||||
|
"noise_unit": "a3aa075dc0eb79991380748b0ebff93d44f3821f6f42405b6f898299e07eab60",
|
||||||
|
"phi_t": "802a7cd4da3ab63031ea7c1979d9b6e84a0d9c7ac7cd31940435fcbd62a250cc",
|
||||||
|
"z_g": "65024e6ca2ae9dff122e16bc4f957e17d0844ebfbc260d5c0fde49c7cd619ada",
|
||||||
|
"z_b": "e1653c27d05bdc055912e9bda3488b6cc735c30cd04e4d85a5efbc9f4f917d6c",
|
||||||
|
"boundaries_t": "f407b1a729abda7a6acb7c22ece5e834c56afd72d87ece179482833d69b172f8",
|
||||||
|
"eps_a": "da3cdea0869cbfd9f2c7a2d3d2f5ed789118df8ec87dfcda37661dc27a40b32e"
|
||||||
|
},
|
||||||
|
"obs": {
|
||||||
|
"seis": "205947a1e5443da066c8e292255724def0d62d81bb22e2197a538461c5d2e3d4",
|
||||||
|
"phi_log": "fa9bf941a520d2b8f213e27f0fcec14bef81fc64112dbbe969c9a29b7d4654b4",
|
||||||
|
"ai_log": "9fd476bb875b5482c2f38f38c9cb5232d6cf503d16d7e37daec1c110880b8009",
|
||||||
|
"tau_k": "00e51672611fc3b6672d0c6acdf484a025a999114fd5fc785c3d2ba2af8c745b",
|
||||||
|
"t_k": "96e9393d77ec22f68c6d02bf8f9faf2405ed747b1f2318c0ce7f776b65fec057",
|
||||||
|
"b": "0755adab47cbc6a08adaddecc3de50b2829dae738d63659040b86138fd1e17c8",
|
||||||
|
"g": "7b1de59ada788bc7815b2c43e39b41d37475dd85c10f5dae5b0ac97f1437267c",
|
||||||
|
"t_of_tau_true": "17264af616441713e0dba664b09ba03739fc7a06608a19ea0fd1787f63f5476d",
|
||||||
|
"y_true": "44a8b5d80d0f5e5ebd2fa554ce032c174535a31677834bbd7763c7fbb3bd4417"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"902": {
|
||||||
|
"wells": {
|
||||||
|
"seis_clean": "5f3534d09866d3703ae30e7d08d6debf359d0cec1ac0bd03badf0e1002db148c",
|
||||||
|
"noise_unit": "7fc3986dee0a0b613879bf2074702429e266ad0cce0d819ac742b4704f1ba009",
|
||||||
|
"phi_t": "e880ed13dcdf17c783acfd03bcf70403e15ac2ddc3c081bcb804f49df42ce724",
|
||||||
|
"z_g": "d2b4e0551a08eb304f034c3289b68b85429c0b1518d98cd2c6d98cdee6f4714f",
|
||||||
|
"z_b": "228ca890c469b1adfd0c2ceb26dfcc966fa08da2aaf7d60916419bf33b4e5d1d",
|
||||||
|
"boundaries_t": "0c5e18d68c4d4d1f1c71e170edc7f2e80c6ab425ccc2b5e98e42207a8cb3d6e2",
|
||||||
|
"eps_a": "7d640af84c68b56a6ce3446fcdd07ae6847b0aeedf80c18e73f7b7117a667451"
|
||||||
|
},
|
||||||
|
"obs": {
|
||||||
|
"seis": "68203f9a4ff5c6a21f30227c997f6d7cf496058dfffe6fa257a57235c70c8013",
|
||||||
|
"phi_log": "b2ba9800e47bc362bdbb1ea2d6afee208289d8972edefae7ff5f0f2a6615e039",
|
||||||
|
"ai_log": "3467e34f9d9f4d649b6ae472dd91a8f505df2dc4a4b3e4ff6b71d3d0d6a8c641",
|
||||||
|
"tau_k": "11d9bb79da9ae6ee0ccac5abde6508bd4c41ea180cfa9e304f8ad33274373e34",
|
||||||
|
"t_k": "2eeebb99fb6725ef91bcbab55d5bedc9cac8c75339c7468a7bedcf8d1cc2efbe",
|
||||||
|
"b": "edaf277378cd1bceb33e7eff98ad4f8738592af7522161b9f40c889b09b9ba91",
|
||||||
|
"g": "65cb230013ccbf845128af85e871c126f1b9a3035ef13cecce37b0116c8170d1",
|
||||||
|
"t_of_tau_true": "870ee33b8ccfdce32beb7117bfa4da65396987d775ecaa5e8a3b10aab58e0dc4",
|
||||||
|
"y_true": "33bcedc3461259c7ab62e24e180d2eac78884c16cd7ad2e707104cbbd8981682"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
189
tests/test_bench.py
Normal file
189
tests/test_bench.py
Normal file
@@ -0,0 +1,189 @@
|
|||||||
|
"""protocol_bench runner: protocol consistency, cell enumeration, guards, TCN path, S8 two-mode banks, summary rules.
|
||||||
|
|
||||||
|
No GPU and no main-grid realization is touched; the generator-dependent tests skip when the D2 inputs are missing.
|
||||||
|
"""
|
||||||
|
|
||||||
|
import itertools
|
||||||
|
import json
|
||||||
|
|
||||||
|
import numpy as np
|
||||||
|
import pandas as pd
|
||||||
|
import pytest
|
||||||
|
import torch
|
||||||
|
import yaml
|
||||||
|
|
||||||
|
from ml_porosity.benchmark import cells as C
|
||||||
|
from ml_porosity.benchmark import protocol as PR
|
||||||
|
from ml_porosity.paths import REPO_ROOT, f3_root
|
||||||
|
|
||||||
|
P = yaml.safe_load((REPO_ROOT / "configs" / "protocol_bench.yaml").read_text(encoding="utf-8"))
|
||||||
|
GEN = yaml.safe_load((REPO_ROOT / P["inputs"]["d2_config"]["path"]).read_text(encoding="utf-8"))
|
||||||
|
NEEDED = [f3_root() / ".survey", REPO_ROOT / GEN["horizon_cache"], REPO_ROOT / P["inputs"]["warp_prior"]["path"],
|
||||||
|
REPO_ROOT / P["inputs"]["wavelet"]["path"]]
|
||||||
|
needs_inputs = pytest.mark.skipif(not all(f.exists() for f in NEEDED), reason="missing D2 inputs")
|
||||||
|
|
||||||
|
|
||||||
|
def test_protocol_consistency():
|
||||||
|
presets = GEN["misspec_presets"]
|
||||||
|
s2 = P["studies"]["S2"]
|
||||||
|
for names in s2["presets"].values():
|
||||||
|
assert all(n in presets for n in names), names
|
||||||
|
assert all(n in presets for n in s2["controls"]["presets"])
|
||||||
|
for s in P["studies"].values():
|
||||||
|
for m in s["methods"]:
|
||||||
|
assert m in P["training"]["budgets"], m
|
||||||
|
assert set(P["grid"]["regimes"]) == set(GEN["regimes"])
|
||||||
|
assert not set(P["grid"]["realizations"]) & set(P["grid"]["dev_realizations"])
|
||||||
|
p2 = yaml.safe_load((REPO_ROOT / "configs" / "protocol_p2.yaml").read_text(encoding="utf-8"))
|
||||||
|
assert not set(P["grid"]["realizations"]) & set(p2["grid"]["realizations"])
|
||||||
|
p2r = yaml.safe_load((REPO_ROOT / "configs" / "protocol_p2r.yaml").read_text(encoding="utf-8"))
|
||||||
|
assert P["grid"]["realizations"] == p2r["grid"]["realizations"]
|
||||||
|
for m in ("Oracle", "B3b", "B3c", "B3c-R", "B3d", "B3d-Sa", "M2-Sa"):
|
||||||
|
assert P["training"]["budgets"][m] == p2r["training"]["budgets"][m], m
|
||||||
|
for m in ("B4a", "B4b", "B4c", "B4d"):
|
||||||
|
assert P["training"]["budgets"][m] == p2["training"]["budgets"][m], m
|
||||||
|
for k, h in P["hypotheses"].items():
|
||||||
|
assert h["kind"] in ("claim", "descriptive", "disclosed"), k
|
||||||
|
assert h.get("statement") or h.get("items"), k
|
||||||
|
|
||||||
|
|
||||||
|
def test_cell_counts_and_uniqueness():
|
||||||
|
counts = {"S1": 560, "S2": 224, "S3": 240, "S4": 48, "S8": 96}
|
||||||
|
for s, n in counts.items():
|
||||||
|
cs = C.study_cells(P, s)
|
||||||
|
assert len(cs) == n, (s, len(cs))
|
||||||
|
assert len(set((c.setting, c.tag, c.backbone) for c in cs)) == n
|
||||||
|
s1 = C.study_cells(P, "S1")
|
||||||
|
assert not any(c.c in (0, 1, 2) and c.n_train in (4, 16) for c in s1) # P2r cells are read, not recomputed
|
||||||
|
assert sum(C.needs_posterior(c) for c in C.study_cells(P, "S3")) == 0 and all(c.posterior == "p2r" for c in C.study_cells(P, "S3"))
|
||||||
|
assert all(c.posterior == "p2r" and c.backbone == "tcn" for c in C.study_cells(P, "S4"))
|
||||||
|
assert sorted(set(c.delta_ms for c in C.study_cells(P, "S8"))) == [8.0, 16.0, 32.0]
|
||||||
|
assert len(C.study_cells(P, "S2", controls=True)) == 224 + 32
|
||||||
|
dev = C.study_cells(P, "S1", rids=[902], regimes=["R10"], grid={"drift_factors": [1.0], "n_train": [4]})
|
||||||
|
assert len(dev) == 1 and dev[0].tag == "r902_c1_n4"
|
||||||
|
|
||||||
|
|
||||||
|
def test_paths_shared_posterior_and_flat_names(tmp_path):
|
||||||
|
a = C.Cell("S1", "R10", None, 1.0, 4, 902, ("Oracle",))
|
||||||
|
b = C.Cell("S4", "R10", None, 1.0, 4, 902, ("Oracle",), backbone="tcn", posterior="bench")
|
||||||
|
assert C.posterior_paths(a, tmp_path, 0)["particles"] == C.posterior_paths(b, tmp_path, 0)["particles"]
|
||||||
|
assert C.posterior_paths(a, tmp_path, 0)["particles"].name == "r902_c1_n4_s0_particles.npz"
|
||||||
|
assert C.train_paths(b, tmp_path)["csv"].name == "r902_c1_n4__tcn.csv"
|
||||||
|
s8 = C.Cell("S8", "Rm5", None, 1.0, 16, 8, ("PM2",), posterior="none", delta_ms=32.0)
|
||||||
|
assert C.posterior_dir(s8, tmp_path) is None and s8.tag == "r8_c1_n16_d32"
|
||||||
|
s2 = C.Cell("S2", "R10", "wv_L1", 1.0, 16, 8, ("Oracle",))
|
||||||
|
assert s2.setting == "R10__wv_L1"
|
||||||
|
|
||||||
|
|
||||||
|
def test_guards():
|
||||||
|
for rids, dev in (([0], True), ([3], False), ([8, 902], True), ([902], False), ([8], True), ([77], True)):
|
||||||
|
with pytest.raises(SystemExit):
|
||||||
|
PR.check_rids(rids, P, dev=dev)
|
||||||
|
PR.check_rids([902, 905], P, dev=True)
|
||||||
|
PR.check_rids([P["reproduction"]["rid"]], P, dev=False, repro=True)
|
||||||
|
with pytest.raises(SystemExit):
|
||||||
|
PR.check_rids([9], P, dev=False, repro=True)
|
||||||
|
if not PR.LOCK.exists():
|
||||||
|
with pytest.raises(RuntimeError):
|
||||||
|
PR.check_rids([8], P, dev=False)
|
||||||
|
|
||||||
|
|
||||||
|
def test_fingerprint_depends_on_settings():
|
||||||
|
st = {"protocol_sha256": "x", "dev": True}
|
||||||
|
assert PR.fingerprint(st, stage="train", rid=8) != PR.fingerprint(st, stage="train", rid=9)
|
||||||
|
assert PR.fingerprint(st, a=1, b=2) == PR.fingerprint(st, b=2, a=1)
|
||||||
|
|
||||||
|
|
||||||
|
def test_tcn_training_path_runs_on_cpu():
|
||||||
|
from ml_porosity.benchmark.training import train_predict_tcn
|
||||||
|
|
||||||
|
rng = np.random.default_rng(0)
|
||||||
|
X, Xte = rng.normal(size=(3, 9, 126)).astype(np.float32), rng.normal(size=(2, 9, 126)).astype(np.float32)
|
||||||
|
Y = rng.normal(size=(3, 2, 126)).astype(np.float32)
|
||||||
|
spec = {"kind": "bank", "Y": Y, "logpi": np.full((3, 2), -np.log(2), np.float32), "lam": 0.5}
|
||||||
|
cfg = {"d_channels": 8, "p_dropout": 0.0, "lr": 1e-3, "grad_clip": 5.0}
|
||||||
|
out = train_predict_tcn(X, Xte, spec, cfg, 0, [2, 3], "cpu")
|
||||||
|
assert set(out) == {2, 3} and out[3][0].shape == (2, 126) and np.all(out[3][1] > 0)
|
||||||
|
out2 = train_predict_tcn(X, Xte, spec, cfg, 0, [3], "cpu")
|
||||||
|
assert np.allclose(out[3][0], out2[3][0]) # same seed, same trajectory
|
||||||
|
spec_h = spec | {"lam": None}
|
||||||
|
assert train_predict_tcn(X, Xte, spec_h, cfg, 0, [2], "cpu")[2][0].shape == (2, 126)
|
||||||
|
|
||||||
|
|
||||||
|
@needs_inputs
|
||||||
|
def test_two_mode_banks_match_corollary_setup():
|
||||||
|
from ml_porosity.benchmark.data import load_inputs
|
||||||
|
from ml_porosity.benchmark.training import two_mode_banks
|
||||||
|
from ml_porosity.registration.labels import antialias, labels_for_warps
|
||||||
|
|
||||||
|
inp = load_inputs(PR.load_protocol())
|
||||||
|
R = inp.realization(902, None)
|
||||||
|
obs, _ = inp.observe(R, 1.0, "R10", 4)
|
||||||
|
diag = [{} for _ in obs]
|
||||||
|
banks = two_mode_banks(R, obs, 32.0, diag)
|
||||||
|
assert np.stack(banks["BK2"]).shape == (4, 2, len(R.t_main)) and np.stack(banks["PM2"]).shape == (4, 1, len(R.t_main))
|
||||||
|
sides = [d["side"] for d in diag]
|
||||||
|
assert set(sides) <= {-1, 1}
|
||||||
|
for i, o in enumerate(obs):
|
||||||
|
y_aa = antialias(o["phi_log"], R.cfg["fine_dt_ms"], R.dt)
|
||||||
|
oracle = labels_for_warps(R.tau_fine, y_aa, o["t_of_tau_true"][None], R.t_main)[0]
|
||||||
|
assert np.allclose(banks["BK2"][i][0], oracle) # the truth is a member of the bank
|
||||||
|
assert 11.0 < diag[i]["PM2_warp_rmse_ms"] < 19.0 # mean warp off by Δ/2 in t, i.e. Δ/(2 e^g) in τ
|
||||||
|
again = two_mode_banks(R, obs, 32.0, [{} for _ in obs])
|
||||||
|
assert all(np.array_equal(a, b) for a, b in zip(banks["BK2"], again["BK2"])) # declared stream → deterministic
|
||||||
|
|
||||||
|
|
||||||
|
@needs_inputs
|
||||||
|
def test_dev_grid_override_and_nominal_fingerprint_helper():
|
||||||
|
from ml_porosity.benchmark.data import fingerprint_realization, load_inputs
|
||||||
|
|
||||||
|
inp = load_inputs(PR.load_protocol())
|
||||||
|
fp = fingerprint_realization(inp.realization(902, None))
|
||||||
|
stored = json.loads((REPO_ROOT / P["inputs"]["fingerprints"]["path"]).read_text())["realizations"]["902"]
|
||||||
|
assert fp["wells"]["z_g"] == stored["wells"]["z_g"]
|
||||||
|
assert fp["obs"]["seis"] == stored["obs"]["seis"]
|
||||||
|
|
||||||
|
|
||||||
|
def test_summary_rules_on_synthetic_runs():
|
||||||
|
from ml_porosity.benchmark.summary import h2a_cells, pair
|
||||||
|
|
||||||
|
rng = np.random.default_rng(1)
|
||||||
|
rows = []
|
||||||
|
for rid, seed, N, m in itertools.product(range(8), range(5), (4, 16), ("B3b", "B3c", "B3c-R", "B3d-Sa", "M2-Sa")):
|
||||||
|
base = {"B3b": 1.0, "B3c": 0.8, "B3c-R": 0.82, "B3d-Sa": 0.6, "M2-Sa": 0.58}[m]
|
||||||
|
rows.append({"rid": rid, "seed": seed, "c": 1.0, "n_train": N, "method": m, "band_rmse": base + 0.01 * rng.standard_normal(),
|
||||||
|
"band_pcc": 0.9 - base / 10, "rmse": base, "pcc": 0.9})
|
||||||
|
run = pd.DataFrame(rows)
|
||||||
|
cells = h2a_cells(run, "B3d-Sa", ["B3b", "B3c", "B3c-R"], np.random.default_rng(0), 200)
|
||||||
|
assert len(cells) == 2 and cells.cell_pass.all() and (cells.best == "B3c").all()
|
||||||
|
pr = pair(run[run.n_train == 16], "M2-Sa", "B3d-Sa", np.random.default_rng(0), 200)
|
||||||
|
assert pr["better"] and pr["ratio"] < 1 and pr["ratio_lo"] <= pr["ratio"] <= pr["ratio_hi"]
|
||||||
|
|
||||||
|
|
||||||
|
@needs_inputs
|
||||||
|
def test_control_gp_bank_matches_t2_construction():
|
||||||
|
from ml_porosity.benchmark.data import load_inputs
|
||||||
|
from ml_porosity.benchmark.training import control_gp_bank
|
||||||
|
|
||||||
|
inp = load_inputs(PR.load_protocol())
|
||||||
|
R = inp.realization(902, None)
|
||||||
|
obs, _ = inp.observe(R, 1.0, "R10", 2)
|
||||||
|
rng = np.random.default_rng(3)
|
||||||
|
smc = {}
|
||||||
|
for o in obs: # synthetic "particles": smooth g, b ~ N(0, 3 ms); 256 of them
|
||||||
|
g = 0.02 + 0.03 * np.cumsum(rng.standard_normal((256, R.grid.n)), 1) / np.sqrt(np.arange(1, R.grid.n + 1))
|
||||||
|
smc[f"{o['name']}/estR/g_acf"] = np.column_stack([3 * rng.standard_normal(256), g]).astype(np.float32)
|
||||||
|
diag = [{} for _ in obs]
|
||||||
|
banks, logpi = control_gp_bank(R, obs, smc, inp.reg, 0, diag)
|
||||||
|
assert np.stack(banks).shape == (2, inp.reg["S"], len(R.t_main)) and np.stack(logpi).shape == (2, inp.reg["S"])
|
||||||
|
assert all(0.8 < d["Ctl-GP_sd_ratio"] < 1.2 for d in diag) and all(d["Ctl-GP_n_valid"] == inp.reg["S"] for d in diag)
|
||||||
|
again, _ = control_gp_bank(R, obs, smc, inp.reg, 0, [{} for _ in obs])
|
||||||
|
assert all(np.array_equal(a, b) for a, b in zip(banks, again))
|
||||||
|
|
||||||
|
|
||||||
|
def test_budget_list_includes_equal_budget_arm():
|
||||||
|
from ml_porosity.benchmark.training import budget_list, budget_of
|
||||||
|
|
||||||
|
assert budget_of(P, "B3d-Sa", "cnngru") == 250 and budget_list(P, "B3d-Sa", "cnngru") == sorted({250, P["training"]["equal_budget_arm"]})
|
||||||
|
assert budget_list(P, "Oracle", "cnngru") == [500]
|
||||||
|
assert budget_list(P, "B3b-TCN", "tcn")[0] == (P["training"].get("budgets_tcn") or {}).get("B3b", 125)
|
||||||
294
tests/test_d2_misspec.py
Normal file
294
tests/test_d2_misspec.py
Normal file
@@ -0,0 +1,294 @@
|
|||||||
|
"""Misspecification parameters of the D2 generator (phase P6, item p6-gen; plan §12 item 22, decision 2).
|
||||||
|
|
||||||
|
The nominal path of ml_porosity/data/synth_d2.py must stay bit-identical to the generator used by protocol_p2 and
|
||||||
|
protocol_p2r: tests/data/d2_fingerprints.json records SHA-256 fingerprints of the realization fields and of the
|
||||||
|
observe() outputs, taken before the misspecification parameters were added. The other tests check that each axis
|
||||||
|
changes only what it claims to change (common random numbers) and that the anchors stay consistent with the true warp.
|
||||||
|
"""
|
||||||
|
|
||||||
|
import hashlib
|
||||||
|
import json
|
||||||
|
|
||||||
|
import numpy as np
|
||||||
|
import pytest
|
||||||
|
import scipy
|
||||||
|
import yaml
|
||||||
|
|
||||||
|
from ml_porosity.data.synth_d2 import D2Realization, load_horizon_grid
|
||||||
|
from ml_porosity.paths import REPO_ROOT, f3_root
|
||||||
|
from ml_porosity.registration.warp_prior import WarpHyper
|
||||||
|
|
||||||
|
P = yaml.safe_load(open(REPO_ROOT / "configs" / "protocol_p2r.yaml"))
|
||||||
|
INP = P["inputs"]
|
||||||
|
CFG = yaml.safe_load(open(REPO_ROOT / INP["d2_config"]["path"]))
|
||||||
|
FP_PATH = REPO_ROOT / "tests" / "data" / "d2_fingerprints.json"
|
||||||
|
NEEDED = [f3_root() / ".survey", REPO_ROOT / CFG["horizon_cache"], REPO_ROOT / INP["warp_prior"]["path"],
|
||||||
|
REPO_ROOT / INP["wavelet"]["path"]]
|
||||||
|
pytestmark = pytest.mark.skipif(not all(p.exists() for p in NEEDED), reason="missing D2 inputs (run scripts/09, 10)")
|
||||||
|
|
||||||
|
WELL_FIELDS = ("seis_clean", "noise_unit", "phi_t", "z_g", "z_b", "boundaries_t", "eps_a")
|
||||||
|
OBS_KEYS = ("seis", "phi_log", "ai_log", "tau_k", "t_k", "b", "g", "t_of_tau_true", "y_true")
|
||||||
|
FP_RIDS = (900, 8, 902) # P2/P2r dev, first P2r main realization, first bench dev realization
|
||||||
|
FP_DRIFT = (0.0, 1.0, 2.0)
|
||||||
|
FP_SNR_DB, FP_SIGMA_A, FP_DENSITY = 10, 7.0, "full"
|
||||||
|
|
||||||
|
|
||||||
|
def _sha(chunks) -> str:
|
||||||
|
h = hashlib.sha256()
|
||||||
|
for a in chunks:
|
||||||
|
h.update(np.ascontiguousarray(np.asarray(a)).tobytes())
|
||||||
|
return h.hexdigest()
|
||||||
|
|
||||||
|
|
||||||
|
def fingerprint_wells(R) -> dict:
|
||||||
|
return {k: _sha(getattr(w, k) for w in R.wells) for k in WELL_FIELDS}
|
||||||
|
|
||||||
|
|
||||||
|
def fingerprint_obs(R, **kw) -> dict:
|
||||||
|
wells = R.test + R.pool[:4]
|
||||||
|
obs = [R.observe(w, c, FP_SNR_DB, FP_SIGMA_A, FP_DENSITY, **kw) for c in FP_DRIFT for w in wells]
|
||||||
|
return {k: _sha(o[k] for o in obs) for k in OBS_KEYS}
|
||||||
|
|
||||||
|
|
||||||
|
def fingerprint(R, **kw) -> dict:
|
||||||
|
return {"wells": fingerprint_wells(R), "obs": fingerprint_obs(R, **kw)}
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(scope="module")
|
||||||
|
def make():
|
||||||
|
hg = load_horizon_grid(CFG["horizons"], REPO_ROOT / CFG["horizon_cache"])
|
||||||
|
prior = json.loads((REPO_ROOT / INP["warp_prior"]["path"]).read_text())["fits"][INP["warp_prior"]["fit"]]
|
||||||
|
wav = np.load(REPO_ROOT / INP["wavelet"]["path"])[INP["wavelet"]["key"]]
|
||||||
|
return lambda rid, **kw: D2Realization(CFG, rid, hg, WarpHyper(**prior["hyper"]), wav, **kw)
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(scope="module")
|
||||||
|
def recorded() -> dict:
|
||||||
|
fp = json.loads(FP_PATH.read_text())
|
||||||
|
env = fp["meta"]["env"]
|
||||||
|
if (env["numpy"], env["scipy"]) != (np.__version__, scipy.__version__):
|
||||||
|
pytest.skip(f"fingerprints recorded with numpy {env['numpy']} / scipy {env['scipy']}; "
|
||||||
|
f"this environment has {np.__version__} / {scipy.__version__}")
|
||||||
|
return fp
|
||||||
|
|
||||||
|
|
||||||
|
def test_inputs_match_fingerprint_record(recorded):
|
||||||
|
for key in ("d2_config", "warp_prior", "wavelet"):
|
||||||
|
f = REPO_ROOT / INP[key]["path"]
|
||||||
|
assert hashlib.sha256(f.read_bytes()).hexdigest() == recorded["meta"]["inputs"][key], key
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.parametrize("rid", FP_RIDS)
|
||||||
|
def test_default_path_matches_fingerprints(make, recorded, rid):
|
||||||
|
"""Realizations and observations are bit-identical to the record taken before the misspec parameters existed."""
|
||||||
|
fp = fingerprint(make(rid))
|
||||||
|
for part in ("wells", "obs"):
|
||||||
|
for k, v in recorded["realizations"][str(rid)][part].items():
|
||||||
|
assert fp[part][k] == v, f"rid {rid}: {part}.{k} changed"
|
||||||
|
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------- bench config and preset validation
|
||||||
|
|
||||||
|
BENCH = yaml.safe_load((REPO_ROOT / "configs" / "d2_synth_bench.yaml").read_text())
|
||||||
|
|
||||||
|
|
||||||
|
def test_d2_bench_generator_matches_p2r():
|
||||||
|
"""configs/d2_synth_bench.yaml uses the protocol_p2r generator and regimes: only misspec_presets may be added."""
|
||||||
|
from ml_porosity.data.synth_d2 import normalize_misspec, preset_misspec
|
||||||
|
|
||||||
|
p2r = yaml.safe_load((REPO_ROOT / "configs" / "d2_synth_p2r.yaml").read_text())
|
||||||
|
bench = dict(BENCH)
|
||||||
|
presets = bench.pop("misspec_presets")
|
||||||
|
assert bench == p2r
|
||||||
|
assert preset_misspec(BENCH, None) is None and preset_misspec(BENCH, "nominal") is None
|
||||||
|
for name in presets:
|
||||||
|
ms = normalize_misspec(preset_misspec(BENCH, name))
|
||||||
|
assert ms["rock_physics"]["region"] == "all"
|
||||||
|
with pytest.raises(KeyError):
|
||||||
|
preset_misspec(BENCH, "no_such_preset")
|
||||||
|
|
||||||
|
|
||||||
|
def test_normalize_misspec_rejects_unknown_keys():
|
||||||
|
from ml_porosity.data.synth_d2 import MISSPEC_DEFAULTS, active_axes, normalize_misspec
|
||||||
|
|
||||||
|
assert normalize_misspec(None) == normalize_misspec({}) == MISSPEC_DEFAULTS
|
||||||
|
assert active_axes(normalize_misspec({"wavelet": {"Q": None, "Q_t_ref_ms": 500.0}})) == {}
|
||||||
|
assert active_axes(normalize_misspec({"drift": {"step_ms": 4.0}})) == {"drift": {"step_ms": 4.0}}
|
||||||
|
for bad in ({"rockphysics": {}}, {"wavelet": {"Q_factor": 2.0}}, {"drift": {"ell_factor": 0.0}},
|
||||||
|
{"rock_physics": {"region": "train"}}, {"wavelet": {"minphase_frac": 1.5}}):
|
||||||
|
with pytest.raises(ValueError):
|
||||||
|
normalize_misspec(bad)
|
||||||
|
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------- common random numbers and axis semantics
|
||||||
|
|
||||||
|
RID = 902
|
||||||
|
C, SNR, SIGMA_A = 1.0, 10, 7.0
|
||||||
|
CRN_FIELDS = ("phi_t", "noise_unit", "z_g", "z_b", "boundaries_t", "eps_a")
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(scope="module")
|
||||||
|
def R0(make):
|
||||||
|
return make(RID)
|
||||||
|
|
||||||
|
|
||||||
|
def _assert_crn(R, R0):
|
||||||
|
"""Earth model, noise and standard-normal draws identical to the nominal realization."""
|
||||||
|
for a, b in zip(R.wells, R0.wells):
|
||||||
|
assert (a.name, a.il, a.xl) == (b.name, b.il, b.xl)
|
||||||
|
for k in CRN_FIELDS:
|
||||||
|
np.testing.assert_array_equal(getattr(a, k), getattr(b, k))
|
||||||
|
|
||||||
|
|
||||||
|
def test_all_nominal_misspec_is_bit_identical(make, R0):
|
||||||
|
explicit = {"rock_physics": {"dt_slope_factor": 1.0, "region": "all"}, "wavelet": {"Q": None},
|
||||||
|
"drift": {"sigma_b_factor": 1.0, "step_ms": 0.0, "jitter_sd_ms": 0.0}}
|
||||||
|
R = make(RID, misspec=explicit)
|
||||||
|
assert R.misspec_active == {} and R.w_fine is R.w_fine_nominal and R.drift_true is R.drift
|
||||||
|
assert fingerprint(R) == fingerprint(R0)
|
||||||
|
|
||||||
|
|
||||||
|
def test_rock_physics_changes_seismic_only(make, R0):
|
||||||
|
R = make(RID, misspec={"rock_physics": {"dt_slope_factor": 1.15, "unit_dt_intercept_sd": 0.05}})
|
||||||
|
_assert_crn(R, R0)
|
||||||
|
for w, w0 in zip(R.wells, R0.wells):
|
||||||
|
assert not np.allclose(w.seis_clean, w0.seis_clean)
|
||||||
|
o, o0 = (r.observe(x, C, SNR, SIGMA_A) for r, x in ((R, w), (R0, w0)))
|
||||||
|
for k in ("phi_log", "ai_log", "tau_k", "t_k", "b", "g", "t_of_tau_true", "y_true"):
|
||||||
|
np.testing.assert_array_equal(o[k], o0[k]) # labels, anchors, warp: unchanged
|
||||||
|
ai_true = R.ai_log_true(w, o)
|
||||||
|
assert ai_true.shape == o["ai_log"].shape and not np.allclose(ai_true, o["ai_log"])
|
||||||
|
np.testing.assert_array_equal(R0.ai_log_true(w0, o0), o0["ai_log"])
|
||||||
|
# region: the perturbation acts on the named wells only
|
||||||
|
Rt = make(RID, misspec={"rock_physics": {"unit_dt_intercept_sd": 0.05, "region": "test"}})
|
||||||
|
for w, w0 in zip(Rt.pool, R0.pool):
|
||||||
|
np.testing.assert_array_equal(w.seis_clean, w0.seis_clean)
|
||||||
|
assert not np.allclose(Rt.test[0].seis_clean, R0.test[0].seis_clean)
|
||||||
|
assert Rt.rp_applies("T00") and not Rt.rp_applies("P00")
|
||||||
|
|
||||||
|
|
||||||
|
def test_rock_physics_uniform_error_is_near_affine(make):
|
||||||
|
"""Uniform coefficient errors change ln AI almost affinely in φ over the D2 porosity range (15–20 % coefficient
|
||||||
|
errors: 4 % of ln AI, of which < 1 % of the ln AI range is non-affine), so the profiled amplitude of the tie
|
||||||
|
likelihood absorbs them; this is why the rp_* presets add per-unit scatter."""
|
||||||
|
from ml_porosity.data.synth_d2 import phi_to_ai
|
||||||
|
|
||||||
|
phi = np.linspace(0.2, 0.43, 200)
|
||||||
|
R = make(RID, misspec={"rock_physics": {"dt_slope_factor": 1.15, "dt_intercept_factor": 1.15,
|
||||||
|
"rho_slope_factor": 1.2}})
|
||||||
|
d = np.log(R.phi_to_ai_true(phi)) - np.log(phi_to_ai(phi))
|
||||||
|
resid = d - np.polyval(np.polyfit(phi, d, 1), phi)
|
||||||
|
assert np.abs(d).max() > 0.02 and np.abs(resid).max() < 0.01 * np.ptp(np.log(phi_to_ai(phi)))
|
||||||
|
|
||||||
|
|
||||||
|
def test_wavelet_axis_changes_seismic_only(make, R0):
|
||||||
|
from ml_porosity.data.wavelet import rotate_phase
|
||||||
|
|
||||||
|
cases = {"phase": {"phase_deg": 45.0}, "minphase": {"minphase_frac": 1.0}, "peak": {"peak_freq_factor": 1.2},
|
||||||
|
"delay": {"delay_ms": 4.0}, "Q": {"Q": 80.0}}
|
||||||
|
phases = np.arange(-180.0, 180.0, 1.0)
|
||||||
|
for name, wv in cases.items():
|
||||||
|
R = make(RID, misspec={"wavelet": wv})
|
||||||
|
_assert_crn(R, R0)
|
||||||
|
w, w0 = R.pool[0], R0.pool[0]
|
||||||
|
assert not np.allclose(w.seis_clean, w0.seis_clean), name
|
||||||
|
o, o0 = R.observe(w, C, SNR, SIGMA_A), R0.observe(w0, C, SNR, SIGMA_A)
|
||||||
|
for k in ("phi_log", "ai_log", "tau_k", "t_k", "t_of_tau_true", "y_true"):
|
||||||
|
np.testing.assert_array_equal(o[k], o0[k])
|
||||||
|
if name == "Q":
|
||||||
|
assert R.w_fine is R.w_fine_nominal # stationary part nominal; Q acts in the forward
|
||||||
|
k600, k1100 = R.true_wavelet_at(600.0), R.true_wavelet_at(1100.0)
|
||||||
|
spec = lambda k: np.abs(np.fft.rfft(k, 4096))
|
||||||
|
f = np.fft.rfftfreq(4096, 0.0005)
|
||||||
|
hi = f > 50
|
||||||
|
assert (spec(k1100)[hi] / spec(k1100).max()).sum() < (spec(k600)[hi] / spec(k600).max()).sum()
|
||||||
|
else:
|
||||||
|
cc = [np.corrcoef(rotate_phase(R.w_fine_nominal, p), R.w_fine)[0, 1] for p in phases]
|
||||||
|
best = phases[int(np.argmax(cc))]
|
||||||
|
if name == "phase":
|
||||||
|
assert abs(best - 45.0) <= 1.0 and max(cc) > 0.999 # inside the constant-phase family
|
||||||
|
if name == "minphase":
|
||||||
|
assert max(cc) < 0.9 # not representable by a constant phase
|
||||||
|
assert len(R.wavelet) == len(R0.wavelet) and len(R.w_fine) == len(R0.w_fine)
|
||||||
|
|
||||||
|
|
||||||
|
def test_minimum_phase_keeps_amplitude_spectrum(R0):
|
||||||
|
from ml_porosity.data.synth_d2 import fractional_minimum_phase
|
||||||
|
|
||||||
|
w = R0.w_fine_nominal
|
||||||
|
for frac in (0.0, 0.5, 1.0):
|
||||||
|
y = fractional_minimum_phase(w, frac)
|
||||||
|
a, b = np.abs(np.fft.rfft(w, 4096)), np.abs(np.fft.rfft(y, 4096))
|
||||||
|
band = a > 0.1 * a.max() # truncation to 128 ms only touches the band edges
|
||||||
|
assert np.abs(b[band] / a[band] - 1.0).max() < 0.05, frac
|
||||||
|
assert abs(np.sum(y**2) / np.sum(w**2) - 1.0) < 0.01, frac
|
||||||
|
np.testing.assert_allclose(fractional_minimum_phase(w, 0.0), w, atol=1e-9)
|
||||||
|
|
||||||
|
|
||||||
|
def test_drift_hyper_factors_use_common_random_numbers(make, R0):
|
||||||
|
R = make(RID, misspec={"drift": {"sigma_b_factor": 3.0, "sigma_g_factor": 1.5}})
|
||||||
|
_assert_crn(R, R0)
|
||||||
|
for w, w0 in zip(R.pool[:3], R0.pool[:3]):
|
||||||
|
np.testing.assert_array_equal(w.seis_clean, w0.seis_clean) # the seismic is untouched
|
||||||
|
o, o0 = R.observe(w, C, SNR, SIGMA_A), R0.observe(w0, C, SNR, SIGMA_A)
|
||||||
|
assert o["b"] == pytest.approx(3.0 * o0["b"])
|
||||||
|
m = C * R.drift.m_g
|
||||||
|
np.testing.assert_allclose(o["g"] - m, 1.5 * (o0["g"] - m), atol=1e-12)
|
||||||
|
np.testing.assert_array_equal(o["t_k"], o0["t_k"]) # picks keep their noise draws
|
||||||
|
np.testing.assert_allclose(np.interp(o["tau_k"], R.tau_fine, o["t_of_tau_true"]), w.boundaries_t, atol=1e-9)
|
||||||
|
Rl = make(RID, misspec={"drift": {"ell_factor": 0.5}})
|
||||||
|
assert Rl.drift_true.ell_ms == pytest.approx(0.5 * R0.drift.ell_ms) and Rl.Lg_true is not Rl.Lg
|
||||||
|
|
||||||
|
|
||||||
|
def test_drift_step_is_exact_jump_below_horizon(make, R0):
|
||||||
|
J, width = 8.0, 12.0
|
||||||
|
R = make(RID, misspec={"drift": {"step_ms": J, "step_width_ms": width}})
|
||||||
|
_assert_crn(R, R0)
|
||||||
|
k = CFG["horizons"].index("Truncation")
|
||||||
|
for w, w0 in zip(R.wells, R0.wells):
|
||||||
|
o, o0 = R.observe(w, C, SNR, SIGMA_A), R0.observe(w0, C, SNR, SIGMA_A)
|
||||||
|
d = o["t_of_tau_true"] - o0["t_of_tau_true"]
|
||||||
|
t_h = R.hg.at(w.il, w.xl)[k]
|
||||||
|
tau_h = np.interp(t_h, o0["t_of_tau_true"], R.tau_fine)
|
||||||
|
assert np.all(np.diff(o["t_of_tau_true"]) > 0)
|
||||||
|
np.testing.assert_allclose(d[R.tau_fine < tau_h - R.grid.dtau], 0.0, atol=1e-9)
|
||||||
|
np.testing.assert_allclose(d[R.tau_fine > tau_h + width + 2 * R.grid.dtau], J, atol=1e-9)
|
||||||
|
np.testing.assert_allclose(R.grid.t_of_tau(o["b"], o["g"])[0], R.true_warp_grid(w, C), atol=1e-9)
|
||||||
|
np.testing.assert_allclose(np.interp(o["tau_k"], R.tau_fine, o["t_of_tau_true"]), w.boundaries_t, atol=1e-9)
|
||||||
|
assert o["b"] == o0["b"] and np.count_nonzero(o["g"] != o0["g"]) == int(round(width / R.grid.dtau))
|
||||||
|
Rn = make(RID, misspec={"drift": {"step_ms": -6.0}})
|
||||||
|
o = Rn.observe(Rn.pool[0], C, SNR, SIGMA_A)
|
||||||
|
assert np.all(np.diff(o["t_of_tau_true"]) > 0)
|
||||||
|
|
||||||
|
|
||||||
|
def test_drift_jitter_is_high_frequency_and_monotone(make, R0):
|
||||||
|
sd, ell = 1.0, 8.0
|
||||||
|
R = make(RID, misspec={"drift": {"jitter_sd_ms": sd, "jitter_ell_ms": ell}})
|
||||||
|
_assert_crn(R, R0)
|
||||||
|
rms = []
|
||||||
|
for w, w0 in zip(R.wells, R0.wells):
|
||||||
|
o, o0 = R.observe(w, C, SNR, SIGMA_A), R0.observe(w0, C, SNR, SIGMA_A)
|
||||||
|
d = o["t_of_tau_true"] - o0["t_of_tau_true"]
|
||||||
|
assert np.all(np.diff(o["t_of_tau_true"]) > 0)
|
||||||
|
np.testing.assert_array_equal(o["g"], o0["g"]) # jitter is not folded into g
|
||||||
|
np.testing.assert_allclose(np.interp(o["tau_k"], R.tau_fine, o["t_of_tau_true"]), w.boundaries_t, atol=1e-9)
|
||||||
|
rms.append(np.sqrt(np.mean(d**2)))
|
||||||
|
# decorrelates within a few ℓ: lag-40 ms autocorrelation small, lag-4 ms large
|
||||||
|
g = np.interp(R.grid.tau, R.tau_fine, d)
|
||||||
|
acf = lambda lag: np.corrcoef(g[:-lag], g[lag:])[0, 1]
|
||||||
|
assert acf(1) > 0.5 and abs(acf(10)) < 0.4
|
||||||
|
assert 0.5 * sd < np.mean(rms) < 1.5 * sd
|
||||||
|
assert R.misspec_info["monotone_repairs"] == 0
|
||||||
|
assert "z_jitter" in R.wells[0].extra and "z_jitter" not in R0.wells[0].extra
|
||||||
|
|
||||||
|
|
||||||
|
def test_presets_build_and_report_active_axes(make, R0):
|
||||||
|
from ml_porosity.data.synth_d2 import preset_misspec
|
||||||
|
|
||||||
|
for name in BENCH["misspec_presets"]:
|
||||||
|
R = make(RID, misspec=preset_misspec(BENCH, name))
|
||||||
|
_assert_crn(R, R0)
|
||||||
|
axis = next(p for p in name.split("_") if p in ("rp", "wv", "dr")) # names: rp_L1, wv_Q, cand_dr_s, ...
|
||||||
|
assert list(R.misspec_active) == [{"rp": "rock_physics", "wv": "wavelet", "dr": "drift"}[axis]]
|
||||||
|
o = R.observe(R.pool[0], C, SNR, SIGMA_A)
|
||||||
|
assert np.isfinite(o["seis"]).all() and np.all(np.diff(o["t_of_tau_true"]) > 0)
|
||||||
Reference in New Issue
Block a user