Compare commits
9 Commits
protocol-f
...
8d5befb412
| Author | SHA1 | Date | |
|---|---|---|---|
| 8d5befb412 | |||
|
|
fc15bf6510 | ||
| bbdb82997c | |||
| 423a333ae9 | |||
| 2e4f618947 | |||
| 381b5ffb06 | |||
| 0cfe202a8b | |||
| 7da6b077b6 | |||
| 4a5d0b26e6 |
4
.gitignore
vendored
4
.gitignore
vendored
@@ -47,3 +47,7 @@ data/Volve/
|
|||||||
|
|
||||||
# NLOG: LAS và TD công khai tải lại được (URL trong docs/research/f3-nlog-inventory.xlsx), hash ở data_manifest/nlog.json
|
# NLOG: LAS và TD công khai tải lại được (URL trong docs/research/f3-nlog-inventory.xlsx), hash ở data_manifest/nlog.json
|
||||||
data/NLOG/
|
data/NLOG/
|
||||||
|
|
||||||
|
# Teapot Dome (RMOTC / U.S. DOE, Texas Data Repository; 1.7 GB): không đẩy lên git. Chỉ dùng cho T0 và pilot P-a
|
||||||
|
# (plan §12 ý 23); kết quả ở outputs/teapot/.
|
||||||
|
data/Teapot/
|
||||||
|
|||||||
124
AGENTS.md
124
AGENTS.md
@@ -1,10 +1,10 @@
|
|||||||
# AGENTS.md
|
# AGENTS.md
|
||||||
|
|
||||||
Seismic-to-porosity learning on F3 when the well tie is uncertain (RML: training on labels drawn from a well-tie posterior). Paper deadline: Sat 31/10/2026. Gate thresholds never change; only dates do.
|
Seismic-to-porosity learning on F3 when the well tie is uncertain (RML: training on labels drawn from a well-tie posterior). Paper deadline: **Sat 14/11/2026** (moved on 29/10/2026 from 31/10; Pivot 1, level B, `docs/plan.md` §12 item 22). Gate thresholds never change; only dates do.
|
||||||
|
|
||||||
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 (28/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.
|
||||||
@@ -29,11 +29,122 @@ Read first: `docs/plan.md` (plan, gates, decisions; §6 roadmap, §10 forbidden
|
|||||||
`docs/research/p3-code-review.md`. `report.html` contains the completed
|
`docs/research/p3-code-review.md`. `report.html` contains the completed
|
||||||
status and G-C result even without the local output sidecar.
|
status and G-C result even without the local output sidecar.
|
||||||
|
|
||||||
|
- **P4 Volve is complete** (29/10, 02:21 UTC) on the Linux server (H200, cuda:1
|
||||||
|
primary arm, cuda:0 σ_a arms in parallel), not on the Windows workstation.
|
||||||
|
Protocol `configs/protocol_volve.yaml` locked 01:17:42 UTC (`.lock.json`,
|
||||||
|
`.sha256`); driver `scripts/run_p4.sh`. **G-D: no consistent improvement, not
|
||||||
|
calibrated** (M2-Sa beats selected B3 at 2/6 wells lowo, 3/6 slot; coverage90
|
||||||
|
≈ 0.47). No method has blind-well skill on Volve (R² < 0 everywhere, PCC ≤ 0.24);
|
||||||
|
σ_a arms change nothing. Details: `docs/plan.md` §12 item 20,
|
||||||
|
`outputs/p4/summary/`. Do not rerun or redesign P4.
|
||||||
|
- Post hoc, outside the lock (`scripts/25_p4_posthoc.py` → `outputs/p4/posthoc/`):
|
||||||
|
a constant at the training-well PHIF mean beats every network (macro RMSE
|
||||||
|
6.03 lowo, 6.59 slot). Between-well level differences dominate the error, so
|
||||||
|
G-D had no power: Volve is evidence neither for nor against RML.
|
||||||
|
- **P4x exploratory is dropped** (decision of 29/10/2026). `exploratory/`
|
||||||
|
and `outputs/p4x/` stay on disk as a record only: do not summarise, cite,
|
||||||
|
or extend them (no V3). The last `exploratory/run_p4x.sh` job was stopped
|
||||||
|
at 670/921 (about 04:05 UTC) and killed to free cuda:0; B3d-Sa and V3
|
||||||
|
never ran. A partial summary generated at 04:07 UTC, before the
|
||||||
|
decision was seen, has been deleted (`outputs/p4x/summary/` no longer
|
||||||
|
exists). Do not restart the job or rerun its summarize stage. History: `docs/plan.md` §12 item 21.
|
||||||
|
- **Pivot 1 activated (29/10/2026)**: the paper is now a theory + synthetic
|
||||||
|
benchmark paper. Working title: *Label registration error in sparse-well
|
||||||
|
seismic property learning: theory, a registration-aware benchmark, and the
|
||||||
|
limits of field validation*. F3 and Volve are scope-bounding cases only.
|
||||||
|
Decisions (user fixed 1 and 5; agent fixed 2–4): (1) level B, deadline
|
||||||
|
14/11/2026; (2) misspecification axis S2 is mandatory, narrow scope, locked
|
||||||
|
in a new `configs/protocol_bench.yaml` before the first run, otherwise the
|
||||||
|
paper says "controlled synthetic study", not "benchmark"; (3) the mechanism
|
||||||
|
study T2 is exploratory on realizations 8–15, pre-declared in
|
||||||
|
`docs/research/t2-mechanism.md`, never confirmatory; (4) venue *Computers &
|
||||||
|
Geosciences*, fallback *Geophysical Prospecting*; (5) P4x dropped. Full
|
||||||
|
analysis and plan: `docs/research/pivot-theory-benchmark.md` (§6 has the
|
||||||
|
decisions and the day-by-day schedule); public field-dataset survey:
|
||||||
|
`docs/research/field-dataset-survey.md` (no dataset confirmed adequate; no
|
||||||
|
new field test in this paper).
|
||||||
|
- **Applicability conditions and a Teapot Dome attempt (29/10/2026,
|
||||||
|
exploratory; `docs/plan.md` §12 item 23).** Declared in
|
||||||
|
`docs/research/applicability-teapot.md` before any computation; results in
|
||||||
|
`docs/research/applicability-results.md`. Retrospective C1/C2
|
||||||
|
(`scripts/26_applicability.py`): F3 and Volve fail C1 (no blind-well skill
|
||||||
|
in the seismic band) and pass C2. T3 power (`scripts/27_t3_power.py`): with
|
||||||
|
an exact reference a sign test needs 5–18 blind wells in most cells; with
|
||||||
|
reference errors of 3 ms or more, 40 wells do not suffice. Teapot T0 failed
|
||||||
|
(at most 2 wells with an independent time–depth reference), and the pilot
|
||||||
|
P-a requested by the user failed (horizon–top knot error 6.75 ms against a
|
||||||
|
1.5 ms tolerance). Teapot is stopped; the user chose to return to the
|
||||||
|
level-B schedule. The raw Teapot data (`data/Teapot/`, 1.7 GB) are
|
||||||
|
gitignored.
|
||||||
|
- **Level A writing done early (29/10/2026; `docs/plan.md` §12 item 24).**
|
||||||
|
`paper/` now follows the Pivot 1 frame (55 pages, compiles cleanly):
|
||||||
|
Propositions 3–6 (classical/Berkson tie error, calibrated bank with a
|
||||||
|
fourth-order population gain, coverage, misregistered reference),
|
||||||
|
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 (6.6 since 02/11),
|
||||||
|
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
|
||||||
|
(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
|
||||||
|
f⁴-weighted distortion sits at 67–72 Hz, where the Berkson integral is
|
||||||
|
1.5–4.6 times the classical one at σ = 1.5–2.5 ms. The second was "the bank
|
||||||
|
gain exceeds the population bound". That holds only for the registered
|
||||||
|
classical bound (7/8 wide cells at N = 16). Under the post hoc Berkson
|
||||||
|
bound, the natural one for posterior-mean labels, only 3/8 cells exceed it
|
||||||
|
(all at c = 1), and at most 1/8 at the measured warp error. Script 31 now
|
||||||
|
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,
|
||||||
|
introduction, conclusion) and the docs were corrected. **Length risk:**
|
||||||
|
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).
|
||||||
|
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.
|
||||||
|
- Committed and pushed on 29/10/2026 with the tag `protocol-volve` (the Volve
|
||||||
|
code hash recomputed from that tree matches `configs/protocol_volve.lock.json`):
|
||||||
|
the P4 code, `configs/protocol_volve.*`, scripts 26–31, the `docs/research/`
|
||||||
|
additions, the P4x record (`exploratory/`, `docs/research/p4-exploratory.md`),
|
||||||
|
`.gitignore`, and the 29/10 paper/docs edits. Run logs `logs/*.out` stay
|
||||||
|
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
|
||||||
|
|
||||||
1. **P4 Volve** (pipeline 28/10, runs 29/10, gate G-D).
|
Schedule: `docs/plan.md` §6.1 (level B, 29/10 → 14/11/2026). Cut-scope order
|
||||||
2. **P5 writing** (29–30/10). Include the negative P3 result and the previously
|
if late is given there; never cut thresholds.
|
||||||
recorded P2r deviation. If late, cut scope in the order given in `docs/plan.md` §6.
|
|
||||||
|
1. **Dataset citations: done 02/11/2026** (plan §12 item 30). The length pass
|
||||||
|
for the venue was dropped by the user on 29/10/2026 (plan §12 item 25): do
|
||||||
|
not schedule it.
|
||||||
|
2. **T2 mechanism study: done on 29/10/2026; written into Sec. 6.4 on 02/11/2026** (plan §12 item 30).
|
||||||
|
3. **protocol_bench: done early (locked 29/10 14:39 UTC).** See Status.
|
||||||
|
4. **Runs: done early (29/10 14:43 → 30/10 02:16 UTC). Summarize and the 11
|
||||||
|
verdicts: done 02/11/2026** (see Status; `outputs/bench/summary/verdict_final.md`).
|
||||||
|
5. **S7 packaging: done 02/11/2026** except the Zenodo deposit (user's account; fill the TODOs of
|
||||||
|
`benchmark/zenodo_metadata.json` first, then put the DOI into `benchmark/README.md` and Sec. 8).
|
||||||
|
**Results sections: done 02/11/2026** (plan §12 item 30). **Proof appendix review and reproduction
|
||||||
|
package: done 02/11/2026** (plan §12 item 32) except the deposit of `outputs/repro/*.tar.gz` (user's account and licence decisions).
|
||||||
|
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
|
||||||
|
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
|
||||||
|
*Computers & Geosciences*. The authors must fill the author list and declarations.
|
||||||
|
|
||||||
## Conventions
|
## Conventions
|
||||||
|
|
||||||
@@ -43,8 +154,9 @@ Read first: `docs/plan.md` (plan, gates, decisions; §6 roadmap, §10 forbidden
|
|||||||
- **Git:** work on `main`. Do not create branches unless the user explicitly asks. End commit messages with a co-author line for the agent.
|
- **Git:** work on `main`. Do not create branches unless the user explicitly asks. End commit messages with a co-author line for the agent.
|
||||||
- **Language:** code, figures, paper text and commit messages in academic English. Explanations to the user in Vietnamese.
|
- **Language:** code, figures, paper text and commit messages in academic English. Explanations to the user in Vietnamese.
|
||||||
- **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).
|
||||||
- **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
|
||||||
|
|||||||
38
README.md
38
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/`.
|
||||||
@@ -60,6 +62,20 @@ scripts/run_p0.sh # toàn bộ pipeline P0 và test
|
|||||||
scripts/run_p1.sh # P1: tie QC, LOWO baseline (khoảng 16 phút với GPU)
|
scripts/run_p1.sh # P1: tie QC, LOWO baseline (khoảng 16 phút với GPU)
|
||||||
scripts/run_p2.sh # P2: prior warp F3, QC D2, test, lưới D2, H1, tổng hợp (GPU cuda:1; đổi bằng DEVICE=...)
|
scripts/run_p2.sh # P2: prior warp F3, QC D2, test, lưới D2, H1, tổng hợp (GPU cuda:1; đổi bằng DEVICE=...)
|
||||||
scripts/run_p2r_dev.sh # chuẩn bị P2r (chạy lại P2) trên dev 900/901: screen, train, stability, sigma_a, f3, h3 (+ stability_m5, b3d_old, train_sa)
|
scripts/run_p2r_dev.sh # chuẩn bị P2r (chạy lại P2) trên dev 900/901: screen, train, stability, sigma_a, f3, h3 (+ stability_m5, b3d_old, train_sa)
|
||||||
|
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)
|
||||||
|
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`:
|
||||||
@@ -96,5 +112,27 @@ Biến môi trường máy đặt sẵn `OMP_NUM_THREADS=40` (cả MKL, OpenBLAS
|
|||||||
| `scripts/15_diag_train.py [--post-dir] [--methods] [--budgets-from] [--save-preds]` | Huấn luyện trên dev với nhãn từ posterior SMC (B3d-Sa, M2-Sa…) và các baseline, cổng kiểu G-B, ensemble kiểu H3 → `outputs/p2/diag/train*/` |
|
| `scripts/15_diag_train.py [--post-dir] [--methods] [--budgets-from] [--save-preds]` | Huấn luyện trên dev với nhãn từ posterior SMC (B3d-Sa, M2-Sa…) và các baseline, cổng kiểu G-B, ensemble kiểu H3 → `outputs/p2/diag/train*/` |
|
||||||
| `scripts/16_f3_posterior.py [--device cuda:1]` | Đặt F3 lên trục σ_post (chỉ mô tả): posterior SMC trên 4 giếng F3 → `outputs/p2/diag/f3_posterior/` |
|
| `scripts/16_f3_posterior.py [--device cuda:1]` | Đặt F3 lên trục σ_post (chỉ mô tả): posterior SMC trên 4 giếng F3 → `outputs/p2/diag/f3_posterior/` |
|
||||||
| `scripts/17_summarize_p2r_dev.py [--only …]` | Tổng hợp dev cho P2r: screen, train/dose-response H2b, B(σ), stability, σ_a, F3 → `outputs/p2/diag/p2rdev/summary.md` |
|
| `scripts/17_summarize_p2r_dev.py [--only …]` | Tổng hợp dev cho P2r: screen, train/dose-response H2b, B(σ), stability, σ_a, F3 → `outputs/p2/diag/p2rdev/summary.md` |
|
||||||
|
| `scripts/18_summarize_p2r.py [--root DIR]` | Phán quyết của `protocol_p2r` trên lưới chính (realization 8–15): H2a, H2b, σ_a, H3, H4 → `outputs/p2r/summary/` (`verdict.json`, `summary.md`) |
|
||||||
|
| `scripts/19_run_f3.py <stage> [--device] [--workers]` | P3 F3: prepare → benchmark → lock → register → train → diagnostics → summarize theo `configs/protocol_f3.yaml` → `outputs/p3/` |
|
||||||
|
| `scripts/20_summarize_f3.py` | Tổng hợp lượt P3 đã khóa, cổng G-C → `outputs/p3/summary/` |
|
||||||
|
| `scripts/21_predict_f3.py` | Mô hình triển khai và volume F3 mô tả (649 inline) sau LOWO của P3 → `outputs/p3/volume/` |
|
||||||
|
| `scripts/22_paper_figures.py [--only …]` | Hình cho bài báo (`paper/figures/*.pdf`), chỉ đọc các summary đã khóa |
|
||||||
|
| `scripts/23_build_volve_wells.py [--config configs/d3_volve.yaml]` | Dữ liệu 6 giếng nghiêng Volve trên miền thời gian (survey, TDR calibrated và blind, patch 3×3 dọc đường giếng, nhãn PHIF) → `outputs/volve/volve_wells.npz`, `volve_wells_summary.json` |
|
||||||
|
| `scripts/24_run_volve.py <stage> [--arms primary\|sensitivity\|all] [--device] [--workers]` | P4 Volve: benchmark → lock → register → train → summarize theo `configs/protocol_volve.yaml`, cổng G-D → `outputs/p4/` |
|
||||||
|
| `scripts/25_p4_posthoc.py` | Post hoc P4, ngoài khóa, không đổi G-D: hằng số bằng trung bình giếng train và tách RMSE thành bias + SD → `outputs/p4/posthoc/` |
|
||||||
|
| `scripts/26_applicability.py` | Điều kiện áp dụng C1, C2 (khai báo ở `docs/research/applicability-teapot.md`), hồi cứu trên F3 và Volve; chỉ đọc output đã khóa và nhãn giếng train của từng fold, không train → `outputs/applicability/` |
|
||||||
|
| `scripts/27_t3_power.py` | T3 exploratory: chấm lại dự đoán P2r đã lưu với tham chiếu lệch σ_ref, power của luật k-of-n và sign test theo số giếng blind (beta-binomial) → `outputs/t3/` |
|
||||||
|
| `python -P scripts/28_teapot_inventory.py --root data/Teapot/raw/rmotc --out outputs/teapot/inventory` | T0 kiểm kê Teapot Dome (chỉ header và độ phủ đường cong; không đọc quan hệ porosity–seismic). Dữ liệu là archive tải về, chạy bằng `python -P` từ gốc repo → `outputs/teapot/inventory/` |
|
||||||
|
| `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/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}}
|
||||||
@@ -39,3 +39,70 @@ checkshots:
|
|||||||
|
|
||||||
# ROI from the trajectories of the 10 wells above + 500 m (D3 inventory §4), ED50 / UTM 31N
|
# ROI from the trajectories of the 10 wells above + 500 m (D3 inventory §4), ED50 / UTM 31N
|
||||||
roi_xy: [433308, 437150, 6477323, 6479997]
|
roi_xy: [433308, 437150, 6477323, 6479997]
|
||||||
|
|
||||||
|
# P4 (Volve field phase, plan §6): the 6 wells with DT + RHOB + NPHI + PHIF (D3), all deviated.
|
||||||
|
# Read by ml_porosity/data/volve_wells.py and scripts/23_build_volve_wells.py (-> outputs/volve/volve_wells.npz).
|
||||||
|
p4:
|
||||||
|
survey_dir: Well_technical_data/WellWellbore # Compass "ACTUAL" exports: minimum curvature, grid north, MD RKB
|
||||||
|
log_subdir: 05.PETROPHYSICAL INTERPRETATION # under well_logs_dir/<logs>
|
||||||
|
las_input: WLC_PETRO_COMPUTED_INPUT_1.LAS # DT, RHOB, NPHI, GR
|
||||||
|
las_output: WLC_PETRO_COMPUTED_OUTPUT_1.LAS # PHIF, on the INPUT MD grid
|
||||||
|
wells:
|
||||||
|
F-1:
|
||||||
|
picks: NO 15/9-F-1
|
||||||
|
logs: 15_9-F-1
|
||||||
|
survey: 15_9-F-1/15_9-F-1/Volve F_F-1_F-1_F-1_ACTUAL
|
||||||
|
F-1 A:
|
||||||
|
picks: NO 15/9-F-1 A
|
||||||
|
logs: 15_9-F-1 A
|
||||||
|
survey: 15_9-F-1/15_9-F-1 A/Volve F_F-1_F-1 A_F-1 A_ACTUAL
|
||||||
|
F-1 B:
|
||||||
|
picks: NO 15/9-F-1 B
|
||||||
|
logs: 15_9-F-1 B
|
||||||
|
survey: 15_9-F-1/15_9-F-1 B/Volve F_F-1_F-1 B_F-1 B_ACTUAL
|
||||||
|
F-11 A:
|
||||||
|
picks: NO 15/9-F-11 A
|
||||||
|
logs: 15_9-F-11 A
|
||||||
|
survey: 15_9-F-11/15_9-F-11 A/Volve F_F-11_159-F-11 A_159-F-11 A_ACTUAL
|
||||||
|
F-11 T2:
|
||||||
|
picks: NO 15/9-F-11 T2
|
||||||
|
logs: 15_9-F-11 T2
|
||||||
|
survey: 15_9-F-11/15_9-F-11 T2/Volve F_F-11_159-F-11 T2_159-F-11 T2_ACTUAL
|
||||||
|
# Alternative TDRs from `checkshots` above. RSVSP is left out: a rig-source VSP in a deviated hole is an
|
||||||
|
# offset VSP, and its vertical times end 35 ms earlier than NIVSP at 4530 m MD.
|
||||||
|
checkshots: [NIVSP, OPTIMIZED]
|
||||||
|
F-12:
|
||||||
|
picks: NO 15/9-F-12
|
||||||
|
logs: 15_9-F-12
|
||||||
|
survey: 15_9-F-12/15_9-F-12/Volve F_F-12_F-12_F-12_ACTUAL
|
||||||
|
# Wellbores sharing a slot, i.e. the hole above the kick-off: F-1 A and F-1 B leave F-1 at 2587 m MD,
|
||||||
|
# F-11 A leaves F-11 T2 at 2580 m MD. The `slot` blind scheme holds out the whole group.
|
||||||
|
slot_groups: [[F-1, F-1 A, F-1 B], [F-11 A, F-11 T2], [F-12]]
|
||||||
|
# Blind schemes for a held-out well (plan §5.2): its input is placed in time by the mean TVDSS–TWT relation of
|
||||||
|
# the wells it is held out from, never by its own picks or DT. lowo = all other wells, slot = other slots.
|
||||||
|
blind_schemes: [lowo, slot]
|
||||||
|
# Volve ROI of plan §12 item 7; 301 samples on the 4 ms grid. Margin only (B1 inversion, synthetics): above
|
||||||
|
# ~2320 ms the calibrated TDR of 5 wells is an extension beyond DT and anchors (F-11 T2: up to 49 ms off NIVSP).
|
||||||
|
ext_window_ms: [2000, 3200]
|
||||||
|
# Input, labels and scoring, 126 samples as in F3. Contains every calibrated label support (2509–2819 ms) and
|
||||||
|
# starts below the upward extension of every calibrated TDR; below DT the path runs on to TD, then is held there.
|
||||||
|
main_window_ms: [2400, 2900]
|
||||||
|
patch_radius: 1 # 3×3 traces along the well path
|
||||||
|
patch_method: bilinear # bilinear in (IL, XL) between bins; nearest is computed for QC only
|
||||||
|
label: PHIF
|
||||||
|
curves: [PHIF, DT, RHOB, NPHI, GR, AI]
|
||||||
|
dt_valid_us_per_ft: [40, 200] # DT outside this range is set to NaN before any TDR or AI is computed
|
||||||
|
# P4 also excludes FP (faulted pick): F-1 Skagerrak Fm. Top is the only FP pick with a TWT among the 6 wells.
|
||||||
|
anchor_exclude_qlf: [NL, NR, FP]
|
||||||
|
# Picks at most this far below the previous anchor are one marker (F-1: Heather Fm. Top and Heather Fm. Sand
|
||||||
|
# VOLVE Top are 0.3 m apart); keeps two near-identical anchors out of the stretch and the warp prior.
|
||||||
|
anchor_min_sep_m: 1.0
|
||||||
|
edge_m: 30 # logged hole used for the velocity of the TDR extension beyond the DT range
|
||||||
|
# TDRs per well (ml_porosity/data/deviated.py), all integrating DT over TVD (vertical time):
|
||||||
|
# calibrated marker-calibrated vertical sonic: scoring reference (plan §5.2) and training-well path
|
||||||
|
# sonic vertical sonic through the first anchor in the DT range, uncalibrated: the τ axis of RML
|
||||||
|
# anchors linear in TVD between the anchors, without DT
|
||||||
|
tdrs: [calibrated, sonic, anchors]
|
||||||
|
resample:
|
||||||
|
fine_dt_ms: 0.25
|
||||||
|
cutoff_frac: 0.8
|
||||||
|
|||||||
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"]
|
||||||
65
configs/protocol_volve.lock.json
Normal file
65
configs/protocol_volve.lock.json
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
{
|
||||||
|
"protocol_sha256": "7fdff4a1a4417da4322500548b7999657759fe5120c8a459b3d96ecb84a6b7b1",
|
||||||
|
"code_sha256": "c0befaa4442c50bcfe45352ba4b9c5a49ff2a4d1c2688cb85357ee828adbad95",
|
||||||
|
"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"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"protected_artifacts": {
|
||||||
|
"outputs:wavelets.npz": "b689ea12578e580d8c2305c8f7219be05ff6e339884fa30b694111e968c0fc64",
|
||||||
|
"outputs:p2/warp_prior_f3.json": "55cda573c06b3a7275bdb4ac5f169fb4e5af329e1d199acc3d4daffe15624d27"
|
||||||
|
},
|
||||||
|
"inputs": {
|
||||||
|
"repo:configs/d3_volve.yaml": "0d8613ab459292d3fcc3b60c43697bbbef222340daa00fde201b9d2cba5d1fd5",
|
||||||
|
"outputs:volve/volve_wells.npz": "ea496fac79c67a09543e5bc52dad200043bcb56eef7c371b948d0f04cc5a2c1d",
|
||||||
|
"outputs:volve/volve_wells_summary.json": "64e1278ad6a02cfac9f5b14df49bd6564e738fcaf0830f164652146b97e1fa4a",
|
||||||
|
"volve:Geophysical_Interpretations/Wells/Well_picks_Volve_v1.dat": "1c132bba09555915b62e23dc4475f790a304856d369d9d26cc76466cf7b77d3a",
|
||||||
|
"volve:Geophysical_Interpretations/Horizons/Horizons_TWT/Official_Horizons/Hugin_Fm_Top+ST10010ZC11_Near_190314+STAT+TIME.dat": "44e12e9c80fa59de95f6c6ea8ad76e3c7ebbefd6f6a8142966509f979666355d",
|
||||||
|
"volve:Well_technical_data/WellWellbore/15_9-F-1/15_9-F-1/Volve F_F-1_F-1_F-1_ACTUAL": "62ee61e501f4838e5eae6e4e012b75a8e8f74763594f5237ce3a65c8433c6d78",
|
||||||
|
"volve:Well_logs_pr_WELL/15_9-F-1/05.PETROPHYSICAL INTERPRETATION/WLC_PETRO_COMPUTED_INPUT_1.LAS": "b7adf7938ff7c43d23d504370871ddb55304797ccfb6e6c886bf923118b2c789",
|
||||||
|
"volve:Well_logs_pr_WELL/15_9-F-1/05.PETROPHYSICAL INTERPRETATION/WLC_PETRO_COMPUTED_OUTPUT_1.LAS": "53b060678accbae3afb3b40a8abe0881456fafbe4571cafeff80b1b2630c38c4",
|
||||||
|
"volve:Well_technical_data/WellWellbore/15_9-F-1/15_9-F-1 A/Volve F_F-1_F-1 A_F-1 A_ACTUAL": "7152f2dceb59c72a2d9ed05b71d8708ffde0de36145da75ec0af1f049528772f",
|
||||||
|
"volve:Well_logs_pr_WELL/15_9-F-1 A/05.PETROPHYSICAL INTERPRETATION/WLC_PETRO_COMPUTED_INPUT_1.LAS": "494513a2f4448df524e6b0229697e26d2453640c37f8be2e45d3e7219a600602",
|
||||||
|
"volve:Well_logs_pr_WELL/15_9-F-1 A/05.PETROPHYSICAL INTERPRETATION/WLC_PETRO_COMPUTED_OUTPUT_1.LAS": "4216236e9618ce348c80a1c2aef1cedde1bba9fa8c32dca0a6438a400439d845",
|
||||||
|
"volve:Well_technical_data/WellWellbore/15_9-F-1/15_9-F-1 B/Volve F_F-1_F-1 B_F-1 B_ACTUAL": "43d4739828f60a1e5e2fdbcb36601f082d3f375e4d087cfb8d093ee18765a3ed",
|
||||||
|
"volve:Well_logs_pr_WELL/15_9-F-1 B/05.PETROPHYSICAL INTERPRETATION/WLC_PETRO_COMPUTED_INPUT_1.LAS": "ad9af11d31c9e116d686294ecb2c3aff7cd96ae7a03e633c70dcbcd7e0748468",
|
||||||
|
"volve:Well_logs_pr_WELL/15_9-F-1 B/05.PETROPHYSICAL INTERPRETATION/WLC_PETRO_COMPUTED_OUTPUT_1.LAS": "6576989d3a8935f9f497ce05831b5dac396e653fbe7f7e4738de18bccf535645",
|
||||||
|
"volve:Well_technical_data/WellWellbore/15_9-F-11/15_9-F-11 A/Volve F_F-11_159-F-11 A_159-F-11 A_ACTUAL": "74bda9f018ef1714371de422c86c7ad3c63480d41c30f6cf3baa5b0588e59882",
|
||||||
|
"volve:Well_logs_pr_WELL/15_9-F-11 A/05.PETROPHYSICAL INTERPRETATION/WLC_PETRO_COMPUTED_INPUT_1.LAS": "84ee266e0635a123ad51c96006835539b200fbc9fa6694d2b20a9067f1352870",
|
||||||
|
"volve:Well_logs_pr_WELL/15_9-F-11 A/05.PETROPHYSICAL INTERPRETATION/WLC_PETRO_COMPUTED_OUTPUT_1.LAS": "680fe7522c635f23e034b9cc1a5b06593fc62f7c1c1d86e2565730ea785f94bf",
|
||||||
|
"volve:Well_technical_data/WellWellbore/15_9-F-11/15_9-F-11 T2/Volve F_F-11_159-F-11 T2_159-F-11 T2_ACTUAL": "2018eafc01148baf018e586109321c685f8676d94a902e2bef494e29622a1e04",
|
||||||
|
"volve:Well_logs_pr_WELL/15_9-F-11 T2/05.PETROPHYSICAL INTERPRETATION/WLC_PETRO_COMPUTED_INPUT_1.LAS": "6ef9631e99d7da34b3d95356fa58dd6ecac230413723c320c30340dd7ed7979c",
|
||||||
|
"volve:Well_logs_pr_WELL/15_9-F-11 T2/05.PETROPHYSICAL INTERPRETATION/WLC_PETRO_COMPUTED_OUTPUT_1.LAS": "d4c214e11d18a2aaa325dc8811d8d42ea77396f21f7d0bd9d022dfa08554a611",
|
||||||
|
"volve:Well_logs_pr_WELL/15_9-F-11 T2/08.VSP_VELOCITY/TZV_TIME_CHECKSHOT_1.ASC": "a58018419164ca3c9dbd9161cac40e590a8f89840b2a2da1be1622c76d9b673e",
|
||||||
|
"volve:Well_logs_pr_WELL/15_9-F-11 T2/08.VSP_VELOCITY/TZV_TIME_CHECKSHOT_3.ASC": "41c9dd5c5e0d8c7753bdc88f1ee50870a1a7dc67ecba73a16925f33ea1751ed1",
|
||||||
|
"volve:Well_technical_data/WellWellbore/15_9-F-12/15_9-F-12/Volve F_F-12_F-12_F-12_ACTUAL": "1e1e80a7656455b09b47aea0205f5f441aacb252c9fe09de2b48ba1279201afc",
|
||||||
|
"volve:Well_logs_pr_WELL/15_9-F-12/05.PETROPHYSICAL INTERPRETATION/WLC_PETRO_COMPUTED_INPUT_1.LAS": "c38ffd606d7065e5c8904e126fd36ef736a4ce1149918ea88216bb3fe73db84e",
|
||||||
|
"volve:Well_logs_pr_WELL/15_9-F-12/05.PETROPHYSICAL INTERPRETATION/WLC_PETRO_COMPUTED_OUTPUT_1.LAS": "3633fd2e7797d80b7dc0b272276bc34124e06d275a129926f0afc57ce596a3dc"
|
||||||
|
},
|
||||||
|
"locked_utc": "2026-10-29T01:17:42.222240+00:00",
|
||||||
|
"segy_sha256": "f902e2bdaa277caf93a32e5f35eae653eb8b923138db0efc1e91918ef6757b2e",
|
||||||
|
"canonical_text": "UTF-8, CRLF normalized to LF for code, protocol and source configuration; binary inputs exact",
|
||||||
|
"wells": [
|
||||||
|
"F-1",
|
||||||
|
"F-1 A",
|
||||||
|
"F-1 B",
|
||||||
|
"F-11 A",
|
||||||
|
"F-11 T2",
|
||||||
|
"F-12"
|
||||||
|
]
|
||||||
|
}
|
||||||
1
configs/protocol_volve.sha256
Normal file
1
configs/protocol_volve.sha256
Normal file
@@ -0,0 +1 @@
|
|||||||
|
7fdff4a1a4417da4322500548b7999657759fe5120c8a459b3d96ecb84a6b7b1 configs/protocol_volve.yaml
|
||||||
185
configs/protocol_volve.yaml
Normal file
185
configs/protocol_volve.yaml
Normal file
@@ -0,0 +1,185 @@
|
|||||||
|
# P4 Volve (plan D3, gate G-D): designed 28/10/2026 after P3 (G-C failed) and before any Volve PHIF metric,
|
||||||
|
# prediction or training run. DRAFT until `scripts/24_run_volve.py lock` on the run machine; after the lock this file
|
||||||
|
# is never edited (a change needs protocol_volve v2 with a recorded deviation).
|
||||||
|
version: 1
|
||||||
|
date: '2026-10-28'
|
||||||
|
prior_observation: >-
|
||||||
|
Before this file, Volve had only descriptive QC of DT, RHOB, picks, checkshots and seismic (plan §12 item 18).
|
||||||
|
The main window was chosen once from the label positions of all six wells, not their values. The design follows
|
||||||
|
protocol_f3 after its G-C failure was known: a post-P3 design for a second field, not a pre-registration made
|
||||||
|
before any field result.
|
||||||
|
data:
|
||||||
|
wells: [F-1, F-1 A, F-1 B, F-11 A, F-11 T2, F-12]
|
||||||
|
label: PHIF
|
||||||
|
dataset: outputs/volve/volve_wells.npz
|
||||||
|
source_config: configs/d3_volve.yaml
|
||||||
|
window_ms: [2400, 2900]
|
||||||
|
ext_window_ms: [2000, 3200]
|
||||||
|
min_label_samples: 8
|
||||||
|
references: [calibrated, anchors, NIVSP, OPTIMIZED]
|
||||||
|
primary_reference: calibrated
|
||||||
|
note: >-
|
||||||
|
PHIF is the CPI effective porosity, density-driven and not a function of DT (plan D3). It is used only where DT
|
||||||
|
is valid (16–37 samples of 4 ms per well). DT enters the time placement: vertical sonic integrated over TVD,
|
||||||
|
calibrated to the markers. NIVSP and OPTIMIZED exist only at F-11 T2.
|
||||||
|
missing_labels: >-
|
||||||
|
Never extrapolate labels. Each bank member keeps the samples where its own tie places the label run (member
|
||||||
|
support); a member with fewer than min_label_samples samples in a training well is an error. A scoring
|
||||||
|
reference with fewer than min_label_samples samples is listed, not scored.
|
||||||
|
split:
|
||||||
|
schemes: [lowo, slot]
|
||||||
|
outer: >-
|
||||||
|
lowo: every other well trains. slot: every well outside the slot group of the test well trains
|
||||||
|
(d3_volve.yaml p4.slot_groups: {F-1, F-1 A, F-1 B}, {F-11 A, F-11 T2}, {F-12}).
|
||||||
|
inner: >-
|
||||||
|
Leave one outer training well out, under both schemes. Under slot an inner validation well can share a slot
|
||||||
|
with inner training wells (deviation inner_lowo_under_slot).
|
||||||
|
inputs: >-
|
||||||
|
Training wells: calibrated reference path. Validation well v: blind key T_in. Outer test well u: blind key
|
||||||
|
T_out. A blind key K places the well path in time by the mean TVDSS–TWT relation of the wells K only; a
|
||||||
|
held-out well never supplies its picks, DT or logs to its own input.
|
||||||
|
seeds: [0, 1, 2, 3, 4]
|
||||||
|
selection: >-
|
||||||
|
Per scheme, outer fold, σ_a arm, method and seed: lowest mean original-scale validation MSE over the inner
|
||||||
|
wells, on their labelled samples of the primary reference; ties choose the earliest budget.
|
||||||
|
final: >-
|
||||||
|
Ensemble the inner models at the selected budget on the outer test input, then the five seeds (moment-matched
|
||||||
|
Gaussian mixture). No refit on the outer test well.
|
||||||
|
cache: >-
|
||||||
|
One trajectory per distinct inner training set, method, seed and σ_a arm (22 sets: 15 of four wells, 4 of
|
||||||
|
three, 3 of two). It predicts every input a fold can ask of it and is reused by every fold that trains on that
|
||||||
|
set; the other wells supply seismic only.
|
||||||
|
registration:
|
||||||
|
kernel: matern32
|
||||||
|
sigma_a_ms: 7.0
|
||||||
|
sigma_b_ms: 50.0
|
||||||
|
hyperprior: {sigma_g: [0.05, 1.0], ell_ms: [150.0, 1.0]}
|
||||||
|
hyper_starts: 4
|
||||||
|
S: 64
|
||||||
|
particles: 1024
|
||||||
|
g_max: 1.0
|
||||||
|
wavelet_ms: 128
|
||||||
|
tau_range_ms: [1800, 3400]
|
||||||
|
fine_dt_ms: 0.5
|
||||||
|
log_fine_dt_ms: 0.25
|
||||||
|
log_cutoff_frac: 0.8
|
||||||
|
warp_dtau_ms: 4.0
|
||||||
|
smc_seed: 0
|
||||||
|
phase_step: 15.0
|
||||||
|
phase_half_width: 3
|
||||||
|
phase_max_extra: 6
|
||||||
|
smc_moves: 8
|
||||||
|
sigma_a_sensitivity_ms: [3.5, 14.0]
|
||||||
|
sensitivity_methods: [B3c-R, B3d-Sa, M2-Sa]
|
||||||
|
sigma_a_note: >-
|
||||||
|
7 ms is inherited from P2r and protocol_f3, not estimated on Volve. Both misspecification arms are reported
|
||||||
|
if run, never used to choose a test result.
|
||||||
|
training_only: >-
|
||||||
|
Hyperparameters, statistical wavelet, phase and SMC posterior of a set use its training wells only. τ is the
|
||||||
|
vertical-sonic time through the first anchor in the DT range; anchors are markers in the DT range inside the
|
||||||
|
ext window.
|
||||||
|
training:
|
||||||
|
d_channels: 64
|
||||||
|
p_dropout: 0.05
|
||||||
|
lr: 0.005
|
||||||
|
grad_clip: 5.0
|
||||||
|
budgets: [125, 250, 500, 1000, 2000]
|
||||||
|
window_samples: 126
|
||||||
|
window_step: 2
|
||||||
|
loss: >-
|
||||||
|
ml_porosity.volve.losses.masked_bank_loss with one window, the whole main window (126 samples), and the label
|
||||||
|
support of each member; member log-likelihoods are compared at the mean member count, normalised by it, then
|
||||||
|
averaged over wells. Equal to the F3 bank loss with a 126-sample window when every sample is labelled.
|
||||||
|
λ = 1/τ_c from the pooled ACF of the high-passed B3b label runs of the training set.
|
||||||
|
methods:
|
||||||
|
main: [B3b, B3c, B3c-R, B3d-Sa, M2-Sa]
|
||||||
|
definitions: >-
|
||||||
|
B3b: sonic TDR stretched through the anchors. B3c: B3b plus smoothed local NCC shifts with the phase fitted on
|
||||||
|
anchor-prior samples. B3c-R: the same with the SMC-refined phase. B3d-Sa: posterior-mean tie. M2-Sa: RML on
|
||||||
|
S = 64 posterior label draws.
|
||||||
|
posterior_mean_definition: >-
|
||||||
|
B3d-Sa averages the forward maps t(τ) over retained particles and then inverts that mean, as in protocol_f3.
|
||||||
|
metrics:
|
||||||
|
primary: rmse
|
||||||
|
f_c_hz: 6.0
|
||||||
|
desc_band_min_samples: 16
|
||||||
|
best_shift_max_samples: 16
|
||||||
|
levels: [50, 80, 90, 95]
|
||||||
|
units: 'porosity units (fraction multiplied by 100)'
|
||||||
|
reporting: >-
|
||||||
|
Per well first, then the unweighted mean over wells, per scheme; seed and combined ensembles separate. Every
|
||||||
|
available reference is reported; the primary reference is never replaced by a better-scoring one. No p-values
|
||||||
|
on correlated time samples. Best-shift is a separate diagnostic table.
|
||||||
|
gate:
|
||||||
|
name: G-D
|
||||||
|
candidate: M2-Sa
|
||||||
|
point_competitors: [B3b, B3c, B3c-R]
|
||||||
|
same_posterior_method: B3d-Sa
|
||||||
|
competitor_selection: >-
|
||||||
|
Per scheme and outer fold: lowest inner-validation MSE averaged over seeds, primary σ_a arm; never outer-test
|
||||||
|
metrics.
|
||||||
|
report: >-
|
||||||
|
Per scheme, primary reference and σ_a arm, combined ensemble: the wells where M2-Sa RMSE is below the selected
|
||||||
|
competitor, macro RMSE of both, M2-Sa versus B3d-Sa, macro coverage80 and coverage90 of M2-Sa, and every well.
|
||||||
|
claim_rules:
|
||||||
|
min_improved_wells: 5
|
||||||
|
coverage_80: [0.75, 0.85]
|
||||||
|
coverage_90: [0.85, 0.95]
|
||||||
|
wording: >-
|
||||||
|
"Consistent improvement" only if at least 5 of 6 wells improve under both schemes (G-C's 3 of 4, scaled
|
||||||
|
and rounded up); "calibrated" only if both macro coverages lie in their bands under both schemes. Otherwise
|
||||||
|
the result is reported as it is (mixed, no improvement, under- or over-coverage). Neither wording overrides
|
||||||
|
the G-C failure on F3.
|
||||||
|
note: >-
|
||||||
|
G-D is descriptive: report results in either direction and scope claims by them (plan §6). No threshold here
|
||||||
|
changes the plan.
|
||||||
|
out_of_scope: >-
|
||||||
|
B0–B2, B3a, B3d, B4, B5, M1 and the F3 ablations (plan §6 scope cut 5), LOAO, the posterior-GP scoring reference,
|
||||||
|
the calibration-assisted setting and volume prediction.
|
||||||
|
deviations:
|
||||||
|
likelihood_window: >-
|
||||||
|
AI exists only over the logged interval, so the tie likelihood of a well (phase grid, SMC, γ) uses the ext
|
||||||
|
samples from its first to its last calibrated AI sample; F3 used the whole ext window. B3c and B3c-R keep the
|
||||||
|
full-window local shifts (windows without synthetic energy are dropped).
|
||||||
|
particle_validity: >-
|
||||||
|
A particle must invert over the main window only; F3 also required label support over the full window, which
|
||||||
|
16–37-sample labels cannot meet.
|
||||||
|
member_support: >-
|
||||||
|
Each member trains on its own label support. The first draft intersected the supports of all members and
|
||||||
|
methods; the CPU smoke (16 particles, S = 8, training wells only, no PHIF metric) cut F-11 A from 15–17 to 7
|
||||||
|
samples, below min_label_samples, and the intersection shrinks further with S = 64 draws and wider σ_a. The
|
||||||
|
intersection length is kept as a diagnostic (registration.csv, common_samples).
|
||||||
|
masked_loss: >-
|
||||||
|
Masked bank loss with a single 126-sample window instead of the F3 64-sample windows at step 2 (training.loss).
|
||||||
|
Label runs (16–37 samples) are shorter than an F3 window, so sliding windows would only cut a run at
|
||||||
|
arbitrary offsets and pick the RML member per offset; one window compares members over the whole run.
|
||||||
|
segment_lambda: >-
|
||||||
|
λ from label runs of any length (pooled lagged products) instead of the F3 full-window ACF; identical for runs
|
||||||
|
longer than the maximum lag.
|
||||||
|
primary_metric: >-
|
||||||
|
RMSE on labelled samples replaces the F3 band RMSE: label runs are shorter than one period at f_c = 6 Hz, so
|
||||||
|
the F3 band split is undefined; band_* (runs of at least 16 samples) is descriptive.
|
||||||
|
inner_lowo_under_slot: >-
|
||||||
|
Inner validation under slot is leave-one-well-out, not slot-blind (three slots leave too few groups); inner
|
||||||
|
validation can be optimistic there.
|
||||||
|
tau_range: '[1800, 3400] ms: the F3 margins of 200 ms around the ext window.'
|
||||||
|
main_window: 'Chosen from the label positions of all six wells (not values), once, before any training.'
|
||||||
|
lateral_path: >-
|
||||||
|
The 3×3 patch follows the deviated path placed in time by each TDR, so the blind TDR also moves the path
|
||||||
|
laterally (up to 76 m, F-1 A under slot). Recorded, not corrected.
|
||||||
|
scope: 'See out_of_scope; plan §6 scope cut 5 (Volve: best B3, B3d-S and M2 only).'
|
||||||
|
runtime:
|
||||||
|
device: cuda:1
|
||||||
|
workers: 8
|
||||||
|
cpu_threads_per_worker: 2
|
||||||
|
machine: >-
|
||||||
|
Linux GPU server (shared; cuda:1 chosen by free memory) via scripts/run_p4.sh, decided 29/10/2026 after the
|
||||||
|
benchmark stage (training wells only, no PHIF metric) instead of the Windows RTX 3060 workstation planned on
|
||||||
|
28/10; scripts/run_p4.ps1 stays the Windows driver. The lock binds code, inputs and environment. Worker count
|
||||||
|
and scheduling do not change results: every job seeds from its own settings.
|
||||||
|
order: >-
|
||||||
|
lock; register, train and summarize the primary arm; then register and train --arms sensitivity and
|
||||||
|
summarize --arms all. An arm not finished before writing is reported as not run.
|
||||||
|
resume: >-
|
||||||
|
A completed job is reused only if protocol, code, inputs, training wells, method, seed and σ_a fingerprints
|
||||||
|
and the artifact checksums match.
|
||||||
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.
|
||||||
286
docs/plan.md
286
docs/plan.md
File diff suppressed because one or more lines are too long
65
docs/research/applicability-results.md
Normal file
65
docs/research/applicability-results.md
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
# Kết quả C1, C2 (hồi cứu) và T3 (power) — 29/10/2026
|
||||||
|
|
||||||
|
Khai báo trước: `applicability-teapot.md` (SHA-256 trong `applicability-teapot.sha256`, Deviation 1 = mở rộng lưới σ_ref). Exploratory, không confirmatory.
|
||||||
|
|
||||||
|
## C1, C2 (`scripts/26_applicability.py` → `outputs/applicability/verdict.json`)
|
||||||
|
|
||||||
|
Ngưỡng từ 19 ô D2 đạt H2a: τ_band_pcc = 0.468, τ_R² = 0.053.
|
||||||
|
|
||||||
|
| Dataset | R² in | band PCC in | skill so với hằng số | C1 | σ_post trung vị | C2 |
|
||||||
|
| --- | --- | --- | --- | --- | --- | --- |
|
||||||
|
| F3 lowo | 0.039 | 0.146 | 0.108 | trượt | 2.83 ms | đạt |
|
||||||
|
| Volve lowo | −0.990 | 0.133 | −0.089 | trượt | 4.33 ms | đạt |
|
||||||
|
| Volve slot | −0.986 | 0.042 | −0.105 | trượt | 4.33 ms | đạt |
|
||||||
|
|
||||||
|
Đúng dự đoán đã khai báo: cả hai trượt C1 (kỹ năng mạng), không phải C2 (độ rộng posterior).
|
||||||
|
|
||||||
|
## T3 (`scripts/27_t3_power.py` → `outputs/t3/`)
|
||||||
|
|
||||||
|
Luật dùng được là sign test một phía α = 0.05; luật k-of-n (k = ⌈0.75n⌉) không phải phép kiểm (ở p = 0.5 vẫn qua 31% với n = 4) và power giảm theo n, nên bỏ.
|
||||||
|
|
||||||
|
N* (power ≥ 0.8, sign test, n ≤ 40) theo sai số đăng ký của reference chấm điểm σ_ref:
|
||||||
|
|
||||||
|
| Ô | 0 | 0.5 | 1 | 1.5 | 2 | ≥ 3 ms |
|
||||||
|
| --- | --- | --- | --- | --- | --- | --- |
|
||||||
|
| R0, N=4 | 5 | 8 | 11 | 13 | 23 | — |
|
||||||
|
| R0, N=16 | 5 | 8 | 13 | 18 | 37 | — |
|
||||||
|
| R10, N=4 | — | — | — | — | — | — |
|
||||||
|
| R10, N=16 | 5 | 5 | 11 | 23 | — | — |
|
||||||
|
| Rm5, N=4 | 18 | 30 | — | — | — | — |
|
||||||
|
| Rm5, N=16 | 11 | 16 | 30 | — | — | — |
|
||||||
|
|
||||||
|
(— : 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 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
|
||||||
|
|
||||||
|
Nguồn: `rmotc.tar` (TDR, doi:10.18738/T8/21WDU8), giải nén ở `data/Teapot/raw/rmotc/` (1,7 GB; 1.210 file LAS, 3D `filt_mig.sgy` 345 × 188 inline/crossline, bin 110 ft, 2 ms, datum 5500 ft, Vc = 9000 ft/s). Kiểm kê chỉ đọc header, độ phủ curve và tài liệu kèm theo; không so nhãn với seismic.
|
||||||
|
|
||||||
|
- **Time-depth độc lập.** Nguồn TD duy nhất là `Seismic/CD files/TimeDepthTables.xls` ("Select time/depth tables" theo readme), 4 giếng:
|
||||||
|
- 25-1-X-14 và 67-1-X-10: "From synthetic log", tức suy ra từ tie synthetic. Không độc lập; cùng loại với marker của F3.
|
||||||
|
- 48-X-28: "From Synthetic Seismogram", 32 mức (TWT, TVD). Nguồn không rõ là checkshot hay tie synthetic; tính rộng rãi là độc lập.
|
||||||
|
- 35-1-X-10: VSP thật ("FROM Paper VSP log"), nhưng chỉ tới 2335 ft MD (≈ 492 ms TWT), nông hơn 1st Wall Creek và mọi tầng chứa chính.
|
||||||
|
- **LAS.** Không file nào có curve thời gian hay checkshot (các dòng khớp `CS` là casing size / cable speed). Tần suất curve: RHOB 515, DPHI 301, NPHI 134, DT 82 file.
|
||||||
|
- **So với ngưỡng §4.** C3 cần ≥ 3 giếng TD độc lập ngoài tập test; C4 (mức Rm5, `outputs/t3/nstar.csv`) cần 11–18 giếng test có reference TD sai ≲ 0,5 ms. Teapot có tối đa 2 giếng TD độc lập tính rộng rãi, và chỉ 1 nếu tính chặt (VSP nông). Tổng 2 < 3 + 11, nên trượt cả C3 lẫn C4 trước khi phải mở bất kỳ log nào. Ngoài ra, các bảng TD dùng datum KB/ASL còn seismic dùng datum phẳng 5500 ft, nên bản thân việc quy đổi datum đã đưa thêm sai số vào σ_ref.
|
||||||
|
- **Quyết định (theo cây §4, đã khai báo trước).** Dừng Teapot ở T0. Bài giữ khung lý thuyết + benchmark (Pivot 1). Discussion nêu dữ kiện kiểm kê này như một ví dụ cho thấy dataset field public hiếm khi thỏa C3–C4. Không thử dataset field khác (§0: không "chọn dataset cho đến khi đạt").
|
||||||
|
|
||||||
|
Kiểm kê LAS chi tiết: `scripts/28_teapot_inventory.py` → `outputs/teapot/inventory/`.
|
||||||
|
|
||||||
|
## Pilot P-a Teapot (29/10/2026, Deviation 2) — trượt, dừng Teapot hẳn
|
||||||
|
|
||||||
|
Khai báo: Deviation 2 trong `applicability-teapot.md` (băm v2 07:11:29 UTC, trước mọi phép tính σ_knot; bản sao `outputs/applicability/declaration_v2.md`). Script `scripts/29_teapot_pilot.py` → `outputs/teapot/pilot_pa/`. Chỉ dùng 37 giếng dev (inline chiếu ≤ 200); không đọc giá trị porosity; không tính gì trên 115 giếng test.
|
||||||
|
|
||||||
|
- **Hình học đạt.** Phép chiếu affine XY → inline/xline khớp header SEG-Y (sai số tối đa 0,013 bin). Cả hai horizon có pick bilinear ở 37/37 giếng dev (độ phủ 100%). Pick nằm đúng cực trị cùng cực tính của trace: Carlile 37/37 và KF2 36/37 lệch không quá 2 ms.
|
||||||
|
- **σ̂_knot (M1, quyết định) = 6,75 ms** (CI 90% bootstrap theo giếng: 4,1–9,4; ước lượng robust 1,4826·MAD = 5,0; Carlile 6,0, KF2 7,4). Ngưỡng σ_tol = 1,5 ms. **Trượt.**
|
||||||
|
- **Cấu trúc sai số (chẩn đoán, không quyết định).** Phần dư của hai horizon tại cùng giếng tương quan 0,85. Thành phần chung (bulk shift theo giếng) có SD 6,6 ms và không tương quan với giếng lân cận (hệ số −0,23 ở khoảng cách khoảng 9 bin ≈ 1.000 ft). Như vậy đây không phải biến thiên vận tốc ngang mượt mà M1 có thể đã quy nhầm thành sai số; nó giống sai số riêng từng giếng (KB/datum, residual statics, pick top). Thành phần vi sai (dạng stretch): 2,8 ms; M2 (sonic, 5 giếng): 2,5 ms.
|
||||||
|
- **Kết luận độc lập với cách ước lượng.** Mọi ước lượng (M1 6,75; robust 5,0; hệ số hai knot 5,3; chỉ phần vi sai 2,5–2,8) đều vượt 1,5 ms, và vượt cả 2 ms (ngưỡng nếu giả định mức R0 lạc quan hơn). Theo T3, với σ_ref ≥ 3 ms không ô D2 nào có power 0,8 ở n ≤ 115 trừ R0 với N_train = 4.
|
||||||
|
- **Quyết định (cơ học theo Deviation 2).** Dừng Teapot hẳn, không có P-b. Bài giữ Pivot 1. Dữ kiện dùng được cho phần "limits of field validation" (exploratory): ngay cả ở dataset field public có nhiều kiểm soát nhất mà nhóm biết (hàng trăm giếng có top cùng horizon 3D đã minh giải), sai số TD độc lập khoảng 5–7 ms (bulk) và 2,5–2,8 ms (vi sai), tức gấp 2–5 lần dung sai mà một field test có lực phân biệt cần (≈ 1–1,5 ms).
|
||||||
|
|
||||||
|
## Dùng trong bài (29/10/2026)
|
||||||
|
|
||||||
|
- **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.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.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.
|
||||||
106
docs/research/applicability-teapot.md
Normal file
106
docs/research/applicability-teapot.md
Normal file
@@ -0,0 +1,106 @@
|
|||||||
|
# Điều kiện áp dụng C1–C4 và nhánh thử Teapot Dome (P6)
|
||||||
|
|
||||||
|
Ngày viết: **29/10/2026**. Trạng thái: **khai báo trước** (pre-declaration). Tài liệu này được viết và băm SHA-256 (`applicability-teapot.sha256`) **trước** khi tính bất kỳ điều kiện nào trên F3 hay Volve, và trước khi có bất kỳ file dữ liệu Teapot Dome nào trên máy. 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.
|
||||||
|
|
||||||
|
Liên quan: `docs/plan.md` §12 ý 22 (Pivot 1), `docs/research/pivot-theory-benchmark.md` (T3), `docs/research/field-dataset-survey.md` (Teapot Dome, tiêu chí Q1–Q7).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 0. Mục đích và giới hạn trung thực
|
||||||
|
|
||||||
|
Người dùng đề xuất (29/10): F3 và Volve trượt vì dữ liệu; nếu một field dataset thỏa các điều kiện dữ liệu cho kết quả dương, bài có thể trở lại khung **bài phương pháp có miền áp dụng rõ**. Nếu Teapot Dome không thỏa, bài giữ khung **lý thuyết + benchmark** (Pivot 1, không đổi).
|
||||||
|
|
||||||
|
Giới hạn phải ghi nhận:
|
||||||
|
|
||||||
|
1. Người viết tài liệu này **đã thấy** kết quả test của F3 và Volve. Để hạn chế việc chọn ngưỡng theo kết quả, mọi ngưỡng của C1 và C2 được **dẫn xuất cơ học từ D2** (benchmark synthetic P2r), không chọn tự do.
|
||||||
|
2. C3 và C4 trượt ở F3 và Volve **theo cấu trúc** (không có TD độc lập đủ giếng; N = 4 và 6). Vì vậy phép kiểm hồi cứu trên F3 và Volve chỉ có nội dung phân biệt qua **C1 và C2**.
|
||||||
|
3. Toàn bộ nhánh này **thiết kế sau khi thấy G-C và G-D**. Bài phải ghi là deviation so với kế hoạch gốc, cùng loại với P2r.
|
||||||
|
4. **Không mua sắm dataset:** Teapot Dome là dataset field duy nhất được thử trong nhánh này. Nếu Teapot trượt ở bất kỳ bước nào, bài này không thử thêm dataset field nào khác.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 1. Định nghĩa C1–C4
|
||||||
|
|
||||||
|
Mọi điều kiện tính **không dùng nhãn của giếng test**: chỉ dùng giếng train, inner fold, posterior tie và TD độc lập ngoài tập test.
|
||||||
|
|
||||||
|
### C1. Mạng có kỹ năng ở giếng blind, trong miền đã kiểm chứng của D2
|
||||||
|
|
||||||
|
- **Đại lượng.** Với mỗi outer fold u, lấy point competitor m*(u) được chọn theo inner-validation MSE (như protocol của dataset đó). Với mỗi inner validation well v ∈ T_out(u), lấy dự đoán tại v của mô hình train trên T_out(u) ∖ {v}, tại budget mà protocol đã chọn cho (u, m*, seed); trung bình 5 seed (mean của μ). So với nhãn reference chính của v (giếng train, nên không phải nhãn test).
|
||||||
|
- `r2_in`: R² (point_metrics, toàn dải).
|
||||||
|
- `band_pcc_in`: PCC băng. F3: `band_metrics` với f_c của protocol (6 Hz). Volve: `desc_band` (run ≥ 16 mẫu, như protocol_volve, chỉ mô tả).
|
||||||
|
- `ss_const`: 1 − RMSE_net / RMSE_const, với RMSE_const của hằng số bằng trung bình nhãn các giếng T_out(u) ∖ {v}.
|
||||||
|
- Gộp: trung bình không trọng số trên mọi cặp (u, v).
|
||||||
|
- **Ngưỡng (dẫn xuất từ D2, `outputs/p2r/`).** Tập ô xác nhận = các ô H2a có `cell_pass = True` trong `outputs/p2r/summary/h2a.csv` với c = 1, regime ∈ {R10, R0, Rm5}, N ∈ {4, 16}. Trong mỗi ô, lấy best competitor của ô đó (cột `best`), tính trung bình `band_pcc` và `r2` trên mọi (realization, seed, giếng test) từ `outputs/p2r/train/<regime>/results.csv`.
|
||||||
|
- τ_pcc = **min** trên tập ô xác nhận của band_pcc trung bình.
|
||||||
|
- τ_r2 = **min** trên tập ô xác nhận của r2 trung bình.
|
||||||
|
- **C1 đạt** nếu `band_pcc_in ≥ τ_pcc` **và** `r2_in ≥ τ_r2` **và** `ss_const > 0`.
|
||||||
|
- Lý do: ngoài khoảng kỹ năng mà D2 đã xác nhận hiệu ứng, benchmark không nói gì; một field test ở đó là ngoại suy. Ghi chú: inner model train trên ít giếng hơn và chấm bằng reference có sai số, nên `*_in` thiên thấp; đây là hướng bảo thủ, chấp nhận.
|
||||||
|
|
||||||
|
### C2. Posterior tie đủ rộng (chỉ cho claim RML so với nhãn trung bình posterior)
|
||||||
|
|
||||||
|
- **Đại lượng.** σ_post của posterior SMC trên giếng train (định nghĩa `protocol_p2r` notes.sigma_post; không dùng nhãn), trung vị trên giếng train của mọi tập train, tại σ_a chính của dataset.
|
||||||
|
- **C2 đạt** nếu σ_post ≥ **1.5 ms** (ngưỡng "wide" của `protocol_p2r` H2b).
|
||||||
|
- C2 chỉ điều kiện hóa claim kiểu H2b (M2-Sa so với B3d-Sa). Claim chính (M2-Sa so với point tie tốt nhất, kiểu H2a/G-C) không cần C2, vì H2a đạt cả ở ô hẹp (c = 0) trên D2.
|
||||||
|
|
||||||
|
### C3. σ_a xác định được
|
||||||
|
|
||||||
|
- **Đại lượng.** Có TD độc lập (checkshot hoặc VSP, không dùng để dựng tie train) ở **≥ 3 giếng không thuộc tập test**. σ̂_a = SD của (thời gian marker theo tie dùng để train − thời gian theo TD độc lập tại cùng độ sâu marker), gộp theo giếng; khoảng tin cậy 90% bằng bootstrap theo giếng.
|
||||||
|
- **C3 đạt** nếu đủ ≥ 3 giếng **và** CI 90% nằm trong [σ̂_a / 2, 2 σ̂_a].
|
||||||
|
- Lý do: nhánh σ_a của P2r cho thấy lợi ích H2a mất khi σ_a sai ×0.5 hoặc ×2.
|
||||||
|
|
||||||
|
### C4. Đủ power
|
||||||
|
|
||||||
|
- **Đại lượng.** N* = số giếng test nhỏ nhất sao cho xác suất luật G-E đạt ≥ **0.80**, tính bằng T3 (mô phỏng trên dự đoán đã lưu của P2r, mục 3), với: (a) regime D2 có band PCC của competitor gần nhất với `band_pcc_in` của field (nếu thấp hơn mọi regime thì dùng regime thấp nhất); (b) sai số reference σ_ref = 0 nếu mọi giếng test có TD độc lập, ngược lại σ_ref = σ̂_a của C3.
|
||||||
|
- **C4 đạt** nếu số giếng test khả dụng (có nhãn porosity trong cửa sổ seismic và đạt QC) ≥ N*.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 2. Phép kiểm hồi cứu trên F3 và Volve (bước R)
|
||||||
|
|
||||||
|
- Tính C1, C2 trên F3 (`outputs/p3/`) và Volve (`outputs/p4/`, scheme lowo và slot) bằng `scripts/26_applicability.py`. C3, C4 ghi theo dữ kiện đã biết (F3: 0 giếng TD độc lập, N = 4; Volve: 2 giếng có checkshot, N = 6) và theo N* của T3.
|
||||||
|
- **Dự đoán đăng ký trước:** cả F3 và Volve trượt **C1**.
|
||||||
|
- Đọc kết quả:
|
||||||
|
- Cả hai trượt C1: nhất quán với "trượt vì dữ liệu" (không chứng minh được, vì là hồi cứu).
|
||||||
|
- Một dataset **đạt C1** (và C2 nếu áp dụng): lập luận "trượt vì dữ liệu" **yếu đi** cho dataset đó; bài không được dùng C1–C4 để giải thích kết quả âm của nó. Nhánh Teapot vẫn có thể chạy, nhưng claim sẽ hẹp hơn.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 3. T3 (power) — exploratory, mức B của Pivot 1
|
||||||
|
|
||||||
|
- Nguồn: `outputs/p2r/train/<regime>/cells/*.npz` (y_true theo warp thật, μ theo phương pháp và seed, 8 giếng test mỗi realization).
|
||||||
|
- Reference chấm điểm mô phỏng: y_true lấy tại t + s(t), với s(t) là warp trơn ngẫu nhiên có SD σ_ref ∈ {0, 2, 4, 8} ms (thành phần hằng + tuyến tính).
|
||||||
|
- Với mỗi ô (regime, c = 1, N), mỗi giếng: chỉ báo "M2-Sa có band RMSE thấp hơn best competitor của ô" theo reference mô phỏng; trung bình seed như ensemble.
|
||||||
|
- Từ chỉ báo theo giếng và độ tương quan trong realization (ICC), tính P(luật đạt | n) cho n = 4…40 theo beta-binomial cho hai luật ứng viên: (a) k-of-n với k = ⌈0.75 n⌉ (G-C 3/4, G-D 5/6); (b) kiểm định dấu một phía α = 0.05 trên chỉ báo theo giếng.
|
||||||
|
- Đầu ra: đường cong N*(regime, σ_ref, luật), `outputs/t3/`. Đây là phân tích giải thích, không confirmatory.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 4. Cây quyết định cho Teapot Dome
|
||||||
|
|
||||||
|
| Bước | Việc (không nhìn nhãn test so với dự đoán) | Đạt → | Trượt → |
|
||||||
|
| --- | --- | --- | --- |
|
||||||
|
| **T0. Kiểm kê** | Tải `rmotc.tar` (TDR, doi:10.18738/T8/21WDU8, CC0). Đếm: giếng trong footprint 3D có density/neutron trong cửa sổ seismic; có sonic; có checkshot/VSP; giếng nghiêng; formation tops/horizon; chất lượng log | C3 khả thi (≥ 3 giếng TD độc lập ngoài test) **và** số giếng test khả dụng ≥ N* (T3, giả định mức Rm5) | **Dừng Teapot.** Bài giữ khung lý thuyết + benchmark; Discussion nêu dữ kiện kiểm kê |
|
||||||
|
| **T1. Dev** | Chia giếng thành **dev** (thiết kế, C1, C2, C3) và **test** (khóa, không mở nhãn tới G-E) theo luật không gian chốt trước khi mở log. Tính C1, C2, C3 chỉ trên dev | C1 và C3 đạt | **Dừng Teapot.** Báo cáo "Teapot nằm ngoài miền áp dụng của benchmark" như một kết quả; khung lý thuyết + benchmark |
|
||||||
|
| **T2. Khóa** | Viết `configs/protocol_teapot.yaml` (+ `.sha256`, `.lock.json`): G-E (luật chọn theo power của T3), N, tập phương pháp (tối thiểu B3 point ties, B3d-Sa, M2-Sa), σ_a từ C3, reference chấm điểm, f_c | Đã khóa | — |
|
||||||
|
| **T3. Chạy** | Nested LOWO trên tập test, như P3/P4 | G-E đạt | G-E trượt (dù C1–C4 đạt) |
|
||||||
|
| **Bài** | | **Khung phương pháp + lý thuyết + miền áp dụng:** "khi C1–C4 đạt, RML cải thiện; F3 và Volve nằm ngoài miền áp dụng" (claim cỡ 1 dataset) | **Khung lý thuyết + benchmark, mạnh hơn:** kết quả âm đủ power, RML không chuyển sang field ngay cả trong miền áp dụng |
|
||||||
|
|
||||||
|
Không đổi trong mọi nhánh: G-C, G-D và kết luận của chúng; H3 bị bác bỏ (không claim calibration); sự phụ thuộc vào σ_a là giới hạn của phương pháp.
|
||||||
|
|
||||||
|
**Mốc thời gian (theo hạn 14/11 ở plan §6.1; ngày có thể dời, ngưỡng thì không):** T0 xong trước **2/11**; nếu G-E chưa có kết quả trước **10/11** thì coi như không làm được trong bài này và giữ khung lý thuyết + benchmark.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Deviation
|
||||||
|
|
||||||
|
Bản băm gốc (v1) được giữ nguyên byte ở `outputs/applicability/declaration_v1.md` (SHA-256 khớp `applicability-teapot.sha256`). Mọi thay đổi sau v1 chỉ nằm trong mục này.
|
||||||
|
|
||||||
|
1. **(29/10/2026, sau lần chạy T3 đầu tiên) Lưới σ_ref mở rộng** từ {0, 2, 4, 8} ms thành {0, 0.5, 1, 1.5, 2, 3, 4, 8} ms. Lý do: lần chạy đầu cho thấy xác suất M2-Sa thắng ở một giếng giảm từ 0.81–0.97 (σ_ref = 0) xuống 0.65–0.82 (2 ms) và về khoảng 0.5 (4 ms), nên ngưỡng dung sai nằm giữa 0 và 2 ms, nơi lưới v1 không có điểm. Kết quả lưới v1 giữ ở `outputs/t3_grid_v1/`. Không đổi luật, ngưỡng hay dữ liệu; chỉ thêm điểm lưới. T3 vẫn là exploratory.
|
||||||
|
|
||||||
|
2. **(29/10/2026, sau kiểm kê T0, trước khi mở bất kỳ nhãn porosity nào) Nguồn TD độc lập mở rộng sang knot horizon–top; pilot trên tập dev nhỏ.**
|
||||||
|
- *Lý do.* T0 cho thấy chỉ có 4 bảng TD (1 VSP nông), nên C3/C4 theo nghĩa checkshot/VSP trượt. Kiểm kê cũng tìm thấy `3DHorizons.xyz` (9 horizon đã minh giải trên khối 3D) và formation tops ở khoảng 1.000 giếng. `FormationCodes.doc` ánh xạ KF2 ↔ F2WC; Carlile ↔ CRLL (trùng tên). Mỗi cặp (thời gian horizon tại giếng, độ sâu top) là một knot TD độc lập với waveform tie. Ngưỡng, luật G-E, luật N* và giả định mức Rm5 **không đổi**; chỉ định nghĩa nguồn TD thay đổi.
|
||||||
|
- *Tập giếng.* W = giếng có tọa độ header nằm trong footprint 3D (inline/xline chiếu bằng phép affine khớp từ `3DHorizons.xyz`), có top CRLL và F2WC, và có density phủ trọn [CRLL, F2WC] (152 giếng). Cửa sổ nhãn là CRLL → F2WC. **Dev** = các giếng W có inline chiếu ≤ 200 (37 giếng, đầu nam của vòm). **Test** = phần còn lại (115 giếng). Luật này chốt từ số đếm, chưa xem giá trị log nào. Không tính gì trên giếng test (kể cả σ_knot) cho tới G-E.
|
||||||
|
- *Thiết kế field (nếu đi tiếp).* Knot **chỉ dùng để chấm điểm giếng test và để ước lượng σ_a**. Giếng train được đăng ký bằng waveform tie với prior σ_a như P3/P4; không dùng knot khi đăng ký. Nếu không làm vậy, σ_post ở giếng train co lại theo knot và câu hỏi RML biến mất. Trong bài, phần này gọi là *controlled field experiment* (giữ lại knot ở giếng train), không gọi là quy trình thực hành chuẩn. Reference TD ở giếng test là nội suy tuyến tính theo độ sâu giữa hai knot (vận tốc khoảng không đổi).
|
||||||
|
- *Pilot P-a (hôm nay, chỉ trên dev, không dùng porosity).* (i) Hình học: đọc được SEG-Y, phép chiếu XY → inline/xline khớp header, horizon khớp với SEG-Y (biên độ tại pick). (ii) Độ phủ horizon: có pick trong bán kính 1 bin tại giếng dev, hoặc nội suy được. (iii) **σ̂_knot (M1, chính)**: với từng horizon, thời gian quan sát được so với 2·z/V̂, trong đó z là độ sâu dưới datum seismic 5500 ft (= TVD − KB + 5500, TVD từ directional survey nếu có, ngược lại TVD = MD) và V̂ là trend bậc hai theo (inline, xline) của vận tốc trung bình, khớp bằng leave-one-out trên dev. σ̂_knot = SD gộp của phần dư. Đây là cận trên, vì nó gồm cả biến thiên vận tốc ngang thật. (iv) Kiểm tra phụ (không quyết định): M2 = phần dư của chênh thời gian giữa hai horizon so với 2∫DT dz ở giếng dev có sonic, chia √2; đối chiếu với bảng TD của 48-X-28 nếu giếng này có trong dev. CI 90% bằng bootstrap theo giếng.
|
||||||
|
- *Cổng P-a (cơ học).* σ_tol = σ_ref lớn nhất trên lưới T3 sao cho N*(Rm5, N_train = 16, sign test, power 0,8) ≤ số giếng test (115), tức σ_tol = 1,5 ms. Đạt nếu σ̂_knot ≤ σ_tol **và** có knot cho cả hai horizon ở ≥ 80% giếng dev. Lấy σ_ref = σ̂_knot, không nhân hệ số 0,78 của mô hình hai knot (chỉ báo như độ nhạy). **Trượt → dừng Teapot hẳn**; bài giữ Pivot 1.
|
||||||
|
- *Nếu đạt P-a → pilot P-b (chỉ dev):* dựng pipeline tie/train trên dev, tính C1 (kỹ năng blind trong dev), C2 (σ_post) và C3 (σ̂_a từ knot). Có kết quả P-b rồi mới quyết định chuyển sang T2 (khóa `configs/protocol_teapot.yaml`).
|
||||||
2
docs/research/applicability-teapot.sha256
Normal file
2
docs/research/applicability-teapot.sha256
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
ba65d9acbc9e16691a8919828345c67967980a9ccd39eac88da41cf1c07e5076 applicability-teapot.md # hashed 2026-10-29T04:06:34Z before any C1-C4 computation
|
||||||
|
21602f1397a08b6d05a02d284c2d309bfead72b3562511687cb51518bd9d7ec0 applicability-teapot.md # v2 (Deviation 2) hashed 2026-10-29T07:11:29Z before any sigma_knot computation
|
||||||
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`.
|
||||||
64
docs/research/field-dataset-survey.md
Normal file
64
docs/research/field-dataset-survey.md
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
# Khảo sát dataset public cho field test (29/10/2026)
|
||||||
|
|
||||||
|
Mục đích: tìm xem có dataset công khai nào đủ điều kiện cho một field test **có sức mạnh thống kê**, khác với F3 (4 giếng) và Volve (6 giếng). Nguồn: tra cứu web ngày 29/10/2026. Phần lớn số liệu bên dưới **chưa kiểm trên dữ liệu thật**: [W] = theo nguồn web, chưa kiểm; [KT] = đã kiểm trong repo.
|
||||||
|
|
||||||
|
## 1. Tiêu chí (rút từ bài học F3 và Volve)
|
||||||
|
|
||||||
|
| Mã | Tiêu chí | Vì sao | Bài học |
|
||||||
|
|---|---|---|---|
|
||||||
|
| Q1 | Giấy phép cho phép công bố, tải được | Bắt buộc | |
|
||||||
|
| Q2 | Seismic 3D post-stack (miền thời gian, hoặc miền sâu kèm mô hình vận tốc) phủ các giếng | Bài toán | |
|
||||||
|
| Q3 | **Đủ nhiều giếng test.** Mục tiêu sơ bộ ≥ 15–20 giếng đủ chuẩn, tốt hơn ≥ 30. Con số chính xác lấy từ T3 (`pivot-theory-benchmark.md`) | Power | F3: chênh giữa phương pháp 0.016 p.u., chênh giữa seed 0.13 p.u. |
|
||||||
|
| Q4 | Nhãn porosity **không suy ra từ sonic** (density/neutron/core) trong cửa sổ seismic | Tránh PHIE = f(DT) | F3: 3/4 giếng là hàm của DT [KT] |
|
||||||
|
| Q5 | **Time–depth độc lập** (checkshot/VSP) ở các giếng test | Tham chiếu chấm điểm không phải point tie; ước lượng σ_a (rủi ro chính của H2a) | F3: marker không phải checkshot; σ_a không nhận dạng được |
|
||||||
|
| Q6 | **Có khả năng có kỹ năng ở giếng blind**: giếng dày so với độ dài tương quan ngang; chênh mức porosity giữa giếng không trội | Không có kỹ năng thì không có power | Volve: hằng số thắng mọi mạng; PHIF chênh 8.5–17 p.u. giữa giếng [KT] |
|
||||||
|
| Q7 | Giếng đứng hoặc có trajectory | Trích nhãn đúng vị trí | Volve phải dựng trajectory từ Compass |
|
||||||
|
|
||||||
|
## 2. Ứng viên
|
||||||
|
|
||||||
|
| Dataset | Q1 giấy phép | Q2 seismic | Q3 giếng | Q4 nhãn | Q5 TD độc lập | Q6 kỹ năng | Đánh giá |
|
||||||
|
|---|---|---|---|---|---|---|---|
|
||||||
|
| **Teapot Dome (NPR-3), Wyoming** | Public domain (DOE/RMOTC), phải ghi nguồn; S3 open.source.geoscience [W] | 3D post-stack migrated, 2 ms, ~345 × 188 trace [W] | ~900 giếng có log; ~26 có cả sonic + density; Moon et al. (2016) dùng 64 giếng cho Second Wall Creek, giữ 39 làm validation [W] | Density/neutron, log cũ, cần QC [W] | **Chưa xác nhận**; một nghiên cứu tie nói không có checkshot/VSP [W] | Tốt: giếng rất dày, onshore, mục tiêu nông [W] | **Ứng viên mạnh nhất về Q3, Q6.** Yếu ở Q5 |
|
||||||
|
| **Groningen (mô hình tĩnh NAM)** | Mở trên YoDa/EPOS-NL, báo EPOS-NL, trích NAM (2020) [W] | PSDM (miền sâu), dưới muối Zechstein [W] | 371 giếng, > 6000 log, top của 12 zone Rotliegend [W] | Nhiều khả năng có density [W] | Checkshot có thể có trên NLOG, chưa kiểm [W] | Trung bình: nhiều giếng lệch theo cụm, ảnh dưới muối | **Mạnh về Q3.** Phải chỉnh bài toán sang miền sâu; định dạng Petrel/RESCUE |
|
||||||
|
| **NLOG offshore Hà Lan** (khảo sát DEF Z3FUG2012A; dự án Petrel EPOS-NL) | Tải miễn phí; điều khoản chính xác chưa kiểm [W] | DEF 6000–8000 km²; EPOS-NL có 280 cube 3D [W] | EPOS-NL: 6590 giếng, 4752 composite log [W] | Phải tự tính porosity từ RHOB | Một số giếng có TD số [KT ở F3] | Chưa biết | Trong footprint F3: 38 borehole nhưng chỉ thêm được 2 giếng dùng được, vì log bắt đầu dưới cửa sổ nông [KT]. Với DEF phải đổi sang mục tiêu sâu hơn. Cần kiểm kê |
|
||||||
|
| **Stratton (BEG), Texas** | Mở trên S3, ghi nguồn BEG [W] | 3D land, Frio fluvial, ~7.5 mi² [W] | Có log; số giếng chưa xác nhận [W] | Chưa rõ | **Có VSP** ở giếng hiệu chỉnh [W] | Tốt nếu giếng dày | Ứng viên phụ: có TD độc lập nhưng diện tích nhỏ, N chưa rõ |
|
||||||
|
| Boonsville (BEG), Texas | **Trả phí** (bản số 145 USD), điều khoản phân phối lại chưa rõ [W] | 3D, 5.5 mi² [W] | 38 giếng [W] | Chưa rõ | Chưa rõ | Tốt | Khó làm benchmark tái lập vì không tải tự do |
|
||||||
|
| Poseidon, Browse Basin | CC BY (3.0 AU hoặc 4.0, nguồn mâu thuẫn) [W] | 3D ~2900 km² (TGS MDIO trên AWS) [W] | ~8 giếng trong cube; log/VSP qua NOPIMS [W] | Có thể có | NOPIMS có VSP [W] | Kém: giếng thăm dò thưa, sâu | **Lặp lại vấn đề của Volve** (N nhỏ) |
|
||||||
|
| Taranaki, NZ (NZP&M) | Open-file [W] | Nhiều 3D (Pohokura...) [W] | Chưa xác nhận | Chưa rõ | Chưa rõ | Chưa rõ | Cần kiểm kê; chưa đủ thông tin |
|
||||||
|
| Volve đầy đủ | CC BY-NC-SA [KT] | ST10010 [KT] | 24 giếng, ~12 có D/S/N [W] (P4 dùng 6) | PHIF theo density [KT] | Chỉ 2 giếng có checkshot [KT] | **Kém** (đã chứng minh) [KT] | Không đề xuất: dữ liệu đã thấy, P4 cấm thiết kế lại, N vẫn nhỏ |
|
||||||
|
| Penobscot / Kerry | Mở | 3D | 2 / 1 giếng | | | | Loại (Q3) |
|
||||||
|
| Diskos (Na Uy) / NDR (Anh) | Thành viên đại học miễn phí (Diskos); giấy phép OGA (NDR); **không phân phối lại** [W] | Rất nhiều | Rất nhiều | | | | Không phải "public dataset": người khác không tái lập được |
|
||||||
|
| Namorado (ANP, Brazil) | Cấp cho đại học [W] | 3D chưa xác nhận | 56 giếng LAS [W] | | | | Truy cập không chắc với đơn vị ngoài Brazil |
|
||||||
|
|
||||||
|
Không tìm thấy benchmark chuẩn nào cho seismic → porosity có nhiều giếng blind dùng chung [W].
|
||||||
|
|
||||||
|
## 3. Kết luận
|
||||||
|
|
||||||
|
1. **Chưa có dataset nào được xác nhận đạt cả 7 tiêu chí.** Điểm nghẽn là Q5: dataset nhiều giếng (Teapot Dome, Groningen) chưa xác nhận có checkshot ở đủ giếng test; dataset có VSP (Stratton, Poseidon, Volve) thì ít giếng hoặc N chưa rõ.
|
||||||
|
2. **Teapot Dome** là ứng viên tốt nhất cho Q3 và Q6. Đây cũng là chỗ duy nhất có tiền lệ dùng hàng chục giếng validation. Nếu không có checkshot, vẫn có thể chấm bằng point tie, nhưng khi đó T3 phải tính cả sai số của tham chiếu.
|
||||||
|
3. **Groningen** là ứng viên thứ hai: N lớn, nhưng miền sâu và dưới muối làm bài toán khác hẳn D2/F3.
|
||||||
|
4. **Không cái nào làm kịp 31/10.** Mỗi dataset cần kiểm kê (1–2 ngày), dựng nhãn và time–depth, một protocol mới khóa trước khi chạy (P6, không đụng P3/P4), rồi mới chạy.
|
||||||
|
|
||||||
|
## 4. Đề xuất
|
||||||
|
|
||||||
|
- **Trong bài hiện tại:** không thêm field test mới. Mục "Detectability" (T3) nêu cụ thể dataset public nào có thể đạt ngưỡng N (Teapot Dome, Groningen) như một khuyến nghị có căn cứ.
|
||||||
|
- **Bước tiếp theo, nếu muốn có field test thật:**
|
||||||
|
1. Chạy T3 trước để có con số N cần thiết, thay cho mức sơ bộ 15–20 ở Q3.
|
||||||
|
2. Kiểm kê Teapot Dome (1 ngày): đếm giếng có density/neutron trong cửa sổ seismic, giếng có sonic để tie, checkshot/VSP, khoảng cách giếng, và tìm xem có checkshot trong kho RMOTC không.
|
||||||
|
3. Kiểm kê Groningen song song nếu Teapot Dome trượt Q5.
|
||||||
|
4. Nếu đạt: pre-register **dự đoán của T3** (power, tỉ lệ cải thiện kỳ vọng) trên dataset mới trước khi chạy. Khi đó field test kiểm chứng lý thuyết power chứ không chỉ kiểm phương pháp, khớp với hướng theory + benchmark.
|
||||||
|
- **Lựa chọn rẻ hơn cho trục "simulator khác":** dataset tổng hợp độc lập với D2 (SEAM Phase I có log tổng hợp [W]; Stanford VI-E). Có warp thật, nên trả lời giới hạn "cùng simulator" của benchmark (S2). Giấy phép chưa kiểm.
|
||||||
|
|
||||||
|
## Nguồn
|
||||||
|
|
||||||
|
- Teapot Dome: [ahay.org, Teapot dome dataset](https://www.ahay.org/RSF/book/tccs/welllogs/paper_html/node2.html); [SEG wiki, scavenger hunt](https://wiki.seg.org/wiki/User:Azizuddin/Scavenger_hunt); [Oil IT 2005](https://oilit.com/HTML_Articles/2005_4_22.php); [Moon et al. 2016 (KIOST)](https://sciwatch.kiost.ac.kr/handle/2020.kiost/2160)
|
||||||
|
- Stratton: [SEG wiki](https://wiki.seg.org/wiki/Stratton_3D_survey); [BEG store](https://store.beg.utexas.edu/cd-rom-sets/2120-sw0003.html)
|
||||||
|
- Boonsville: [BEG store SW0007](https://store.beg.utexas.edu/seminars-and-workshops/2216-sw0007.html)
|
||||||
|
- Poseidon: [AWS Registry](https://registry.opendata.aws/tgs-opendata-poseidon); [NOPIMS](https://www.ga.gov.au/nopims/access-and-help2)
|
||||||
|
- NLOG/EPOS-NL: [NLOG 3D download](https://www.nlog.nl/en/nieuws/new-free-3d-seismic-data-download-map); [DEF survey](https://www.nlog.nl/en/nieuws/additional-north-sea-data-def-survey); [EPOS-NL data](https://www.nlog.nl/en/epos-nl-data)
|
||||||
|
- Groningen: [YoDa](https://public.yoda.uu.nl/geo/UU01/1QH0MW.html); [GeoExpro](https://geoexpro.com/static-model-giant-groningen-field-publicly-available/)
|
||||||
|
- Volve: [Frontiers 2020](https://www.frontiersin.org/articles/10.3389/feart.2020.00285/pdf)
|
||||||
|
- Diskos: [Sodir membership](https://www.sodir.no/en/diskos/About-us/membership/); NDR: [NSTA](https://www.nstauthority.co.uk/data-and-insights/data/themes/seismic/)
|
||||||
|
- Taranaki: [NZP&M geodata](https://geodata.nzpam.govt.nz/survey/3095909085)
|
||||||
|
- Namorado: [SBGF 2009](https://sbgf.org.br/mysbgf/eventos/expanded_abstracts/11th_CISBGf/1454_evt_6year_2009.pdf)
|
||||||
|
- SEAM: [SEG SEAM open data](https://seg.org/seam/open-data/)
|
||||||
95
docs/research/p4-exploratory.md
Normal file
95
docs/research/p4-exploratory.md
Normal file
@@ -0,0 +1,95 @@
|
|||||||
|
# P4x — exploratory model variants on Volve (post hoc)
|
||||||
|
|
||||||
|
> **Dropped on 2026-10-29** (decision 5 of the Pivot 1 record, `docs/plan.md` §12 item 22). P4x is not summarised, cited or extended; V3 is not run. The job `exploratory/run_p4x.sh` that was running on cuda:0 (560/921 at 03:43 UTC) was stopped at 670/921 (about 04:05 UTC) and killed to free the GPU; the B3d-Sa stage and V3 never ran. A partial summary in `outputs/p4x/summary/` (04:07 UTC), generated before this decision was seen, has been deleted. The remaining output is unused, and Section 6 stays empty. `exploratory/` and `outputs/p4x/` remain on disk as a record only. The text below is kept unchanged as the pre-run declaration.
|
||||||
|
|
||||||
|
Created: 2026-10-29T02:40Z (09:40 +07:00), before any P4x training run, trend fit or P4x metric.
|
||||||
|
Status: **exploratory and post hoc**. Designed after the locked P4 result (`configs/protocol_volve.yaml`, gate G-D:
|
||||||
|
no blind-well skill, M2-Sa and B3b indistinguishable) was known, and motivated by a diagnosis of that result that
|
||||||
|
used outer-test labels (per-well bias of 3.4–5 p.u. with bias-removed RMSE close to the label SD). Nothing here
|
||||||
|
changes G-D, the P4 verdict or any locked protocol. No result here can support a claim listed in `docs/plan.md`
|
||||||
|
§10 or a confirmatory statement in the paper; at most it can be reported as an exploratory observation with this
|
||||||
|
status attached.
|
||||||
|
|
||||||
|
## 1. Purpose
|
||||||
|
|
||||||
|
1. Does a backbone with real blind-well skill on Volve exist within this data (same wells, inputs, labels, folds),
|
||||||
|
and if it does, does a gap between RML (M2-Sa) and the point tie (B3b) appear once there is skill?
|
||||||
|
2. If no variant has skill, what does the pattern of failures say about why (between-well level offset versus
|
||||||
|
within-well shape)?
|
||||||
|
|
||||||
|
## 2. Fixed elements (identical to locked P4)
|
||||||
|
|
||||||
|
- Six wells, label PHIF, main window 2400–2900 ms, 3×3 patch inputs along the deviated path, primary scoring
|
||||||
|
reference `calibrated`.
|
||||||
|
- σ_a = 7 ms only; registration banks reused read-only from `outputs/p4/registration/*_sa7.npz` (no new
|
||||||
|
registration).
|
||||||
|
- Nested folds of `ml_porosity.volve.folds` (schemes lowo and slot, 22 distinct inner training sets), seeds 0–4.
|
||||||
|
- Budget selection by inner-validation MSE only, inner models ensembled at the selected budget on the outer test
|
||||||
|
input (blind key T_out), then the five seeds (moment-matched Gaussian mixture): the unchanged
|
||||||
|
`ml_porosity.volve.evaluation.neural_predictions` code, called with an in-memory method list.
|
||||||
|
- Methods per variant: B3b and M2-Sa (required), B3d-Sa (run after the two required methods of every variant;
|
||||||
|
if not finished it is reported as not run).
|
||||||
|
- Locked code under `ml_porosity/` is imported read-only; P4x code lives in `exploratory/` (outside the P4 code
|
||||||
|
lock). Outputs go to `outputs/p4x/`.
|
||||||
|
|
||||||
|
## 3. Variants (complete list; frozen at creation time)
|
||||||
|
|
||||||
|
**V0 — reproduction.**
|
||||||
|
(a) Re-select and re-score the locked P4 trajectories (`outputs/p4/train`, σ_a = 7) through the P4x harness. The
|
||||||
|
combined-ensemble RMSE of B3b, B3d-Sa and M2-Sa per scheme and well must equal `outputs/p4/summary/metrics.csv`
|
||||||
|
within 1e-6. (b) Retrain seed 0 of B3b and M2-Sa for all 22 training sets through the P4x training path
|
||||||
|
(unmodified `train_trajectory`, cuda:0) and report the maximum absolute difference of the per-budget predictions
|
||||||
|
from the stored P4 trajectories. A non-zero difference from GPU non-determinism is reported, not hidden.
|
||||||
|
|
||||||
|
**V1a — velocity-trend residual.** Trend v(t) = a + b·V(t), where V is the 2011 TTI PSDM instantaneous interval
|
||||||
|
velocity (`data/Volve/Seismic/ST10010/Velocities/ST10010ZC11-MIG-VEL...segy`; depth domain, 20 m samples, 50 m
|
||||||
|
lateral grid), sampled trilinearly at the (inline, crossline, TVDSS) of each time sample of the path. Path: the
|
||||||
|
reference path for training wells, the blind path of key K for every other target; MD→TVD from the public survey
|
||||||
|
by linear interpolation, TVDSS = TVD − KB. a, b by ordinary least squares on all labelled samples of the training
|
||||||
|
wells of the trajectory (B3b bank labels, paired with V on the reference path at the same time sample). The network
|
||||||
|
(unchanged CNN-GRU, 64 channels, same loss, optimiser, budgets, seeds) learns the residual: targets
|
||||||
|
(Y_member − v)/s0 with s0 the P4 normalisation SD of the set; prediction μ = v + s0·μ_net, σ = s0·σ_net. The trend
|
||||||
|
is a function of the input location only, so it is the same for every bank member and method.
|
||||||
|
|
||||||
|
**V1b — TWT-trend residual.** As V1a with v(t) = a + b·t (two-way time in ms), OLS on the same training labels.
|
||||||
|
|
||||||
|
**V2a — narrow CNN-GRU.** The P4 architecture with 8 instead of 64 channels; everything else as P4 (no trend).
|
||||||
|
|
||||||
|
**V2b — linear-Gaussian model.** μ from one Conv1d over the 9 patch channels with kernel 9 (±16 ms) and a bias;
|
||||||
|
a single learned scalar σ (homoscedastic, softplus). 83 parameters, no dropout. Trained with the same masked bank
|
||||||
|
loss (M2-Sa: log-sum-exp over the 64 posterior members with λ = 1/τ_c; B3b and B3d-Sa: single-member masked
|
||||||
|
Gaussian NLL), Adam lr 0.005, gradient clip 5, same budgets, selection and seeds. This is the "ridge-like"
|
||||||
|
low-capacity model; a closed-form ridge is not used because it cannot be trained on the M2-Sa bank likelihood.
|
||||||
|
|
||||||
|
**V3 (optional) — V1a trend + V2b residual model.** Run only if V0–V2 finish by 05:30Z; otherwise reported as
|
||||||
|
not run.
|
||||||
|
|
||||||
|
**Reference predictors without training (context only).** Fitted on the outer training wells (B3b labels) and
|
||||||
|
applied to the outer test well along its blind path T_out: T0 constant (pooled mean, σ = pooled SD); T1a velocity
|
||||||
|
trend; T1b TWT trend (σ = residual SD of the fit).
|
||||||
|
|
||||||
|
## 4. Metrics
|
||||||
|
|
||||||
|
Per scheme (lowo, slot), per outer test well, per method, combined ensemble, primary reference: RMSE, bias
|
||||||
|
(mean of prediction − reference), |bias|, bias-removed RMSE (SD of the error), PCC, R² (relative to the test
|
||||||
|
well's own mean), coverage80 and coverage90, label SD of the test well (population SD on its labelled samples).
|
||||||
|
Macro = unweighted mean over the six wells. RML–point gap: M2-Sa − B3b in RMSE and bias-removed RMSE, per well
|
||||||
|
and macro, and the number of wells where M2-Sa < B3b. Porosity units (fraction × 100).
|
||||||
|
|
||||||
|
Blind-well skill (declared criteria): a variant/method/scheme has skill if its macro R² > 0, or if its macro
|
||||||
|
bias-removed RMSE is at most 0.9 × the macro label SD (a constant prediction gives exactly 1.0 × label SD).
|
||||||
|
Both are reported with the number of wells that meet each criterion per well.
|
||||||
|
|
||||||
|
## 5. Rules
|
||||||
|
|
||||||
|
- Outer-test labels are read only by scoring, after every prediction is fixed. Trend coefficients use the
|
||||||
|
training wells of the trajectory (or the outer training wells for T0/T1); the velocity cube is seismic-derived
|
||||||
|
and available at every location. Budgets are chosen by inner validation only.
|
||||||
|
- Every variant listed above that is started is reported, including failures and partial runs. No variant is
|
||||||
|
chosen, dropped or re-tuned using outer-test metrics. A variant added after results are seen will be labelled
|
||||||
|
as such with its time.
|
||||||
|
- No p-values (six wells, correlated samples).
|
||||||
|
|
||||||
|
## 6. Results
|
||||||
|
|
||||||
|
(Appended after the runs.)
|
||||||
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.
|
||||||
245
docs/research/pivot-theory-benchmark.md
Normal file
245
docs/research/pivot-theory-benchmark.md
Normal file
@@ -0,0 +1,245 @@
|
|||||||
|
# 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). 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**.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 0. Tóm tắt
|
||||||
|
|
||||||
|
1. **Phần đứng được** của đề tài là lý thuyết (Mệnh đề 1, 2; Bổ đề 1–5) và hai kết quả synthetic đã pre-register và đạt (H1; H2a, H2b của P2r). Phần **không đứng được** là mọi claim về field và về calibration.
|
||||||
|
2. Hai field test không bác bỏ phương pháp. Chúng **không có sức mạnh thống kê** để phát hiện hiệu ứng cỡ 10–20% khi mạng không có kỹ năng ở giếng blind (F3: band PCC ≤ 0.22; Volve: R² < 0 với mọi phương pháp, hằng số thắng mọi mạng). Đây là một kết quả có thể **chuyển thành lý thuyết** (mục 2.1, T3).
|
||||||
|
3. Lỗ hổng lý thuyết lớn nhất: **cơ chế của lợi ích H2b chưa được giải thích**. Ở 7/8 ô rộng, lợi ích vượt cận khử mờ 1/B(σ_post) của Mệnh đề 1. Giải thích được điều này là đóng góp lý thuyết mới quan trọng nhất của bài mới (T2). *(Cập nhật 29/10: 1/B(σ_post) là cận quần thể ρ* dưới cấu trúc sai số classical, còn tie trung bình posterior gần cấu trúc Berkson; tính cận tại sai số warp thì vẫn vượt ở 6/8 ô rộng. Bài mục 4.3 và 6.3; `docs/theory.md` mục 1.4 và 6.)* *(Sửa lần hai 29/10: nhận định "vượt cận" chỉ đúng với cận classical. Với cận Berkson, tính post hoc, chỉ 3/8 ô vượt tại σ_post (cả ba ở c = 1) và tối đa 1/8 tại sai số warp. Lý do là méo nằm quanh 70 Hz, nơi hai cấu trúc khác nhau nhiều. Câu hỏi của T2 vì vậy là: 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. Xem `docs/plan.md` §12 ý 24.)*
|
||||||
|
4. Benchmark D2 đã có nhưng **chưa thành benchmark**: lưới phase diagram chưa đầy, các trục stress của plan §5.5 (rock physics sai, wavelet sai, σ_b) chưa chạy, chưa đóng gói, chưa có luật so sánh cho người ngoài.
|
||||||
|
5. Hạn 31/10/2026 **không đủ** cho pivot đầy đủ. Mục 4 chia hai mức: mức A (viết lại khung bài + các mệnh đề rẻ + phân tích power từ số liệu đã có) làm kịp 31/10; mức B (lấp lưới, trục stress, thí nghiệm cơ chế, đóng gói benchmark) cần 1–2 tuần nữa. Ngày là việc của người dùng quyết. *(Cập nhật: người dùng chọn mức B, hạn 14/11/2026; mục 6. Mức A xong ngày 29/10.)*
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 1. Kiểm kê bằng chứng
|
||||||
|
|
||||||
|
### 1.1 Bằng chứng dương (đã pre-register, đạt; giữ nguyên trong bài mới)
|
||||||
|
|
||||||
|
| # | Kết quả | Số liệu | Nguồn |
|
||||||
|
| --- | --- | --- | --- |
|
||||||
|
| D1 | **Mệnh đề 1 (blur)**: predictor tối ưu MSE dưới misregistration = m tích chập với p_δ; hệ quả cận std ratio, PCC trong băng; L_Var chỉ chỉnh biên độ | Chứng minh dưới (A1) δ ⊥ (X, y) | `docs/theory.md` §1; `paper/sections/04_theory.tex` |
|
||||||
|
| D2 | **H1** kiểm chứng định lượng Mệnh đề 1 | r(σ) = 1.009 / 1.009 / 1.007 / 1.093 tại σ = 4 / 8 / 16 / 32 ms; chỉ trên dải 6.8–22.5 Hz | `outputs/p2/h1/` |
|
||||||
|
| D3 | **Mệnh đề 2 (nhận dạng)**: không anchor thì dịch chung của mạng và warp là ridge; sd(β) ≈ σ_a/√ΣK | Chứng minh dưới (B) | `docs/theory.md` §2 |
|
||||||
|
| D4 | **H4** (anchor là cần thiết) | Bỏ anchor: warp RMSE 3.15 → 31.1 ms (×9.9), band RMSE 0.735 → 1.398 p.u. | P2 |
|
||||||
|
| D5 | **Bổ đề 1–5**: point tie, hard-min, soft-min, soft-DTW, DILATE là trường hợp riêng của RML_λ; có unit test | Chính xác | `docs/theory.md` §4; `tests/test_losses.py` |
|
||||||
|
| D6 | **H2a** (P2r): nhãn tại warp trung bình của posterior SMC hơn point tie tốt nhất | c = 1: R10 0.857 / 0.782; R0 0.888 / 0.888; Rm5 0.915 / 0.923 (N = 4 / 16). Phần lớn lợi ích đã có ở c = 0 (macro 0.81 / 0.85 / 0.88) | `outputs/p2r/summary/verdict.json` |
|
||||||
|
| D7 | **H2b** (P2r): RML trên bank hơn nhãn trung bình khi posterior rộng, tăng theo σ_post | N = 16: 8/8 ô rộng đạt, ρ = −0.85, ô hẹp 0.996 | như trên |
|
||||||
|
| D8 | **Nhánh σ_a**: lợi ích H2a biến mất khi σ_a sai ×0.5 hoặc ×2 | 3.5 ms: 0.977 / 1.141; 14 ms: 0.985 / 0.928; 0/2 ô | như trên |
|
||||||
|
| D9 | **P2 (G-B trượt)** là một kết quả về registration: posterior anchor + trọng số IS trên 64 mẫu không co về warp thật (3.25 ms, ngang B3c 3.85 ms); SMC co về 0.56 ms | Đã pre-register, báo cáo như ra | P2, P2 diag |
|
||||||
|
| D10 | **Audit F3** (C4): PHIE = f(DT) chính xác ở 3/4 giếng; density dự đoán ở 2 giếng; marker không phải checkshot độc lập; TD lệch 14–66 ms | [KT] | plan §1.2 |
|
||||||
|
| D11 | **Bộ sinh D2** hiệu chỉnh theo F3 (horizon thật, rock physics F3, wavelet F3, prior warp fit trên anchor F3) với warp thật đã biết | 8 realization × 5 regime | `ml_porosity/data/synth_d2.py`, `configs/d2_synth_p2r.yaml` |
|
||||||
|
| D12 | **Posterior tie SMC** (tempering theo ACF, ước lượng pha, tiêu chí ổn định 0.5 ms) | P = 1024 | `ml_porosity/registration/smc_torch.py` |
|
||||||
|
|
||||||
|
### 1.2 Bằng chứng âm (phải giữ trong bài, chuyển thành "phạm vi")
|
||||||
|
|
||||||
|
| # | Kết quả | Số liệu |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| A1 | **H3 bác bỏ**, mọi ensemble under-cover, **tệ hơn khi nhãn tốt hơn** | cov90 ở R10, c = 1, N = 16: B5 0.79; M2-Sa-ens 0.58; Oracle-ens 0.48 |
|
||||||
|
| A2 | **G-C trượt** (F3): cải thiện 1/4 giếng; coverage 0.524 / 0.609 | M2-Sa 1.272 so với B3c-R 1.256 p.u.; chênh giữa seed tới 0.13 p.u. (8× khoảng cách); band PCC ≤ 0.22 với mọi mạng; chỉ B4b (1.211) thấp hơn mốc "không có nội dung băng" (1.224); B0a trend thắng mọi mạng về RMSE tổng (2.48 p.u.) |
|
||||||
|
| A3 | **G-D trượt** (Volve): 2/6 và 3/6 giếng; cov90 0.47–0.48 | R² −0.84 đến −1.71 với mọi phương pháp; hằng số tại trung bình giếng train (6.03 / 6.59) thắng mọi mạng; trend theo TWT (P4x, T1b) còn thấp hơn (5.37 / 5.83); mức PHIF giữa giếng chênh 8.5–17 p.u. |
|
||||||
|
| A4 | σ_a **không xác định được** trên F3: type-II ≈ 0.4 ms (coi marker chính xác), spread marker–horizon 7 ms; LOAO cho z² trung bình 0.21 (prior quá rộng) | F3 nằm ở hai đầu trục σ_post tùy σ_a: 0.6 ms hoặc 2.5–3.4 ms |
|
||||||
|
| A5 | **Pha wavelet không xác định được** trên F3 (6 ước lượng trải 214°, log-evidence chỉ đổi 1–5 nats) nhưng xác định tốt trên Volve (43°) | registration không phải nút thắt của Volve |
|
||||||
|
| A6 | Ablation F3: 9/11 biến thể có band RMSE thấp hơn M2-Sa; kích thước bank (1/8/64/256) không có ảnh hưởng; bỏ anchor lại *giảm* band RMSE (1.247) | khớp với giả thuyết "điểm số băng trên F3 không nhạy với timing của nhãn", chưa kiểm |
|
||||||
|
| A7 | Thứ tự phương pháp **đảo** giữa synthetic và F3: B4a–d (anchor-free) kém B3b 38–53% ở P2 nhưng thấp hơn mọi point tie trên F3 | chưa giải thích |
|
||||||
|
|
||||||
|
### 1.3 Đọc lại chuỗi suy luận: thất bại ở đâu
|
||||||
|
|
||||||
|
Chuỗi claim gốc: *(i)* tie không chắc chắn → *(ii)* nhãn bị blur (MĐ1) → *(iii)* posterior tie tốt + marginalize sửa được (H2a, H2b) → *(iv)* trên field cũng vậy (G-C, G-D) → *(v)* bất định truyền sang dự đoán (H3).
|
||||||
|
|
||||||
|
- (i), (ii): đứng vững, có cả chứng minh lẫn kiểm chứng định lượng.
|
||||||
|
- (iii): đứng trên synthetic, **có điều kiện** (σ_a đúng, posterior đủ rộng, N đủ lớn). Nhưng *cơ chế* của phần (iii)-H2b chưa rõ (mục 2.1 T2).
|
||||||
|
- (iv): **không có sức mạnh thống kê.** Trên F3 khoảng cách 0.016 p.u. so với dao động seed 0.13 p.u.; trên Volve mọi mạng thua hằng số. Field test không nói gì về (iii) theo cả hai chiều. Điều đáng nói: *điều này có thể tính trước* từ chính benchmark (mục 2.1 T3), và việc đó chưa làm.
|
||||||
|
- (v): bác bỏ, và hướng bác bỏ (nhãn tốt hơn → coverage tệ hơn) là một hiện tượng cần lý thuyết (T4), không chỉ là một thất bại.
|
||||||
|
|
||||||
|
Kết luận: bài hiện tại yếu vì nó được *đóng khung* như bài phương pháp có field validation, trong khi bằng chứng thật nằm ở (i)–(iii). Pivot 1 là đóng khung lại cho đúng với bằng chứng, không phải thay đổi bằng chứng.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 2. Vấn đề tồn đọng
|
||||||
|
|
||||||
|
### 2.1 Lỗ hổng lý thuyết (T1–T8)
|
||||||
|
|
||||||
|
Xếp theo mức quan trọng cho bài mới. Cột "chi phí" là ước lượng [ĐX].
|
||||||
|
|
||||||
|
| ID | Vấn đề | Hiện trạng | Hướng giải | Chi phí |
|
||||||
|
| --- | --- | --- | --- | --- |
|
||||||
|
| **T2** | **Cơ chế lợi ích của RML trên bank (H2b).** Ở 7/8 ô rộng (N = 16; c = 1 và 2), tỉ số M2-Sa/B3d-Sa nằm *dưới* cận khử mờ 1/B(σ_post); ví dụ Rm5 c = 1: cận cho phép 0 lợi ích (1.000), đo được 0.982. Chỉ R10tb c = 2 nằm trong cận (0.667 so với 0.634). Hai giả thuyết chưa tách: (a) tăng cường nhãn (regularization), (b) warp trung bình lệch khi posterior đa mode. | Thảo luận trong paper nêu "mechanism is open"; thí nghiệm đối chứng "bank nhiễu ngẫu nhiên cùng độ rộng" **chưa chạy** | Giả thuyết thứ ba, chưa có trong paper, đáng kiểm nhất: **(c) tái đăng ký ngầm (implicit re-registration).** Với λ hữu hạn, Bổ đề 3 cho gradient = NLL có trọng số r = softmax(log π + λℓ). Mạng *dùng chung* giữa các giếng đóng vai trò prior về tính nhất quán liên giếng; responsibilities dồn về các hạt mà nhãn khớp với dự đoán nhất quán đó, tức posterior tie được *tinh chỉnh lại* bằng thông tin từ các giếng khác. Kiểm: (1) tính warp RMSE có trọng số r so với warp RMSE của τ̄ trên P2r; nếu r-weighted < τ̄ thì (c) đúng; (2) đối chứng (a): bank = τ̄ + nhiễu GP cùng σ_post, không mang thông tin; (3) đối chứng (b): tách ô posterior đa mode. Viết thành **Mệnh đề 3**: điều kiện để fixed point của RML_λ có responsibilities tập trung gần warp thật (kiểu EM với prior chia sẻ). *(Cập nhật 29/10: trong bài, (c) là Nhận xét 1, chưa thành mệnh đề; số "Mệnh đề 3" ở đây không phải Mệnh đề 3 của bài, vốn là hai cấu trúc sai số. Tính cận tại sai số warp RMS của B3d-Sa thì 6/8 ô vượt cận (thêm R10tb c = 1: cận 0.710, đo 0.890); R10tb c = 2 vượt mép lưới blur 6 ms nên cận bị kẹp ở 1/B(6 ms). Nguồn: `outputs/p2r/posthoc/`. Khai báo T2 phải ghi rằng các tỉ số này đã được xem post hoc. **Sửa lần hai 29/10:** với cận Berkson (post hoc; `bound_post_b` trong `outputs/p2r/posthoc/bound.csv`), chỉ 3/8 ô vượt tại σ_post và tối đa 1/8 tại sai số warp. Bài thêm test (iv), kiểm Berkson hay classical bằng hiệp phương sai của offset, và test (v), B3d-Sa ở số vòng lặp của Oracle. 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". Khai báo phải ghi cả các cận (b), b60 và phổ chéo đã xem.)* | Thấp về GPU (bank P2r và budget đã có; mỗi run < 1 phút); trung bình về viết |
|
||||||
|
| **T3** | **Lý thuyết về khả năng phát hiện (power) của một field test.** Với n giếng test, chênh lệch thật Δ, độ lệch seed s, và tham chiếu chấm điểm *bản thân là một point tie* với sai số σ_ref, xác suất mà luật "≥ k/n giếng cải thiện" đạt là bao nhiêu? | Paper chỉ nói định tính ("needs more wells") | Hai phần: (1) **giải tích**: band RMSE đo với tham chiếu lệch δ_ref = RMSE thật ⊕ thành phần do δ_ref, chung cho mọi phương pháp → tỉ số bị kéo về 1 (đã quan sát: dải tham chiếu 0.06–0.15 p.u., khoảng cách 0.016 p.u.); (2) **mô phỏng trên D2**: lấy 4 giếng test, chấm bằng một point tie thay vì warp thật, lặp lại qua realization × seed, đếm tần suất luật G-C đạt khi lợi ích thật là 10–20% (đã biết từ H2a). Kết quả là một **đường cong "cần bao nhiêu giếng"**. Biến hai field test âm thành một kết luận định lượng, có thể tính trước. | Thấp (dùng dự đoán đã lưu `outputs/p2r/train/*/cells/*.npz`; chỉ cần code chấm điểm mới) |
|
||||||
|
| **T4** | **Vì sao nhãn tốt hơn → coverage tệ hơn** (A1). | Chỉ mô tả | Hệ quả trực tiếp của Bổ đề 2 (λ → 0: σ*² hấp thụ Var_π y): head heteroscedastic học *phương sai của nhãn*, không học sai số dự đoán ở giếng mới. Nhãn sạch hơn → σ nhỏ hơn, trong khi sai số epistemic theo không gian (giếng test cách ≥ 1 km) không đổi và seed-ensemble không bắt được. Viết thành **Mệnh đề 4** (hoặc hệ quả): coverage của ensemble seed với head heteroscedastic giảm đơn điệu theo chất lượng nhãn khi sai số không gian trội. Kiểm bằng số liệu H3 đã có (Oracle-ens 0.48 < M2 0.58 < B5 0.79) và tách σ_aleatoric / Var_seed trong các file npz. *(Cập nhật 29/10: thành Mệnh đề 5 của bài, phát biểu qua tỉ số ξ = E s²/E(y − μ)²; phần (a) là đồng nhất thức, (b) và (c) là giới hạn quần thể. T4 post hoc (`scripts/30_t4_coverage.py`): mọi ensemble quá hẹp (ξ 0.19 ở Oracle, tối đa 0.66), và độ dài huấn luyện lẫn với nguồn nhãn, nên "giảm đơn điệu theo chất lượng nhãn" chưa được kiểm.)* | Thấp |
|
||||||
|
| **T8** | **Posterior đa mode (cycle skip)**: ô có lợi ích lớn nhất (R10tb c = 2, 33%) lại bị gắn cờ "unstable". | Loại khỏi bằng chứng chính | Mệnh đề 1 với p_δ hai điểm ±Δ/2 cho P(f) = cos(πfΔ): nhãn trung bình của hai mode lệch nửa chu kỳ **triệt tiêu** băng seismic tại f = 1/(2Δ). Đây là lý do B3d-Sa sụp ở c = 2 và là trường hợp mà bank *được dự báo* hơn hẳn. Viết thành hệ quả rõ ràng, đưa "cycle-skip regime" vào benchmark như một trục có kiểm soát thay vì gắn cờ bỏ. *(Cập nhật 29/10: Hệ quả 3 của bài; phát biểu chính xác ở `docs/theory.md` mục 6.3: hệ số truyền âm trên 1/(2Δ) < |f| < 3/(2Δ).)* | Thấp (lý thuyết); trung bình (ổn định SMC đa mode hoặc chấp nhận báo cáo biến thiên giữa run) |
|
||||||
|
| **T1** | **(A1) bị vi phạm khi tie được ước lượng từ chính seismic X** (δ của τ̄ phụ thuộc X) và trên F3 (nhãn và trục thời gian chung DT). | Chỉ ghi là giới hạn | Mở rộng MĐ1: ŷ*(t) = ∫ p(δ \| X) m(t + δ) dδ, bộ lọc *phụ thuộc X* (không còn LTI). Với posterior hiệu chỉnh tốt, Var(δ \| X) ≈ σ_post(X)², cho đúng cận B(σ_post) đang dùng, nay có phát biểu chặt. **Sửa 29/10:** khi viết ra thì không đúng như vậy. Sai số của tie trung bình posterior gần cấu trúc *Berkson* (độc lập với D), không phải classical, nên nó làm *sắc* predictor (bộ lọc 1/Q), không làm mờ. Bài viết thành Mệnh đề 3 (hai cấu trúc) và Mệnh đề 4 (bank hiệu chỉnh: lợi ích quần thể so với nhãn điểm là bậc bốn theo σ); 1/B(σ_post) chỉ là ρ* dưới cấu trúc (a). Xem `docs/theory.md` mục 1.4 (ghi chú sửa) và mục 6. Trường hợp nhãn–trục chung DT: δ tương quan với ∂y/∂t; viết hệ quả về bias (không chỉ blur). | Thấp–trung bình |
|
||||||
|
| **T7** | **Đánh đổi dịch–pha** trong số hạng tie seismic (MĐ2 chỉ phác thảo). | Nhận xét định tính (43° ở ±30 Hz) | Thông tin Fisher về β từ likelihood tie: I(β) ∝ ∫ (2πf)² S_syn(f) df, trừ phần bị pha hấp thụ. Cho công thức sd(β) theo băng thông và SNR. Giải thích vì sao pha trên F3 không xác định (băng hẹp ở vùng kết hợp 7–23 Hz) mà trên Volve lại xác định. | Trung bình |
|
||||||
|
| **T5** | **Tương tác giữa N (số giếng) và σ_δ**: phase diagram "khi nào registration quan trọng" (C3 gốc) chỉ có một phần. | P2: c × N đủ nhưng posterior kém; P2r: chỉ c ∈ {0,1,2}, N ∈ {4,16} | Lấp lưới (mục 2.2 S1) rồi fit luật thang: band RMSE² ≈ e_oracle²(N) + e_blur²(σ). Kiểm tính cộng. | GPU 1 ngày |
|
||||||
|
| **T6** | λ = 1/τ_c là heuristic; F3 cho λ = 1 hơi tốt hơn; P2 diag ≤ 7% khác biệt. | Không claim | Giữ là heuristic; thêm một ablation λ trên benchmark và một đoạn nối với magnitude adjustment (Pauli 2011, Ribatet 2012; chưa đọc toàn văn). Ưu tiên thấp. | Thấp |
|
||||||
|
| T9 | H1 chỉ kiểm trên 6.8–22.5 Hz; σ = 32 ms lệch 9% chưa rõ nguyên nhân. | Ghi là giới hạn | Thử lại với predictor có công suất ở tần cao hơn (SNR ∞, N = 16, budget lớn) để mở rộng dải kiểm; hoặc chấp nhận và nói rõ. | Thấp |
|
||||||
|
| T10 | Định vị lý thuyết trong literature **label noise / errors-in-variables**: misregistration là nhiễu ở *chỉ số* (index) chứ không ở *giá trị* nhãn; MĐ1 là analog của attenuation bias. | Chưa có trong related work | Thêm một đoạn related work và một nhận xét; nâng tính tổng quát (áp dụng cho core–log depth shift, 4D time shift, nhãn đăng ký ảnh). | Thấp (viết) |
|
||||||
|
|
||||||
|
### 2.2 Lỗ hổng của benchmark (S1–S8)
|
||||||
|
|
||||||
|
| ID | Vấn đề | Hiện trạng | Việc cần làm |
|
||||||
|
| --- | --- | --- | --- |
|
||||||
|
| **S1** | Lưới phase diagram chưa đầy với posterior SMC | P2r: c ∈ {0, 1, 2}, N ∈ {4, 16}, 5 regime | Thêm c = 0.5 (và 1.5), N ∈ {2, 8}; cùng realization 8–15. Hình chính F4 của plan §8 chưa tồn tại ở dạng đầy đủ. |
|
||||||
|
| **S2** | Các trục stress của plan §5.5 **chưa chạy**: rock physics sai mô hình (φ–DT khác giữa train/test), wavelet sai pha/tần số, σ_b, drift sai mô hình (bước nhảy tại Truncation, jitter tần cao) | Bị cắt theo thứ tự cắt phạm vi | Cần sửa `synth_d2.py` (thêm tham số misspec), chạy ở R10 và Rm5, c = 1, N = 16. Đây là phần khiến benchmark "trung thực" thay vì "cùng simulator". |
|
||||||
|
| **S3** | B4a–d (anchor-free) chưa chạy lại trong regime SMC của P2r | Chỉ có ở P2 | Chạy lại để bảng kết quả benchmark đầy đủ một protocol. |
|
||||||
|
| **S4** | Chỉ một backbone trên synthetic | TCN chỉ có ở ablation F3 | Thêm TCN trên 2–3 ô đại diện. |
|
||||||
|
| **S5** | Thí nghiệm cơ chế (T2) | Chưa có | Xem T2. |
|
||||||
|
| **S6** | Nghiên cứu khả năng phát hiện (T3) | Chưa có | Xem T3. |
|
||||||
|
| **S7** | **Đóng gói**: generator + realization cố định (hash) + regime + luật đạt + metric + baseline + hướng dẫn | Code có, nhưng gắn với `scripts/14`, `15`, `18` và protocol nội bộ | Tách thành gói `ml_porosity.benchmark` (hoặc repo riêng), một lệnh sinh dữ liệu, một lệnh chấm, bảng kết quả tham chiếu, giấy phép (horizon F3 là CC BY-SA 3.0), DOI Zenodo. |
|
||||||
|
| **S8** | Ô c = 2 không ổn định giữa các run SMC | Gắn cờ, loại | Hoặc tăng P / nhiều run và báo cáo biến thiên như một phần của benchmark, hoặc định nghĩa "cycle-skip regime" có kiểm soát (đặt Δ mode tường minh). Gắn với T8. |
|
||||||
|
| S9 | Chỉ 2 realization dev (900/901) cho mọi quyết định thiết kế | Ghi là giới hạn | Thêm 2–4 realization dev nếu còn thiết kế mới (S2). |
|
||||||
|
| S10 | Khoảng cách giếng test ≥ 1 km cố định | Một giá trị | Thêm trục khoảng cách (500 m, 1, 2, 4 km) nếu muốn nói về sai số không gian (liên quan T4). |
|
||||||
|
|
||||||
|
### 2.3 Vấn đề field (giữ lại như phạm vi, không giải trong bài mới)
|
||||||
|
|
||||||
|
- F3: nhãn là sonic; F02-1 nhãn khác; marker không độc lập; σ_a và pha không xác định; mạng không có kỹ năng trong băng; tham chiếu chấm điểm là một point tie.
|
||||||
|
- Volve: 16–37 mẫu nhãn mỗi giếng; mức PHIF giữa giếng chênh lớn; không mạng nào có kỹ năng; P4x chỉ xong V0 (tái lập) và các trend tham chiếu, V1–V3 chưa chạy (`outputs/p4x/summary/checks.json`: danh sách method rỗng).
|
||||||
|
- Trong bài mới, hai field case phục vụ hai mục đích: (1) **hiệu chỉnh benchmark** (D2 lấy horizon, rock physics, wavelet, prior drift, σ_a từ F3); (2) **minh họa T3**: field test với 4–6 giếng không phát hiện được hiệu ứng cỡ benchmark. Không dùng để claim gì khác.
|
||||||
|
|
||||||
|
### 2.4 Vấn đề về quy trình và độ tin cậy
|
||||||
|
|
||||||
|
- P2r là pre-registration **sau khi P2 trượt** (deviation đã ghi). `protocol_f3` được tag git *sau* khi chạy (bằng chứng khóa là timestamp tự ghi). Bài mới phải giữ nguyên các ghi chú này.
|
||||||
|
- Pivot 1 có trong plan §9 **trước** mọi field test, nhưng quyết định pivot là **sau** khi thấy kết quả field. Bài phải nói rõ: khung "lý thuyết + benchmark" được chọn sau khi field test trượt; các kết quả synthetic được pre-register trước đó và không đổi.
|
||||||
|
- Nhiều kết quả hiện "descriptive only". Trong bài benchmark, cần tách rõ: kết quả **confirmatory** (H1, H2a, H2b, H4, σ_a arm), kết quả **benchmark reference** (bảng mọi phương pháp), và **exploratory** (T2, T3, S2 nếu thiết kế sau khi xem dữ liệu).
|
||||||
|
- `docs/plan.md` §10 (claim cấm) vẫn áp dụng, nhất là: không gọi kết quả synthetic là "generalization ra field"; không claim calibration.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 3. Hướng mới: bài lý thuyết + benchmark
|
||||||
|
|
||||||
|
### 3.1 Luận điểm trung tâm
|
||||||
|
|
||||||
|
> Sai số đăng ký của nhãn (well tie) là một dạng **nhiễu ở chỉ số thời gian**, khác nhiễu nhãn cổ điển. Nó có hiệu ứng *dự đoán được* lên predictor học được (blur theo hàm đặc trưng của sai số; không nhận dạng được dịch chung nếu không có anchor). Trên một benchmark có warp thật, các cách dùng posterior tie (nhãn trung bình, bank) sửa được một phần, với điều kiện rõ ràng (σ_a đúng, posterior đủ rộng, N đủ lớn), và cơ chế của phần sửa thêm là [kết quả T2]. Cuối cùng, benchmark cho biết **một field test cần bao nhiêu giếng** để phát hiện hiệu ứng đó, và hai field test công khai hiện có nằm dưới ngưỡng ấy.
|
||||||
|
|
||||||
|
Tên làm việc (theo plan §9, Pivot 1): *Label registration error in sparse-well seismic property learning: theory, a registration-aware benchmark, and the limits of field validation.*
|
||||||
|
|
||||||
|
### 3.2 Đóng góp đề xuất
|
||||||
|
|
||||||
|
> *Ghi chú 29/10/2026:* "Mệnh đề 3" và "Mệnh đề 4" ở mục 3, 4 và 6 là đánh số lúc lập kế hoạch. Trong bài: Mệnh đề 3 là hai cấu trúc sai số của tie, Mệnh đề 4 là bank hiệu chỉnh, coverage là Mệnh đề 5, reference lệch là Mệnh đề 6; cơ chế bank (T2) chưa thành mệnh đề, giả thuyết tái đăng ký ngầm là Nhận xét 1.
|
||||||
|
|
||||||
|
| | Đóng góp | Thành phần đã có | Thành phần mới |
|
||||||
|
| --- | --- | --- | --- |
|
||||||
|
| **C1′** | Lý thuyết nhiễu đăng ký | MĐ1 + hệ quả; MĐ2; Bổ đề 1–5; H1 | T1 (δ phụ thuộc X), T2 (cơ chế bank, Mệnh đề 3), T4 (coverage, Mệnh đề 4), T8 (đa mode), T7 (dịch–pha) tùy thời gian |
|
||||||
|
| **C2′** | Benchmark có warp thật, hiệu chỉnh theo F3, với luật đạt pre-registered | D2, 5 regime, SMC posterior, kết quả P2 và P2r | S1 lấp lưới, S2 trục misspec, S3, S4, S8, S7 đóng gói |
|
||||||
|
| **C3′** | Khung loss thống nhất (RML_λ) làm **họ baseline** của benchmark, không phải "phương pháp đề xuất thắng" | Bổ đề 1–5, code | Trình bày lại: bảng phương pháp = các điểm trong không gian (bank, π, λ) |
|
||||||
|
| **C4′** | Lý thuyết và mô phỏng về **khả năng phát hiện** của field test; audit F3 | Số liệu F3, Volve, P4x; audit C4 | T3 (giải tích + mô phỏng trên D2); viết lại hai field case thành một mục "scope" ngắn, bảng chi tiết vào phụ lục |
|
||||||
|
|
||||||
|
### 3.3 Cấu trúc bài (đề xuất)
|
||||||
|
|
||||||
|
1. Introduction: nhiễu đăng ký của nhãn; vì sao khác label noise; C1′–C4′.
|
||||||
|
2. Related work: thêm nhóm label noise / errors-in-variables / misaligned supervision; thêm benchmark papers trong geoscience ML (so sánh cách đánh giá).
|
||||||
|
3. Theory: MĐ1, hệ quả, MĐ2, **Mệnh đề 3 (cơ chế bank)**, **Mệnh đề 4 (coverage)**, hệ quả đa mode; H1.
|
||||||
|
4. Benchmark: thiết kế D2 (nguồn hiệu chỉnh từ F3 → audit F3 chuyển vào đây hoặc phụ lục), các trục, luật đạt, metric, họ phương pháp (RML_λ), oracle.
|
||||||
|
5. Results on the benchmark: registration (P2 vs SMC), H2a, H2b, σ_a, S2 misspec, S1 phase diagram, cơ chế (T2), coverage (T4).
|
||||||
|
6. Detectability and the two field cases: T3; F3 và Volve tóm tắt 1–2 trang, bảng vào phụ lục.
|
||||||
|
7. Discussion: khi nào cần quan tâm registration; khuyến nghị cho field study (đo σ_a, số giếng, tham chiếu chấm điểm); giới hạn (cùng simulator, một backbone, λ heuristic).
|
||||||
|
8. Conclusion; data/code/benchmark availability.
|
||||||
|
|
||||||
|
### 3.4 Venue
|
||||||
|
|
||||||
|
- Phù hợp nhất với "theory + benchmark": *Computers & Geosciences* (mạnh về benchmark/code), *Geophysical Prospecting*, *Journal of Applied Geophysics*. Plan §9 nêu *Frontiers in Earth Science*, *Earth Science Informatics* cho Pivot 1.
|
||||||
|
- Nếu nhấn mạnh lý thuyết tổng quát (T10) có thể cân nhắc venue ML, nhưng lịch không cho phép trong tuần này. Quartile phải tra lại khi nộp [XM].
|
||||||
|
|
||||||
|
### 3.5 Claim vẫn cấm (kế thừa plan §10)
|
||||||
|
|
||||||
|
Không "first"; không gọi synthetic là generalization ra field; không claim calibration; không claim field superiority; không gọi marker là checkshot; không dùng số liệu luận văn làm baseline.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 4. Kế hoạch với hai mức
|
||||||
|
|
||||||
|
### 4.1 Mức A: kịp 31/10/2026 (chỉ viết + tính toán trên số liệu đã có) — xong ngày 29/10/2026
|
||||||
|
|
||||||
|
| Việc | Đầu vào | Ghi chú |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| A1. Viết lại abstract, intro, contributions, discussion, conclusion theo 3.1–3.3 | bản nháp hiện tại | Chuyển F3/Volve thành mục "scope"; bảng chi tiết sang phụ lục |
|
||||||
|
| A2. Viết T1, T4, T8 thành mệnh đề/hệ quả (chứng minh ngắn, đều là hệ quả của MĐ1 và Bổ đề 2) | `docs/theory.md` | Không cần GPU |
|
||||||
|
| A3. T4: tách σ_aleatoric và Var_seed từ `outputs/p2r/train/*/cells/*.npz` để minh họa Mệnh đề 4 | file đã có | Vài giờ |
|
||||||
|
| A4. T3 phần giải tích + phần mô phỏng dùng dự đoán đã lưu của P2r (chấm 4 giếng test bằng tham chiếu point tie thay vì warp thật, đếm tần suất đạt luật G-C) | `cells/*.npz`, nhãn point tie | 1 ngày; cần kiểm xem npz có lưu nhãn point tie của giếng test hay phải dựng lại từ realization |
|
||||||
|
| A5. T10: đoạn related work về label noise / errors-in-variables | — | Cần trích dẫn đúng; kiểm bằng OpenAlex |
|
||||||
|
| A6. Ghi quyết định pivot vào `docs/plan.md` §12 với ngày và lý do; cập nhật `AGENTS.md` | — | Ghi rõ là quyết định sau khi thấy field test |
|
||||||
|
|
||||||
|
**Trạng thái (29/10/2026): A1–A6 xong** (`docs/plan.md` §12 ý 24).
|
||||||
|
- 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).
|
||||||
|
- 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; 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).
|
||||||
|
- 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).
|
||||||
|
|
||||||
|
Mức A cho ra một bản nộp được nhưng benchmark **chưa đầy** (thiếu S1–S3, S7) và cơ chế T2 chỉ ở mức giả thuyết.
|
||||||
|
|
||||||
|
### 4.2 Mức B: thêm 1–2 tuần (GPU + đóng gói)
|
||||||
|
|
||||||
|
| Tuần | Việc | GPU |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| 1 | T2: ba thí nghiệm cơ chế (responsibility-weighted warp error; bank nhiễu ngẫu nhiên đối chứng; tách ô đa mode) trên realization 8–15, 2–3 regime | < 0.5 ngày (bank có sẵn, budget 250) |
|
||||||
|
| 1 | S1: lấp lưới c ∈ {0.5, 1.5}, N ∈ {2, 8} với SMC | ≈ 1 ngày trên 2 GPU (P2r mất vài giờ cho 30 ô; SMC là phần chậm) |
|
||||||
|
| 1 | S3, S4 | < 0.5 ngày |
|
||||||
|
| 2 | S2: sửa generator cho misspec rock physics / wavelet / σ_b / drift; dev trên realization mới 902–905; khóa protocol mới; chạy ở 2 regime | 1 ngày code + 1 ngày GPU |
|
||||||
|
| 2 | S8/T8: regime cycle-skip có kiểm soát | 0.5 ngày |
|
||||||
|
| 2 | S7: đóng gói benchmark, README, hash, Zenodo | 1–2 ngày |
|
||||||
|
| 2 | Viết lại §4–5 theo kết quả; review nội bộ | — |
|
||||||
|
|
||||||
|
Mọi thí nghiệm mới ở mức B phải có **protocol mới** (`configs/protocol_bench.yaml`) khóa trước khi chạy, và ghi rõ là thiết kế sau khi đã thấy P2r. T2 và T3 là **exploratory/explanatory**, không phải confirmatory, trừ khi pre-register trên realization mới (16–23).
|
||||||
|
|
||||||
|
### 4.3 Hạ tầng tái dùng và chi phí
|
||||||
|
|
||||||
|
| Thành phần | Tái dùng | Ghi chú |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| `ml_porosity/data/synth_d2.py` (267 dòng) | S1, S2 (cần thêm tham số misspec) | Generator identical giữa P2 và P2r |
|
||||||
|
| `ml_porosity/registration/smc_torch.py`, `warp_prior.py`, `ties.py` | Toàn bộ | P = 1024, tiêu chí ổn định đã có |
|
||||||
|
| `ml_porosity/losses/rml.py`, `softdtw.py` | Toàn bộ | Bổ đề 1–5 có test |
|
||||||
|
| `scripts/14_diag_posterior.py`, `15_diag_train.py`, `18_summarize_p2r.py` | S1, S3, T2 | Resume theo cell; nhận realization mới khi protocol khớp hash |
|
||||||
|
| `outputs/p2r/posterior/*/*_particles.npz` (bank), `outputs/p2r/train/*/cells/*.npz` (μ, σ từng seed trên giếng test) | T2, T3, T4 | 7.7 GB; mô hình không lưu trọng số, cần train lại cho T2 (rẻ) |
|
||||||
|
| `outputs/p2/h1/` | T9 | — |
|
||||||
|
| GPU | cuda:0 / cuda:1 theo tải | P2 grid 128 ô × 11 phương pháp × 5 seed: 89 phút; SMC P = 1024 ≈ 3.3× P = 256 |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 5. Rủi ro của hướng mới
|
||||||
|
|
||||||
|
| Rủi ro | Mức | Giảm thiểu |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| Reviewer: "benchmark cùng simulator với phương pháp" | Cao | S2 (misspec) là bắt buộc nếu muốn gọi là benchmark; không có S2 thì gọi là "controlled experiment", không gọi là benchmark |
|
||||||
|
| T2 cho kết quả: lợi ích chỉ là regularization (giả thuyết a) | Trung bình | Vẫn là kết quả có giá trị (nói rõ RML là một dạng augmentation có thông tin); không làm bài sụp |
|
||||||
|
| Pivot bị đọc là "HARKing" | Trung bình | Pivot 1 có trong plan §9 trước field test; mọi kết quả synthetic đã pre-register; nói thẳng thời điểm quyết định |
|
||||||
|
| Hạn 31/10 không đủ cho mức B | Chắc chắn | Người dùng chọn: nộp mức A (benchmark chưa đầy, ghi rõ) hoặc dời hạn. *(Đã giải quyết 29/10: mức B, hạn 14/11/2026.)* |
|
||||||
|
| Bản thảo dài gấp khoảng 2,7 lần giới hạn số từ của venue (thêm 29/10: thân bài khoảng 14.750 từ sau A6; C&G khoảng 5.500 từ theo nguồn thứ cấp, chưa kiểm trên trang chính thức) | Cao | Người dùng bỏ lượt rút gọn độ dài ngày 29/10 (plan §12 ý 25); rủi ro vẫn mở, chưa có biện pháp. Nếu sau này có rút gọn thì không bỏ kết quả âm hay deviation đã ghi (plan §9, R9). |
|
||||||
|
| Novelty của phần lý thuyết bị trùng với label-noise literature | Thấp–trung bình | T10: tìm kiếm "misaligned labels / index noise / registration noise regression" trước khi viết; khác biệt là nhiễu ở chỉ số + anchor + vật lý |
|
||||||
|
| Benchmark không ai dùng | Trung bình | S7 làm tử tế: một lệnh sinh, một lệnh chấm, bảng tham chiếu; giấy phép rõ |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 6. Quyết định (chốt 29/10/2026)
|
||||||
|
|
||||||
|
Người dùng chốt ý 1 và 5; ý 2–4 do agent chốt theo bằng chứng (quy ước AGENTS.md: không chờ GVHD). Đã ghi vào `docs/plan.md` §12 ý 22, `AGENTS.md` và `report.html`.
|
||||||
|
|
||||||
|
| # | Việc | Quyết định | Căn cứ |
|
||||||
|
| --- | --- | --- | --- |
|
||||||
|
| 1 | Hạn nộp | **Mức B. Hạn mới: thứ 7, 14/11/2026** (dời 2 tuần). Ngưỡng và luật của mọi gate không đổi; chỉ ngày đổi. | Mức A chỉ cho một "controlled study" chưa đầy lưới; mục 4.2 cần 1–2 tuần GPU và đóng gói. |
|
||||||
|
| 2 | S2 (misspec) | **Bắt buộc, phạm vi hẹp**: ba trục (rock physics sai hệ số; wavelet sai pha và băng thông; σ_b / prior drift sai), hai regime (R10, Rm5), c = 1, N ∈ {4, 16}, realization 8–15, tập phương pháp rút gọn (Oracle, B3c-R, B3d-Sa, M2-Sa). Thiết kế trên dev 902–905; khóa trong `configs/protocol_bench.yaml` trước lần chạy đầu. Nếu đến 10/11 chưa xong S2 thì bài gọi là "controlled synthetic study", không gọi là benchmark. | Rủi ro cao nhất ở mục 5 là "cùng simulator"; không có S2 thì không trả lời được. |
|
||||||
|
| 3 | T2 | **Exploratory / explanatory**, trên realization 8–15 với bank P2r đã có. Khai báo trước khi chạy ở `docs/research/t2-mechanism.md` (cách làm như P4x). Trong bài là "mechanism analysis" kèm Mệnh đề 3 (*ghi chú 29/10: đánh số lúc lập kế hoạch; trong bài, giả thuyết tái đăng ký ngầm là Nhận xét 1, còn Mệnh đề 3 của bài là hai cấu trúc sai số của tie*); không phải gate, không claim confirmatory. Không sinh realization 16–23 cho T2. | Giả thuyết (c) hình thành sau khi thấy H2b; ba thí nghiệm cần lặp; một lượt SMC riêng cho T2 không vừa hai tuần. |
|
||||||
|
| 4 | Venue | **Chính: *Computers & Geosciences*.** Dự phòng: *Geophysical Prospecting*. Quartile tra lại khi nộp [XM]. | C&G nhận bài benchmark kèm code và yêu cầu code/data availability, khớp S7. |
|
||||||
|
| 5 | P4x | **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ữ trên đĩa làm hồ sơ, không xóa. Job `exploratory/run_p4x.sh` (cuda:0) ở 560/921 lúc 03:43 UTC 29/10 khi chốt; lệnh dừng từ phiên agent bị từ chối, nên job tự chạy hết (khoảng 40 phút) và kết quả không dùng. | Không phục vụ bài mới; biến thể chọn sau khi thấy nhãn test. |
|
||||||
|
|
||||||
|
### 6.1 Lịch mức B (29/10 → 14/11/2026)
|
||||||
|
|
||||||
|
| Ngày | Việc | Tham chiếu |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| T5 29/10 | Chốt quyết định; cập nhật plan, AGENTS, report; khảo sát dataset field public (`field-dataset-survey.md`: chưa có dataset nào xác nhận đủ điều kiện). *Cập nhật:* trong ngày còn thử Teapot Dome (T0 và pilot P-a đều trượt; người dùng chọn quay về lịch mức B; plan §12 ý 23) và viết xong mức A (plan §12 ý 24) | A6; A1–A5 |
|
||||||
|
| T6 30/10 – T7 31/10 | ~~Mức A: viết lại abstract, intro, contributions, discussion, conclusion theo 3.1–3.3; T1, T4, T8 thành mệnh đề; T4 từ npz; T3 giải tích + mô phỏng trên dự đoán P2r; T10 related work~~ (xong sớm ngày 29/10). Thêm trích dẫn dataset F3 và Volve; còn lại là dự phòng. ~~Lượt rút gọn độ dài~~ (bỏ theo quyết định của người dùng ngày 29/10; plan §12 ý 25) | plan §6.1; rủi ro ở mục 5 |
|
||||||
|
| CN 1/11 | T2 exploratory: khai báo `t2-mechanism.md` rồi chạy ba thí nghiệm | 4.2 tuần 1 |
|
||||||
|
| T2 2/11 – T3 3/11 | Sửa generator cho S2 (tham số misspec); dev trên 902–905; viết và **khóa `protocol_bench.yaml`** (S1, S2, S3, S4, S8) kèm `.sha256` và `.lock.json` trước lần chạy đầu | 4.2 |
|
||||||
|
| T4 4/11 – T5 5/11 | S1 (lấp lưới c ∈ {0.5, 1.5}, N ∈ {2, 8}), S3 (B4 dưới SMC), S4 (backbone thứ hai) trên hai GPU | 4.2 tuần 1 |
|
||||||
|
| T6 6/11 – T7 7/11 | S2 ba trục; S8/T8 cycle-skip | 4.2 tuần 2 |
|
||||||
|
| CN 8/11 – T3 10/11 | S7: đóng gói benchmark (một lệnh sinh, một lệnh chấm, bảng tham chiếu, README, hash, Zenodo); viết lại §4–5 theo kết quả | 4.2 |
|
||||||
|
| T4 11/11 – T5 12/11 | Review nội bộ; hình; phụ lục chứng minh; gói tái lập | — |
|
||||||
|
| T6 13/11 | Kiểm tra novelty lần cuối; tra quartile; preprint | — |
|
||||||
|
| **T7 14/11** | **Nộp** | — |
|
||||||
|
|
||||||
|
**Thứ tự cắt phạm vi nếu trễ** (cắt từ trên xuống; không cắt ngưỡng): (1) S4 backbone thứ hai; (2) S8/T8; (3) S2 rút còn một trục rock physics, khi đó tên gọi đổi thành "controlled synthetic study"; (4) S1 rút còn c ∈ {0.5, 1.5} với N = 4/16; (5) T2 chỉ giữ thí nghiệm (1), responsibility-weighted warp error.
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
pages = {M93--M108},
|
pages = {M93--M108},
|
||||||
doi = {10.1190/geo2023-0614.1},
|
doi = {10.1190/geo2023-0614.1},
|
||||||
url = {https://doi.org/10.1190/geo2023-0614.1},
|
url = {https://doi.org/10.1190/geo2023-0614.1},
|
||||||
note = {P03; survey evidence level A; full text added 2026-10-26 (refs/geo-2023-0614.1.pdf): labels matched to seismic with time-depth from well-to-seismic ties taken as given; carbonate reservoir, 48 wells}
|
note = {P03; survey evidence level A; full text added 2026-10-26 (refs/xu2024sts.pdf): labels matched to seismic with time-depth from well-to-seismic ties taken as given; carbonate reservoir, 48 wells}
|
||||||
}
|
}
|
||||||
|
|
||||||
@article{chen2024multidimensional,
|
@article{chen2024multidimensional,
|
||||||
@@ -49,7 +49,7 @@
|
|||||||
pages = {1--15},
|
pages = {1--15},
|
||||||
doi = {10.1109/TGRS.2024.3460184},
|
doi = {10.1109/TGRS.2024.3460184},
|
||||||
url = {https://doi.org/10.1109/TGRS.2024.3460184},
|
url = {https://doi.org/10.1109/TGRS.2024.3460184},
|
||||||
note = {P04; survey evidence level A; accessed 2026-10-23}
|
note = {P04; survey evidence level A; accessed 2026-10-23; full text not obtainable (confirmed 2026-10-28): cite as abstract-only}
|
||||||
}
|
}
|
||||||
|
|
||||||
@article{li2024bpinn,
|
@article{li2024bpinn,
|
||||||
@@ -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},
|
||||||
note = {P05; survey evidence level A; accessed 2026-10-23}
|
note = {P05; survey evidence level A; accessed 2026-10-23; full text not obtainable (confirmed 2026-10-28): cite as abstract-only}
|
||||||
}
|
}
|
||||||
|
|
||||||
@article{ntibahanana2024ensemble,
|
@article{ntibahanana2024ensemble,
|
||||||
@@ -88,7 +88,7 @@
|
|||||||
pages = {698--712},
|
pages = {698--712},
|
||||||
doi = {10.1111/1365-2478.13333},
|
doi = {10.1111/1365-2478.13333},
|
||||||
url = {https://doi.org/10.1111/1365-2478.13333},
|
url = {https://doi.org/10.1111/1365-2478.13333},
|
||||||
note = {P07; survey evidence level F; accessed 2026-10-23}
|
note = {P07; survey evidence level F; accessed 2026-10-23; full text not obtainable (confirmed 2026-10-28): cite as abstract-only}
|
||||||
}
|
}
|
||||||
|
|
||||||
@article{li2025cascadedtie,
|
@article{li2025cascadedtie,
|
||||||
@@ -113,7 +113,7 @@
|
|||||||
eid = {106194},
|
eid = {106194},
|
||||||
doi = {10.1016/j.compgeo.2024.106194},
|
doi = {10.1016/j.compgeo.2024.106194},
|
||||||
url = {https://doi.org/10.1016/j.compgeo.2024.106194},
|
url = {https://doi.org/10.1016/j.compgeo.2024.106194},
|
||||||
note = {P09; survey evidence level A; accessed 2026-10-23}
|
note = {P09; survey evidence level A; accessed 2026-10-23; full text not obtainable (confirmed 2026-10-28): cite as abstract-only}
|
||||||
}
|
}
|
||||||
|
|
||||||
@article{li2026leakage,
|
@article{li2026leakage,
|
||||||
@@ -203,7 +203,7 @@
|
|||||||
pages = {2000--2009},
|
pages = {2000--2009},
|
||||||
doi = {10.1190/1.1635053},
|
doi = {10.1190/1.1635053},
|
||||||
url = {https://doi.org/10.1190/1.1635053},
|
url = {https://doi.org/10.1190/1.1635053},
|
||||||
note = {Full text read; marker mistie modeled as latent time shifts with a triangular prior, estimated jointly with the wavelet by MCMC; refs/Bayesian wavelet estimation from seismic and well data.pdf}
|
note = {Full text read; marker mistie modeled as latent time shifts with a triangular prior, estimated jointly with the wavelet by MCMC; refs/buland2003bayesianwavelet.pdf}
|
||||||
}
|
}
|
||||||
|
|
||||||
@article{gunning2006waveletextractor,
|
@article{gunning2006waveletextractor,
|
||||||
@@ -215,7 +215,7 @@
|
|||||||
pages = {681--695},
|
pages = {681--695},
|
||||||
doi = {10.1016/j.cageo.2005.10.001},
|
doi = {10.1016/j.cageo.2005.10.001},
|
||||||
url = {https://doi.org/10.1016/j.cageo.2005.10.001},
|
url = {https://doi.org/10.1016/j.cageo.2005.10.001},
|
||||||
note = {Full text read (added 2026-10-26); MAP estimate of wavelet jointly with checkshot/marker times (Gaussian prior), registration shift and lateral positioning error per well, Laplace posterior, wavelet span by marginal likelihood; refs/j.cageo.2005.10.001.pdf}
|
note = {Full text read (added 2026-10-26); MAP estimate of wavelet jointly with checkshot/marker times (Gaussian prior), registration shift and lateral positioning error per well, Laplace posterior, wavelet span by marginal likelihood; refs/gunning2006waveletextractor.pdf}
|
||||||
}
|
}
|
||||||
|
|
||||||
@article{wu2017multiwelltie,
|
@article{wu2017multiwelltie,
|
||||||
@@ -228,7 +228,7 @@
|
|||||||
pages = {IM13--IM20},
|
pages = {IM13--IM20},
|
||||||
doi = {10.1190/geo2016-0295.1},
|
doi = {10.1190/geo2016-0295.1},
|
||||||
url = {https://doi.org/10.1190/geo2016-0295.1},
|
url = {https://doi.org/10.1190/geo2016-0295.1},
|
||||||
note = {Full text read (HAL version, refs/geo2016-0295.pdf); first published online 2016-11-09}
|
note = {Full text read (HAL version, refs/wu2017multiwelltie.pdf); first published online 2016-11-09}
|
||||||
}
|
}
|
||||||
|
|
||||||
@article{tschannen2022partialtie,
|
@article{tschannen2022partialtie,
|
||||||
@@ -240,7 +240,7 @@
|
|||||||
pages = {105120},
|
pages = {105120},
|
||||||
doi = {10.1016/j.cageo.2022.105120},
|
doi = {10.1016/j.cageo.2022.105120},
|
||||||
url = {https://doi.org/10.1016/j.cageo.2022.105120},
|
url = {https://doi.org/10.1016/j.cageo.2022.105120},
|
||||||
note = {Full text read; variational CNN for wavelet (phase uncertainty), Bayesian optimization of bulk shift within user bounds; refs/1-s2.0-S0098300422000784-main.pdf}
|
note = {Full text read; variational CNN for wavelet (phase uncertainty), Bayesian optimization of bulk shift within user bounds; refs/tschannen2022partialtie.pdf}
|
||||||
}
|
}
|
||||||
|
|
||||||
@article{ali2025syntheticpseudowells,
|
@article{ali2025syntheticpseudowells,
|
||||||
@@ -253,7 +253,7 @@
|
|||||||
eid = {31},
|
eid = {31},
|
||||||
doi = {10.1007/s10462-024-11030-8},
|
doi = {10.1007/s10462-024-11030-8},
|
||||||
url = {https://doi.org/10.1007/s10462-024-11030-8},
|
url = {https://doi.org/10.1007/s10462-024-11030-8},
|
||||||
note = {Full text read; target is P-impedance from prestack gathers, not porosity; published online 2024-11-30; refs/s10462-024-11030-8.pdf}
|
note = {Full text read; target is P-impedance from prestack gathers, not porosity; published online 2024-11-30; refs/ali2025syntheticpseudowells.pdf}
|
||||||
}
|
}
|
||||||
|
|
||||||
@misc{herrera2012automatedtie,
|
@misc{herrera2012automatedtie,
|
||||||
@@ -278,7 +278,7 @@
|
|||||||
eprint = {1703.01541},
|
eprint = {1703.01541},
|
||||||
archivePrefix = {arXiv},
|
archivePrefix = {arXiv},
|
||||||
url = {https://proceedings.mlr.press/v70/cuturi17a.html},
|
url = {https://proceedings.mlr.press/v70/cuturi17a.html},
|
||||||
note = {refs/SoftDTW_Cuturi2017.pdf}
|
note = {refs/cuturi2017softdtw.pdf}
|
||||||
}
|
}
|
||||||
|
|
||||||
@inproceedings{leguen2019dilate,
|
@inproceedings{leguen2019dilate,
|
||||||
@@ -289,7 +289,7 @@
|
|||||||
eprint = {1909.09020},
|
eprint = {1909.09020},
|
||||||
archivePrefix = {arXiv},
|
archivePrefix = {arXiv},
|
||||||
url = {https://arxiv.org/abs/1909.09020},
|
url = {https://arxiv.org/abs/1909.09020},
|
||||||
note = {DILATE; refs/DILATE_LeGuen2019.pdf}
|
note = {DILATE; refs/leguen2019dilate.pdf}
|
||||||
}
|
}
|
||||||
|
|
||||||
@inproceedings{lakshminarayanan2017deepensembles,
|
@inproceedings{lakshminarayanan2017deepensembles,
|
||||||
@@ -300,7 +300,7 @@
|
|||||||
eprint = {1612.01474},
|
eprint = {1612.01474},
|
||||||
archivePrefix = {arXiv},
|
archivePrefix = {arXiv},
|
||||||
url = {https://arxiv.org/abs/1612.01474},
|
url = {https://arxiv.org/abs/1612.01474},
|
||||||
note = {refs/DeepEnsembles_Lakshminarayanan2017.pdf}
|
note = {refs/lakshminarayanan2017deepensembles.pdf}
|
||||||
}
|
}
|
||||||
|
|
||||||
@inproceedings{kendall2017uncertainties,
|
@inproceedings{kendall2017uncertainties,
|
||||||
@@ -311,7 +311,7 @@
|
|||||||
eprint = {1703.04977},
|
eprint = {1703.04977},
|
||||||
archivePrefix = {arXiv},
|
archivePrefix = {arXiv},
|
||||||
url = {https://arxiv.org/abs/1703.04977},
|
url = {https://arxiv.org/abs/1703.04977},
|
||||||
note = {refs/HeteroscedasticUQ_Kendall2017.pdf}
|
note = {refs/kendall2017uncertainties.pdf}
|
||||||
}
|
}
|
||||||
|
|
||||||
@article{gneiting2007scoringrules,
|
@article{gneiting2007scoringrules,
|
||||||
@@ -324,7 +324,7 @@
|
|||||||
pages = {359--378},
|
pages = {359--378},
|
||||||
doi = {10.1198/016214506000001437},
|
doi = {10.1198/016214506000001437},
|
||||||
url = {https://doi.org/10.1198/016214506000001437},
|
url = {https://doi.org/10.1198/016214506000001437},
|
||||||
note = {Proper scoring rules and CRPS; refs/ProperScoringRules_Gneiting2007.pdf}
|
note = {Proper scoring rules and CRPS; refs/gneiting2007scoringrules.pdf}
|
||||||
}
|
}
|
||||||
|
|
||||||
@inproceedings{murray2010ess,
|
@inproceedings{murray2010ess,
|
||||||
@@ -338,7 +338,7 @@
|
|||||||
eprint = {1001.0175},
|
eprint = {1001.0175},
|
||||||
archivePrefix = {arXiv},
|
archivePrefix = {arXiv},
|
||||||
url = {https://proceedings.mlr.press/v9/murray10a.html},
|
url = {https://proceedings.mlr.press/v9/murray10a.html},
|
||||||
note = {refs/EllipticalSliceSampling_Murray2010.pdf}
|
note = {refs/murray2010ess.pdf}
|
||||||
}
|
}
|
||||||
|
|
||||||
@article{ravasi2020pylops,
|
@article{ravasi2020pylops,
|
||||||
@@ -350,7 +350,7 @@
|
|||||||
pages = {100361},
|
pages = {100361},
|
||||||
doi = {10.1016/j.softx.2019.100361},
|
doi = {10.1016/j.softx.2019.100361},
|
||||||
url = {https://doi.org/10.1016/j.softx.2019.100361},
|
url = {https://doi.org/10.1016/j.softx.2019.100361},
|
||||||
note = {Local copy is the arXiv version (1907.12349); refs/PyLops_Ravasi2020.pdf}
|
note = {Local copy is the arXiv version (1907.12349); refs/ravasi2020pylops.pdf}
|
||||||
}
|
}
|
||||||
|
|
||||||
@inproceedings{alfarraj2019semisupervised,
|
@inproceedings{alfarraj2019semisupervised,
|
||||||
@@ -361,5 +361,5 @@
|
|||||||
year = {2019},
|
year = {2019},
|
||||||
doi = {10.1190/segam2019-3215902.1},
|
doi = {10.1190/segam2019-3215902.1},
|
||||||
url = {https://doi.org/10.1190/segam2019-3215902.1},
|
url = {https://doi.org/10.1190/segam2019-3215902.1},
|
||||||
note = {Local copy is the arXiv version (1905.13412); refs/AlfarrajAlRegib2019_semi-supervised-AI-inversion.pdf}
|
note = {Local copy is the arXiv version (1905.13412); refs/alfarraj2019semisupervised.pdf}
|
||||||
}
|
}
|
||||||
|
|||||||
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
@@ -1,14 +1,16 @@
|
|||||||
# Tổng quan kỹ thuật: học porosity từ seismic khi well tie không chắc chắn
|
# Tổng quan kỹ thuật: học porosity từ seismic khi well tie không chắc chắn
|
||||||
|
|
||||||
Cập nhật 27/10/2026, phản ánh trạng thái dự án đến hết ngày 26/10/2026.
|
Cập nhật 04/11/2026, phản ánh trạng thái dự án đến hết ngày 04/11/2026.
|
||||||
|
|
||||||
Tài liệu này dành cho người mới: chưa làm địa vật lý, chưa quen phần Bayes, hoặc cả hai. Nó giải thích bài toán, ý tưởng, từng thành phần và lý thuyết đằng sau, rồi chỉ ra mỗi thứ nằm ở đâu trong code. Chi tiết đầy đủ, số liệu kiểm tra và chứng minh nằm ở [plan.md](plan.md) và [theory.md](theory.md).
|
> **Lịch sử tài liệu.** Bản đầu viết ngày 27/10/2026 (trạng thái đến 26/10). Ngày 29/10 (commit 0cfe202) file này bị thay bằng một bản bài giảng; bản bài giảng nay nằm ở [lecture.md](lecture.md). Ngày 04/11/2026 bản tổng quan được dựng lại từ bản 27/10 (commit 9976abc). Mục 1–2, 4 và phần lớn mục 5 giữ nguyên; mục 3, 6–13 được cập nhật theo Pivot 1 và các kết quả P2r, P3, P4, P6.
|
||||||
|
|
||||||
|
Tài liệu này dành cho người mới: chưa làm địa vật lý, chưa quen phần Bayes, hoặc cả hai. Nó giải thích bài toán, ý tưởng, từng thành phần và lý thuyết đằng sau, rồi chỉ ra mỗi thứ nằm ở đâu trong code. Chi tiết đầy đủ, số liệu kiểm tra và chứng minh nằm ở [plan.md](plan.md), [theory.md](theory.md) và bài báo trong [paper/](../paper/). Bản giải thích chậm hơn, nhiều ví dụ đời thường hơn: [lecture.md](lecture.md).
|
||||||
|
|
||||||
**Cách đọc.**
|
**Cách đọc.**
|
||||||
- Mục 1–3: bức tranh lớn, gần như không có công thức. Đọc trước.
|
- Mục 1–3: bức tranh lớn, gần như không có công thức. Đọc trước.
|
||||||
- Mục 4: kiến thức nền. Bỏ qua phần nào đã biết.
|
- Mục 4: kiến thức nền. Bỏ qua phần nào đã biết.
|
||||||
- Mục 5–6: phương pháp và lý thuyết.
|
- Mục 5–6: phương pháp và lý thuyết.
|
||||||
- Mục 7–10: dữ liệu, đối thủ so sánh, cách đánh giá, kết quả hiện tại.
|
- Mục 7–10: dữ liệu, các phương pháp đem so, cách đánh giá, kết quả đến 04/11/2026.
|
||||||
- Mục 11–12: bản đồ code và bảng thuật ngữ. Gặp từ lạ thì tra mục 12.
|
- Mục 11–12: bản đồ code và bảng thuật ngữ. Gặp từ lạ thì tra mục 12.
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -89,17 +91,40 @@ Pipeline chuẩn hiện nay: *tie → chuyển nhãn sang thời gian → huấn
|
|||||||
| L2: dự đoán thuộc tính bằng deep learning, có UQ | Học seismic → porosity/impedance, có khi ước lượng bất định | Giả định nhãn đã đăng ký đúng |
|
| L2: dự đoán thuộc tính bằng deep learning, có UQ | Học seismic → porosity/impedance, có khi ước lượng bất định | Giả định nhãn đã đăng ký đúng |
|
||||||
| L3: loss chịu lệch thời gian (soft-DTW, DILATE, hard-min shift) | Cho phép dự đoán và nhãn lệch nhau | Không anchor, không vật lý, không bất định có kiểm chứng |
|
| L3: loss chịu lệch thời gian (soft-DTW, DILATE, hard-min shift) | Cho phép dự đoán và nhãn lệch nhau | Không anchor, không vật lý, không bất định có kiểm chứng |
|
||||||
|
|
||||||
Bài nhắm vào phần giao của ba nhóm: coi sai số đăng ký là biến ẩn, ràng buộc bằng anchor và vật lý, marginalize khi huấn luyện, và tính đến nó khi đánh giá. Theo các lượt tìm kiếm literature đã làm (plan §2.4), chưa thấy công trình nào làm đủ cả bốn việc. Quy tắc viết bài: không dùng chữ "first".
|
Bài nhắm vào phần giao của ba nhóm: coi sai số đăng ký là biến ẩn, ràng buộc bằng anchor và vật lý, marginalize khi huấn luyện, và tính đến nó khi đánh giá. Theo các lượt tìm kiếm literature (plan §2.4; quét bổ sung ngày 02/11/2026 trên Crossref, OpenAlex 2025–2026 và đọc toàn văn sáu tài liệu trước chỉ có tóm tắt, plan §12 ý 31, 33), chưa thấy công trình nào đưa bất định của tie vào việc huấn luyện một bộ dự đoán thuộc tính. Bài viết "To our knowledge…", không dùng chữ "first". Lượt quét cuối làm vào ngày nộp.
|
||||||
|
|
||||||
### 3.2 Bốn đóng góp dự kiến
|
### 3.2 Bốn đóng góp (khung Pivot 1, từ 29/10/2026)
|
||||||
|
|
||||||
- **C1, lý thuyết.** "MSE dưới misregistration = học một target bị làm mờ" (Mệnh đề 1) và điều kiện nhận dạng (Mệnh đề 2).
|
Ngày 29/10/2026, sau khi cả hai cổng field (G-C trên F3, G-D trên Volve) đều trượt, bài chuyển thành bài **lý thuyết + benchmark synthetic** (Pivot 1 mức B, plan §12 ý 22). F3 và Volve chỉ còn là các trường hợp giới hạn phạm vi.
|
||||||
- **C2, phương pháp RML.** Prior trên warp có điều kiện theo anchor, likelihood tie vật lý, loss marginal likelihood có hiệu chỉnh.
|
- 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*.
|
||||||
- **C3, giao thức đánh giá có xét registration.** Gồm benchmark synthetic hiệu chỉnh theo F3 và "phase diagram" cho biết khi nào vấn đề này đáng kể.
|
- Tạp chí dự kiến: *Computers & Geosciences*; dự phòng *Geophysical Prospecting*.
|
||||||
- **C4, audit dữ liệu F3** cho bài toán porosity (mục 7.1).
|
- Hạn nộp: thứ 7, 14/11/2026 (trước đó là 31/10).
|
||||||
|
|
||||||
|
Bốn đóng góp, theo mục 1 của bài ([01_introduction.tex](../paper/sections/01_introduction.tex)):
|
||||||
|
|
||||||
|
- **C1, lý thuyết** (mục 6).
|
||||||
|
- MSE trên nhãn lệch thời gian học ra target bị làm mờ (Mệnh đề 1).
|
||||||
|
- Không có anchor thì thời gian tuyệt đối không nhận dạng được (Mệnh đề 2).
|
||||||
|
- Sai số của tie có thể theo cấu trúc *classical* (làm mờ predictor) hoặc *Berkson* (làm sắc predictor) (Mệnh đề 3).
|
||||||
|
- Bank nhãn hiệu chỉnh có cùng nghiệm quần thể với 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 sai số tie (Mệnh đề 4).
|
||||||
|
- Liên hệ coverage với cấu trúc sai số (Mệnh đề 5), và độ lệch khi chấm bằng reference lệch (Mệnh đề 6).
|
||||||
|
- **C2, benchmark có xét registration** (mục 7.2, 10.7).
|
||||||
|
- Synthetic D2 biết warp thật. Các trục: drift, SNR, mật độ anchor, sai mô hình (S2), lỗi hai mode (S8).
|
||||||
|
- Luật đạt/trượt khoá trước khi chạy. Báo cáo cả phép so sánh đã trượt (P2) lẫn phép so sánh thiết kế sau đó (P2r).
|
||||||
|
- Phát hành dạng gói task có truth ẩn và lệnh chấm theo đúng luật đã khoá.
|
||||||
|
- **C3, một họ baseline** (mục 5.9).
|
||||||
|
- RML_λ chứa tie điểm, hard-min/soft-min shift và soft-DTW là trường hợp riêng (Bổ đề 1–5).
|
||||||
|
- Bài dùng họ này để định nghĩa các phương pháp đem so, **không** đề xuất RML như một phương pháp thắng.
|
||||||
|
- **C4, khả năng phát hiện và phạm vi của field test** (mục 10.4–10.6).
|
||||||
|
- Reference ở giếng blind phải chính xác bao nhiêu và cần bao nhiêu giếng blind (Hệ quả 4, T3).
|
||||||
|
- Audit F3: nhãn ở 3/4 giếng là hàm tuyến tính của sonic; marker là pick horizon, không phải checkshot.
|
||||||
|
- Hai field test khoá trước (F3, Volve) đều trượt; Teapot Dome không đủ reference thời gian–độ sâu độc lập.
|
||||||
|
|
||||||
|
So với bản 27/10: "C2, phương pháp RML" nay thành C3 và không còn là phương pháp đề xuất; "C4, audit F3" gộp vào C4 mới.
|
||||||
|
|
||||||
**Không phải đóng góp:** backbone mạng mới, thêm attention, thêm loss, GAN, hay chỉ sửa leakage.
|
**Không phải đóng góp:** backbone mạng mới, thêm attention, thêm loss, GAN, hay chỉ sửa leakage.
|
||||||
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 4. Kiến thức nền
|
## 4. Kiến thức nền
|
||||||
@@ -358,10 +383,13 @@ $$
|
|||||||
t_k = t(\tau_k) + \varepsilon_k,\qquad \varepsilon_k\sim\mathcal N(0,\sigma_a^2).
|
t_k = t(\tau_k) + \varepsilon_k,\qquad \varepsilon_k\sim\mathcal N(0,\sigma_a^2).
|
||||||
$$
|
$$
|
||||||
|
|
||||||
Protocol P2 dùng σ_a = 7 ms, lấy từ độ lệch robust (MAD) giữa marker và horizon tại 4 giếng F3. Anchor là thứ **ghim thời gian tuyệt đối** (Mệnh đề 2).
|
Protocol P2 dùng σ_a = 7 ms, lấy từ độ lệch robust (MAD) giữa marker và horizon tại 4 giếng F3. Các protocol sau thêm nhánh σ_a đặt sai để đo độ nhạy: P2r đặt σ_a bằng một nửa và gấp đôi giá trị thật; P3 và P4 thử 3.5 và 14 ms. Anchor là thứ **ghim thời gian tuyệt đối** (Mệnh đề 2).
|
||||||
|
|
||||||
|
|
||||||
### 5.4 Posterior warp và lấy mẫu
|
### 5.4 Posterior warp và lấy mẫu
|
||||||
|
|
||||||
|
Đây là cách lấy mẫu của P2 (M1, M2, B3d). Từ P2r, posterior chính là SMC (cuối mục 5.5).
|
||||||
|
|
||||||
[sampler.py](../ml_porosity/registration/sampler.py):
|
[sampler.py](../ml_porosity/registration/sampler.py):
|
||||||
1. Tính posterior Gaussian xấp xỉ của u = [b, g] bằng Gauss–Newton quanh MAP (`laplace_posterior`).
|
1. Tính posterior Gaussian xấp xỉ của u = [b, g] bằng Gauss–Newton quanh MAP (`laplace_posterior`).
|
||||||
2. Dùng nó làm "prior" cho elliptical slice sampling, với likelihood là phần sai khác giữa mô hình chính xác (e^g) và bản tuyến tính hoá, cộng ràng buộc |g| ≤ g_max.
|
2. Dùng nó làm "prior" cho elliptical slice sampling, với likelihood là phần sai khác giữa mô hình chính xác (e^g) và bản tuyến tính hoá, cộng ràng buộc |g| ≤ g_max.
|
||||||
@@ -386,7 +414,14 @@ Có hai biến thể:
|
|||||||
- **M1:** chỉ dùng anchor, π_s đều.
|
- **M1:** chỉ dùng anchor, π_s đều.
|
||||||
- **M2:** anchor + trọng số vật lý. Đây là phương pháp chính.
|
- **M2:** anchor + trọng số vật lý. Đây là phương pháp chính.
|
||||||
|
|
||||||
Chẩn đoán sau G-B (mục 10.3) thay bước trọng số này bằng **SMC tempering** ([smc.py](../ml_porosity/registration/smc.py); bản GPU ở [smc_torch.py](../ml_porosity/registration/smc_torch.py)), với γ chọn theo tự tương quan của phần dư.
|
**Từ P2r: posterior SMC (hậu tố "-Sa").** Chẩn đoán sau G-B (mục 10.3) cho thấy bước trọng số trên bị suy biến: ESS ở γ = 1 chỉ khoảng 1/64, nên quy tắc ESS ≥ S/4 ép γ xuống 0.02–0.11 và posterior gần như chỉ dựa vào anchor. Từ P2r, bước này được thay bằng **SMC tempering** ([smc.py](../ml_porosity/registration/smc.py); bản GPU [smc_torch.py](../ml_porosity/registration/smc_torch.py)):
|
||||||
|
- 1024 hạt, bắt đầu từ prior + anchor, tăng γ từng bậc, resample rồi di chuyển hạt bằng MCMC (mục 4.6).
|
||||||
|
- γ cuối chọn theo tự tương quan của phần dư synthetic–seismic; pha wavelet ước lượng lại (`phase_R`).
|
||||||
|
- **B3d-Sa:** một nhãn tại warp trung bình của 1024 hạt. **M2-Sa:** RML trên bank 64 hạt.
|
||||||
|
- Trên D2 ở c = 1, sai số warp giảm từ khoảng 3.3 ms xuống khoảng 0.57 ms; tie điểm tốt nhất (B3c) vẫn ở 3.8–4.2 ms.
|
||||||
|
|
||||||
|
**Độ rộng posterior σ_post** (ms) là con số quan trọng nhất để đọc kết quả. σ_post nhỏ thì mọi hạt gần như trùng nhau, bank không khác một nhãn duy nhất, nên RML không có gì để thêm. Benchmark gọi một ô là **rộng** khi σ_post ≥ 1.5 ms. Trên F3 với σ_a = 7 ms, σ_post khoảng 2.5–3.4 ms; nếu coi marker gần như chính xác (σ_a ≈ 0.4 ms) thì chỉ còn 0.56–0.64 ms.
|
||||||
|
|
||||||
|
|
||||||
### 5.6 Ngân hàng nhãn (label bank)
|
### 5.6 Ngân hàng nhãn (label bank)
|
||||||
|
|
||||||
@@ -449,6 +484,12 @@ Bảng này biến ablation thành một con đường đi từ mô hình cũ t
|
|||||||
|
|
||||||
Khác biệt cốt lõi giữa RML và các loss căn chỉnh chung không nằm ở "min hay soft-min". Nó nằm ở **bank đến từ đâu**: posterior có anchor và vật lý, hay mọi dịch chuyển đều được phép như nhau.
|
Khác biệt cốt lõi giữa RML và các loss căn chỉnh chung không nằm ở "min hay soft-min". Nó nằm ở **bank đến từ đâu**: posterior có anchor và vật lý, hay mọi dịch chuyển đều được phép như nhau.
|
||||||
|
|
||||||
|
Hai cách dùng cùng một posterior phải tách bạch khi đọc kết quả:
|
||||||
|
- **B3d-Sa** ("cách trung bình"): một nhãn tại warp trung bình posterior, huấn luyện bình thường. Ứng với S = 1.
|
||||||
|
- **M2-Sa** ("cách bank", RML thật sự): giữ cả bank và dùng loss RML.
|
||||||
|
|
||||||
|
Phần lớn lợi ích đo được đến từ việc có posterior tốt (B3d-Sa đã thắng tie điểm); bank chỉ thêm được khi posterior rộng (mục 10.3). Sau Pivot 1, bảng trên là cách bài định nghĩa các phương pháp đem so (đóng góp C3), không phải lập luận rằng RML thắng.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 6. Lý thuyết (tóm tắt trực giác)
|
## 6. Lý thuyết (tóm tắt trực giác)
|
||||||
@@ -490,11 +531,39 @@ $$
|
|||||||
|
|
||||||
**Kiểm chứng (H4).** Bỏ anchor (chỉ còn vật lý) làm sai số warp tăng từ khoảng 3 ms lên khoảng 31–33 ms và RMSE băng tăng gần gấp đôi. Giả thuyết "anchor là cần thiết" **không bị bác bỏ**.
|
**Kiểm chứng (H4).** Bỏ anchor (chỉ còn vật lý) làm sai số warp tăng từ khoảng 3 ms lên khoảng 31–33 ms và RMSE băng tăng gần gấp đôi. Giả thuyết "anchor là cần thiết" **không bị bác bỏ**.
|
||||||
|
|
||||||
### 6.3 Phạm vi của lý thuyết
|
### 6.3 Mệnh đề 3–6 và Hệ quả 3–4 (thêm 29/10/2026)
|
||||||
|
|
||||||
- **Đã chứng minh dưới giả thiết nêu rõ:** Mệnh đề 1, 2 và Bổ đề 1–5.
|
Bản tiếng Việt đầy đủ ở [theory.md](theory.md) mục 6; chứng minh ở Phụ lục A của bài ([A_proofs.tex](../paper/sections/A_proofs.tex)). Một subagent độc lập đã đọc lại Mục 4, Phụ lục A và Bổ đề 5 ngày 02/11/2026: 15 phát hiện, sửa 14, sửa một phần 1; không verdict hay con số nào đổi (plan §12 ý 32).
|
||||||
- **Heuristic:** λ = 1/τ_c.
|
|
||||||
- **Chưa làm:** chẩn đoán strain energy của warp; tính nhất quán của estimator; RML-EM (M3).
|
**Mệnh đề 3: hai cấu trúc sai số của tie.** Gọi û là tie điểm, u* là warp thật.
|
||||||
|
- *Classical:* sai số độc lập với nhãn thật. Predictor học được bị **làm mờ**, như Mệnh đề 1; với sai số Gauss, hệ số truyền là e^{−2π²σ²f²}.
|
||||||
|
- *Berkson:* sai số độc lập với dữ liệu đã có. Predictor học được bị **làm sắc**; hệ số truyền là e^{+2π²σ²f²}.
|
||||||
|
- Tie tại trung bình posterior (B3d-Sa) là lý tưởng hoá tự nhiên của cấu trúc Berkson. T2 (mục 10.6) xác nhận cấu trúc này ở c = 1.
|
||||||
|
|
||||||
|
**Mệnh đề 4: bank hiệu chỉnh.** Bank gọi là *hiệu chỉnh* khi trung bình có trọng số trên bank bằng kỳ vọng posterior.
|
||||||
|
- Khi đó RML ở λ → 0 có cùng nghiệm quần thể với huấn luyện trên nhãn thật (μ = m, σ² = Var(y | X)).
|
||||||
|
- Warp trung bình không có tính chất này: nhãn tại warp trung bình chỉ trùng nhãn trung bình tới bậc một theo độ trải posterior.
|
||||||
|
- **Lợi ích tối đa** ρ* của bank so với nhãn điểm: méo quần thể là **bậc bốn theo σ**, nên rất nhỏ khi posterior hẹp. Cận 1/B_a (classical) là cận đã đăng ký cho H2b; 1/B_b (Berkson) tính post hoc. Ngoài bậc dẫn, tích phân Berkson lớn hơn tích phân classical một hệ số e^{4π²σ²f²}. Trọng số f⁴ đẩy méo lên 67–72 Hz, nên tích phân Berkson bằng 1.5–1.7, 2.1–2.6 và 3.3–4.6 lần tích phân classical tại σ = 1.5, 2 và 2.5 ms. (Nhận định cũ "hệ số < 1.17" sai vì chỉ xét tới 25 Hz; sửa 29/10.)
|
||||||
|
|
||||||
|
**Hệ quả 3: sai số hai mode.** Sai số ±Δ/2 với xác suất ½ mỗi bên cho P = Q = cos(πfΔ).
|
||||||
|
- Hệ số truyền **â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 không có hiện tượng này.
|
||||||
|
- Bank hai thành viên trọng số bằng nhau chứa warp thật nhưng **không hiệu chỉnh**; ở λ → 0 hệ số truyền của nó là cos²(πfΔ) ≥ 0.
|
||||||
|
- Ở λ > 0, responsibility dồn trọng số về thành viên khớp với mạng, tức một kiểu tái đăng ký ngầm (Nhận xét 1).
|
||||||
|
|
||||||
|
**Mệnh đề 5: coverage.** ξ = phương sai dự báo / sai số bình phương trung bình (cột `kappa` của [30_t4_coverage.py](../scripts/30_t4_coverage.py)).
|
||||||
|
- 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.
|
||||||
|
- Đây là giới hạn quần thể. Trên P2r, độ dài huấn luyện và nguồn nhãn lẫn nhau, nên phần (b), (c) **chưa được kiểm**. Không claim hiệu chỉnh.
|
||||||
|
|
||||||
|
**Mệnh đề 6 và Hệ quả 4: chấm bằng reference lệch.**
|
||||||
|
- Nếu reference ở giếng blind lệch σ_r, sai số đo được có thêm một số hạng phụ thuộc phương pháp. Số hạng đó có thể đảo thứ hạng hai phương pháp, và không giảm khi thêm giếng blind.
|
||||||
|
- Lợi thế đo được chỉ có thể cùng dấu với lợi thế thật khi **σ_r < σ/√2**, với σ là sai số tie của nhãn điểm. Điều kiện này cần ở mọi tần số nhưng không đủ: trong mô phỏng T3, điểm đổi dấu nằm ở 3.6/3.8/4.3 ms, so với σ/√2 = 3.0/4.1/5.1 ms (sửa 02/11/2026).
|
||||||
|
|
||||||
|
### 6.4 Phạm vi của lý thuyết
|
||||||
|
|
||||||
|
- **Đã chứng minh dưới giả thiết nêu rõ:** Mệnh đề 1–6, Hệ quả 3–4 (ở mức quần thể), Bổ đề 1–5 (chính xác, có test số).
|
||||||
|
- **Lý tưởng hoá:** bank hiệu chỉnh của Mệnh đề 4. Hệ quả 4 chỉ cho dấu ở bậc dẫn.
|
||||||
|
- **Heuristic:** λ = 1/τ_c; lập luận mẫu hữu hạn (theory §6.5).
|
||||||
|
- **Chưa làm:** chẩn đoán strain energy của warp; tính nhất quán của estimator; RML-EM (M3); kiểm phần (b), (c) của Mệnh đề 5.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -534,39 +603,68 @@ Trên dữ liệu thật không bao giờ biết warp đúng. D2 tạo dữ li
|
|||||||
- 8 giếng test cố định cho mỗi realization, cách mọi giếng khác ≥ 1 km.
|
- 8 giếng test cố định cho mỗi realization, cách mọi giếng khác ≥ 1 km.
|
||||||
- Realization 900 và 901 chỉ dùng để chọn ngân sách bước huấn luyện, không bao giờ dùng cho kết quả.
|
- Realization 900 và 901 chỉ dùng để chọn ngân sách bước huấn luyện, không bao giờ dùng cho kết quả.
|
||||||
- **Oracle:** mô hình huấn luyện trên nhãn với warp *thật*. Chỉ có được trên synthetic; là trần tham chiếu, không phải đối thủ.
|
- **Oracle:** mô hình huấn luyện trên nhãn với warp *thật*. Chỉ có được trên synthetic; là trần tham chiếu, không phải đối thủ.
|
||||||
|
**Regime của P2r và benchmark P6.** Từ P2r, ngoài c và N còn có trục chất lượng dữ liệu:
|
||||||
|
|
||||||
### 7.3 D3: Volve (field thứ hai, chưa chạy)
|
| Regime | SNR | Anchor | Ghi chú |
|
||||||
|
| --- | --- | --- | --- |
|
||||||
|
| R10 | 10 dB | đủ | posterior hẹp nhất |
|
||||||
|
| R0 | 0 dB | đủ | |
|
||||||
|
| Rm5 | −5 dB | đủ | gần F3 nhất |
|
||||||
|
| R0h | 0 dB | cách một lấy một | |
|
||||||
|
| R10tb | 10 dB | chỉ đỉnh và đáy | posterior rộng |
|
||||||
|
|
||||||
|
P2r dùng realization test 8–15 (mới, khác P2); dev là 900/901 cho ngân sách bước và 902–905 cho mức sai mô hình của P6.
|
||||||
|
|
||||||
|
**Sai mô hình (S2, từ 29/10/2026).** Bộ sinh có tham số `misspec=` ([synth_d2.py](../ml_porosity/data/synth_d2.py), preset trong [d2_synth_bench.yaml](../configs/d2_synth_bench.yaml)). Truth được sinh với sai số nêu dưới đây, còn analyst vẫn được mô tả mô hình danh nghĩa:
|
||||||
|
- **rock physics** (`rp_L1`, `rp_L2`): sai số hệ số chặn DT theo từng đơn vị địa tầng;
|
||||||
|
- **wavelet** (`wv_L1`, `wv_L2`: pha hỗn hợp/pha cực tiểu; `wv_Q`: Q hằng bằng 80);
|
||||||
|
- **drift** (`dr_L1`, `dr_L2`: nhân hyperparameter; bước nhảy + jitter).
|
||||||
|
|
||||||
|
`misspec=None` tái lập dấu vân tay P2r từng bit ([tests/test_d2_misspec.py](../tests/test_d2_misspec.py)). Sai số rock physics đều trên mọi đơn vị bị likelihood α-profiled hấp thụ, nên chỉ dùng làm đối chứng. Ghi chú bộ sinh: [bench-generator.md](research/bench-generator.md).
|
||||||
|
|
||||||
|
**Hai mode (S8).** Analyst biết mỗi tie là một trong hai warp, t_true hoặc t_true + s·Δ, với Δ ∈ {8, 16, 32} ms. Đây là phép kiểm có điều khiển của Hệ quả 3.
|
||||||
|
|
||||||
|
### 7.3 D3: Volve (field thứ hai, đã chạy 29/10/2026)
|
||||||
|
|
||||||
- Mỏ Volve ở phần Na Uy của Biển Bắc, dữ liệu Equinor công bố theo giấy phép CC BY-NC-SA 4.0.
|
- Mỏ Volve ở phần Na Uy của Biển Bắc, dữ liệu Equinor công bố theo giấy phép CC BY-NC-SA 4.0.
|
||||||
- Vai trò: porosity ở đây (PHIF) tính từ density–neutron, **độc lập với sonic**. Nó phá vỡ cấu trúc "nhãn = hàm của DT" của F3.
|
- Porosity ở đây (PHIF) tính từ density–neutron, **độc lập với sonic**. Nó phá vỡ cấu trúc "nhãn = hàm của DT" của F3.
|
||||||
- Đã kiểm kê: 10 giếng có marker TWT, cube post-stack ST10010 đã tải và QC.
|
- Dùng 6 giếng **nghiêng** (có giếng tới 82°): dựng quỹ đạo, đổi MD sang TVD, lấy patch seismic 3×3 dọc đường giếng ([deviated.py](../ml_porosity/data/deviated.py), [volve_wells.py](../ml_porosity/data/volve_wells.py)). Nhãn ngắn: 16–37 mẫu mỗi giếng, tổng 150 mẫu. Cube post-stack ST10010.
|
||||||
- Thí nghiệm dự kiến ngày 28–29/10/2026 (pha P4).
|
- Kết quả ở mục 10.5.
|
||||||
|
|
||||||
Ngoài ra, dữ liệu **NLOG** (cổng dữ liệu dầu khí Hà Lan) được dùng để kiểm tra nhãn F3 bằng RHOB đo thật (`scripts/08_d1_label_check.py`).
|
### 7.4 Dữ liệu phụ
|
||||||
|
|
||||||
|
- **NLOG** (cổng dữ liệu dầu khí Hà Lan): kiểm tra nhãn F3 bằng RHOB đo thật (`scripts/08_d1_label_check.py`).
|
||||||
|
- **Teapot Dome** (29/10/2026, exploratory): kiểm kê để tìm field có reference thời gian–độ sâu độc lập. Trượt (mục 10.6). Dữ liệu thô `data/Teapot/` (1.7 GB) bị gitignore.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 8. Các phương pháp được so sánh
|
## 8. Các phương pháp được so sánh
|
||||||
|
|
||||||
Mọi phương pháp mạng dùng **cùng backbone, cùng input, cùng optimizer và cùng cách chọn ngân sách**. Chúng chỉ khác nhau ở nhãn và loss.
|
Mọi phương pháp mạng dùng **cùng backbone, cùng input, cùng optimizer và cùng cách chọn ngân sách** (chọn trên dev). Chúng chỉ khác nhau ở nhãn và loss.
|
||||||
|
|
||||||
| ID | Mô tả dễ hiểu | Trả lời câu hỏi |
|
| ID | Mô tả dễ hiểu | Trả lời câu hỏi | Dùng ở |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- | --- |
|
||||||
| B0a | Đường xu hướng nén chặt theo thời gian, không dùng seismic | Seismic có thêm gì ngoài trend? |
|
| B0a | Đường xu hướng nén chặt theo thời gian, không dùng seismic | Seismic có thêm gì ngoài trend? | P1, P3 |
|
||||||
| B0b | Ridge / random forest / GBM trên các attribute seismic (biên độ, envelope, pha và tần số tức thời, relative AI, TWT) | Baseline ML nông nhưng mạnh |
|
| B0b | Ridge / random forest / GBM trên các attribute seismic (biên độ, envelope, pha và tần số tức thời, relative AI, TWT) | Baseline ML nông nhưng mạnh | P1 |
|
||||||
| B1 | Inversion AI cổ điển (PyLops) với LFM từ giếng train, rồi φ = a + b·AI | Baseline địa vật lý mà reviewer sẽ hỏi |
|
| B1 | Inversion AI cổ điển (PyLops) với LFM từ giếng train, rồi φ = a + b·AI | Baseline địa vật lý mà reviewer sẽ hỏi | P1 |
|
||||||
| B2 | CNN–GRU với 6 loss gốc của luận văn, pipeline đã sửa | Nối tiếp luận văn |
|
| B2 | CNN–GRU với 6 loss gốc của luận văn, pipeline đã sửa | Nối tiếp luận văn | P1 |
|
||||||
| B3a | Tie điểm kiểu luận văn: neo tại anchor nông nhất, không hiệu chỉnh drift | |
|
| B3a | Tie điểm kiểu luận văn: neo tại anchor nông nhất, không hiệu chỉnh drift | | P1 |
|
||||||
| B3b | Tie điểm marker-calibrated sonic | Tie "chuẩn ngành" |
|
| B3b | Tie điểm marker-calibrated sonic | Tie "chuẩn ngành" | mọi pha |
|
||||||
| B3c | B3b + dịch cục bộ theo tương quan synthetic–seismic (như tie thủ công) | Tie điểm tốt nhất có dùng seismic |
|
| B3c | B3b + dịch cục bộ theo tương quan synthetic–seismic (như tie thủ công) | Tie điểm tốt nhất có dùng seismic | mọi pha |
|
||||||
| B3d | Một nhãn duy nhất từ warp trung bình có trọng số của posterior M2 | Dùng posterior nhưng không marginalize |
|
| B3c-R | B3c với wavelet ở pha ước lượng lại | Tie điểm tốt nhất, công bằng với SMC | P2r, P3, P4, P6 |
|
||||||
| B4a–d | Nhãn B3b + loss căn chỉnh chung: hard-min shift, soft-min shift, soft-DTW, DILATE | Có cần anchor/vật lý không, hay loss chịu lệch là đủ? |
|
| B3d | Một nhãn từ warp trung bình có trọng số của posterior M2 (kiểu P2) | Dùng posterior nhưng không marginalize | P2 |
|
||||||
| B5 | Ensemble 5 seed của B3b | Calibration tốt lên là nhờ mô hình registration hay chỉ nhờ ensemble? |
|
| **B3d-Sa** | Một nhãn tại warp trung bình posterior SMC (1024 hạt) | Chỉ cần posterior tốt là đủ? (H2a) | P2r, P3, P4, P6 |
|
||||||
| **M1** | RML, bank 64 mẫu warp posterior theo anchor, trọng số đều | |
|
| B4a–d | Nhãn B3b + loss căn chỉnh chung: hard-min shift, soft-min shift, soft-DTW, DILATE | Có cần anchor/vật lý không, hay loss chịu lệch là đủ? | P2, P3, P6 (S3) |
|
||||||
| **M2** | RML, như M1 + trọng số tie vật lý | **Phương pháp chính** |
|
| B5 | Ensemble 5 seed của B3b | Calibration tốt lên là nhờ mô hình registration hay chỉ nhờ ensemble? | P2, P2r |
|
||||||
| M2-ens | Ensemble 5 seed của M2 | So với B5 cho calibration (H3) |
|
| M1, M2 | RML trên bank 64 mẫu warp posterior kiểu P2 (M1: trọng số đều; M2: + trọng số tie vật lý) | | P2 |
|
||||||
| M3 | RML-EM: cập nhật cả π trong lúc huấn luyện | Hoãn |
|
| **M2-Sa** | RML trên bank 64 hạt SMC | Học trên cả bank có thêm gì không? (H2b) | P2r, P3, P4, P6 |
|
||||||
| Oracle | Nhãn với warp thật (chỉ D2) | Trần tham chiếu |
|
| Ctl-GP | Bank đối chứng: 64 warp Gauss cùng trung bình và hiệp phương sai với posterior | Bank có lợi nhờ thông tin của posterior, hay chỉ nhờ tăng cường nhãn? | T2, P6 (công khai) |
|
||||||
|
| PM2, BK2, HM2 | S8: nhãn tại warp trung bình hai mode; RML trên bank hai thành viên; hard-min trên bank đó | Hệ quả 3 | P6 (S8) |
|
||||||
|
| `-TCN` | Các phương pháp trên với backbone TCN thay CNN–GRU | Kết quả có phụ thuộc backbone? | P6 (S4) |
|
||||||
|
| M3 | RML-EM: cập nhật cả π trong lúc huấn luyện | Hoãn, không làm | |
|
||||||
|
| Oracle | Nhãn với warp thật (chỉ D2) | Trần tham chiếu, không phải đối thủ | D2 |
|
||||||
|
|
||||||
|
Trên F3 (P3), đối thủ tie điểm được chọn bằng validation trong vòng LOWO trong: B3c-R được chọn ở cả 4 giếng.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -577,9 +675,10 @@ Mọi phương pháp mạng dùng **cùng backbone, cùng input, cùng optimizer
|
|||||||
- **Blind well:** giếng test chỉ dùng để chấm điểm. Không dùng DT, RHOB, PHIE hay marker của nó cho huấn luyện, tie, chọn hyperparameter, chọn checkpoint hay dịch hậu kiểm.
|
- **Blind well:** giếng test chỉ dùng để chấm điểm. Không dùng DT, RHOB, PHIE hay marker của nó cho huấn luyện, tie, chọn hyperparameter, chọn checkpoint hay dịch hậu kiểm.
|
||||||
- **Tham chiếu chấm điểm cố định:** marker-calibrated sonic, chốt trước khi huấn luyện bất kỳ mô hình nào. Độ nhạy của chính phép chấm được báo cáo bằng cách chấm lại với TDR `.wlt`. Không bao giờ chọn tham chiếu "đẹp nhất".
|
- **Tham chiếu chấm điểm cố định:** marker-calibrated sonic, chốt trước khi huấn luyện bất kỳ mô hình nào. Độ nhạy của chính phép chấm được báo cáo bằng cách chấm lại với TDR `.wlt`. Không bao giờ chọn tham chiếu "đẹp nhất".
|
||||||
- **Pre-registration:**
|
- **Pre-registration:**
|
||||||
- Protocol, metric và ngưỡng ghi trong [protocol.yaml](../configs/protocol.yaml) (P1) và [protocol_p2.yaml](../configs/protocol_p2.yaml) (P2).
|
- Protocol, metric và ngưỡng ghi trong file protocol, khoá bằng SHA-256 (và từ P3 thêm `.lock.json` gồm hash code, môi trường và input) trước khi chạy. Script chính từ chối chạy nếu hash không khớp.
|
||||||
- Mỗi file được khoá bằng SHA-256 trước khi chạy. Script chính từ chối chạy nếu hash không khớp.
|
- Các protocol: [protocol.yaml](../configs/protocol.yaml) (P1), [protocol_p2.yaml](../configs/protocol_p2.yaml) (P2), [protocol_p2r.yaml](../configs/protocol_p2r.yaml) (P2r), [protocol_f3.yaml](../configs/protocol_f3.yaml) (P3), [protocol_volve.yaml](../configs/protocol_volve.yaml) (P4), [protocol_bench.yaml](../configs/protocol_bench.yaml) (P6, khoá 29/10/2026 14:39 UTC).
|
||||||
- Đổi protocol thì phải tạo version mới.
|
- Không bao giờ sửa protocol đã khoá hay nới ngưỡng. Đổi thì tạo protocol mới và ghi **deviation**. P2r là một deviation (thiết kế sau khi P2 trượt); phần Methods của bài phải nói rõ.
|
||||||
|
- Phân tích làm sau khi thấy kết quả được gắn nhãn **post hoc** hoặc **exploratory** và không đổi verdict. Exploratory được khai báo trước trong `docs/research/` trước khi tính (T2, điều kiện áp dụng, Teapot).
|
||||||
- **Thống kê trung thực:** báo cáo từng giếng rồi mới 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. Sức mạnh thống kê chủ yếu đến từ D2 (bootstrap theo realization).
|
- **Thống kê trung thực:** báo cáo từng giếng rồi mới 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. Sức mạnh thống kê chủ yếu đến từ D2 (bootstrap theo realization).
|
||||||
|
|
||||||
### 9.2 Metric ([metrics.py](../ml_porosity/eval/metrics.py))
|
### 9.2 Metric ([metrics.py](../ml_porosity/eval/metrics.py))
|
||||||
@@ -594,28 +693,35 @@ Mọi phương pháp mạng dùng **cùng backbone, cùng input, cùng optimizer
|
|||||||
|
|
||||||
**Metric quyết định** của gate G-B là **RMSE trong băng seismic**, vì đó là phần misregistration phá hỏng (mục 2.2).
|
**Metric quyết định** của gate G-B là **RMSE trong băng seismic**, vì đó là phần misregistration phá hỏng (mục 2.2).
|
||||||
|
|
||||||
### 9.3 Giả thuyết và cổng go/no-go
|
### 9.3 Giả thuyết, cổng và kết quả
|
||||||
|
|
||||||
| | Giả thuyết | Bác bỏ nếu |
|
**Giả thuyết ban đầu (P2).**
|
||||||
|
|
||||||
|
| | Giả thuyết | Bác bỏ nếu | Kết quả |
|
||||||
|
| --- | --- | --- | --- |
|
||||||
|
| H1 | MSE trên nhãn lệch σ_δ cho dự đoán bị làm mờ đúng như exp(−2π²σ²f²) | Tỉ số đo/lý thuyết ngoài [0.5, 2] | Không bị bác |
|
||||||
|
| H2 | RML tốt hơn tie điểm tốt nhất và loss căn chỉnh chung khi misregistration ≳ 1/8 chu kỳ; ngang bằng khi tie đã tốt | Không có gain so với B3 tốt nhất trong vùng drift thực tế | G-B trượt; tách thành H2a/H2b ở P2r |
|
||||||
|
| H3 | Khoảng dự đoán của RML calibrate tốt hơn cùng backbone + cùng UQ nhưng không mô hình registration | Coverage chỉ tốt lên nhờ khoảng rộng ra | Bị bác ở P2; chỉ mô tả từ P2r |
|
||||||
|
| H4 | Không có anchor thì warp và mạng bù trừ nhau; anchor là cần thiết | Bỏ anchor mà kết quả tương đương | Không bị bác |
|
||||||
|
|
||||||
|
**P2r** tách H2 làm hai:
|
||||||
|
- **H2a:** B3d-Sa hơn tie điểm tốt nhất ít nhất 10% RMSE băng (hoặc +0.05 PCC băng) ở c = 1 với cả hai N, và không kém quá 2% ở c = 0.
|
||||||
|
- **H2b:** M2-Sa hơn B3d-Sa (luật "better": RMSE băng thấp hơn ở ≥ 4/5 seed và ở đa số realization) ở các ô posterior rộng, và lợi ích tăng theo σ_post.
|
||||||
|
|
||||||
|
**Các cổng.** Ngưỡng không bao giờ đổi; chỉ ngày có thể đổi.
|
||||||
|
|
||||||
|
| Cổng | Câu hỏi | Kết quả |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| H1 | MSE trên nhãn lệch σ_δ cho dự đoán bị làm mờ đúng như exp(−2π²σ²f²) | Tỉ số đo/lý thuyết ngoài [0.5, 2] |
|
| G-A (26/10) | Baseline tái lập được không? | Điều kiện chuyển hướng không thoả, sang P2 |
|
||||||
| H2 | RML tốt hơn tie điểm tốt nhất và loss căn chỉnh chung khi misregistration ≳ 1/8 chu kỳ; ngang bằng khi tie đã tốt | Không có gain so với B3 tốt nhất trong vùng drift thực tế |
|
| G-B (26/10) | Trên D2 ở c = 1, M2 hơn đối thủ tốt nhất ≥ 10% RMSE băng (hoặc +0.05 PCC băng), và không kém quá 2% khi c = 0? | **Trượt** |
|
||||||
| H3 | Khoảng dự đoán của RML calibrate tốt hơn cùng backbone + cùng UQ nhưng không mô hình registration | Coverage chỉ tốt lên nhờ khoảng rộng ra |
|
| G-C (28/10) | Trên F3, M2-Sa hơn đối thủ ở ≥ 3/4 giếng **và** coverage 80/90% trong ±5% của mức danh nghĩa? | **Trượt cả hai điều kiện** |
|
||||||
| H4 | Không có anchor thì warp và mạng bù trừ nhau; anchor là cần thiết | Bỏ anchor mà kết quả tương đương |
|
| G-D (29/10) | Trên Volve, cải thiện nhất quán (≥ 5/6 giếng ở cả hai cách chia) và coverage đạt? | **Không đạt**; phép thử không có lực |
|
||||||
|
|
||||||
Lộ trình nén (chốt 27/10/2026): xong toàn bộ bài trước thứ 7, 31/10/2026. Có 4 cổng:
|
Sau G-C và G-D, Pivot 1 (mục 3.2): benchmark P6 khoá protocol riêng với 9 claim, 11 verdict (mục 10.7). Lịch còn lại ở plan §6.1; thứ tự cắt phạm vi nếu trễ cũng ở đó, không bao giờ cắt ngưỡng.
|
||||||
- **G-A** (26/10, đã đánh giá): baseline tái lập được.
|
|
||||||
- **G-B** (26/10, đã đánh giá, không đạt): M2 hơn đối thủ tốt nhất trên D2 ít nhất 10% RMSE băng (hoặc +0.05 PCC băng) ở c = 1, và không kém quá 2% khi c = 0.
|
|
||||||
- **G-C** (cuối 28/10): kết quả F3 nhất quán với synthetic.
|
|
||||||
- **G-D** (cuối 29/10): field thứ hai.
|
|
||||||
|
|
||||||
Sau đó viết bài 29–30/10 (draft v1, v2), review và nộp ngày 31/10. Lịch chi tiết và thứ tự cắt phạm vi nếu trễ ở plan §6.
|
|
||||||
|
|
||||||
Trượt cổng thì chẩn đoán có thời hạn rồi chuyển hướng theo luật đã viết trước (plan §9).
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 10. Kết quả hiện tại (đến 26/10/2026)
|
## 10. Kết quả đến 04/11/2026
|
||||||
|
|
||||||
### 10.1 P1: baseline trên F3 (LOWO 4 giếng, 5 seed)
|
### 10.1 P1: baseline trên F3 (LOWO 4 giếng, 5 seed)
|
||||||
|
|
||||||
@@ -649,24 +755,145 @@ Những điểm vẫn đáng chú ý:
|
|||||||
- H3 **bị bác**: M2-ens calibrate kém hơn B5. Ở chế độ ít giếng, mọi loss có σ học được đều làm σ co lại vì mạng nhớ nhãn train.
|
- H3 **bị bác**: M2-ens calibrate kém hơn B5. Ở chế độ ít giếng, mọi loss có σ học được đều làm σ co lại vì mạng nhớ nhãn train.
|
||||||
- H4 **không bị bác** (mục 6.2).
|
- H4 **không bị bác** (mục 6.2).
|
||||||
|
|
||||||
### 10.3 Chẩn đoán sau G-B (chỉ trên realization dev, chưa khoá)
|
### 10.3 Chẩn đoán sau G-B và P2r (27/10/2026)
|
||||||
|
|
||||||
**Nút thắt là posterior warp, không phải loss.**
|
**Chẩn đoán (chỉ trên realization dev).** Nút thắt là posterior warp, không phải loss. Trọng số vật lý của M2 suy biến (mục 5.5); thay bằng SMC thì sai số warp ở c = 1 giảm từ khoảng 3.3 ms xuống khoảng 0.57 ms. So với đối thủ dùng cùng posterior nhưng chỉ lấy một nhãn trung bình, RML không thắng khi posterior hẹp, đúng như Mệnh đề 1 dự đoán.
|
||||||
- Trọng số vật lý của M2 quá nhọn: ESS ở γ = 1 chỉ ≈ 1/64. Quy tắc ESS ≥ S/4 vì vậy ép γ xuống 0.02–0.11, và mẫu warp gần như không mang thông tin seismic.
|
|
||||||
- Thay bằng SMC tempering (γ theo tự tương quan phần dư, pha ước lượng lại), sai số warp ở c = 1 giảm từ khoảng 3.3 ms xuống khoảng 0.57 ms. B3c vẫn ở 3.8–4.2 ms.
|
|
||||||
- Nhãn từ posterior SMC cho kết quả gần Oracle: RMSE băng thấp hơn B3c 22–23% ở c = 1.
|
|
||||||
|
|
||||||
**Marginalize trên bank chưa thêm được gì.** So với đối thủ dùng *cùng posterior* nhưng chỉ lấy một nhãn trung bình (B3d-S), M2-S không thắng (tỉ số 0.92–1.03). Điều này khớp Mệnh đề 1: posterior hẹp (độ rộng 90% chỉ 0.9–2.9 ms ở c ≤ 1), nên các ứng viên trong bank gần như trùng nhau và trung bình trên bank không làm mờ đáng kể.
|
**P2r** ([protocol_p2r.yaml](../configs/protocol_p2r.yaml), realization 8–15, 5 regime; tổng hợp ở `outputs/p2r/summary/`; plan §12 ý 11–14). Kết luận G-B của P2 **giữ nguyên**; P2r là deviation và phải ghi trong Methods.
|
||||||
|
- **H2a đạt** ở R10, R0, Rm5. Ví dụ R10, c = 1: RMSE băng của B3d-Sa bằng 0.857 (N = 4) và 0.782 (N = 16) lần tie điểm tốt nhất; trên ba regime đủ anchor là giảm 8–22%. Phép so phụ với B3d (posterior kiểu P2) chỉ giữ ở R10.
|
||||||
|
- Cần đọc kỹ: B3d-Sa đã thắng tie điểm ngay cả khi c = 0 (tỉ số khoảng 0.81). Phần lớn lợi ích **không đến từ việc xử lý drift**, mà từ tie có điều kiện theo seismic. Phần gắn với drift: khi c tăng, B3d-Sa giữ gần Oracle, còn đối thủ xấu đi.
|
||||||
|
- **H2b đạt** (N = 16): M2-Sa tốt hơn B3d-Sa ở 8/8 ô rộng, và lợi ích tăng theo σ_post (Spearman ρ = −0.85). Ở ô hẹp, hai phương pháp ngang nhau (tỉ số 0.996).
|
||||||
|
- **Nhánh σ_a trượt:** đặt σ_a bằng một nửa hoặc gấp đôi giá trị thật thì H2a không còn đạt. Lợi ích H2a **cần σ_a đúng**; σ_a thật của F3 không biết.
|
||||||
|
- **H3 chỉ mô tả:** mọi ensemble, kể cả Oracle, đều quá hẹp; coverage 90% từ 0.31 đến 0.79, trung vị 0.47. Không claim calibration.
|
||||||
|
|
||||||
**Hệ quả hiện tại.**
|
**Kiểm post hoc trên P2r (29/10).** [31_p2r_posthoc.py](../scripts/31_p2r_posthoc.py) so lợi ích H2b với cận quần thể của Mệnh đề 4. Theo cận classical 1/B_a (đã đăng ký), lợi ích vượt cận ở 7/8 ô rộng tại σ_post (6/8 tại sai số warp). Theo cận Berkson 1/B_b (post hoc), cấu trúc tự nhiên của nhãn tại warp trung bình, chỉ 3/8 ô vượt tại σ_post, cả ba ở c = 1; tại sai số warp nhiều nhất 1/8. Vì vậy **không được nói lợi ích của bank vượt cận quần thể**. M2-Sa vẫn kém Oracle ở mọi ô rộng (4–63%). T4 ([30_t4_coverage.py](../scripts/30_t4_coverage.py)) mô tả ξ và coverage: ở R10, c = 1, N = 16, ξ là 0.19 ở Oracle và tối đa 0.66 (B5).
|
||||||
- H2 chưa được ủng hộ trước đối thủ cùng posterior. Cải thiện đo được đến từ **posterior tie** (anchor + vật lý + SMC); tie posterior tự nó không mới (Gunning & Glinsky 2006; Buland & Omre 2003), nên điều đem ra kiểm là dùng posterior làm nhãn huấn luyện.
|
|
||||||
- Cập nhật 27/10/2026: đã khoá `protocol_p2r` (H2 tách thành H2a/H2b, H3 chỉ mô tả, nhánh σ_a); chi tiết ở plan §12 mục 11.
|
### 10.4 P3: F3 thật, nested LOWO (28/10/2026)
|
||||||
- Việc còn lại đến hết 27/10/2026:
|
|
||||||
- học σ_a, σ_b;
|
**Thiết kế.** 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 và học trên 2 giếng. Validation chọn số bước và đối thủ tie điểm, không bao giờ dùng giếng test ngoài. Tổng 1320 quỹ đạo huấn luyện, 12 ablation, hai nhánh σ_a, 20 mô hình triển khai, dự đoán cả khối 649 inline. Protocol [protocol_f3.yaml](../configs/protocol_f3.yaml) (+ `.sha256`, `.lock.json`), khoá trước khi chạy; chạy trên máy Windows RTX 3060.
|
||||||
- chạy lưới stress (SNR thấp, ít anchor, rock physics sai mô hình) để tìm vùng mà posterior đủ rộng cho RML có tác dụng.
|
|
||||||
- Sau đó chọn một trong hai:
|
**G-C trượt cả hai điều kiện.**
|
||||||
- khoá `protocol_p2r` với posterior SMC và thêm B3d-S vào tập đối thủ;
|
- M2-Sa chỉ hơn 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. F02-1 1.008, F03-2 1.000, F06-1 1.070.
|
||||||
- hoặc **Pivot 1** (plan §9): bài phân tích về sai số registration của nhãn, với posterior tie là phương pháp, còn RML và nhãn warp trung bình là hai cách dùng posterior đó.
|
- Coverage 80% là 52.38% (cần 75–85%); coverage 90% là 60.91% (cần 85–95%).
|
||||||
|
- Đổi σ_a, thước đo hay nhãn đều không làm kết quả đạt.
|
||||||
|
|
||||||
|
**Đọc kết quả.** Mỗi mô hình chỉ học từ 2 giếng; mạng dự đoán được rất ít nội dung băng seismic, và sai khác giữa các phương pháp nhỏ hơn sai khác giữa các seed. Mốc mô tả làm sau: dự đoán không có nội dung băng seismic có RMSE băng 1.224 p.u.; M2-Sa đạt 1.272, B3c-R 1.256, chỉ B4b (1.211) thấp hơn mốc một chút. B0a vẫn có RMSE tổng tốt nhất (2.48 p.u.).
|
||||||
|
|
||||||
|
**Sự cố.** Lượt đầu dừng ở 132/649 inline vì Windows khoá `outputs/p3/progress.js`. [resume_f3_volume.py](../operations/resume_f3_volume.py) chỉ khôi phục bước suy luận, giữ code đã đăng ký và các dòng đã xong; audit ở `outputs/p3/volume_recovery.json`, `completion_checks.json`. Review code: [p3-code-review.md](research/p3-code-review.md).
|
||||||
|
|
||||||
|
**Quyết định:** đóng P3, không chạy lại. 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.
|
||||||
|
|
||||||
|
### 10.5 P4: Volve (29/10/2026)
|
||||||
|
|
||||||
|
**Thiết kế.** Hai cách chia fold: LOWO, và "slot" (giấu cả nhóm giếng chung một lỗ khoan). Vị trí giếng test đặt bằng mô hình thời gian–độ sâu trung bình của các giếng train. Protocol [protocol_volve.yaml](../configs/protocol_volve.yaml) khoá 01:17:42 UTC; driver `scripts/run_p4.sh`; chạy trên server Linux (H200; nhánh chính cuda:1, các nhánh σ_a song song trên cuda:0), xong 02:21 UTC.
|
||||||
|
|
||||||
|
**G-D không đạt.**
|
||||||
|
|
||||||
|
| Tiêu chí đã khoá | lowo | slot |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| M2-Sa 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% |
|
||||||
|
|
||||||
|
Không phương pháp nào có kỹ năng ở giếng blind (R² < 0 ở mọi nơi, PCC ≤ 0.24). Đổi σ_a sang 3.5 hay 14 ms gần như không đổi gì (RMSE macro lệch ≤ 0.06 p.u.).
|
||||||
|
|
||||||
|
**Post hoc, ngoài khoá** ([25_p4_posthoc.py](../scripts/25_p4_posthoc.py) → `outputs/p4/posthoc/`). Một hằng số bằng trung bình PHIF của giếng train thắng mọi mạng (RMSE macro 6.03 lowo, 6.59 slot). Porosity trung bình khác nhau nhiều giữa các giếng (8.5–17.0 p.u.); các phương pháp tie chỉ chênh nhau tối đa 0.25 p.u. trên tổng sai số 6–7 p.u. G-D vì vậy không có lực: Volve **không chống và cũng không ủng hộ** RML. Registration trên Volve tốt hơn F3 (pha wavelet xác định tốt; σ_post trung vị khoảng 4 ms, gần như không theo σ_a); nút thắt không nằm ở tie.
|
||||||
|
|
||||||
|
**P4x bị bỏ (29/10).** Vài biến thể mô hình thử sau G-D (khai báo ở [p4-exploratory.md](research/p4-exploratory.md)) bị dừng ở 670/921 job. `exploratory/` và `outputs/p4x/` chỉ giữ làm hồ sơ: không tổng hợp, không trích dẫn, không mở rộng (plan §12 ý 21).
|
||||||
|
|
||||||
|
### 10.6 Pivot 1 và các phân tích exploratory (29/10 → 02/11/2026)
|
||||||
|
|
||||||
|
**T2: cơ chế của lợi ích bank** (exploratory trên realization 8–15, khai báo và băm trước khi tính ở [t2-mechanism.md](research/t2-mechanism.md); kết quả [t2-results.md](research/t2-results.md); [32_t2_mechanism.py](../scripts/32_t2_mechanism.py); bài mục 6.4).
|
||||||
|
- Sai số nhãn của B3d-Sa là kiểu Berkson ở c = 1, nên cận 1/B_b áp dụng và lợi ích H2b không vượt hiệu chỉnh quần thể.
|
||||||
|
- Bank nhiễu GP cùng trung bình và hiệp phương sai với posterior (Ctl-GP) lấy được phần lớn lợi ích ở c = 1: chủ yếu là 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 PM–Oracle là do độ dài huấn luyện.
|
||||||
|
- Không bao giờ dùng T2 để chọn lại ngân sách của P2r.
|
||||||
|
|
||||||
|
**T3: một field test cần gì** ([27_t3_power.py](../scripts/27_t3_power.py); bài mục 6.6). Chấm lại dự đoán P2r đã lưu bằng reference cố ý lệch σ_ref.
|
||||||
|
- Với reference chính xác, sign test cần 5–18 giếng blind để đạt power 0.8 ở phần lớn các ô. Với σ_ref từ 3 ms trở lên, 40 giếng cũng không đủ.
|
||||||
|
- Luật "≥ k/n giếng cải thiện" của G-C, G-D không phải phép kiểm: khi không có khác biệt thật, nó vẫn đạt với xác suất 0.31 (4 giếng) và 0.11 (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; plan §12 ý 23).
|
||||||
|
- C1: mạng có kỹ năng ở giếng blind trong băng seismic. C2: posterior tie đủ rộng. C3: σ_a xác định được bằng dữ liệu thời gian–độ sâu độc lập ở ≥ 3 giếng ngoài tập test. C4: đủ giếng cho phép kiểm có lực.
|
||||||
|
- F3 và Volve trượt C1, đạt C2 ([26_applicability.py](../scripts/26_applicability.py)).
|
||||||
|
- Teapot: tối đa 2 giếng có reference thời gian–độ sâu độc lập (T0 trượt); pilot P-a dùng cặp horizon–top cho sai số 6.75 ms so với dung sai 1.5 ms (trượt). Teapot dừng; bài không có field test mới.
|
||||||
|
- C1–C4 được nêu sau khi cả hai field gate trượt, nên không phải tiêu chí đăng ký trước.
|
||||||
|
|
||||||
|
### 10.7 P6: benchmark có xét registration (29/10 → 02/11/2026)
|
||||||
|
|
||||||
|
**Chạy.** [protocol_bench.yaml](../configs/protocol_bench.yaml) khoá 29/10 14:39 UTC (sha256 `aa763f0a…`; ngân sách TCN 125 chọn trên dev). Chạy chính 29/10 14:43 → 30/10 02:16 UTC trên hai H200 trong tmux, có supervisor ([p6_supervisor.py](../operations/p6_supervisor.py)) tự khởi động lại driver chết: S1 560 ô train, S2 224 posterior + 224 train, S3+S4+S8 384 train. Tổng hợp xong 02/11 02:02 UTC. Thiết kế: [bench-protocol.md](research/bench-protocol.md).
|
||||||
|
|
||||||
|
**Các nghiên cứu.**
|
||||||
|
|
||||||
|
| Nghiên cứu | Nội dung |
|
||||||
|
| --- | --- |
|
||||||
|
| S1 | Phase diagram c ∈ {0, 0.5, 1, 1.5, 2} × N ∈ {2, 4, 8, 16} ở 5 regime |
|
||||||
|
| S2 | Sai mô hình: rock physics, wavelet, drift (mục 7.2), ở R10 và Rm5 |
|
||||||
|
| S3 | Thêm baseline không anchor B4a–d vào tập đối thủ của H2a |
|
||||||
|
| S4 | Backbone thứ hai TCN |
|
||||||
|
| S7 | Đóng gói benchmark |
|
||||||
|
| S8 | Lỗi hai mode Δ ∈ {8, 16, 32} ms (Hệ quả 3) |
|
||||||
|
|
||||||
|
**Verdict (9 claim, 11 verdict, 9 đạt theo đúng lời phát biểu; [verdict_final.md](../outputs/bench/summary/verdict_final.md)).**
|
||||||
|
|
||||||
|
| Verdict | Kết quả | Nội dung |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| S1-H1 | đạt | H2a ở drift mạnh hơn: R10, c = 1.5, tỉ số 0.853 / 0.796 (N = 4 / 16) |
|
||||||
|
| S1-H2 | đạt | Lợi ích bank tăng theo N ở 13/13 họ rộng, ρ = −0.47, p < 1e−4 |
|
||||||
|
| S2-H1 rock physics | **trượt** | 0.940 / 0.934: lợi ích H2a co xuống dưới ngưỡng |
|
||||||
|
| S2-H1 wavelet | **trượt** | 1.023 / 1.042: posterior SMC quá tự tin (cov90 0.17 / 0.10), lợi ích mất hẳn |
|
||||||
|
| S2-H1 drift | đạt | 0.862 / 0.798 |
|
||||||
|
| S2-H2 | đạt | Bank không bao giờ gây hại dưới sai mô hình (14/14 ≤ 1.02) |
|
||||||
|
| S3-H1 | đạt | H2a giữ khi thêm B4a–d, ở R10, R0, Rm5 |
|
||||||
|
| S4-H1 | đạt | H2a giữ với TCN |
|
||||||
|
| S4-H2 | đạt | Lợi ích bank ở ô rộng giữ với TCN |
|
||||||
|
| S8-H1 | đạt | Hàm truyền của nhãn hai mode đảo dấu ở Δ = 32 ms, như Hệ quả 3 |
|
||||||
|
| S8-H2 | đạt | BK2 hơn PM2 ở Δ = 16 và 32 ms (BK2/PM2 0.28–0.71) |
|
||||||
|
|
||||||
|
Cả hai verdict trượt đều được dự đoán đạt trước khi chạy. Vì vậy **không được nói H2a bền với sai mô hình nói chung**: S2 chỉ đạt ở trục drift. Vì S2 đã chạy đủ, bài được dùng chữ "benchmark".
|
||||||
|
|
||||||
|
**Hai cách đọc (D-13).** Code tổng hợp đã khoá khác lời phát biểu ở ba chỗ:
|
||||||
|
- S1-H1: code đòi đúng 2 dòng nhưng S1 có 4 giá trị N, nên ra null.
|
||||||
|
- S2-H1: không có trường `pass` ở mức trên cùng, nên ra "not available".
|
||||||
|
- S3-H1: code thêm Ctl-GP vào tập đối thủ; đọc như chạy thì trượt ở mọi regime vì Ctl-GP gần bằng B3d-Sa.
|
||||||
|
|
||||||
|
Code đã khoá không bị sửa. [36_bench_verdicts.py](../scripts/36_bench_verdicts.py) (ngoài hash khoá, kiểm khoá trước) áp đúng lời phát biểu → `verdict_final.{json,md}`. Bài báo cáo cả hai cách đọc và phần Methods phải nêu deviation này.
|
||||||
|
|
||||||
|
**Đọc S8.** Locked S8-H2 gọi BK2 là "calibrated" chỉ theo nghĩa yếu là warp thật nằm trong bank. Theo Hệ quả 3, ở λ → 0 hệ số truyền của nó là cos²(πfΔ), nhưng đo được 0.92–1.00 ở N = 16: responsibility đã tái đăng ký nhãn. Bài nói rõ; verdict không đổi.
|
||||||
|
|
||||||
|
**Gói benchmark S7** (02/11; [37_bench_package.py](../scripts/37_bench_package.py), [benchmark/README.md](../benchmark/README.md)).
|
||||||
|
- 630 task (test 8–15, dev 900–905; mỗi realization 45 task: 5 regime danh nghĩa × 5 c, 14 thiết lập S2, 6 thiết lập S8), truth ẩn, input và `inputs/analyst.json` trong `outputs/bench/package/` (845 MB, gitignore, là payload Zenodo).
|
||||||
|
- Hash nội dung ở [benchmark/MANIFEST.json](../benchmark/MANIFEST.json). Bảng tham chiếu 45200 lượt chạy (21 phương pháp) ở `benchmark/reference/`.
|
||||||
|
- `score --pred DIR --name NAME` chấm theo đúng luật H2a và luật "better" đã khoá; `selftest` đạt.
|
||||||
|
- **Chưa deposit Zenodo:** cần tài khoản của người dùng, danh sách tác giả và kiểm giấy phép (nháp CC BY-SA 3.0, thừa hưởng từ F3).
|
||||||
|
|
||||||
|
**Gói tái lập** (02/11; [39_repro_package.py](../scripts/39_repro_package.py), [repro/README.md](../repro/README.md)). Năm archive dữ liệu dẫn xuất tất định trong `outputs/repro/` (11112 file; F3 và synthetic CC BY-SA 3.0, Volve CC BY-NC-SA 4.0, Teapot CC0 chưa xác minh), manifest [repro/MANIFEST.json](../repro/MANIFEST.json). `verify` chạy lại 12 bước trong phòng sạch không có dữ liệu thô: 12/12 đạt, 63 file viết lại trùng từng byte, 3 trùng giá trị, không file nào khác ([verify_report.md](../repro/verify_report.md)). Chưa deposit; cần người dùng chọn giấy phép cho bảng applicability gộp F3+Volve và giấy phép code.
|
||||||
|
|
||||||
|
### 10.8 Bài báo và trạng thái đến 04/11/2026
|
||||||
|
|
||||||
|
- [paper/](../paper/) theo khung Pivot 1, biên dịch sạch (69 trang sau lượt rà soát chống hallucination ngày 04/11, plan §12 ý 36); phần chính khoảng 18700 từ, so với giới hạn khoảng 5500 của *Computers & Geosciences* (rủi ro R9; người dùng bỏ lượt cắt độ dài ngày 29/10, plan §12 ý 25). Số liệu của bài lấy từ đâu: [paper/README.md](../paper/README.md).
|
||||||
|
- Đã viết (số mục theo bài): Mệnh đề 3–6, Hệ quả 3–4; T4 và kiểm cận H2b (mục 6.3); T2 (6.4); Thí nghiệm 3 benchmark (6.5); T3 (6.6); các field case (6.7, chi tiết F3/Volve ở Phụ lục B). Hình Thí nghiệm 3: [38_bench_figures.py](../scripts/38_bench_figures.py).
|
||||||
|
- Còn todo: tác giả, khai báo của tác giả, URL repository và DOI, DOI và giấy phép Zenodo, giấy phép Teapot, todoblock novelty ở mục 2 (quét lại ngày 13/11).
|
||||||
|
- Máy thứ ba (04/11, plan §12 ý 34): `outputs/` và `data/` lấy từ snapshot 30/10 (21987/21987 sha256 khớp); các output 02/11 nằm ngoài git được sinh lại, trùng từng byte. Người dùng còn phải chép: 7 PDF trong `refs/`, `outputs_thesis/`, log thô.
|
||||||
|
- Việc tiếp theo (11–14/11, làm sớm được): review nội bộ, hình, đọc lại phụ lục chứng minh, quét novelty cuối, kiểm quartile, preprint, nộp.
|
||||||
|
|
||||||
|
### 10.9 Tóm tắt
|
||||||
|
|
||||||
|
| Câu hỏi | Trả lời |
|
||||||
|
| --- | --- |
|
||||||
|
| Nhãn lệch có làm mạng học ra ảnh mờ không? | Có, nếu sai số kiểu classical. 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 8–22% so với tie điểm tốt nhất (H2a), nếu σ_a đúng. Giữ ở drift mạnh hơn, với TCN, khi thêm B4a–d, dưới sai drift; **không** giữ dưới sai rock physics và sai pha wavelet |
|
||||||
|
| Học trên cả bank có thêm gì không? | Có, nhưng chỉ khi posterior rộng (H2b), tăng theo N (S1-H2); phần lớn là tăng cường nhãn, nằm trong cận Berkson (T2) |
|
||||||
|
| Nhãn tại tie trung bình posterior thì mạng học ra gì? | Ảnh sắc hơn thật: sai số kiểu Berkson (Mệnh đề 3) |
|
||||||
|
| Lỗi hai mode thì sao? | Băng seismic học được đảo dấu (S8-H1); bank chứa warp thật sửa được (S8-H2) |
|
||||||
|
| 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? | Không thắng; khác biệt nhỏ hơn nhiễu do seed (G-C trượt) |
|
||||||
|
| Trên Volve? | 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 có lực) |
|
||||||
|
| Field test cần gì? | Reference ở giếng blind chính xác cỡ 1 ms và khoảng 5–18 giếng blind; F3, Volve, Teapot đều không có |
|
||||||
|
|
||||||
|
**Được nói và không được nói** khi viết bài: danh sách đầy đủ ở plan §10 và [lecture.md](lecture.md) Bài 12. Mấy điều cấm chính: không claim field superiority hay calibrated uncertainty; không nói H2a bền với sai mô hình nói chung; không nói lợi ích bank vượt cận quần thể; không dùng Volve làm bằng chứng cho hay chống RML; không trích P4x; không gọi marker F3 là checkshot độc lập; không gọi "porosity" F3 mà không nói nó là sonic tuyến tính.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -697,16 +924,43 @@ Những điểm vẫn đáng chú ý:
|
|||||||
| Huấn luyện chung cho mọi phương pháp P2 | [models/bank_train.py](../ml_porosity/models/bank_train.py) |
|
| Huấn luyện chung cho mọi phương pháp P2 | [models/bank_train.py](../ml_porosity/models/bank_train.py) |
|
||||||
| Baseline B0b (attribute) và B1 (inversion) | [baselines/attributes.py](../ml_porosity/baselines/attributes.py), [baselines/inversion.py](../ml_porosity/baselines/inversion.py) |
|
| Baseline B0b (attribute) và B1 (inversion) | [baselines/attributes.py](../ml_porosity/baselines/attributes.py), [baselines/inversion.py](../ml_porosity/baselines/inversion.py) |
|
||||||
| Metric điểm, theo băng, calibration | [eval/metrics.py](../ml_porosity/eval/metrics.py) |
|
| Metric điểm, theo băng, calibration | [eval/metrics.py](../ml_porosity/eval/metrics.py) |
|
||||||
|
| Giếng nghiêng (Volve): quỹ đạo, MD → TVD, patch dọc đường giếng | [data/deviated.py](../ml_porosity/data/deviated.py), [data/volve_wells.py](../ml_porosity/data/volve_wells.py) |
|
||||||
|
| Pipeline P3 (F3): protocol/khoá, registration, training, evaluation, volume, dashboard | [f3/](../ml_porosity/f3/) |
|
||||||
|
| Pipeline P4 (Volve): protocol, fold lowo/slot, loss có mask, registration, training, evaluation | [volve/](../ml_porosity/volve/) |
|
||||||
|
| Runner benchmark P6: protocol/khoá, ô, dữ liệu, registration, training, ngân sách dev, tổng hợp verdict, tái lập P2r | [benchmark/](../ml_porosity/benchmark/) (`protocol.py`, `cells.py`, `data.py`, `registration.py`, `training.py`, `devbudgets.py`, `summary.py`, `repro.py`, `runner.py`) |
|
||||||
|
|
||||||
### 11.2 Chạy
|
### 11.2 Chạy theo pha
|
||||||
|
|
||||||
Cài đặt và bảng mô tả từng script ở [README.md](../README.md). Thứ tự:
|
Cài đặt và bảng mô tả từng script ở [README.md](../README.md). Luôn chạy qua `scripts/runlog.sh` hoặc các driver `run_p*.sh`; đặt `OMP_NUM_THREADS`, `MKL_NUM_THREADS`, `OPENBLAS_NUM_THREADS` rõ ràng; job nhiều giờ thì chạy trong tmux của người dùng.
|
||||||
- `scripts/run_p0.sh`: hạ tầng và test.
|
|
||||||
- `scripts/run_p1.sh`: audit F3 và baseline LOWO.
|
|
||||||
- `scripts/run_p2.sh`: prior warp, D2, lưới chính, H1, tổng hợp; chạy trên GPU `cuda:1`.
|
|
||||||
- `scripts/14_diag_posterior.py` và `scripts/15_diag_train.py`: chẩn đoán sau G-B.
|
|
||||||
|
|
||||||
Test nằm trong [tests/](../tests/). Các test quan trọng cho lý thuyết nằm ở [test_losses.py](../tests/test_losses.py) (các trường hợp riêng của RML) và [test_registration.py](../tests/test_registration.py).
|
| Pha | Driver | Script chính |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| P0 | `scripts/run_p0.sh` | test, manifest dữ liệu (`00_data_manifest.py --check`) |
|
||||||
|
| P1 | `scripts/run_p1.sh` | 01–08 |
|
||||||
|
| P2 | `scripts/run_p2.sh` | 09–13 |
|
||||||
|
| Chẩn đoán sau G-B, P2r | `scripts/run_p2r_main.sh` | 14–17 (dev), 18 (tổng hợp) |
|
||||||
|
| P3 F3 | `scripts/run_p3.ps1` (Windows) | 19–21; khôi phục volume `operations/resume_f3_volume.py` |
|
||||||
|
| P4 Volve | `scripts/run_p4.sh`, `scripts/run_p4.ps1` | 23, 24; 25 (post hoc, ngoài khoá) |
|
||||||
|
| Điều kiện áp dụng, T3, Teapot (exploratory) | | 26, 27; 28, 29 |
|
||||||
|
| T4 và kiểm cận H2b (post hoc trên P2r) | | 30, 31 |
|
||||||
|
| T2 (exploratory) | | 32 |
|
||||||
|
| P6 benchmark | `scripts/run_bench.sh`, `operations/p6_supervisor.py` | 33 (QC bộ sinh), 34 (runner: `lock`, chạy, `summarize`), 35 (hiệu chuẩn S2 trên dev), 36 (verdict cuối) |
|
||||||
|
| S7 gói benchmark | | 37 (`generate`, `check`, `tables`, `score`, `selftest`) |
|
||||||
|
| Hình cho bài báo | | 22; 38 (Thí nghiệm 3) |
|
||||||
|
| Gói tái lập | | 39 (`build`, `check`, `verify`, `code`) |
|
||||||
|
|
||||||
|
Script 34 resume theo fingerprint: dừng thì chạy lại đúng lệnh cũ; không chạy hai driver trên cùng study/regime. 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). Không chạy lại hay thiết kế lại P3, P4.
|
||||||
|
|
||||||
|
**Thư mục ngoài `ml_porosity/`.**
|
||||||
|
- [configs/](../configs/): cấu hình dữ liệu và các protocol đã khoá.
|
||||||
|
- [benchmark/](../benchmark/): tài liệu người dùng của gói benchmark (tiếng Anh), manifest, bảng tham chiếu, nháp metadata Zenodo.
|
||||||
|
- [repro/](../repro/): tài liệu và manifest của gói tái lập.
|
||||||
|
- [operations/](../operations/): script vận hành (khôi phục P3, supervisor P6).
|
||||||
|
- [exploratory/](../exploratory/): hồ sơ P4x, không mở rộng.
|
||||||
|
- `code_thesis/`: code luận văn gốc, không sửa.
|
||||||
|
- `outputs/`, `data/`, `refs/*.pdf`, `.venv` không nằm trong git; danh sách và sha256 ở [server-migration.md](research/server-migration.md).
|
||||||
|
|
||||||
|
Test nằm trong [tests/](../tests/). Các test quan trọng cho lý thuyết nằm ở [test_losses.py](../tests/test_losses.py) (các trường hợp riêng của RML) và [test_registration.py](../tests/test_registration.py); [test_d2_misspec.py](../tests/test_d2_misspec.py) kiểm bộ sinh sai mô hình.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -716,66 +970,84 @@ Test nằm trong [tests/](../tests/). Các test quan trọng cho lý thuyết n
|
|||||||
| --- | --- |
|
| --- | --- |
|
||||||
| Acoustic impedance (AI) | Mật độ × vận tốc sóng P. Thay đổi AI tạo ra phản xạ |
|
| Acoustic impedance (AI) | Mật độ × vận tốc sóng P. Thay đổi AI tạo ra phản xạ |
|
||||||
| Anchor | Cặp (độ sâu, thời gian) độc lập với sonic, ở đây là marker khớp horizon. Có sai số pick σ_a |
|
| Anchor | Cặp (độ sâu, thời gian) độc lập với sonic, ở đây là marker khớp horizon. Có sai số pick σ_a |
|
||||||
| Băng seismic / băng thấp | Phần tín hiệu ≥ 6 Hz (seismic có thông tin) / < 6 Hz (chủ yếu trend) |
|
|
||||||
| Bank (ngân hàng nhãn) | S phiên bản nhãn ứng với S mẫu warp, kèm trọng số π |
|
| Bank (ngân hàng nhãn) | S phiên bản nhãn ứng với S mẫu warp, kèm trọng số π |
|
||||||
|
| Berkson / classical (sai số) | Classical: sai số độc lập với giá trị thật, làm mờ predictor. Berkson: sai số độc lập với dữ liệu đã có (vd. tie tại trung bình posterior), làm sắc predictor (Mệnh đề 3) |
|
||||||
| Blind well | Giếng test hoàn toàn không đóng góp vào huấn luyện |
|
| Blind well | Giếng test hoàn toàn không đóng góp vào huấn luyện |
|
||||||
| Bulk shift | Dịch toàn bộ chuỗi một hằng số thời gian |
|
| Bulk shift | Dịch toàn bộ chuỗi một hằng số thời gian |
|
||||||
|
| Băng seismic / băng thấp | Phần tín hiệu ≥ 6 Hz (seismic có thông tin) / < 6 Hz (chủ yếu trend) |
|
||||||
| Calibration | Mức khớp giữa bất định khai báo và sai số thực |
|
| Calibration | Mức khớp giữa bất định khai báo và sai số thực |
|
||||||
| Checkshot / VSP | Đo trực tiếp thời gian truyền sóng tới các độ sâu trong giếng |
|
| Checkshot / VSP | Đo trực tiếp thời gian truyền sóng tới các độ sâu trong giếng |
|
||||||
|
| cov90 | Coverage của khoảng 90% |
|
||||||
| Coverage | Tỉ lệ giá trị thật nằm trong khoảng dự đoán ở một mức danh nghĩa |
|
| Coverage | Tỉ lệ giá trị thật nằm trong khoảng dự đoán ở một mức danh nghĩa |
|
||||||
| CRPS | Điểm đánh giá cả độ chính xác lẫn độ sắc của phân phối dự đoán (càng nhỏ càng tốt) |
|
| CRPS | Điểm đánh giá cả độ chính xác lẫn độ sắc của phân phối dự đoán (càng nhỏ càng tốt) |
|
||||||
|
| Ctl-GP | Bank đối chứng gồm 64 warp Gauss có cùng trung bình và hiệp phương sai với posterior SMC |
|
||||||
| Cycle skipping | Tie khớp nhầm lệch đúng một chu kỳ wavelet |
|
| Cycle skipping | Tie khớp nhầm lệch đúng một chu kỳ wavelet |
|
||||||
|
| Deviation | Thay đổi so với protocol đã khoá, ghi lại công khai kèm lý do (vd. P2r, cách đọc D-13 của P6) |
|
||||||
| Drift | Lệch tích luỹ theo độ sâu giữa thời gian sonic và thời gian seismic |
|
| Drift | Lệch tích luỹ theo độ sâu giữa thời gian sonic và thời gian seismic |
|
||||||
| DT (sonic) | Slowness của sóng P, µs/m |
|
| DT (sonic) | Slowness của sóng P, µs/m |
|
||||||
| ESS | (1) Elliptical slice sampling: thuật toán MCMC. (2) Effective sample size: số mẫu hiệu dụng của bộ trọng số |
|
| ESS | (1) Elliptical slice sampling: thuật toán MCMC. (2) Effective sample size: số mẫu hiệu dụng của bộ trọng số |
|
||||||
|
| Exploratory / post hoc | Phân tích khai báo trước nhưng không khoá ngưỡng / phân tích làm sau khi thấy kết quả. Không đổi verdict |
|
||||||
| Gaussian process (GP) | Phân phối xác suất trên hàm, xác định bởi trung bình và kernel |
|
| Gaussian process (GP) | Phân phối xác suất trên hàm, xác định bởi trung bình và kernel |
|
||||||
| Heteroscedastic | Mạng dự đoán cả độ bất định σ(t) thay đổi theo từng điểm |
|
| Heteroscedastic | Mạng dự đoán cả độ bất định σ(t) thay đổi theo từng điểm |
|
||||||
| Horizon | Mặt phản xạ được dò liên tục trong cube seismic |
|
| Horizon | Mặt phản xạ được dò liên tục trong cube seismic |
|
||||||
|
| Hạt (particle, SMC) | Một ứng viên warp trong đám 1024 hạt của SMC; có trọng số, được resample và di chuyển |
|
||||||
| Inline / crossline / bin | Hai trục của lưới khảo sát và một ô của lưới |
|
| Inline / crossline / bin | Hai trục của lưới khảo sát và một ô của lưới |
|
||||||
| λ (lambda) | Luỹ thừa trong RML, điều khiển giữa trung bình (λ → 0) và hard-min (λ → ∞) |
|
|
||||||
| LFM | Low-frequency model: mô hình phần tần số thấp, thường nội suy từ giếng theo horizon |
|
| LFM | Low-frequency model: mô hình phần tần số thấp, thường nội suy từ giếng theo horizon |
|
||||||
| LOWO | Leave-one-well-out cross-validation |
|
| LOWO | Leave-one-well-out cross-validation |
|
||||||
| Marginalize | Lấy tổng (tích phân) theo một biến chưa biết thay vì cố định nó ở một giá trị |
|
| Marginalize | Lấy tổng (tích phân) theo một biến chưa biết thay vì cố định nó ở một giá trị |
|
||||||
| Marker | Nóc tầng đá xác định trên log giếng |
|
| Marker | Nóc tầng đá xác định trên log giếng |
|
||||||
| MD / TVD / KB | Độ sâu đo dọc lỗ khoan / độ sâu thẳng đứng / mốc đo trên giàn |
|
| MD / TVD / KB | Độ sâu đo dọc lỗ khoan / độ sâu thẳng đứng / mốc đo trên giàn |
|
||||||
| Misregistration / registration | Sai lệch / việc căn chỉnh giữa trục thời gian của nhãn và của seismic |
|
| Misregistration / registration | Sai lệch / việc căn chỉnh giữa trục thời gian của nhãn và của seismic |
|
||||||
|
| Nhãn trung bình posterior | Một nhãn lấy tại warp trung bình của posterior (B3d, B3d-Sa) |
|
||||||
| Oracle | Mô hình huấn luyện với warp thật (chỉ có trên synthetic) |
|
| Oracle | Mô hình huấn luyện với warp thật (chỉ có trên synthetic) |
|
||||||
| PCC | Hệ số tương quan Pearson |
|
|
||||||
| PHIE / PHIE_DT | Porosity hiệu dụng trong LAS / nhãn chính của dự án = −0.2018 + 0.0011·DT |
|
|
||||||
| p.u. | Porosity unit = porosity × 100 |
|
| p.u. | Porosity unit = porosity × 100 |
|
||||||
|
| PCC | Hệ số tương quan Pearson |
|
||||||
| Phase diagram | Bản đồ kết quả theo (mức drift c × số giếng N) |
|
| Phase diagram | Bản đồ kết quả theo (mức drift c × số giếng N) |
|
||||||
|
| PHIE / PHIE_DT | Porosity hiệu dụng trong LAS / nhãn chính của dự án = −0.2018 + 0.0011·DT |
|
||||||
|
| Pivot 1 | Quyết định 29/10/2026 chuyển bài thành lý thuyết + benchmark synthetic |
|
||||||
| Post-stack | Seismic đã cộng các lần thu, mỗi bin một trace |
|
| Post-stack | Seismic đã cộng các lần thu, mỗi bin một trace |
|
||||||
| Pre-registration | Chốt protocol và ngưỡng trước khi chạy, khoá bằng hash |
|
| Pre-registration | Chốt protocol và ngưỡng trước khi chạy, khoá bằng hash |
|
||||||
| Realization | Một lần sinh ngẫu nhiên earth model synthetic |
|
| Realization | Một lần sinh ngẫu nhiên earth model synthetic |
|
||||||
|
| Reference (tham chiếu chấm điểm) | Nhãn ở giếng blind dùng để chấm; nếu chính nó bị lệch σ_r thì thứ hạng có thể đảo (Mệnh đề 6) |
|
||||||
| Reflectivity | Chuỗi hệ số phản xạ theo thời gian |
|
| Reflectivity | Chuỗi hệ số phản xạ theo thời gian |
|
||||||
| RML | Registration-Marginalized Learning, phương pháp của bài |
|
| Regime | Tổ hợp SNR và mật độ anchor của synthetic: R10, R0, Rm5, R0h, R10tb (mục 7.2) |
|
||||||
|
| RML | Registration-Marginalized Learning: loss marginal trên bank nhãn; từ Pivot 1 là họ baseline dùng để định nghĩa các phương pháp đem so (C3), không phải phương pháp thắng |
|
||||||
| Rock physics | Quan hệ giữa thuộc tính đá (porosity) và log (DT, RHOB, AI) |
|
| Rock physics | Quan hệ giữa thuộc tính đá (porosity) và log (DT, RHOB, AI) |
|
||||||
|
| S1–S8 | Các nghiên cứu của benchmark P6 (mục 10.7) |
|
||||||
| SMC tempering | Lấy mẫu bằng một đám hạt, tăng dần luỹ thừa likelihood γ từ 0 tới 1 |
|
| SMC tempering | Lấy mẫu bằng một đám hạt, tăng dần luỹ thừa likelihood γ từ 0 tới 1 |
|
||||||
| Soft-DTW / DILATE | Loss căn chỉnh chuỗi khả vi, không có anchor |
|
| Soft-DTW / DILATE | Loss căn chỉnh chuỗi khả vi, không có anchor |
|
||||||
| Std ratio | Độ lệch chuẩn dự đoán / độ lệch chuẩn nhãn. Nhỏ hơn 1 nghĩa là dự đoán bị co |
|
| Std ratio | Độ lệch chuẩn dự đoán / độ lệch chuẩn nhãn. Nhỏ hơn 1 nghĩa là dự đoán bị co |
|
||||||
| Synthetic seismogram | Trace seismic nhân tạo dựng từ log giếng và wavelet |
|
| Synthetic seismogram | Trace seismic nhân tạo dựng từ log giếng và wavelet |
|
||||||
| τ (tau) | Thời gian sonic: tích phân DT từ một điểm neo |
|
| TCN | Temporal convolutional network: backbone thứ hai, dùng trong S4 |
|
||||||
| Tempering (γ) | Nâng likelihood lên luỹ thừa γ ≤ 1 để bớt nhọn |
|
|
||||||
| TDR | Time–depth relationship: ánh xạ độ sâu ↔ thời gian |
|
| TDR | Time–depth relationship: ánh xạ độ sâu ↔ thời gian |
|
||||||
|
| Tempering (γ) | Nâng likelihood lên luỹ thừa γ ≤ 1 để bớt nhọn |
|
||||||
| Trace | Chuỗi biên độ seismic tại một vị trí |
|
| Trace | Chuỗi biên độ seismic tại một vị trí |
|
||||||
| TWT | Two-way time: thời gian sóng đi xuống và về (ms) |
|
| TWT | Two-way time: thời gian sóng đi xuống và về (ms) |
|
||||||
| Type-II ML / MAP-II | Chọn hyperparameter của prior bằng cực đại marginal likelihood (có thêm hyperprior thì là MAP-II) |
|
| Type-II ML / MAP-II | Chọn hyperparameter của prior bằng cực đại marginal likelihood (có thêm hyperprior thì là MAP-II) |
|
||||||
| Warp | Hàm t(τ) đơn điệu biến thời gian sonic thành thời gian seismic; gồm b và g |
|
| Warp | Hàm t(τ) đơn điệu biến thời gian sonic thành thời gian seismic; gồm b và g |
|
||||||
| Wavelet | Xung seismic có băng tần hữu hạn; tích chập với reflectivity cho trace |
|
| Wavelet | Xung seismic có băng tần hữu hạn; tích chập với reflectivity cho trace |
|
||||||
| Well tie | Chỉnh TDR để synthetic khớp seismic tại giếng |
|
| Well tie | Chỉnh TDR để synthetic khớp seismic tại giếng |
|
||||||
|
| λ (lambda) | Luỹ thừa trong RML, điều khiển giữa trung bình (λ → 0) và hard-min (λ → ∞) |
|
||||||
|
| ξ (xi) | Phương sai dự báo / sai số bình phương trung bình; ξ < 1 nghĩa là quá tự tin (Mệnh đề 5) |
|
||||||
|
| σ_post | Độ rộng posterior warp (ms). Ô benchmark gọi là "rộng" khi σ_post ≥ 1.5 ms |
|
||||||
|
| τ (tau) | Thời gian sonic: tích phân DT từ một điểm neo |
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 13. Đọc tiếp
|
## 13. Đọc tiếp
|
||||||
|
|
||||||
- [plan.md](plan.md): kế hoạch đầy đủ, số liệu audit, thiết kế thí nghiệm, rủi ro và các hướng pivot.
|
- [plan.md](plan.md): kế hoạch đầy đủ, số liệu audit, thiết kế thí nghiệm, rủi ro, các hướng pivot và nhật ký quyết định (§12).
|
||||||
- [theory.md](theory.md): chứng minh Mệnh đề 1–2, heuristic λ, Bổ đề 1–5.
|
- [theory.md](theory.md): chứng minh Mệnh đề 1–2, heuristic λ, Bổ đề 1–5; mục 6 là Mệnh đề 3–6 và Hệ quả 3–4.
|
||||||
- [research/porosity-research-gap-survey.md](research/porosity-research-gap-survey.md): survey literature (mã P01–P15).
|
- [lecture.md](lecture.md): bản bài giảng (Bài 0–13), giải thích chậm cho người mới, có câu hỏi tự kiểm tra.
|
||||||
- [research/porosity-references.bib](research/porosity-references.bib): tài liệu tham khảo.
|
- [paper/](../paper/): bài báo (tiếng Anh); [paper/README.md](../paper/README.md) ghi nguồn của từng con số.
|
||||||
|
- [research/pivot-theory-benchmark.md](research/pivot-theory-benchmark.md): phân tích và lịch của Pivot 1; [research/bench-protocol.md](research/bench-protocol.md): thiết kế và kết quả P6; [research/field-dataset-survey.md](research/field-dataset-survey.md): khảo sát dữ liệu field công khai.
|
||||||
|
- [research/porosity-research-gap-survey.md](research/porosity-research-gap-survey.md): survey literature (mã P01–P15); [research/porosity-references.bib](research/porosity-references.bib): tài liệu tham khảo.
|
||||||
|
- [benchmark/README.md](../benchmark/README.md), [repro/README.md](../repro/README.md): hướng dẫn dùng gói benchmark và gói tái lập (tiếng Anh).
|
||||||
- [`report.html`](../report.html): báo cáo tiến độ có hình.
|
- [`report.html`](../report.html): báo cáo tiến độ có hình.
|
||||||
- Tài liệu gốc nên đọc trước:
|
- Tài liệu gốc nên đọc trước:
|
||||||
- Cuturi & Blondel (2017), soft-DTW;
|
- Cuturi & Blondel (2017), soft-DTW;
|
||||||
- Murray, Adams & MacKay (2010), elliptical slice sampling;
|
- Murray, Adams & MacKay (2010), elliptical slice sampling;
|
||||||
- Buland & Omre (2003), tie Bayes;
|
- Buland & Omre (2003), tie Bayes;
|
||||||
- Lakshminarayanan et al. (2017), deep ensembles;
|
- Lakshminarayanan et al. (2017), deep ensembles;
|
||||||
- Gneiting & Raftery (2007), CRPS và scoring rules.
|
- Gneiting & Raftery (2007), CRPS và scoring rules;
|
||||||
|
- Carroll et al. (2006), *Measurement Error in Nonlinear Models* (sai số classical và Berkson).
|
||||||
|
|||||||
106
docs/theory.md
106
docs/theory.md
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
Ngày 26/10/2026. Tài liệu này viết phần lý thuyết mà [plan.md](plan.md) §4.6 yêu cầu, ở dạng sẽ đưa vào phụ lục bài báo.
|
Ngày 26/10/2026. Tài liệu này viết phần lý thuyết mà [plan.md](plan.md) §4.6 yêu cầu, ở dạng sẽ đưa vào phụ lục bài báo.
|
||||||
|
|
||||||
|
**Bổ sung ngày 29/10/2026 (Pivot 1, [plan.md](plan.md) §12 ý 24):** mục 6 là bản tiếng Việt của mục 4.3–4.5 trong bài (`paper/sections/04_theory.tex`): Mệnh đề 3–6, Hệ quả 3–4, Nhận xét 1, cận ρ* và lập luận mẫu hữu hạn. Số mệnh đề theo bài. Mục 1.4 và 6.4 có ghi chú sửa cách đọc cận 1/B(σ_post): cận đã đăng ký là cấu trúc (a); bài báo thêm cận (b) post hoc. Cũng ngày 29/10, nhận định trước đó "hai cấu trúc gần như cho cùng một cận" đã được rút lại.
|
||||||
|
|
||||||
- Mục 1–2 là chứng minh, đúng dưới các giả thiết được nêu rõ.
|
- Mục 1–2 là chứng minh, đúng dưới các giả thiết được nêu rõ.
|
||||||
- Mục 3 là **heuristic**, không phải định lý.
|
- Mục 3 là **heuristic**, không phải định lý.
|
||||||
- Mục 4 là các bổ đề ngắn nối các baseline của plan §4.5 với RML. Mỗi bổ đề có test số tương ứng trong `tests/test_losses.py`.
|
- Mục 4 là các bổ đề ngắn nối các baseline của plan §4.5 với RML. Mỗi bổ đề có test số tương ứng trong `tests/test_losses.py`.
|
||||||
@@ -27,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à
|
||||||
|
|
||||||
@@ -156,7 +158,7 @@ Gọi δ(t) = τ̄(t) − τ(t) là sai số của warp trung bình. Nếu poste
|
|||||||
3. Ở 50 Hz, P = 0.95 / 0.90 / 0.82 khi σ_post = 1 / 1.5 / 2 ms. Đây là lý do protocol_p2r lấy σ_post ≥ 1.5 ms làm ranh giới "posterior rộng".
|
3. Ở 50 Hz, P = 0.95 / 0.90 / 0.82 khi σ_post = 1 / 1.5 / 2 ms. Đây là lý do protocol_p2r lấy σ_post ≥ 1.5 ms làm ranh giới "posterior rộng".
|
||||||
|
|
||||||
**Cận định lượng.**
|
**Cận định lượng.**
|
||||||
- Hệ số truyền tại một tần số không phải là con số quyết định metric. Mục 1.3 cho thấy predictor chỉ có công suất kết hợp với nhãn trong khoảng 7–23 Hz. Ở 20 Hz, σ = 1.5 ms cho P = 0.98.
|
- Hệ số truyền tại một tần số không phải là con số quyết định metric. Mục 1.3 cho thấy predictor chỉ có công suất kết hợp với nhãn trong khoảng 7–23 Hz. Ở 20 Hz, σ = 1.5 ms cho P = 0.98. (Sửa 29/10/2026: méo quần thể có trọng số f⁴, nên trung vị tần số của méo nằm ở 67–72 Hz dù phần lớn công suất ở dưới 25 Hz; xem ghi chú cuối mục.)
|
||||||
- Vì vậy ta đo trực tiếp B(σ) = band_rmse(blur_σ(μ)) / band_rmse(μ), với μ là dự đoán của Oracle trên realization dev (`scripts/17_summarize_p2r_dev.py`, phần blur).
|
- Vì vậy ta đo trực tiếp B(σ) = band_rmse(blur_σ(μ)) / band_rmse(μ), với μ là dự đoán của Oracle trên realization dev (`scripts/17_summarize_p2r_dev.py`, phần blur).
|
||||||
- Nếu RML khử hết blur, tỉ số M2-S/B3d-S tốt nhất là ≈ 1/B(σ_post).
|
- Nếu RML khử hết blur, tỉ số M2-S/B3d-S tốt nhất là ≈ 1/B(σ_post).
|
||||||
- Trên dự đoán MSE0 của H1 (σ ∈ {4, 8} ms), B(σ) tính theo cách này khớp với suy giảm đo được: 1.33 so với 1.38, và 1.85 so với 1.91. Cách tính vì vậy dự báo đúng mức phạt của nhãn lệch.
|
- Trên dự đoán MSE0 của H1 (σ ∈ {4, 8} ms), B(σ) tính theo cách này khớp với suy giảm đo được: 1.33 so với 1.38, và 1.85 so với 1.91. Cách tính vì vậy dự báo đúng mức phạt của nhãn lệch.
|
||||||
@@ -168,6 +170,16 @@ Gọi δ(t) = τ̄(t) − τ(t) là sai số của warp trung bình. Nếu poste
|
|||||||
- Vì vậy B(σ) là kỳ vọng định hướng, không phải cận chặt. H2b được kiểm bằng thực nghiệm.
|
- Vì vậy B(σ) là kỳ vọng định hướng, không phải cận chặt. H2b được kiểm bằng thực nghiệm.
|
||||||
- Dev ở SNR −5 dB vi phạm "cận" này theo chiều ngược lại. Input nhiễu làm dự đoán Oracle vốn đã mượt, nên B(σ) ≈ 1.00 tới σ = 3 ms (1/B ≈ 0.98–1.00). Dù vậy M2-Sa/B3d-Sa đo được là 0.93–0.96 ở N = 16. Phần lợi ích này không đến từ khử blur theo Mệnh đề 1. Hai giải thích ứng viên, chưa tách được trên dev: (i) bank nhãn chống cho mạng nhớ một nhãn lệch duy nhất, tức một dạng tăng cường nhãn; (ii) τ̄ lệch có hệ thống khi posterior đa mode. Vì thế báo cáo không được gán lợi ích của RML cho cơ chế blur, trừ khi có bằng chứng riêng.
|
- Dev ở SNR −5 dB vi phạm "cận" này theo chiều ngược lại. Input nhiễu làm dự đoán Oracle vốn đã mượt, nên B(σ) ≈ 1.00 tới σ = 3 ms (1/B ≈ 0.98–1.00). Dù vậy M2-Sa/B3d-Sa đo được là 0.93–0.96 ở N = 16. Phần lợi ích này không đến từ khử blur theo Mệnh đề 1. Hai giải thích ứng viên, chưa tách được trên dev: (i) bank nhãn chống cho mạng nhớ một nhãn lệch duy nhất, tức một dạng tăng cường nhãn; (ii) τ̄ lệch có hệ thống khi posterior đa mode. Vì thế báo cáo không được gán lợi ích của RML cho cơ chế blur, trừ khi có bằng chứng riêng.
|
||||||
|
|
||||||
|
**Sửa ngày 29/10/2026 (bài mục 4.3 và 6.3; chi tiết ở mục 6 dưới đây).**
|
||||||
|
- Hệ quả 1 ở trên coi sai số của warp trung bình là *classical* (độc lập với y), nên B3d-S bị làm mờ. Đó là một giả thiết, không phải hệ quả. Tie lấy bằng trung bình posterior là lý tưởng hoá tự nhiên của cấu trúc *Berkson* (Mệnh đề 3(b)): tối ưu quần thể của nó bị làm **sắc** bởi 1/Q, không bị làm mờ.
|
||||||
|
- 1/B(σ_post) đúng là ρ* (mục 6.4) dưới cấu trúc (a) với sai số Gauss, lấy dự đoán của Oracle thay cho m (trong bài: 1/B_a). Dưới (b), tích phân méo lớn hơn một hệ số e^{4π²σ²f²}. Với σ = 2 ms, hệ số này là 1,10 ở 25 Hz và 1,77 ở 60 Hz. Trọng số f⁴ đẩy méo lên cao: với dự đoán Oracle của P2r (N = 16), 71–73% công suất kết hợp với nhãn nằm dưới 25 Hz, nhưng trung vị tần số của méo bậc dẫn là 67–72 Hz. Ở đó tích phân (b) bằng 1,5–1,7 lần tích phân (a) tại σ = 1,5 ms, 2,1–2,6 lần tại 2 ms và 3,3–4,6 lần tại 2,5 ms (`outputs/p2r/posthoc/meta.json`, `n16_spectra`). Cận tính cho cấu trúc này vì vậy không dùng được cho cấu trúc kia. Bản ghi trước đó viết "hệ số < 1,17, cấu trúc gần như không đổi cận". Nhận định đó sai vì chỉ xét |f| ≤ 25 Hz. Méo quần thể là bậc bốn theo σ, nên cận rất gần 1 khi posterior hẹp.
|
||||||
|
- Kiểm post hoc (`scripts/31_p2r_posthoc.py` → `outputs/p2r/posthoc/{bound.csv, blur_ab.csv, meta.json}`). Script đọc summary đã đăng ký và dự đoán Oracle trong `outputs/p2r/train/<regime>/cells/*.npz`, chạy khoảng 6 phút. Kết quả ở N = 16, 8 ô rộng:
|
||||||
|
- **Cận (a), đã đăng ký.** Tỉ số M2-Sa/B3d-Sa thấp hơn cận ở 7/8 ô tại σ_post và 6/8 tại sai số warp RMS của B3d-Sa trên giếng train. Ngoại lệ: R10tb c = 2 (σ_post 11,5 ms, sai số warp 19,1 ms; vượt mép lưới blur 6 ms nên `np.interp` trả 1/B(6 ms) = 0,634, cận tính đúng tại σ_post là 0,481; tỉ số 0,667), và R10tb c = 1 khi tính tại sai số warp (4,8 ms so với σ_post 1,9 ms; cận 0,710; tỉ số 0,890).
|
||||||
|
- **Cận (b), post hoc.** Làm sắc dự đoán Oracle bằng e^{+2π²σ²f²} và tính đúng tại độ rộng của từng ô. Tỉ số thấp hơn cận ở 3/8 ô tại σ_post, cả ba ở c = 1 (R0, R0h, R10tb). Lề ở R0h và R10tb < 0,004, nằm trong CI 95%. Tại sai số warp: 0/8.
|
||||||
|
- **Hai biến thể của (b).** Làm sắc cũng khuếch đại sai số ước lượng của chính Oracle, nên 1/B_b bị kéo thấp, nhất là ở c = 2. Biến thể b60 giữ hệ số ở giá trị 60 Hz phía trên 60 Hz. Biến thể phổ chéo thay phổ dự đoán Oracle bằng phổ chéo với nhãn thật. Cả hai cho cùng 3/8 tại σ_post; tại sai số warp chỉ còn R0 c = 1 (1/8). Với phổ chéo, cận (a) cũng chỉ bị vượt ở 5/8 ô tại σ_post và 3/8 tại sai số warp.
|
||||||
|
- **Oracle/B3d-Sa (post hoc; c = 1, N = 16).** 0,927 / 0,919 / 0,758 / 0,933 ở R0 / R0h / R10tb / Rm5. Tỉ số dưới cận (a) ở cả 4 ô, dưới cận (b) tại σ_post ở 3–4 ô tuỳ ước lượng, tại sai số warp ở 1–2 ô. Ở c = 0, mọi cận nằm trong 0,4% quanh 1, nhưng Oracle vẫn tốt hơn B3d-Sa 1–3%. Hai bên còn khác số vòng lặp (500 và 250).
|
||||||
|
- Vì vậy câu "tỉ số M2-S/B3d-S tốt nhất là ≈ 1/B(σ_post)" chỉ là cận quần thể. Nhận định "lợi ích của bank vượt cận" ghi trước đây không được xác lập. Nó chỉ đúng dưới (a). Dưới (b) nó chỉ còn ở c = 1 và gần như biến mất tại sai số warp đo được. Chưa kiểm sai số của warp trung bình có cấu trúc Berkson hay không (phép kiểm hiệp phương sai ở mục 6.1; T2 test (iv)). Nguồn lợi ích chưa xác định: có thể là hiệu chỉnh quần thể của cấu trúc Berkson, có thể là hiệu ứng mẫu hữu hạn (mục 6.5; T2, `docs/research/t2-mechanism.md`). M2-Sa không đạt Oracle ở ô rộng nào. Ở c = 1, N = 16 nó còn kém Oracle 4–6% (R0, R0h, Rm5) và 17% (R10tb); ở R10tb c = 2 là 63%. Nó đóng 27–46% khoảng cách B3d-Sa–Oracle ở c = 1 và 39–65% ở c = 2.
|
||||||
|
|
||||||
## 2. Mệnh đề 2 (nhận dạng)
|
## 2. Mệnh đề 2 (nhận dạng)
|
||||||
|
|
||||||
**Thiết lập.**
|
**Thiết lập.**
|
||||||
@@ -183,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.
|
||||||
|
|
||||||
@@ -201,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.
|
||||||
@@ -380,11 +393,96 @@ Test: `test_rml_between_hard_min_and_mixture_mean` và `test_rml_small_lambda_is
|
|||||||
- Mệnh đề 1 và hai hệ quả: ở mức quần thể, cho predictor tối ưu MSE, dưới (A1); phần phổ cần thêm giả thiết dừng.
|
- Mệnh đề 1 và hai hệ quả: ở mức quần thể, cho predictor tối ưu MSE, dưới (A1); phần phổ cần thêm giả thiết dừng.
|
||||||
- Mệnh đề 2: dưới (B); sd(β) là xấp xỉ bậc hai.
|
- Mệnh đề 2: dưới (B); sd(β) là xấp xỉ bậc hai.
|
||||||
- Bổ đề 1–5: chính xác, có test số.
|
- Bổ đề 1–5: chính xác, có test số.
|
||||||
- **Heuristic.** λ = 1/τ_c (mục 3).
|
- Mệnh đề 3–6, Hệ quả 3–4 (mục 6, thêm 29/10/2026): ở mức quần thể; chứng minh ở Phụ lục A của bài. Bank hiệu chỉnh (Mệnh đề 4) là lý tưởng hoá. Hệ quả 4 chỉ cho dấu ở bậc dẫn.
|
||||||
|
- **Heuristic.** λ = 1/τ_c (mục 3); lập luận mẫu hữu hạn (mục 6.5).
|
||||||
- **Chưa làm.**
|
- **Chưa làm.**
|
||||||
- Tính nhất quán của estimator marginal likelihood (tuỳ chọn ở plan §4.6).
|
- Tính nhất quán của estimator marginal likelihood (tuỳ chọn ở plan §4.6).
|
||||||
- Chẩn đoán strain energy.
|
- Chẩn đoán strain energy.
|
||||||
- RML-EM (M3).
|
- RML-EM (M3).
|
||||||
|
- Xác định nguồn lợi ích của bank: hiệu chỉnh quần thể trong cận ρ* dưới (b), hay hiệu ứng mẫu hữu hạn vượt cận đó (T2, exploratory, `docs/research/t2-mechanism.md`, khai báo trước khi chạy; test (iv) kiểm cấu trúc Berkson hay classical).
|
||||||
|
- Kiểm phần (b), (c) của Mệnh đề 5: ở P2r độ dài huấn luyện và nguồn nhãn lẫn vào nhau.
|
||||||
|
|
||||||
|
## 6. Cấu trúc sai số của tie, bank hiệu chỉnh, coverage, reference lệch (thêm 29/10/2026)
|
||||||
|
|
||||||
|
Bản tiếng Việt của mục 4.3–4.5 trong bài. Chứng minh ở Phụ lục A của bài (`paper/sections/A_proofs.tex`); ở đây chỉ phát biểu và nêu ý nghĩa.
|
||||||
|
|
||||||
|
**Ký hiệu thêm.** D là toàn bộ dữ liệu ở giếng (seismic, log, anchor); input X là hàm của D. u* là warp thật, y = y^{u*}; û = û(D) là tie điểm với nhãn ỹ = y^{û}. Sai số viết được theo hai chiều:
|
||||||
|
- ỹ(t) = y(t + δ(t)), với δ(t) = t_{u*}(z_{û}(t)) − t;
|
||||||
|
- y(t) = ỹ(t + ε(t)), với ε(t) = t_{û}(z_{u*}(t)) − t.
|
||||||
|
|
||||||
|
m̃(t) = E[ỹ(t) | X] là predictor tối ưu của nhãn điểm; P(f) = E e^{i2πfδ}, Q(f) = E e^{i2πfε}.
|
||||||
|
|
||||||
|
### 6.1 Mệnh đề 3 (hai cấu trúc sai số)
|
||||||
|
|
||||||
|
Giả thiết (A2) cho y và ỹ.
|
||||||
|
- **(a) Classical.** Nếu δ(t) độc lập với y(·) khi biết X, với phân phối có điều kiện p_t(·|X), thì m̃(t) = ∫ p_t(d|X) m(t + d) dd và Var(ỹ(t)|X) = ∫ p_t(d|X) Var(y(t + d)|X) dd + Var_{p_t}[m(t + d)].
|
||||||
|
- **(b) Berkson.** Nếu ε(t) độc lập với D khi biết X, với phân phối có điều kiện q_t(·|X), thì m(t) = ∫ q_t(e|X) m̃(t + e) de và Var(y(t)|X) = ∫ q_t(e|X) Var(ỹ(t + e)|X) de + Var_{q_t}[m̃(t + e)].
|
||||||
|
- Nếu p_t, q_t không phụ thuộc t thì, trung bình trên cửa sổ và bỏ hiệu ứng biên, nhãn điểm có phương sai có điều kiện lớn hơn dưới (a) và nhỏ hơn dưới (b). Nếu chúng không phụ thuộc cả t lẫn X thì m̃ là m lọc bởi P dưới (a), và m là m̃ lọc bởi Q dưới (b). Với sai số Gauss trung bình 0, phương sai σ², hệ số truyền từ m sang m̃ là e^{−2π²σ²f²} dưới (a) và e^{+2π²σ²f²} dưới (b).
|
||||||
|
|
||||||
|
**Ý 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.
|
||||||
|
- 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 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)
|
||||||
|
|
||||||
|
Bank {(u_s, π_s)} gọi là *hiệu chỉnh* nếu Σ_s π_s G(u_s, D) = E[G(u*, D) | D] với mọi G khả tích. Với bank hiệu chỉnh:
|
||||||
|
- (a) nhãn trung bình ȳ = Σ_s π_s y^{u_s} thoả ȳ(t) = E[y(t) | D] và E[ȳ(t) | X] = m(t);
|
||||||
|
- (b) với mọi mạng (μ_θ, σ_θ) chỉ phụ thuộc dữ liệu qua X, E[Σ_s π_s ℓ_s] = E[ℓ*], trong đó ℓ* là log-likelihood cửa sổ của nhãn tại warp thật.
|
||||||
|
|
||||||
|
Do đó giới hạn λ → 0 của RML (Bổ đề 2) có cùng nghiệm tối ưu quần thể với huấn luyện trên nhãn thật (μ = m, σ² = Var(y | X)), và MSE trên nhãn trung bình có nghiệm μ = m.
|
||||||
|
|
||||||
|
**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.
|
||||||
|
- 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)
|
||||||
|
|
||||||
|
- **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 đầ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)).
|
||||||
|
|
||||||
|
### 6.4 Bank được lợi tối đa bao nhiêu (ρ*)
|
||||||
|
|
||||||
|
- Vì E[y − m | X] = 0, mọi predictor h chỉ phụ thuộc dữ liệu qua X thoả E|B(h − y)|² = E|B(m − y)|² + E|B(h − m)|². Ở mức quần thể, không phương pháp nào thắng Oracle về band MSE.
|
||||||
|
- Nếu phương pháp nhãn điểm hội tụ về m̃ và phương pháp bank về m, tỉ số band RMSE của chúng là ρ* = (1 + E|B(m̃ − m)|² / E|B(m − y)|²)^{−1/2}, và không phương pháp nào hơn nhãn điểm quá hệ số này.
|
||||||
|
- Với sai số không phụ thuộc t và X: E|B(m̃ − m)|² = ∫_{|f|≥f_c} |1 − P|² S_m df dưới (a), và ∫_{|f|≥f_c} |1 − Q|² |Q|^{−2} S_m df dưới (b). Với sai số Gauss, cả hai tích phân bằng (2π²σ²f²)² S_m ở bậc dẫn, nên **méo quần thể là bậc bốn theo σ**. Ngoài bậc dẫn, tích phân (b) lớn hơn tích phân (a) một hệ số e^{4π²σ²f²}. Với σ = 2 ms, hệ số này là 1,10 ở 25 Hz và 1,77 ở 60 Hz. Trọng số f⁴ đẩy méo lên tần số cao. Với dự đoán Oracle của P2r, 71–73% công suất kết hợp với nhãn nằm dưới 25 Hz, nhưng trung vị tần số của méo bậc dẫn là 67–72 Hz. Tích phân (b) bằng 1,5–1,7 lần, 2,1–2,6 lần và 3,3–4,6 lần tích phân (a) tại σ = 1,5, 2 và 2,5 ms. Cận tính cho cấu trúc này vì vậy không dùng được cho cấu trúc kia. Bản trước viết "hệ số < 1,17, cấu trúc gần như không đổi ρ*". Nhận định đó sai vì chỉ xét |f| ≤ 25 Hz (sửa 29/10/2026).
|
||||||
|
- Cận 1/B(σ_post) dùng ở mục 1.4 và trong H2b là ρ* dưới (a) với sai số Gauss, lấy dự đoán của mạng Oracle thay cho m (trong bài: 1/B_a). Bài báo cũng báo 1/B_b, cùng ước lượng đó dưới (b), tính post hoc (Bảng `tab:h2b`). Kết quả kiểm post hoc ở ghi chú cuối mục 1.4.
|
||||||
|
|
||||||
|
### 6.5 Mẫu hữu hạn (heuristic, không phải định lý)
|
||||||
|
|
||||||
|
- Bản thân sai số của nhãn là bậc một. Với sai số trung bình 0, phương sai σ²: ỹ − y ≈ δ·y′ dưới (a) và ỹ − y ≈ −ε·ỹ′ dưới (b). Ở bậc này trung bình có điều kiện theo X bằng 0, và với sai số hằng trên cửa sổ, phương sai trong băng là σ² ∫_{|f|≥f_c} (2πf)² S_y df. Phần lớn phương sai này chỉ dịch chuyển phần nhiễu nhãn vốn không đoán được từ X.
|
||||||
|
- Tới bậc hai theo σ và trung bình trên cửa sổ, phương sai có điều kiện mà một mạng học trên ỹ phải hấp thụ tăng khoảng trung bình của σ² m′² dưới (a) và giảm khoảng chừng đó dưới (b) (Mệnh đề 3). Đây là hiệu ứng bậc hai, so với méo bậc bốn của m̃, nên khi có ít giếng, hiệu ứng mẫu hữu hạn có thể lớn hơn sai lệch quần thể.
|
||||||
|
- Lập luận gợi ý rằng sai số đúng cấu trúc (b) sẽ không làm mạng kém hơn Oracle tới bậc hai, vì nhãn mang ít nhiễu có điều kiện hơn nhãn thật. Bank còn có thể đổi việc học mẫu hữu hạn theo cách ρ* không thấy: phương sai học được hấp thụ độ trải của bank và giảm trọng số các mẫu mà thành viên bank bất đồng; với λ > 0, responsibilities tái đăng ký nhãn trong lúc huấn luyện (Nhận xét 1). Bài mục 6.3 so lợi ích đo được với ρ*.
|
||||||
|
|
||||||
|
### 6.6 Mệnh đề 5 (coverage)
|
||||||
|
|
||||||
|
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.
|
||||||
|
- (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 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 ξ.
|
||||||
|
|
||||||
|
**Ý 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ể (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.
|
||||||
|
- Độ 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.
|
||||||
|
|
||||||
|
### 6.7 Mệnh đề 6 (reference lệch) và Hệ quả 4 (dung sai)
|
||||||
|
|
||||||
|
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.
|
||||||
|
- 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 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 ŷ_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⁴). 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 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.
|
||||||
|
|
||||||
|
**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. 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.
|
||||||
|
- 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).
|
||||||
|
|
||||||
## Tài liệu
|
## Tài liệu
|
||||||
|
|
||||||
|
|||||||
416
exploratory/p4x_volve.py
Normal file
416
exploratory/p4x_volve.py
Normal file
@@ -0,0 +1,416 @@
|
|||||||
|
"""P4x: exploratory, post hoc model variants on Volve (docs/research/p4-exploratory.md).
|
||||||
|
|
||||||
|
Not part of any locked protocol. Imports the locked P4 code read-only (data views, folds, banks, trajectory trainer,
|
||||||
|
nested selection and scoring) and changes only what a variant declares: a low-frequency trend subtracted from the
|
||||||
|
targets (V1a velocity, V1b TWT), the network width (V2a) or a linear-Gaussian model (V2b, V3).
|
||||||
|
|
||||||
|
python exploratory/p4x_volve.py paths # velocity/TVDSS along every path (no label)
|
||||||
|
python exploratory/p4x_volve.py train --variants V0 V1a ... --methods B3b M2-Sa --workers 8 --device cuda:0
|
||||||
|
python exploratory/p4x_volve.py summarize # V0a check, every variant, reference predictors
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import argparse
|
||||||
|
import copy
|
||||||
|
import itertools
|
||||||
|
import json
|
||||||
|
import sys
|
||||||
|
import time
|
||||||
|
from concurrent.futures import FIRST_COMPLETED, ProcessPoolExecutor, wait
|
||||||
|
from datetime import datetime, timezone
|
||||||
|
from multiprocessing import get_context
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
import numpy as np
|
||||||
|
|
||||||
|
REPO = Path(__file__).resolve().parents[1]
|
||||||
|
sys.path.insert(0, str(REPO))
|
||||||
|
|
||||||
|
from ml_porosity.volve.folds import prediction_targets, target_name # noqa: E402
|
||||||
|
from ml_porosity.volve.runner import fold_sets, job_path, load_bundle, reg_path, save_npz # noqa: E402
|
||||||
|
|
||||||
|
P4 = REPO / "outputs" / "p4"
|
||||||
|
OUT = REPO / "outputs" / "p4x"
|
||||||
|
VEL = (REPO / "data/Volve/Seismic/ST10010/Velocities"
|
||||||
|
/ "ST10010ZC11-MIG-VEL.MIG_VEL.VELOCITY.3D.JS-017527.segy")
|
||||||
|
SA = 7.0
|
||||||
|
LABEL = "PHIF"
|
||||||
|
VARIANTS = {
|
||||||
|
"V0": dict(trend=None, model="cnn", d=64), # retraining check (seed 0 only)
|
||||||
|
"V1a": dict(trend="velocity", model="cnn", d=64),
|
||||||
|
"V1b": dict(trend="twt", model="cnn", d=64),
|
||||||
|
"V2a": dict(trend=None, model="cnn", d=8),
|
||||||
|
"V2b": dict(trend=None, model="linear"),
|
||||||
|
"V3": dict(trend="velocity", model="linear"),
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def stamp() -> str:
|
||||||
|
return datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ")
|
||||||
|
|
||||||
|
|
||||||
|
def protocol() -> dict:
|
||||||
|
from ml_porosity.volve.protocol import load_protocol
|
||||||
|
return load_protocol()
|
||||||
|
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------- velocity and depth along every path (no label)
|
||||||
|
|
||||||
|
def velocity_cube():
|
||||||
|
import segyio
|
||||||
|
with segyio.open(VEL, iline=189, xline=193) as f:
|
||||||
|
cube = segyio.tools.cube(f).astype(np.float64)
|
||||||
|
il, xl, z = np.asarray(f.ilines, float), np.asarray(f.xlines, float), np.asarray(f.samples, float)
|
||||||
|
h = np.array([[t[segyio.su.iline], t[segyio.su.xline], t[segyio.su.cdpx], t[segyio.su.cdpy],
|
||||||
|
t[segyio.su.scalco]] for t in f.header], float)
|
||||||
|
scale = np.where(h[:, 4] < 0, -1.0 / h[:, 4], np.where(h[:, 4] > 0, h[:, 4], 1.0))
|
||||||
|
xy = h[:, 2:4] * scale[:, None]
|
||||||
|
A = np.c_[xy, np.ones(len(xy))]
|
||||||
|
coef, *_ = np.linalg.lstsq(A, h[:, :2], rcond=None) # (x, y, 1) -> (il, xl)
|
||||||
|
resid = np.abs(A @ coef - h[:, :2]).max()
|
||||||
|
return cube, (il, xl, z), coef, float(resid)
|
||||||
|
|
||||||
|
|
||||||
|
def build_paths() -> None:
|
||||||
|
"""V(t) and TVDSS(t) on the main window for every (well, key) path in the dataset: key 'reference' and every
|
||||||
|
blind key. Uses the well path (public survey) and the seismic-derived velocity only; no log, pick or label."""
|
||||||
|
from scipy.interpolate import RegularGridInterpolator
|
||||||
|
from ml_porosity.volve.data import load_arrays
|
||||||
|
|
||||||
|
p = protocol()
|
||||||
|
arrays = load_arrays()
|
||||||
|
cube, (il, xl, z), coef, resid = velocity_cube()
|
||||||
|
interp = RegularGridInterpolator((il, xl, z), cube, method="linear", bounds_error=True)
|
||||||
|
main = arrays[f"{p['data']['wells'][0]}/main_mask"].astype(bool)
|
||||||
|
t_main = arrays[f"{p['data']['wells'][0]}/times_ms"][main]
|
||||||
|
out, qc = {"times_ms": t_main}, {"affine_max_residual_bins": resid, "paths": {}}
|
||||||
|
for w in p["data"]["wells"]:
|
||||||
|
smd, stvd = arrays[f"{w}/survey/md"], arrays[f"{w}/survey/tvd"]
|
||||||
|
sx, sy, kb = arrays[f"{w}/survey/x"], arrays[f"{w}/survey/y"], float(arrays[f"{w}/kb_msl"])
|
||||||
|
keys = ["reference"] + sorted({k.split("/")[2] for k in arrays if k.startswith(f"{w}/blind/")})
|
||||||
|
for key in keys:
|
||||||
|
base = f"{w}/{'reference' if key == 'reference' else 'blind/' + key}"
|
||||||
|
md = arrays[f"{base}/md"][main]
|
||||||
|
x, y = np.interp(md, smd, sx), np.interp(md, smd, sy)
|
||||||
|
tvdss = np.interp(md, smd, stvd) - kb
|
||||||
|
ij = np.c_[x, y, np.ones_like(x)] @ coef
|
||||||
|
v = interp(np.c_[ij, tvdss])
|
||||||
|
out[f"{w}|{key}/velocity"], out[f"{w}|{key}/tvdss"] = v, tvdss
|
||||||
|
q = {"dil_vs_dataset": float(np.abs(ij[:, 0] - arrays[f"{base}/il"][main]).max()),
|
||||||
|
"dxl_vs_dataset": float(np.abs(ij[:, 1] - arrays[f"{base}/xl"][main]).max()),
|
||||||
|
"v_range": [float(v.min()), float(v.max())]}
|
||||||
|
if key == "reference":
|
||||||
|
q["dtvd_vs_dataset_m"] = float(np.abs(tvdss + kb - arrays[f"{base}/tvd"][main]).max())
|
||||||
|
qc["paths"][f"{w}|{key}"] = q
|
||||||
|
OUT.mkdir(parents=True, exist_ok=True)
|
||||||
|
np.savez_compressed(OUT / "paths.npz", **out)
|
||||||
|
worst = {k: max(q[k] for q in qc["paths"].values() if k in q)
|
||||||
|
for k in ("dil_vs_dataset", "dxl_vs_dataset", "dtvd_vs_dataset_m")}
|
||||||
|
qc["worst"] = worst
|
||||||
|
(OUT / "paths_qc.json").write_text(json.dumps(qc, indent=1), encoding="utf-8")
|
||||||
|
print(json.dumps({"affine_max_residual_bins": resid, **worst}))
|
||||||
|
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------- trends (training wells of each set only)
|
||||||
|
|
||||||
|
def covariate(paths: dict, kind: str, well: str, key: str) -> np.ndarray:
|
||||||
|
if kind == "velocity":
|
||||||
|
return paths[f"{well}|{key}/velocity"]
|
||||||
|
return paths["times_ms"].astype(float)
|
||||||
|
|
||||||
|
|
||||||
|
def fit_trend(kind: str, paths: dict, labels: dict[str, np.ndarray]) -> tuple[float, float, float]:
|
||||||
|
"""OLS of the label on the covariate over all labelled samples of the given wells (path: reference).
|
||||||
|
Returns (a, b, residual SD)."""
|
||||||
|
c = np.concatenate([covariate(paths, kind, w, "reference")[np.isfinite(y)] for w, y in labels.items()])
|
||||||
|
y = np.concatenate([y[np.isfinite(y)] for y in labels.values()])
|
||||||
|
if kind is None or kind == "constant":
|
||||||
|
return float(y.mean()), 0.0, float(y.std())
|
||||||
|
A = np.c_[np.ones_like(c), c]
|
||||||
|
(a, b), *_ = np.linalg.lstsq(A, y, rcond=None)
|
||||||
|
return float(a), float(b), float(np.std(y - A @ np.array([a, b])))
|
||||||
|
|
||||||
|
|
||||||
|
def b3b_labels(names) -> dict[str, np.ndarray]:
|
||||||
|
"""B3b-tie labels (fraction, main window, NaN off support) of the wells of a registration set."""
|
||||||
|
z = load_bundle(reg_path(P4, names, SA))
|
||||||
|
Y = z[f"{LABEL}/B3b"]
|
||||||
|
return {w: Y[i, 0] for i, w in enumerate(z["wells"])}
|
||||||
|
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------- linear-Gaussian model (V2b, V3)
|
||||||
|
|
||||||
|
def linear_factory(method, channels, cfg):
|
||||||
|
import torch
|
||||||
|
from torch import nn
|
||||||
|
import torch.nn.functional as F
|
||||||
|
|
||||||
|
class LinearGaussian(nn.Module):
|
||||||
|
"""μ = Conv1d(patch channels → 1, kernel k) + bias; a single scalar σ = softplus(s) + σ_min."""
|
||||||
|
|
||||||
|
def __init__(self, in_ch: int, k: int = 9, sigma_min: float = 1e-3):
|
||||||
|
super().__init__()
|
||||||
|
self.conv = nn.Conv1d(in_ch, 1, k, padding=k // 2)
|
||||||
|
self.s = nn.Parameter(torch.zeros(1))
|
||||||
|
self.sigma_min = sigma_min
|
||||||
|
|
||||||
|
def forward(self, x):
|
||||||
|
mu = self.conv(x)
|
||||||
|
return mu, (F.softplus(self.s) + self.sigma_min).expand_as(mu)
|
||||||
|
|
||||||
|
torch.backends.cudnn.benchmark = False
|
||||||
|
torch.backends.cudnn.deterministic = True
|
||||||
|
return LinearGaussian(channels, cfg.get("kernel", 9))
|
||||||
|
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------- one trajectory
|
||||||
|
|
||||||
|
def train_job(job: dict) -> dict:
|
||||||
|
import torch
|
||||||
|
import ml_porosity.volve.training as T
|
||||||
|
from ml_porosity.f3.training import make_model as cnn_factory
|
||||||
|
from ml_porosity.volve.data import VolveData
|
||||||
|
|
||||||
|
p, v = job["p"], VARIANTS[job["variant"]]
|
||||||
|
root = OUT / job["variant"]
|
||||||
|
names = tuple(sorted(job["names"]))
|
||||||
|
path = job_path(root, names, job["method"], LABEL, job["seed"], SA)
|
||||||
|
if path.exists():
|
||||||
|
return {"cached": True, "path": str(path)}
|
||||||
|
T.make_model = linear_factory if v["model"] == "linear" else cnn_factory
|
||||||
|
cfg = dict(p["training"])
|
||||||
|
if v["model"] == "cnn":
|
||||||
|
cfg["d_channels"] = v["d"]
|
||||||
|
data = VolveData(p, training_wells=names)
|
||||||
|
bundle = load_bundle(reg_path(P4, names, SA))
|
||||||
|
if tuple(bundle["wells"]) != names:
|
||||||
|
raise RuntimeError("Registration cache contains different wells")
|
||||||
|
targets = prediction_targets(data.wells, names)
|
||||||
|
X = np.stack([data.X(w, "reference") for w in names])
|
||||||
|
X_targets = np.stack([data.X(w, k) for w, k in targets])
|
||||||
|
spec = T.method_spec(bundle, LABEL, job["method"])
|
||||||
|
m0, s0 = bundle[f"{LABEL}/norm"]
|
||||||
|
trend_meta = {}
|
||||||
|
if v["trend"]:
|
||||||
|
with np.load(OUT / "paths.npz") as z:
|
||||||
|
paths = {k: z[k] for k in z.files}
|
||||||
|
Yb = bundle[f"{LABEL}/B3b"]
|
||||||
|
a, b, rsd = fit_trend(v["trend"], paths, {w: Yb[i, 0] for i, w in enumerate(names)})
|
||||||
|
tr_train = np.stack([a + b * covariate(paths, v["trend"], w, "reference") for w in names])
|
||||||
|
tr_targets = np.stack([a + b * covariate(paths, v["trend"], w, k) for w, k in targets])
|
||||||
|
spec["Y"] = spec["Y"] - ((tr_train - m0) / s0)[:, None, :]
|
||||||
|
trend_meta = {"trend": v["trend"], "a": a, "b": b, "residual_sd": rsd}
|
||||||
|
else:
|
||||||
|
tr_targets = np.full((len(targets), X.shape[2]), m0)
|
||||||
|
pred, meta = T.train_trajectory(X, X_targets, spec, job["method"], cfg, job["seed"], p["training"]["budgets"],
|
||||||
|
job["device"], None, p["runtime"]["cpu_threads_per_worker"])
|
||||||
|
pred = {k: (val * s0 + tr_targets if k.endswith("/mu") else val * s0) for k, val in pred.items()}
|
||||||
|
pred |= {"targets": np.asarray([target_name(w, k) for w, k in targets]), "wells": np.asarray(names),
|
||||||
|
"norm": bundle[f"{LABEL}/norm"]}
|
||||||
|
if v["trend"]:
|
||||||
|
pred["trend_targets"] = tr_targets
|
||||||
|
save_npz(path, pred)
|
||||||
|
path.with_suffix(".json").write_text(json.dumps(meta | trend_meta | {
|
||||||
|
"variant": job["variant"], "training_wells": list(names), "method": job["method"], "seed": job["seed"],
|
||||||
|
"device": job["device"], "finished": stamp(), "torch": torch.__version__}, indent=1), encoding="utf-8")
|
||||||
|
return {"cached": False, "path": str(path), "wall_seconds": meta["wall_seconds"]}
|
||||||
|
|
||||||
|
|
||||||
|
def run_train(variants, methods, seeds, workers, device) -> None:
|
||||||
|
p = protocol()
|
||||||
|
jobs = [dict(p=p, variant=var, names=list(n), method=m, seed=s, device=device)
|
||||||
|
for var in variants for m in methods for s in ([0] if var == "V0" else seeds) for n in fold_sets(p)]
|
||||||
|
todo = [j for j in jobs if not job_path(OUT / j["variant"], j["names"], j["method"], LABEL, j["seed"],
|
||||||
|
SA).exists()]
|
||||||
|
print(f"{stamp()} train: {len(jobs)} jobs, {len(todo)} to run, workers={workers}, device={device}", flush=True)
|
||||||
|
begin, done = time.time(), 0
|
||||||
|
with ProcessPoolExecutor(workers, mp_context=get_context("spawn")) as ex:
|
||||||
|
pending = {ex.submit(train_job, j): j for j in todo}
|
||||||
|
while pending:
|
||||||
|
finished, _ = wait(pending, return_when=FIRST_COMPLETED)
|
||||||
|
for f in finished:
|
||||||
|
j = pending.pop(f)
|
||||||
|
f.result()
|
||||||
|
done += 1
|
||||||
|
if done % 10 == 0 or not pending:
|
||||||
|
el = time.time() - begin
|
||||||
|
print(f"{stamp()} {done}/{len(todo)} {j['variant']} {j['method']} s{j['seed']} "
|
||||||
|
f"elapsed {el / 60:.1f} min, eta {el / done * (len(todo) - done) / 60:.1f} min", flush=True)
|
||||||
|
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------- evaluation
|
||||||
|
|
||||||
|
def extra(y: np.ndarray, mu: np.ndarray, sigma: np.ndarray) -> dict:
|
||||||
|
"""Porosity units; labelled samples only."""
|
||||||
|
from scipy.stats import norm
|
||||||
|
ok = np.isfinite(y)
|
||||||
|
y, mu, sigma = 100 * y[ok], 100 * mu[ok], np.maximum(100 * sigma[ok], 1e-6)
|
||||||
|
e = mu - y
|
||||||
|
bias = e.mean()
|
||||||
|
out = dict(n=int(ok.sum()), rmse=float(np.sqrt(np.mean(e ** 2))), bias=float(bias), abs_bias=float(abs(bias)),
|
||||||
|
rmse_debiased=float(np.sqrt(np.mean((e - bias) ** 2))), label_sd=float(y.std()),
|
||||||
|
pcc=float(np.corrcoef(y, mu)[0, 1]) if mu.std() > 0 else np.nan,
|
||||||
|
r2=float(1 - np.mean(e ** 2) / y.var()))
|
||||||
|
for lev in (80, 90):
|
||||||
|
zq = norm.ppf(0.5 + lev / 200)
|
||||||
|
out[f"coverage_{lev}"] = float(np.mean(np.abs(e) <= zq * sigma))
|
||||||
|
out["debiased_over_sd"] = out["rmse_debiased"] / out["label_sd"]
|
||||||
|
return out
|
||||||
|
|
||||||
|
|
||||||
|
def variant_predictions(variant: str, p: dict, arrays: dict) -> tuple[list[dict], list[str]]:
|
||||||
|
from ml_porosity.volve.evaluation import neural_predictions
|
||||||
|
root = OUT / variant
|
||||||
|
methods = [m for m in ("B3b", "B3d-Sa", "M2-Sa")
|
||||||
|
if all(job_path(root, n, m, LABEL, s, SA).exists()
|
||||||
|
for n in fold_sets(p) for s in p["split"]["seeds"])]
|
||||||
|
if not methods:
|
||||||
|
return [], []
|
||||||
|
q = copy.deepcopy(p)
|
||||||
|
q["methods"]["main"] = methods
|
||||||
|
pred, _ = neural_predictions(q, root, arrays, [SA])
|
||||||
|
return [a for a in pred if a["seed"] == "ensemble"], methods
|
||||||
|
|
||||||
|
|
||||||
|
def reference_predictors(p: dict, arrays: dict, paths: dict) -> list[dict]:
|
||||||
|
"""T0 constant, T1a velocity trend, T1b TWT trend: fitted on the outer training wells (B3b labels), applied
|
||||||
|
along the outer test well's blind path T_out."""
|
||||||
|
from ml_porosity.data.volve_wells import blind_key
|
||||||
|
from ml_porosity.volve.folds import outer_folds
|
||||||
|
from ml_porosity.volve.protocol import source_config
|
||||||
|
p4 = source_config(p)["p4"]
|
||||||
|
labels = {}
|
||||||
|
for names in fold_sets(p):
|
||||||
|
for w, y in b3b_labels(names).items():
|
||||||
|
if w in labels and not np.allclose(labels[w], y, equal_nan=True):
|
||||||
|
raise RuntimeError(f"B3b labels of {w} differ between sets")
|
||||||
|
labels[w] = y
|
||||||
|
out = []
|
||||||
|
for scheme in p["split"]["schemes"]:
|
||||||
|
for test, train in outer_folds(p["data"]["wells"], scheme, p4):
|
||||||
|
key = blind_key(train)
|
||||||
|
for name, kind in (("T0", "constant"), ("T1a", "velocity"), ("T1b", "twt")):
|
||||||
|
a, b, rsd = fit_trend(kind, paths, {w: labels[w] for w in train})
|
||||||
|
mu = a + b * (covariate(paths, kind, test, key) if kind != "constant" else 0.0)
|
||||||
|
mu = np.broadcast_to(mu, paths["times_ms"].shape).astype(float)
|
||||||
|
out.append(dict(variant=name, scheme=scheme, test_well=test, method="trend-only",
|
||||||
|
mu=mu, sigma=np.full_like(mu, rsd), a=a, b=b))
|
||||||
|
return out
|
||||||
|
|
||||||
|
|
||||||
|
def summarize() -> None:
|
||||||
|
import pandas as pd
|
||||||
|
from ml_porosity.volve.data import VolveData, load_arrays
|
||||||
|
from ml_porosity.volve.evaluation import neural_predictions
|
||||||
|
|
||||||
|
p = protocol()
|
||||||
|
arrays = load_arrays()
|
||||||
|
full = VolveData(p, arrays=arrays)
|
||||||
|
ref = p["data"]["primary_reference"]
|
||||||
|
report = {"created": stamp()}
|
||||||
|
|
||||||
|
# V0a: locked trajectories through this harness
|
||||||
|
locked = pd.read_csv(P4 / "summary" / "metrics.csv")
|
||||||
|
locked = locked[(locked.seed.astype(str) == "ensemble") & (locked.reference == ref) & (locked.sigma_a_ms == SA)]
|
||||||
|
pred, _ = neural_predictions(p, P4, arrays, [SA])
|
||||||
|
diffs = []
|
||||||
|
for a in pred:
|
||||||
|
if a["seed"] != "ensemble":
|
||||||
|
continue
|
||||||
|
row = locked[(locked.scheme == a["scheme"]) & (locked.test_well == a["test_well"])
|
||||||
|
& (locked.method == a["method"])]
|
||||||
|
diffs.append(abs(extra(full.y(a["test_well"], ref), a["mu"], a["sigma"])["rmse"] - float(row.rmse.iloc[0])))
|
||||||
|
report["V0a_max_abs_rmse_diff"] = float(max(diffs))
|
||||||
|
report["V0a_rows"] = len(diffs)
|
||||||
|
rows = []
|
||||||
|
for a in pred:
|
||||||
|
if a["seed"] == "ensemble" and a["method"] in ("B3b", "B3d-Sa", "M2-Sa"):
|
||||||
|
rows.append(dict(variant="P4", scheme=a["scheme"], test_well=a["test_well"], method=a["method"])
|
||||||
|
| extra(full.y(a["test_well"], ref), a["mu"], a["sigma"]))
|
||||||
|
|
||||||
|
# V0b: retrained seed-0 trajectories versus the stored P4 ones
|
||||||
|
v0 = []
|
||||||
|
for names in fold_sets(p):
|
||||||
|
for m in ("B3b", "M2-Sa"):
|
||||||
|
mine, theirs = job_path(OUT / "V0", names, m, LABEL, 0, SA), job_path(P4, names, m, LABEL, 0, SA)
|
||||||
|
if not mine.exists():
|
||||||
|
continue
|
||||||
|
a, b = load_bundle(mine), load_bundle(theirs)
|
||||||
|
assert list(a["targets"]) == list(b["targets"])
|
||||||
|
v0.append(max(float(np.max(np.abs(a[k] - b[k]))) for k in a if k.endswith("/mu") or k.endswith("/sigma")))
|
||||||
|
report["V0b_trajectories"] = len(v0)
|
||||||
|
report["V0b_max_abs_diff_fraction"] = float(max(v0)) if v0 else None
|
||||||
|
report["V0b_median_max_abs_diff_fraction"] = float(np.median(v0)) if v0 else None
|
||||||
|
|
||||||
|
for variant in ("V1a", "V1b", "V2a", "V2b", "V3"):
|
||||||
|
preds, methods = variant_predictions(variant, p, arrays)
|
||||||
|
report[f"{variant}_methods"] = methods
|
||||||
|
for a in preds:
|
||||||
|
rows.append(dict(variant=variant, scheme=a["scheme"], test_well=a["test_well"], method=a["method"])
|
||||||
|
| extra(full.y(a["test_well"], ref), a["mu"], a["sigma"]))
|
||||||
|
with np.load(OUT / "paths.npz") as z:
|
||||||
|
paths = {k: z[k] for k in z.files}
|
||||||
|
for a in reference_predictors(p, arrays, paths):
|
||||||
|
rows.append({k: a[k] for k in ("variant", "scheme", "test_well", "method")}
|
||||||
|
| extra(full.y(a["test_well"], ref), a["mu"], a["sigma"]) | dict(trend_a=a["a"], trend_b=a["b"]))
|
||||||
|
|
||||||
|
per = pd.DataFrame(rows)
|
||||||
|
dest = OUT / "summary"
|
||||||
|
dest.mkdir(parents=True, exist_ok=True)
|
||||||
|
per.to_csv(dest / "per_well.csv", index=False)
|
||||||
|
cols = ["rmse", "abs_bias", "rmse_debiased", "label_sd", "debiased_over_sd", "pcc", "r2", "coverage_80",
|
||||||
|
"coverage_90"]
|
||||||
|
g = per.groupby(["variant", "scheme", "method"], sort=False)
|
||||||
|
macro = g[cols].mean().join(g.size().rename("n_wells"))
|
||||||
|
macro["wells_r2_pos"] = g.r2.apply(lambda s: int((s > 0).sum()))
|
||||||
|
macro["wells_debiased_le_0.9sd"] = g.debiased_over_sd.apply(lambda s: int((s <= 0.9).sum()))
|
||||||
|
macro = macro.reset_index()
|
||||||
|
macro["skill"] = (macro.r2 > 0) | (macro.rmse_debiased <= 0.9 * macro.label_sd)
|
||||||
|
macro.to_csv(dest / "macro.csv", index=False)
|
||||||
|
|
||||||
|
gaps = []
|
||||||
|
for (variant, scheme), d in per[per.method.isin(["B3b", "M2-Sa"])].groupby(["variant", "scheme"], sort=False):
|
||||||
|
w = d.pivot(index="test_well", columns="method", values=["rmse", "rmse_debiased"])
|
||||||
|
if ("rmse", "M2-Sa") not in w or ("rmse", "B3b") not in w:
|
||||||
|
continue
|
||||||
|
dr = w[("rmse", "M2-Sa")] - w[("rmse", "B3b")]
|
||||||
|
dd = w[("rmse_debiased", "M2-Sa")] - w[("rmse_debiased", "B3b")]
|
||||||
|
gaps.append(dict(variant=variant, scheme=scheme, macro_gap_rmse=float(dr.mean()),
|
||||||
|
macro_gap_rmse_debiased=float(dd.mean()), wells_m2_better=int((dr < 0).sum()),
|
||||||
|
n_wells=int(dr.size), **{f"gap_{k}": float(x) for k, x in dr.items()}))
|
||||||
|
gaps = pd.DataFrame(gaps)
|
||||||
|
gaps.to_csv(dest / "gap_m2_minus_b3b.csv", index=False)
|
||||||
|
(dest / "checks.json").write_text(json.dumps(report, indent=1), encoding="utf-8")
|
||||||
|
|
||||||
|
text = ["# P4x — exploratory Volve variants (post hoc; see docs/research/p4-exploratory.md)", "",
|
||||||
|
f"Generated {report['created']}. σ_a = 7 ms, primary reference `{ref}`, combined ensembles, "
|
||||||
|
"porosity units. Exploratory: cannot support plan §10 claims or alter G-D.", "",
|
||||||
|
"## Checks", "", "```", json.dumps(report, indent=1), "```", "",
|
||||||
|
"## Macro over wells", "", macro.to_markdown(index=False, floatfmt=".3f"), "",
|
||||||
|
"## M2-Sa − B3b (RMSE, p.u.; negative = M2-Sa better)", "",
|
||||||
|
gaps.to_markdown(index=False, floatfmt=".3f") if len(gaps) else "(none)", "",
|
||||||
|
"Per-well rows: per_well.csv. Skill: macro R² > 0 or macro bias-removed RMSE ≤ 0.9 × macro label SD."]
|
||||||
|
(dest / "summary.md").write_text("\n".join(text) + "\n", encoding="utf-8")
|
||||||
|
print(json.dumps(report, indent=1))
|
||||||
|
|
||||||
|
|
||||||
|
def main() -> None:
|
||||||
|
ap = argparse.ArgumentParser()
|
||||||
|
ap.add_argument("stage", choices=["paths", "train", "summarize"])
|
||||||
|
ap.add_argument("--variants", nargs="+", default=["V0", "V1a", "V1b", "V2a", "V2b"])
|
||||||
|
ap.add_argument("--methods", nargs="+", default=["B3b", "M2-Sa"])
|
||||||
|
ap.add_argument("--seeds", nargs="+", type=int, default=[0, 1, 2, 3, 4])
|
||||||
|
ap.add_argument("--workers", type=int, default=8)
|
||||||
|
ap.add_argument("--device", default="cuda:0")
|
||||||
|
a = ap.parse_args()
|
||||||
|
if a.stage == "paths":
|
||||||
|
build_paths()
|
||||||
|
elif a.stage == "train":
|
||||||
|
run_train(a.variants, a.methods, a.seeds, a.workers, a.device)
|
||||||
|
else:
|
||||||
|
summarize()
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
13
exploratory/run_p4x.sh
Executable file
13
exploratory/run_p4x.sh
Executable file
@@ -0,0 +1,13 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# P4x exploratory driver (docs/research/p4-exploratory.md): required methods of every variant first, then B3d-Sa,
|
||||||
|
# then the optional V3. Completed trajectories are skipped, so the driver can be restarted.
|
||||||
|
set -euo pipefail
|
||||||
|
cd "$(dirname "$0")/.."
|
||||||
|
DEVICE="${DEVICE:-cuda:0}"
|
||||||
|
WORKERS="${WORKERS:-8}"
|
||||||
|
export 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
|
||||||
|
run() { scripts/runlog.sh -n "p4x_$1" -- exploratory/p4x_volve.py train --device "$DEVICE" --workers "$WORKERS" "${@:2}"; }
|
||||||
|
run required --variants V0 V1a V1b V2a V2b --methods B3b M2-Sa
|
||||||
|
run b3d --variants V1a V1b V2a V2b --methods B3d-Sa
|
||||||
|
run v3 --variants V3 --methods B3b M2-Sa B3d-Sa
|
||||||
@@ -143,3 +143,70 @@ run_id,parent,name,status,exit_code,start,end,wall_s,wall,device,git,dirty,code_
|
|||||||
20261028-001548_p3_all,,p3_all,failed,1,2026-10-28T00:15:48+07:00,2026-10-28T03:57:33+07:00,13305.6,3:41:46,cuda:0,a22f9d951fe3,True,04bf3e1e27b1e1b7,runlog,'C:\Users\PC\Documents\ML-Porosity\.venv\Scripts\python.exe' -X utf8 'C:\Users\PC\Documents\ML-Porosity\scripts\19_run_f3.py' all --device cuda:0 --workers 4
|
20261028-001548_p3_all,,p3_all,failed,1,2026-10-28T00:15:48+07:00,2026-10-28T03:57:33+07:00,13305.6,3:41:46,cuda:0,a22f9d951fe3,True,04bf3e1e27b1e1b7,runlog,'C:\Users\PC\Documents\ML-Porosity\.venv\Scripts\python.exe' -X utf8 'C:\Users\PC\Documents\ML-Porosity\scripts\19_run_f3.py' all --device cuda:0 --workers 4
|
||||||
20261028-064743_p3_volume_recovery,,p3_volume_recovery,ok,0,2026-10-28T06:47:43+07:00,2026-10-28T06:50:45+07:00,182.2,0:03:02,cuda:0,a22f9d951fe3,True,04bf3e1e27b1e1b7,runlog,'.\.venv\Scripts\python.exe' -X utf8 operations/resume_f3_volume.py --device cuda:0
|
20261028-064743_p3_volume_recovery,,p3_volume_recovery,ok,0,2026-10-28T06:47:43+07:00,2026-10-28T06:50:45+07:00,182.2,0:03:02,cuda:0,a22f9d951fe3,True,04bf3e1e27b1e1b7,runlog,'.\.venv\Scripts\python.exe' -X utf8 operations/resume_f3_volume.py --device cuda:0
|
||||||
20261028-065050_p3_completion_audit,,p3_completion_audit,ok,0,2026-10-28T06:50:50+07:00,2026-10-28T06:51:16+07:00,26.1,0:00:26,,a22f9d951fe3,True,04bf3e1e27b1e1b7,runlog,'.\.venv\Scripts\python.exe' -X utf8 operations/check_f3_completion.py
|
20261028-065050_p3_completion_audit,,p3_completion_audit,ok,0,2026-10-28T06:50:50+07:00,2026-10-28T06:51:16+07:00,26.1,0:00:26,,a22f9d951fe3,True,04bf3e1e27b1e1b7,runlog,'.\.venv\Scripts\python.exe' -X utf8 operations/check_f3_completion.py
|
||||||
|
20261029-011622_p4_benchmark,,p4_benchmark,ok,0,2026-10-29T01:16:22+00:00,2026-10-29T01:16:48+00:00,25.5,0:00:25,cuda:1,7da6b077b6e3,True,d3410f1130a74cc3,runlog,/home/jovyan/lamlvh/ML-Porosity/.venv/bin/python scripts/24_run_volve.py benchmark --device cuda:1
|
||||||
|
20261029-011736_p4_lock_primary,,p4_lock_primary,ok,0,2026-10-29T01:17:36+00:00,2026-10-29T01:17:43+00:00,6.2,0:00:06,cuda:1,7da6b077b6e3,True,a6f9ea223246c9b7,runlog,.venv/bin/python scripts/24_run_volve.py lock --device cuda:1 --workers 8 --arms primary
|
||||||
|
20261029-011750_p4_register_primary,,p4_register_primary,ok,0,2026-10-29T01:17:50+00:00,2026-10-29T01:20:36+00:00,166.6,0:02:47,cuda:1,7da6b077b6e3,True,984655c40e2413fc,runlog,.venv/bin/python scripts/24_run_volve.py register --device cuda:1 --workers 8 --arms primary
|
||||||
|
20261029-012257_p4_register_sensitivity,,p4_register_sensitivity,ok,0,2026-10-29T01:22:57+00:00,2026-10-29T01:28:25+00:00,327.6,0:05:28,cuda:0,7da6b077b6e3,True,984655c40e2413fc,runlog,.venv/bin/python scripts/24_run_volve.py register --device cuda:0 --workers 8 --arms sensitivity
|
||||||
|
20261029-012036_p4_train_primary,,p4_train_primary,ok,0,2026-10-29T01:20:36+00:00,2026-10-29T02:07:23+00:00,2806.5,0:46:46,cuda:1,7da6b077b6e3,True,984655c40e2413fc,runlog,.venv/bin/python scripts/24_run_volve.py train --device cuda:1 --workers 8 --arms primary
|
||||||
|
20261029-020723_p4_summarize_primary,,p4_summarize_primary,ok,0,2026-10-29T02:07:23+00:00,2026-10-29T02:07:32+00:00,8.4,0:00:08,cuda:1,7da6b077b6e3,True,984655c40e2413fc,runlog,.venv/bin/python scripts/24_run_volve.py summarize --device cuda:1 --workers 8 --arms primary
|
||||||
|
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-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
|
||||||
281
ml_porosity/data/deviated.py
Normal file
281
ml_porosity/data/deviated.py
Normal file
@@ -0,0 +1,281 @@
|
|||||||
|
"""Deviated-well geometry and time–depth relationships (Volve, plan phase P4).
|
||||||
|
|
||||||
|
Conventions: MD and TVD are metres below the rotary kelly bushing (RKB); TVDSS = TVD − (KB − MSL), positive
|
||||||
|
down; X/Y are projected easting/northing (m) with grid north; times are two-way times (ms) from the seismic datum.
|
||||||
|
|
||||||
|
Seismic time is vertical time, whereas a sonic tool measures slowness along the borehole. The vertical sonic TDR
|
||||||
|
therefore integrates DT over TVD instead of MD (isotropic, flat-layer approximation). Anisotropy and dip are left
|
||||||
|
to the anchor calibration and, in RML, to the warp prior. All TDRs stay keyed by MD, so `log_to_time` and
|
||||||
|
`calibrate_to_anchors` apply unchanged.
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from dataclasses import dataclass
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
import numpy as np
|
||||||
|
from scipy import integrate
|
||||||
|
|
||||||
|
from ml_porosity.data.tdr import TDR, US_PER_M_TO_S_PER_M, _interp_extrap, calibrate_to_anchors
|
||||||
|
|
||||||
|
_COLUMNS = ("MD", "Inc", "Azim", "TVD")
|
||||||
|
_NODE_STEP_M = 1.0 # MD spacing of TDR nodes outside the logged interval (TVD is curved between survey stations)
|
||||||
|
|
||||||
|
|
||||||
|
def _tangent(inc_deg, azi_deg) -> np.ndarray:
|
||||||
|
"""Unit tangent (east, north, down) from inclination and grid azimuth in degrees."""
|
||||||
|
i, a = np.radians(inc_deg), np.radians(azi_deg)
|
||||||
|
return np.stack([np.sin(i) * np.sin(a), np.sin(i) * np.cos(a), np.cos(i)], axis=-1)
|
||||||
|
|
||||||
|
|
||||||
|
def _mc_step(t0: np.ndarray, t1: np.ndarray, dmd) -> np.ndarray:
|
||||||
|
"""Minimum-curvature displacement over arc length `dmd` between unit tangents t0 and t1 (exact on a circular arc)."""
|
||||||
|
beta = np.arccos(np.clip(np.sum(t0 * t1, axis=-1), -1.0, 1.0))
|
||||||
|
small = beta < 1e-9
|
||||||
|
rf = np.where(small, 1.0, 2.0 / np.where(small, 1.0, beta) * np.tan(beta / 2))
|
||||||
|
return 0.5 * np.asarray(dmd, dtype=float)[..., None] * (t0 + t1) * rf[..., None]
|
||||||
|
|
||||||
|
|
||||||
|
def read_compass_header(path: str | Path) -> dict[str, str]:
|
||||||
|
"""`key: value` lines above `SURVEY LIST` in a Compass survey export."""
|
||||||
|
head = {}
|
||||||
|
for s in Path(path).read_text(encoding="latin-1").splitlines():
|
||||||
|
if s.strip() == "SURVEY LIST":
|
||||||
|
return head
|
||||||
|
if ":" in s:
|
||||||
|
k, v = s.split(":", 1)
|
||||||
|
head[k.strip()] = v.strip()
|
||||||
|
raise ValueError(f"{path}: no SURVEY LIST section")
|
||||||
|
|
||||||
|
|
||||||
|
@dataclass(frozen=True)
|
||||||
|
class Trajectory:
|
||||||
|
"""Survey stations of one wellbore."""
|
||||||
|
|
||||||
|
name: str
|
||||||
|
md: np.ndarray # (N,) m RKB, strictly increasing
|
||||||
|
inc: np.ndarray # deg
|
||||||
|
azi: np.ndarray # deg from grid north
|
||||||
|
tvd: np.ndarray # m RKB
|
||||||
|
x: np.ndarray # easting (m)
|
||||||
|
y: np.ndarray # northing (m)
|
||||||
|
kb_msl: float = 0.0 # RKB elevation above MSL (m)
|
||||||
|
|
||||||
|
def __post_init__(self):
|
||||||
|
arrays = {k: np.asarray(getattr(self, k), dtype=float) for k in ("md", "inc", "azi", "tvd", "x", "y")}
|
||||||
|
n = arrays["md"].size
|
||||||
|
if n < 2 or any(a.shape != (n,) for a in arrays.values()):
|
||||||
|
raise ValueError("trajectory arrays must be 1-D of equal length ≥ 2")
|
||||||
|
if np.any(np.diff(arrays["md"]) <= 0):
|
||||||
|
raise ValueError(f"trajectory {self.name!r}: MD is not strictly increasing")
|
||||||
|
for k, a in arrays.items():
|
||||||
|
object.__setattr__(self, k, a)
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_compass(cls, path: str | Path, name: str | None = None) -> Trajectory:
|
||||||
|
"""Read a Compass "ACTUAL" survey export (header, then `SURVEY LIST`, a column line, a unit line and
|
||||||
|
one row per station: MD, Inc, Azim, TVD, X/Y offsets, UTM E/N, DLS)."""
|
||||||
|
head = read_compass_header(path)
|
||||||
|
if head.get("Calculation Method") != "Minimum Curvature" or head.get("North Reference") != "Grid":
|
||||||
|
raise ValueError(f"{path}: expected minimum curvature and grid north, got {head.get('Calculation Method')!r}"
|
||||||
|
f" / {head.get('North Reference')!r}")
|
||||||
|
lines = Path(path).read_text(encoding="latin-1").splitlines()
|
||||||
|
start = next(k for k, s in enumerate(lines) if s.strip() == "SURVEY LIST")
|
||||||
|
if tuple(lines[start + 1].split()[:4]) != _COLUMNS or "UTM N/S" not in lines[start + 1]:
|
||||||
|
raise ValueError(f"{path}: unexpected survey columns {lines[start + 1]!r}")
|
||||||
|
if lines[start + 2].split()[:2] != ["m", "RKB"]:
|
||||||
|
raise ValueError(f"{path}: MD is not referenced to RKB")
|
||||||
|
rows = np.array([[float(v) for v in s.split()] for s in lines[start + 3:] if s.strip()])
|
||||||
|
if rows.ndim != 2 or rows.shape[1] != 9:
|
||||||
|
raise ValueError(f"{path}: expected 9 numeric columns per station")
|
||||||
|
md, inc, azi, tvd, _, _, x, y, _ = rows.T
|
||||||
|
kb = float(head["KB-MSL"].removesuffix("m"))
|
||||||
|
return cls(name or head.get("WELLBORE NAME", Path(path).name), md, inc, azi, tvd, x, y, kb)
|
||||||
|
|
||||||
|
def recompute(self) -> np.ndarray:
|
||||||
|
"""Station positions (x, y, tvd) by minimum curvature from the first station; QC against the listed ones."""
|
||||||
|
t = _tangent(self.inc, self.azi)
|
||||||
|
start = np.array([self.x[0], self.y[0], self.tvd[0]])
|
||||||
|
return np.vstack([start, start + np.cumsum(_mc_step(t[:-1], t[1:], np.diff(self.md)), axis=0)])
|
||||||
|
|
||||||
|
def dls(self) -> np.ndarray:
|
||||||
|
"""Dogleg severity (deg/30 m) of each survey interval."""
|
||||||
|
t = _tangent(self.inc, self.azi)
|
||||||
|
beta = np.arccos(np.clip(np.sum(t[:-1] * t[1:], axis=-1), -1.0, 1.0))
|
||||||
|
return np.degrees(beta) * 30.0 / np.diff(self.md)
|
||||||
|
|
||||||
|
def at(self, md) -> tuple[np.ndarray, np.ndarray, np.ndarray]:
|
||||||
|
"""(tvd, x, y) at MD: minimum curvature between stations, anchored on the listed station coordinates
|
||||||
|
(the small closure residual of each interval is spread linearly over it). No extrapolation."""
|
||||||
|
md = np.asarray(md, dtype=float)
|
||||||
|
if np.any(md < self.md[0] - 1e-9) or np.any(md > self.md[-1] + 1e-9):
|
||||||
|
raise ValueError(f"trajectory {self.name!r}: MD outside the survey {self.md[0]}–{self.md[-1]} m")
|
||||||
|
i = np.clip(np.searchsorted(self.md, md, side="right") - 1, 0, self.md.size - 2)
|
||||||
|
dmd = self.md[i + 1] - self.md[i]
|
||||||
|
f = np.clip((md - self.md[i]) / dmd, 0.0, 1.0)
|
||||||
|
t = _tangent(self.inc, self.azi)
|
||||||
|
t0, t1 = t[i], t[i + 1]
|
||||||
|
beta = np.arccos(np.clip(np.sum(t0 * t1, axis=-1), -1.0, 1.0))
|
||||||
|
sb = np.sin(beta)
|
||||||
|
small = sb < 1e-9
|
||||||
|
w0 = np.where(small, 1 - f, np.sin((1 - f) * beta) / np.where(small, 1.0, sb))
|
||||||
|
w1 = np.where(small, f, np.sin(f * beta) / np.where(small, 1.0, sb))
|
||||||
|
tf = w0[..., None] * t0 + w1[..., None] * t1 # tangent at fraction f of the circular arc
|
||||||
|
tf = tf / np.linalg.norm(tf, axis=-1, keepdims=True)
|
||||||
|
p = np.stack([self.x, self.y, self.tvd], axis=-1)
|
||||||
|
closure = p[i + 1] - p[i] - _mc_step(t0, t1, dmd)
|
||||||
|
q = p[i] + _mc_step(t0, tf, f * dmd) + f[..., None] * closure
|
||||||
|
return q[..., 2], q[..., 0], q[..., 1]
|
||||||
|
|
||||||
|
def tvdss(self, md) -> np.ndarray:
|
||||||
|
return self.at(md)[0] - self.kb_msl
|
||||||
|
|
||||||
|
|
||||||
|
def vertical_sonic_tdr(md, tvd, dt_us_per_m, md0: float, t0_ms: float, name: str = "sonic") -> TDR:
|
||||||
|
"""Vertical-time sonic TDR through (md0, t0_ms): t(md) = t0 + 2·∫ DT dTVD from md0 to md.
|
||||||
|
|
||||||
|
Only valid DT samples are used (gaps are integrated as DT varying linearly between their ends). md0 must lie
|
||||||
|
within the valid DT range, and TVD must increase strictly along it (no well turning upwards)."""
|
||||||
|
md, tvd, dt = (np.asarray(v, dtype=float) for v in (md, tvd, dt_us_per_m))
|
||||||
|
ok = np.isfinite(dt) & (dt > 0) & np.isfinite(tvd)
|
||||||
|
md_v, tvd_v, dt_v = md[ok], tvd[ok], dt[ok]
|
||||||
|
if md_v.size < 2:
|
||||||
|
raise ValueError("no valid DT")
|
||||||
|
if np.any(np.diff(tvd_v) <= 0):
|
||||||
|
raise ValueError("TVD does not increase strictly over the logged interval")
|
||||||
|
if not md_v[0] <= md0 <= md_v[-1]:
|
||||||
|
raise ValueError(f"anchor MD {md0} lies outside the valid DT range {md_v[0]}–{md_v[-1]} m")
|
||||||
|
t = 2000.0 * integrate.cumulative_trapezoid(dt_v * US_PER_M_TO_S_PER_M, tvd_v, initial=0.0)
|
||||||
|
return TDR(md_v, t - np.interp(md0, md_v, t) + t0_ms, name)
|
||||||
|
|
||||||
|
|
||||||
|
def _sorted_anchors(anchor_md, anchor_twt_ms) -> tuple[np.ndarray, np.ndarray]:
|
||||||
|
za, ta = np.asarray(anchor_md, dtype=float), np.asarray(anchor_twt_ms, dtype=float)
|
||||||
|
order = np.argsort(za, kind="stable")
|
||||||
|
za, ta = za[order], ta[order]
|
||||||
|
if np.any(np.diff(za) <= 0) or np.any(np.diff(ta) <= 0):
|
||||||
|
raise ValueError("anchors must be strictly increasing in MD and TWT")
|
||||||
|
return za, ta
|
||||||
|
|
||||||
|
|
||||||
|
def _nodes(traj: Trajectory, lo: float, hi: float, extra=()) -> np.ndarray:
|
||||||
|
"""Survey stations, a regular MD grid and `extra` points strictly inside (lo, hi), clipped to the survey."""
|
||||||
|
grid = np.arange(np.ceil(traj.md[0]), traj.md[-1], _NODE_STEP_M)
|
||||||
|
z = np.union1d(np.union1d(grid, traj.md), np.asarray(extra, dtype=float))
|
||||||
|
return z[(z > lo) & (z < hi)]
|
||||||
|
|
||||||
|
|
||||||
|
def calibrated_vertical_tdr(traj: Trajectory, md, dt_us_per_m, anchor_md, anchor_twt_ms, edge_m: float = 30.0,
|
||||||
|
name: str = "calibrated") -> TDR:
|
||||||
|
"""Marker-calibrated vertical sonic TDR (the scoring reference of plan §5.2) over the whole survey.
|
||||||
|
|
||||||
|
Within the valid DT range: the vertical sonic through the first anchor in that range, stretched between
|
||||||
|
consecutive anchors in the range and bulk-shifted beyond them (`calibrate_to_anchors`). Outside the valid DT
|
||||||
|
range, which only places the well path in time and never carries labels: piecewise linear in TVD through the
|
||||||
|
anchors there, continued at the outermost segment's velocity; with no anchor on that side, constant vertical
|
||||||
|
velocity equal to the median sonic velocity over the adjacent `edge_m` of logged hole."""
|
||||||
|
md, dt = np.asarray(md, dtype=float), np.asarray(dt_us_per_m, dtype=float)
|
||||||
|
ok = np.isfinite(dt) & (dt > 0)
|
||||||
|
if ok.sum() < 2:
|
||||||
|
raise ValueError("no valid DT")
|
||||||
|
md_v, dt_v = md[ok], dt[ok]
|
||||||
|
m0, m1 = md_v[0], md_v[-1]
|
||||||
|
za, ta = _sorted_anchors(anchor_md, anchor_twt_ms)
|
||||||
|
inside = (za >= m0) & (za <= m1)
|
||||||
|
if inside.sum() < 2:
|
||||||
|
raise ValueError(f"{traj.name}: fewer than two anchors within the valid DT range {m0}–{m1} m")
|
||||||
|
base = vertical_sonic_tdr(md_v, traj.at(md_v)[0], dt_v, za[inside][0], ta[inside][0])
|
||||||
|
core = calibrate_to_anchors(base, za[inside], ta[inside], name)
|
||||||
|
|
||||||
|
def extend(nodes: np.ndarray, beyond: np.ndarray, edge_md: float, edge_t: float, edge_dt: np.ndarray):
|
||||||
|
if nodes.size == 0:
|
||||||
|
return nodes
|
||||||
|
zc = np.r_[traj.at(za[beyond])[0], traj.at(edge_md)[0]]
|
||||||
|
tc = np.r_[ta[beyond], edge_t]
|
||||||
|
zn = traj.at(nodes)[0]
|
||||||
|
if zc.size >= 2:
|
||||||
|
order = np.argsort(zc)
|
||||||
|
return _interp_extrap(zn, zc[order], tc[order])
|
||||||
|
return edge_t + 2000.0 * (zn - zc[0]) / float(np.median(1e6 / edge_dt))
|
||||||
|
|
||||||
|
up, down = za < m0, za > m1
|
||||||
|
md_up = _nodes(traj, -np.inf, m0, za[up])
|
||||||
|
md_down = _nodes(traj, m1, np.inf, za[down])
|
||||||
|
t_up = extend(md_up, up, m0, core.twt_ms[0], dt_v[md_v <= m0 + edge_m])
|
||||||
|
t_down = extend(md_down, down, m1, core.twt_ms[-1], dt_v[md_v >= m1 - edge_m])
|
||||||
|
return TDR(np.r_[md_up, core.md, md_down], np.r_[t_up, core.twt_ms, t_down], name)
|
||||||
|
|
||||||
|
|
||||||
|
def anchor_tdr(traj: Trajectory, anchor_md, anchor_twt_ms, name: str = "anchors") -> TDR:
|
||||||
|
"""Piecewise linear in TVD between anchors, without the sonic. Meaningful only within the anchor span."""
|
||||||
|
za, ta = _sorted_anchors(anchor_md, anchor_twt_ms)
|
||||||
|
nodes = np.union1d(_nodes(traj, za[0], za[-1]), za)
|
||||||
|
return TDR(nodes, np.interp(traj.at(nodes)[0], traj.at(za)[0], ta), name)
|
||||||
|
|
||||||
|
|
||||||
|
def path_at_times(traj: Trajectory, tdr: TDR, t_ms) -> dict[str, np.ndarray]:
|
||||||
|
"""Well position at each time of `t_ms` under `tdr`. Below TD (or above the first station) the position is
|
||||||
|
held at the end station, i.e. the path continues vertically; `beyond` flags those samples."""
|
||||||
|
md = tdr.depth_at(t_ms)
|
||||||
|
tvd, x, y = traj.at(np.clip(md, traj.md[0], traj.md[-1]))
|
||||||
|
return {"md": md, "tvd": tvd, "x": x, "y": y, "beyond": (md < traj.md[0]) | (md > traj.md[-1])}
|
||||||
|
|
||||||
|
|
||||||
|
def tvdss_td_model(trajs: list[Trajectory], tdrs: list[TDR], z) -> np.ndarray:
|
||||||
|
"""Mean TWT over wells at TVDSS `z`; each well's MD-keyed TDR is mapped through its own trajectory and
|
||||||
|
extrapolated linearly beyond its nodes. Used to place a held-out well in time without its own TD data."""
|
||||||
|
z = np.asarray(z, dtype=float)
|
||||||
|
out = []
|
||||||
|
for traj, tdr in zip(trajs, tdrs, strict=True):
|
||||||
|
md = tdr.md[(tdr.md >= traj.md[0]) & (tdr.md <= traj.md[-1])]
|
||||||
|
zs = traj.tvdss(md)
|
||||||
|
if np.any(np.diff(zs) <= 0):
|
||||||
|
raise ValueError(f"{traj.name}: TVDSS does not increase strictly along the TDR nodes")
|
||||||
|
out.append(_interp_extrap(z, zs, tdr.time_at(md)))
|
||||||
|
return np.mean(out, axis=0)
|
||||||
|
|
||||||
|
|
||||||
|
def tdr_from_tvdss(traj: Trajectory, z_model, t_model, name: str = "tvdss_model") -> TDR:
|
||||||
|
"""MD-keyed TDR of `traj` over its survey from a TVDSS → TWT function (z_model, t_model)."""
|
||||||
|
md = np.union1d(_nodes(traj, -np.inf, np.inf), traj.md)
|
||||||
|
return TDR(md, _interp_extrap(traj.tvdss(md), np.asarray(z_model, float), np.asarray(t_model, float)), name)
|
||||||
|
|
||||||
|
|
||||||
|
def composite_patch(cube, il, xl, times_ms, radius: int = 1, method: str = "bilinear",
|
||||||
|
cache: dict | None = None) -> np.ndarray:
|
||||||
|
"""Seismic patch along a well path, shape (C, L) with C = (2r+1)²: channel (di, dx), in the IL-major order of
|
||||||
|
`SeismicCube.patch`, holds at sample n the trace at (il[n] + di, xl[n] + dx) evaluated at times_ms[n], which
|
||||||
|
must lie on the cube's sample grid. 'bilinear' interpolates the four surrounding bins; 'nearest' takes the
|
||||||
|
nearest one. `cube` needs `times_ms`, `dt_ms` and `trace(il, xl)`; `cache` maps (il, xl) to traces."""
|
||||||
|
if method not in ("bilinear", "nearest"):
|
||||||
|
raise ValueError(f"unknown method {method!r}")
|
||||||
|
il, xl, t = (np.asarray(v, dtype=float) for v in (il, xl, times_ms))
|
||||||
|
k = np.rint((t - cube.times_ms[0]) / cube.dt_ms).astype(int)
|
||||||
|
if np.any(k < 0) or np.any(k >= len(cube.times_ms)) or not np.allclose(cube.times_ms[k], t, rtol=0, atol=1e-6):
|
||||||
|
raise ValueError("times_ms must lie on the cube's sample grid")
|
||||||
|
cache = {} if cache is None else cache
|
||||||
|
|
||||||
|
def add(out: np.ndarray, i: np.ndarray, j: np.ndarray, w: np.ndarray) -> None:
|
||||||
|
on = w > 0
|
||||||
|
for key in set(zip(i[on].tolist(), j[on].tolist())):
|
||||||
|
if key not in cache:
|
||||||
|
cache[key] = cube.trace(*key)
|
||||||
|
sel = on & (i == key[0]) & (j == key[1])
|
||||||
|
out[sel] += w[sel] * cache[key][k[sel]]
|
||||||
|
|
||||||
|
channels = []
|
||||||
|
for di in range(-radius, radius + 1):
|
||||||
|
for dx in range(-radius, radius + 1):
|
||||||
|
fi, fj = il + di, xl + dx
|
||||||
|
out = np.zeros(t.size)
|
||||||
|
if method == "nearest":
|
||||||
|
add(out, np.rint(fi).astype(int), np.rint(fj).astype(int), np.ones(t.size))
|
||||||
|
else:
|
||||||
|
i0, j0 = np.floor(fi).astype(int), np.floor(fj).astype(int)
|
||||||
|
wi, wj = fi - i0, fj - j0
|
||||||
|
for a, b, w in ((0, 0, (1 - wi) * (1 - wj)), (0, 1, (1 - wi) * wj),
|
||||||
|
(1, 0, wi * (1 - wj)), (1, 1, wi * wj)):
|
||||||
|
add(out, i0 + a, j0 + b, w)
|
||||||
|
channels.append(out)
|
||||||
|
return np.stack(channels).astype(np.float32)
|
||||||
@@ -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})")
|
||||||
|
|||||||
126
ml_porosity/data/volve_wells.py
Normal file
126
ml_porosity/data/volve_wells.py
Normal file
@@ -0,0 +1,126 @@
|
|||||||
|
"""P4 Volve wells: survey, petrophysical logs and TWT anchors of one wellbore (`p4` section of configs/d3_volve.yaml).
|
||||||
|
|
||||||
|
Logs are taken from the petrophysical interpretation (WLC_PETRO_COMPUTED_INPUT/OUTPUT LAS, MD from RKB) and
|
||||||
|
converted to the F3 units: DT µs/m, RHOB kg/m³, AI = RHOB·Vp in (m/s)·(kg/m³). Anchors are the well picks with a
|
||||||
|
TWT, minus the excluded surfaces and quality flags; picks at the same MD (e.g. SHETLAND GP. Top = Ekofisk Fm. Top)
|
||||||
|
or within `min_sep_m` of a shallower anchor are one marker.
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from dataclasses import dataclass, field
|
||||||
|
|
||||||
|
import numpy as np
|
||||||
|
import pandas as pd
|
||||||
|
|
||||||
|
from ml_porosity.data.deviated import Trajectory, read_compass_header
|
||||||
|
from ml_porosity.data.las_io import read_las
|
||||||
|
from ml_porosity.paths import volve_root
|
||||||
|
|
||||||
|
FT_M = 0.3048
|
||||||
|
_UNITS = {"DT": {"us/ft"}, "RHOB": {"g/cm3"}, "NPHI": {"v/v", "v/v_decimal"}, "PHIF": {"v/v", "v/v_decimal"}}
|
||||||
|
ANCHOR_COLUMNS = ["surface", "qlf", "md", "tvd", "tvdss", "twt_ms", "x", "y"]
|
||||||
|
|
||||||
|
|
||||||
|
@dataclass(frozen=True)
|
||||||
|
class VolveWell:
|
||||||
|
name: str # short name used in P4, e.g. "F-11 T2"
|
||||||
|
pick_name: str # name in the well picks, e.g. "NO 15/9-F-11 T2"
|
||||||
|
traj: Trajectory
|
||||||
|
header: dict[str, str] # Compass survey header
|
||||||
|
logs: pd.DataFrame # index MD (m RKB) within the survey; DT, RHOB, NPHI, GR, PHIF, AI
|
||||||
|
anchors: pd.DataFrame # ANCHOR_COLUMNS, strictly increasing in MD and TWT
|
||||||
|
excluded: pd.DataFrame # picks with a TWT that are not anchors: ANCHOR_COLUMNS + `reason`
|
||||||
|
qc: dict = field(default_factory=dict) # loader counts: DT samples rejected, samples dropped beyond the survey
|
||||||
|
|
||||||
|
def valid_range(self, curve: str) -> tuple[float, float]:
|
||||||
|
v = self.logs[curve].dropna()
|
||||||
|
return float(v.index[0]), float(v.index[-1])
|
||||||
|
|
||||||
|
def label_support(self, label: str = "PHIF") -> tuple[float, float]:
|
||||||
|
"""MD range of the label within the valid DT range: labels are never placed by an extrapolated TDR."""
|
||||||
|
(a, b), (c, d) = self.valid_range(label), self.valid_range("DT")
|
||||||
|
if max(a, c) >= min(b, d):
|
||||||
|
raise ValueError(f"{self.name}: {label} and DT do not overlap")
|
||||||
|
return max(a, c), min(b, d)
|
||||||
|
|
||||||
|
|
||||||
|
def blind_training_wells(test: str, scheme: str, p4: dict) -> tuple[str, ...]:
|
||||||
|
"""Wells whose data may be used when `test` is held out: `lowo` all others, `slot` all outside its slot group."""
|
||||||
|
if scheme == "lowo":
|
||||||
|
out = set(p4["wells"]) - {test}
|
||||||
|
elif scheme == "slot":
|
||||||
|
group = next(set(g) for g in p4["slot_groups"] if test in g)
|
||||||
|
out = set(p4["wells"]) - group
|
||||||
|
else:
|
||||||
|
raise ValueError(f"unknown blind scheme {scheme!r}")
|
||||||
|
return tuple(w for w in p4["wells"] if w in out)
|
||||||
|
|
||||||
|
|
||||||
|
def blind_key(wells) -> str:
|
||||||
|
"""npz key of the blind input placed in time by the TD model of `wells` (any order)."""
|
||||||
|
return "+".join(sorted(wells))
|
||||||
|
|
||||||
|
|
||||||
|
def well_anchors(picks: pd.DataFrame, pick_name: str, exclude_surfaces, exclude_qlf,
|
||||||
|
min_sep_m: float = 0.0) -> tuple[pd.DataFrame, pd.DataFrame]:
|
||||||
|
"""(anchors, excluded) for one well from `read_well_picks` output. A pick at most `min_sep_m` below the last
|
||||||
|
kept anchor is dropped, preferring picks without a quality flag at equal MD; picks at the same MD must agree
|
||||||
|
in TWT."""
|
||||||
|
p = picks[(picks.well == pick_name) & picks.twt_ms.notna()].copy()
|
||||||
|
p["reason"] = ""
|
||||||
|
p.loc[p.qlf.isin(exclude_qlf), "reason"] = "qlf " + p.qlf
|
||||||
|
p.loc[p.surface.isin(exclude_surfaces), "reason"] = "surface"
|
||||||
|
cand = p[p.reason == ""].assign(flagged=lambda d: d.qlf != "").sort_values(["md", "flagged"], kind="stable")
|
||||||
|
keep: list = []
|
||||||
|
for i, r in cand.iterrows():
|
||||||
|
if keep and r.md - p.at[keep[-1], "md"] <= min_sep_m:
|
||||||
|
first = p.loc[keep[-1]]
|
||||||
|
if r.md == first.md and abs(r.twt_ms - first.twt_ms) > 0.1:
|
||||||
|
raise ValueError(f"{pick_name}: picks at MD {r.md} disagree in TWT")
|
||||||
|
p.at[i, "reason"] = (f"same MD as {first.surface}" if r.md == first.md
|
||||||
|
else f"{r.md - first.md:.2f} m below {first.surface}")
|
||||||
|
else:
|
||||||
|
keep.append(i)
|
||||||
|
anchors = p.loc[keep, ANCHOR_COLUMNS].reset_index(drop=True)
|
||||||
|
if np.any(np.diff(anchors.twt_ms) <= 0):
|
||||||
|
raise ValueError(f"{pick_name}: anchor TWT does not increase with MD")
|
||||||
|
excluded = p.loc[p.reason != "", ANCHOR_COLUMNS + ["reason"]].sort_values("md", kind="stable")
|
||||||
|
return anchors, excluded.reset_index(drop=True)
|
||||||
|
|
||||||
|
|
||||||
|
def load_volve_well(name: str, cfg: dict, picks: pd.DataFrame) -> VolveWell:
|
||||||
|
p4, spec, root = cfg["p4"], cfg["p4"]["wells"][name], volve_root()
|
||||||
|
survey = root / p4["survey_dir"] / spec["survey"]
|
||||||
|
traj = Trajectory.from_compass(survey, name)
|
||||||
|
folder = root / cfg["well_logs_dir"] / spec["logs"] / p4["log_subdir"]
|
||||||
|
li, ui, _ = read_las(folder / p4["las_input"])
|
||||||
|
lo, uo, _ = read_las(folder / p4["las_output"])
|
||||||
|
units = ui | {"PHIF": uo.get("PHIF", "")}
|
||||||
|
for c, ok in _UNITS.items():
|
||||||
|
if units.get(c, "").lower() not in ok:
|
||||||
|
raise ValueError(f"{name}: unexpected unit {units.get(c)!r} for {c}")
|
||||||
|
|
||||||
|
# OUTPUT is sampled on the INPUT MD grid (0.1 m; 0.5 ft for F-12)
|
||||||
|
key = np.round(li.index.to_numpy(), 3)
|
||||||
|
phif = pd.Series(lo["PHIF"].to_numpy(), index=np.round(lo.index.to_numpy(), 3))
|
||||||
|
if not phif.index.isin(key).all():
|
||||||
|
raise ValueError(f"{name}: OUTPUT depths are not on the INPUT grid")
|
||||||
|
dt_ft = li["DT"].to_numpy(dtype=float)
|
||||||
|
lo_ft, hi_ft = p4["dt_valid_us_per_ft"]
|
||||||
|
bad = np.isfinite(dt_ft) & ((dt_ft < lo_ft) | (dt_ft > hi_ft))
|
||||||
|
dt = np.where(bad, np.nan, dt_ft) / FT_M
|
||||||
|
rhob = li["RHOB"].to_numpy(dtype=float) * 1000.0
|
||||||
|
logs = pd.DataFrame({"DT": dt, "RHOB": rhob, "NPHI": li["NPHI"].to_numpy(dtype=float),
|
||||||
|
"GR": li["GR"].to_numpy(dtype=float), "PHIF": phif.reindex(key).to_numpy(dtype=float),
|
||||||
|
"AI": rhob * 1e6 / dt}, index=pd.Index(li.index.to_numpy(dtype=float), name="MD"))
|
||||||
|
|
||||||
|
# Only positions on the survey can be placed in time. F-12 has GR down to 4187 m below its 3520 m TD.
|
||||||
|
inside = (logs.index >= traj.md[0]) & (logs.index <= traj.md[-1])
|
||||||
|
beyond = logs[~inside].notna().sum()
|
||||||
|
if beyond[["DT", p4["label"]]].any():
|
||||||
|
raise ValueError(f"{name}: DT or {p4['label']} beyond the survey {traj.md[0]}–{traj.md[-1]} m")
|
||||||
|
anchors, excluded = well_anchors(picks, spec["picks"], cfg["anchor_exclude_surfaces"], p4["anchor_exclude_qlf"],
|
||||||
|
p4["anchor_min_sep_m"])
|
||||||
|
qc = {"n_dt_rejected": int(bad.sum()), "n_beyond_survey": {c: int(n) for c, n in beyond.items() if n}}
|
||||||
|
return VolveWell(name, spec["picks"], traj, read_compass_header(survey), logs[inside], anchors, excluded, qc)
|
||||||
@@ -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
|
||||||
|
|||||||
1
ml_porosity/volve/__init__.py
Normal file
1
ml_porosity/volve/__init__.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
"""P4: blind-well Volve experiments with partial labels, separate from the frozen P3 (F3) modules."""
|
||||||
144
ml_porosity/volve/data.py
Normal file
144
ml_porosity/volve/data.py
Normal file
@@ -0,0 +1,144 @@
|
|||||||
|
"""P4 data views (plan §5.2): private arrays of the training wells, seismic-only blind inputs of every other well.
|
||||||
|
|
||||||
|
A restricted view (training_wells given) keeps, for a well outside the training set, only
|
||||||
|
|
||||||
|
times_ms, main_mask, kb_msl, survey/* the well path, known without its logs or picks
|
||||||
|
blind/<K>/{seismic_patch, md, il, xl, beyond} only for K ⊇ training_wells, well ∉ K
|
||||||
|
|
||||||
|
so its logs, picks, TDRs, reference path and the label-centred bin (il, xl, x, y: placed at the middle of the
|
||||||
|
label interval) are never loaded. Labels, the reference input and registration observations of such a well
|
||||||
|
raise RuntimeError. The full view (training_wells None) is for scoring only.
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import numpy as np
|
||||||
|
|
||||||
|
from ml_porosity.data.resample import log_to_time
|
||||||
|
from ml_porosity.data.tdr import TDR
|
||||||
|
from ml_porosity.models.bank_train import zscore_patch
|
||||||
|
from ml_porosity.paths import outputs_dir
|
||||||
|
from ml_porosity.registration.warp_prior import WarpGrid
|
||||||
|
|
||||||
|
PUBLIC = frozenset({"times_ms", "main_mask", "kb_msl"})
|
||||||
|
PUBLIC_PREFIXES = ("survey/",)
|
||||||
|
|
||||||
|
|
||||||
|
def npz_path():
|
||||||
|
return outputs_dir() / "volve" / "volve_wells.npz"
|
||||||
|
|
||||||
|
|
||||||
|
def load_arrays(path=None) -> dict[str, np.ndarray]:
|
||||||
|
with np.load(npz_path() if path is None else path) as z:
|
||||||
|
return {k: z[k] for k in z.files}
|
||||||
|
|
||||||
|
|
||||||
|
def blind_members(key: str) -> frozenset[str]:
|
||||||
|
return frozenset(key.split("+"))
|
||||||
|
|
||||||
|
|
||||||
|
def visible(key: str, training_wells: frozenset[str] | None) -> bool:
|
||||||
|
"""Whether the flat npz key "<well>/<item>" belongs to a view on `training_wells`."""
|
||||||
|
well, item = key.split("/", 1)
|
||||||
|
if training_wells is None or well in training_wells:
|
||||||
|
return True
|
||||||
|
if item in PUBLIC or item.startswith(PUBLIC_PREFIXES):
|
||||||
|
return True
|
||||||
|
if item.startswith("blind/"):
|
||||||
|
members = blind_members(item.split("/")[1])
|
||||||
|
return well not in members and training_wells <= members
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
class VolveData:
|
||||||
|
def __init__(self, protocol: dict, training_wells: tuple[str, ...] | None = None,
|
||||||
|
arrays: dict[str, np.ndarray] | None = None):
|
||||||
|
self.protocol = protocol
|
||||||
|
self.wells = list(protocol["data"]["wells"])
|
||||||
|
self.label = protocol["data"]["label"]
|
||||||
|
self.training_wells = None if training_wells is None else frozenset(training_wells)
|
||||||
|
if self.training_wells is not None and not self.training_wells <= set(self.wells):
|
||||||
|
raise ValueError("Unknown training well")
|
||||||
|
source = load_arrays() if arrays is None else arrays
|
||||||
|
self.arrays = {k: v for k, v in source.items()
|
||||||
|
if k.split("/", 1)[0] in self.wells and visible(k, self.training_wells)}
|
||||||
|
self.t = self.ext(self.wells[0], "times_ms")
|
||||||
|
self.main = self.ext(self.wells[0], "main_mask").astype(bool)
|
||||||
|
self.t_main = self.t[self.main]
|
||||||
|
self.dt = float(np.diff(self.t)[0])
|
||||||
|
for w in self.wells:
|
||||||
|
if not (np.array_equal(self.ext(w, "times_ms"), self.t)
|
||||||
|
and np.array_equal(self.ext(w, "main_mask").astype(bool), self.main)):
|
||||||
|
raise ValueError(f"Volve time axes differ: {w}")
|
||||||
|
r = protocol["registration"]
|
||||||
|
f = r["fine_dt_ms"]
|
||||||
|
self.grid = WarpGrid(*r["tau_range_ms"], r["warp_dtau_ms"])
|
||||||
|
self.tau = np.arange(r["tau_range_ms"][0], r["tau_range_ms"][1] + f / 2, f)
|
||||||
|
self.t_fine = np.arange(self.t[0] - 300, self.t[-1] + 300 + f / 2, f)
|
||||||
|
|
||||||
|
def is_training(self, well: str) -> bool:
|
||||||
|
return self.training_wells is None or well in self.training_wells
|
||||||
|
|
||||||
|
def ext(self, well: str, key: str) -> np.ndarray:
|
||||||
|
try:
|
||||||
|
return self.arrays[f"{well}/{key}"]
|
||||||
|
except KeyError:
|
||||||
|
raise KeyError(f"{well}/{key} is not in this data view") from None
|
||||||
|
|
||||||
|
def blind_keys(self, well: str) -> list[str]:
|
||||||
|
head = f"{well}/blind/"
|
||||||
|
return sorted({k[len(head):].split("/")[0] for k in self.arrays if k.startswith(head)})
|
||||||
|
|
||||||
|
def patch(self, well: str, key: str) -> np.ndarray:
|
||||||
|
"""(C, n_ext) seismic patch: key 'reference' (calibrated path, training wells only) or a blind key."""
|
||||||
|
if key == "reference":
|
||||||
|
if not self.is_training(well):
|
||||||
|
raise RuntimeError("The reference path of a held-out well uses its own picks and DT")
|
||||||
|
return self.ext(well, "reference/seismic_patch")
|
||||||
|
if well in blind_members(key):
|
||||||
|
raise RuntimeError(f"Blind key {key!r} contains its own well {well!r}")
|
||||||
|
return self.ext(well, f"blind/{key}/seismic_patch")
|
||||||
|
|
||||||
|
def X(self, well: str, key: str) -> np.ndarray:
|
||||||
|
"""Network input (C, L) on the main window."""
|
||||||
|
return zscore_patch(self.patch(well, key), self.main)
|
||||||
|
|
||||||
|
def y(self, well: str, reference: str, label: str | None = None) -> np.ndarray:
|
||||||
|
"""Label on the main window under TDR `reference`; NaN outside its support."""
|
||||||
|
if not self.is_training(well):
|
||||||
|
raise RuntimeError("Held-out labels are unavailable in a training data view")
|
||||||
|
return self.ext(well, f"{reference}/{label or self.label}")[self.main]
|
||||||
|
|
||||||
|
def training_observations(self, names: tuple[str, ...]) -> list[dict]:
|
||||||
|
"""Registration inputs of training wells on the sonic time axis τ (vertical sonic through the first anchor
|
||||||
|
in the DT range). Anchors: in the DT range and inside the ext window. `lik`: ext samples from the first to
|
||||||
|
the last finite calibrated AI sample (the tie likelihood is evaluated there only)."""
|
||||||
|
if self.training_wells is not None and not set(names) <= self.training_wells:
|
||||||
|
raise RuntimeError("Held-out logs and anchors are unavailable in a training data view")
|
||||||
|
r = self.protocol["registration"]
|
||||||
|
obs = []
|
||||||
|
for name in names:
|
||||||
|
sonic = TDR(self.ext(name, "tdr/sonic/md"), self.ext(name, "tdr/sonic/twt_ms"), "sonic")
|
||||||
|
md = self.ext(name, "log/md")
|
||||||
|
amd, att = self.ext(name, "anchors_md"), self.ext(name, "anchors_twt_ms")
|
||||||
|
keep = self.ext(name, "anchors_in_dt").astype(bool) & (att >= self.t[0]) & (att <= self.t[-1])
|
||||||
|
if keep.sum() < 1:
|
||||||
|
raise ValueError(f"No anchor in the DT range: {name}")
|
||||||
|
resampled, valid = {}, {}
|
||||||
|
for curve in ("AI", self.label):
|
||||||
|
v = log_to_time(md, self.ext(name, f"log/{curve}"), sonic, self.tau,
|
||||||
|
fine_dt_ms=r["log_fine_dt_ms"], cutoff_frac=r["log_cutoff_frac"])
|
||||||
|
good = np.isfinite(v)
|
||||||
|
if good.sum() < 2:
|
||||||
|
raise ValueError(f"No sonic-domain log: {name}/{curve}")
|
||||||
|
resampled[curve] = np.interp(self.tau, self.tau[good], v[good])
|
||||||
|
valid[curve] = good
|
||||||
|
ok = np.flatnonzero(np.isfinite(self.ext(name, "calibrated/AI")))
|
||||||
|
lik = np.zeros(self.t.size, bool)
|
||||||
|
lik[ok[0]: ok[-1] + 1] = True
|
||||||
|
seis = self.ext(name, "reference/seismic_patch")
|
||||||
|
obs.append({"name": name, "tau_k": sonic.time_at(amd[keep]), "t_k": att[keep].astype(float),
|
||||||
|
"ai_log": resampled["AI"], "labels": {self.label: resampled[self.label]},
|
||||||
|
"label_valid": {self.label: valid[self.label]}, "lik": lik,
|
||||||
|
"seis": seis[len(seis) // 2].astype(float)})
|
||||||
|
return obs
|
||||||
287
ml_porosity/volve/evaluation.py
Normal file
287
ml_porosity/volve/evaluation.py
Normal file
@@ -0,0 +1,287 @@
|
|||||||
|
"""P4 nested selection, scoring and the descriptive G-D report.
|
||||||
|
|
||||||
|
Selection (the budget of each trajectory, the point competitor of each outer fold) reads validation labels through
|
||||||
|
the data view of the outer training wells, VolveData(training_wells=T_out), which holds no label, log or pick of the
|
||||||
|
outer test well. Outer-test labels are read only by `score`, after every prediction is fixed.
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import json
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
import numpy as np
|
||||||
|
import pandas as pd
|
||||||
|
|
||||||
|
from ml_porosity.data.volve_wells import blind_key
|
||||||
|
from ml_porosity.eval.metrics import gaussian_metrics, point_metrics
|
||||||
|
from ml_porosity.f3.evaluation import choose_budget
|
||||||
|
from ml_porosity.f3.progress import write_json
|
||||||
|
from ml_porosity.f3.training import ensemble
|
||||||
|
from ml_porosity.volve.data import VolveData, load_arrays
|
||||||
|
from ml_porosity.volve.folds import inner_folds, outer_folds, target_name
|
||||||
|
from ml_porosity.volve.losses import finite_runs, highpass_segment
|
||||||
|
from ml_porosity.volve.protocol import source_config
|
||||||
|
from ml_porosity.volve.runner import arm_methods, fold_sets, job_path, load_bundle, reg_path
|
||||||
|
|
||||||
|
Z90 = 1.6448536269514722
|
||||||
|
COLUMNS = ["rmse", "mae", "pcc", "r2", "std_ratio", "coverage_80", "coverage_90", "nll", "crps", "mean_sigma",
|
||||||
|
"band_rmse", "band_pcc"]
|
||||||
|
|
||||||
|
|
||||||
|
def neural_predictions(p: dict, root: Path, arrays: dict, sigmas: list[float]) -> tuple[list[dict], list[dict]]:
|
||||||
|
"""Per scheme, outer fold, σ_a arm, method and seed: the budget with the lowest mean validation MSE over the
|
||||||
|
inner wells (original scale, labelled samples; earliest tie), the inner models ensembled at that budget on the
|
||||||
|
outer test input (key T_out), then the seeds ensembled."""
|
||||||
|
p4 = source_config(p)["p4"]
|
||||||
|
label, ref, budgets = p["data"]["label"], p["data"]["primary_reference"], p["training"]["budgets"]
|
||||||
|
cache, predictions, selections = {}, [], []
|
||||||
|
for scheme in p["split"]["schemes"]:
|
||||||
|
for test, outer_train in outer_folds(p["data"]["wells"], scheme, p4):
|
||||||
|
view = VolveData(p, training_wells=outer_train, arrays=arrays)
|
||||||
|
folds = inner_folds(outer_train)
|
||||||
|
labels = {v: view.y(v, ref) for v, _ in folds}
|
||||||
|
test_key = blind_key(outer_train)
|
||||||
|
for sa in sigmas:
|
||||||
|
for method in arm_methods(p, sa):
|
||||||
|
fold = dict(scheme=scheme, test_well=test, method=method, label=label, sigma_a_ms=sa)
|
||||||
|
per_seed = []
|
||||||
|
for seed in p["split"]["seeds"]:
|
||||||
|
curves, members = [], []
|
||||||
|
for v, t_in in folds:
|
||||||
|
path = job_path(root, t_in, method, label, seed, sa)
|
||||||
|
if path not in cache:
|
||||||
|
cache[path] = load_bundle(path)
|
||||||
|
z = cache[path]
|
||||||
|
if tuple(z["wells"]) != tuple(sorted(t_in)):
|
||||||
|
raise RuntimeError(f"Trajectory trained on other wells: {path}")
|
||||||
|
names = list(z["targets"])
|
||||||
|
y = labels[v]
|
||||||
|
ok = np.isfinite(y)
|
||||||
|
i = names.index(target_name(v, blind_key(t_in)))
|
||||||
|
curves.append([np.mean((z[f"{b}/mu"][i][ok] - y[ok]) ** 2) for b in budgets])
|
||||||
|
members.append((z, names.index(target_name(test, test_key))))
|
||||||
|
budget = choose_budget(np.array(curves), budgets)
|
||||||
|
mu, sigma = ensemble(np.stack([z[f"{budget}/mu"][i] for z, i in members]),
|
||||||
|
np.stack([z[f"{budget}/sigma"][i] for z, i in members]))
|
||||||
|
entry = fold | dict(seed=seed, members=len(folds), test_key=test_key, mu=mu, sigma=sigma)
|
||||||
|
predictions.append(entry)
|
||||||
|
per_seed.append(entry)
|
||||||
|
selections.append(fold | dict(
|
||||||
|
seed=seed, budget=budget,
|
||||||
|
validation_mse=float(np.mean(np.asarray(curves)[:, budgets.index(budget)])),
|
||||||
|
validation_wells=";".join(v for v, _ in folds),
|
||||||
|
validation_keys=";".join(blind_key(t) for _, t in folds),
|
||||||
|
training_sets=";".join(",".join(t) for _, t in folds)))
|
||||||
|
mu, sigma = ensemble(np.stack([e["mu"] for e in per_seed]), np.stack([e["sigma"] for e in per_seed]))
|
||||||
|
predictions.append(fold | dict(seed="ensemble", members=sum(e["members"] for e in per_seed),
|
||||||
|
test_key=test_key, mu=mu, sigma=sigma))
|
||||||
|
return predictions, selections
|
||||||
|
|
||||||
|
|
||||||
|
def references(full: VolveData, well: str, p: dict) -> list[str]:
|
||||||
|
"""The scoring references that exist for a well (NIVSP and OPTIMIZED only at F-11 T2)."""
|
||||||
|
return [r for r in p["data"]["references"] if f"{well}/{r}/{full.label}" in full.arrays]
|
||||||
|
|
||||||
|
|
||||||
|
def desc_band(y: np.ndarray, mu: np.ndarray, f_c: float, dt: float, min_samples: int) -> dict:
|
||||||
|
"""High-passed (< f_c removed) reference and prediction on each finite reference run of ≥ min_samples, pooled.
|
||||||
|
Runs are shorter than one period at f_c: descriptive only."""
|
||||||
|
runs = [(a, b) for a, b in finite_runs(y) if b - a >= min_samples]
|
||||||
|
if not runs:
|
||||||
|
return {"band_samples": 0, "band_rmse": np.nan, "band_pcc": np.nan, "band_std_ratio": np.nan}
|
||||||
|
t = np.concatenate([highpass_segment(y[a:b], f_c, dt) for a, b in runs])
|
||||||
|
q = np.concatenate([highpass_segment(mu[a:b], f_c, dt) for a, b in runs])
|
||||||
|
m = point_metrics(t, q)
|
||||||
|
return {"band_samples": int(t.size)} | {f"band_{k}": m[k] for k in ("rmse", "pcc", "std_ratio")}
|
||||||
|
|
||||||
|
|
||||||
|
def score(full: VolveData, pred: dict, reference: str, p: dict) -> dict:
|
||||||
|
"""Metrics in porosity units on the samples where the reference exists; references with fewer than
|
||||||
|
min_label_samples samples are listed but not scored."""
|
||||||
|
y = 100 * full.y(pred["test_well"], reference)
|
||||||
|
mu, sigma = 100 * pred["mu"], np.maximum(100 * pred["sigma"], 1e-6)
|
||||||
|
ok = np.isfinite(y)
|
||||||
|
row = {k: v for k, v in pred.items() if k not in ("mu", "sigma")} | dict(reference=reference,
|
||||||
|
n_reference=int(ok.sum()))
|
||||||
|
if ok.sum() < p["data"]["min_label_samples"]:
|
||||||
|
return row | dict(scored=False)
|
||||||
|
m = p["metrics"]
|
||||||
|
return (row | dict(scored=True) | point_metrics(y, mu) | gaussian_metrics(y[ok], mu[ok], sigma[ok])
|
||||||
|
| desc_band(y, mu, m["f_c_hz"], full.dt, m["desc_band_min_samples"]))
|
||||||
|
|
||||||
|
|
||||||
|
def best_shift(full: VolveData, pred: dict, reference: str, max_shift: int) -> dict:
|
||||||
|
"""Lag (samples, positive = prediction later) maximising PCC with the reference; diagnostic only, smallest |lag|
|
||||||
|
on ties. Never alters a score."""
|
||||||
|
y = full.y(pred["test_well"], reference)
|
||||||
|
idx = np.flatnonzero(np.isfinite(y))
|
||||||
|
best = (-np.inf, 0)
|
||||||
|
for s in sorted(range(-max_shift, max_shift + 1), key=abs):
|
||||||
|
j = idx + s
|
||||||
|
if j[0] < 0 or j[-1] >= pred["mu"].size:
|
||||||
|
continue
|
||||||
|
r = point_metrics(y[idx], pred["mu"][j])["pcc"]
|
||||||
|
if np.isfinite(r) and r > best[0]:
|
||||||
|
best = (r, s)
|
||||||
|
return {"best_shift_samples": best[1], "best_shift_ms": best[1] * full.dt, "best_shift_pcc": best[0]}
|
||||||
|
|
||||||
|
|
||||||
|
def gate_gd(metrics: pd.DataFrame, selection: pd.DataFrame, p: dict) -> dict:
|
||||||
|
"""G-D: report every well in either direction; claim wording follows protocol_volve gate.claim_rules."""
|
||||||
|
g, sa = p["gate"], p["registration"]["sigma_a_ms"]
|
||||||
|
rules = g["claim_rules"]
|
||||||
|
primary = metrics[(metrics.reference == p["data"]["primary_reference"]) & (metrics.seed.astype(str) == "ensemble")
|
||||||
|
& (metrics.sigma_a_ms == sa)]
|
||||||
|
within = lambda c, band: band[0] - 1e-12 <= c <= band[1] + 1e-12
|
||||||
|
schemes = {}
|
||||||
|
for scheme in p["split"]["schemes"]:
|
||||||
|
rows = []
|
||||||
|
for well in p["data"]["wells"]:
|
||||||
|
sel = selection[(selection.scheme == scheme) & (selection.test_well == well)
|
||||||
|
& (selection.sigma_a_ms == sa) & selection.method.isin(g["point_competitors"])]
|
||||||
|
scores = sel.groupby("method").validation_mse.mean()
|
||||||
|
if len(scores) != len(g["point_competitors"]):
|
||||||
|
return {"evaluated": False, "reason": "Incomplete point competitors"}
|
||||||
|
competitor = str(scores.idxmin())
|
||||||
|
pick = {}
|
||||||
|
for role, method in (("candidate", g["candidate"]), ("competitor", competitor),
|
||||||
|
("same_posterior", g["same_posterior_method"])):
|
||||||
|
hit = primary[(primary.scheme == scheme) & (primary.test_well == well) & (primary.method == method)]
|
||||||
|
if len(hit) != 1 or not bool(hit.iloc[0].scored):
|
||||||
|
raise ValueError(f"Incomplete G-D predictions: {scheme}/{well}/{method}")
|
||||||
|
pick[role] = hit.iloc[0]
|
||||||
|
a, b, d = pick["candidate"], pick["competitor"], pick["same_posterior"]
|
||||||
|
rows.append(dict(well=well, competitor=competitor, competitor_validation_mse=float(scores[competitor]),
|
||||||
|
n=int(a.n), rmse=float(a.rmse), competitor_rmse=float(b.rmse),
|
||||||
|
ratio=float(a.rmse / b.rmse), improved=bool(a.rmse < b.rmse),
|
||||||
|
same_posterior_rmse=float(d.rmse), improved_vs_same_posterior=bool(a.rmse < d.rmse),
|
||||||
|
coverage_80=float(a.coverage_80), coverage_90=float(a.coverage_90)))
|
||||||
|
frame = pd.DataFrame(rows)
|
||||||
|
c80, c90 = float(frame.coverage_80.mean()), float(frame.coverage_90.mean())
|
||||||
|
wins = int(frame.improved.sum())
|
||||||
|
schemes[scheme] = dict(
|
||||||
|
improved_wells=wins, n_wells=len(rows), macro_rmse=float(frame.rmse.mean()),
|
||||||
|
macro_competitor_rmse=float(frame.competitor_rmse.mean()),
|
||||||
|
macro_same_posterior_rmse=float(frame.same_posterior_rmse.mean()),
|
||||||
|
improved_vs_same_posterior_wells=int(frame.improved_vs_same_posterior.sum()),
|
||||||
|
coverage_80=c80, coverage_90=c90,
|
||||||
|
consistent_improvement=wins >= rules["min_improved_wells"],
|
||||||
|
coverage_in_band=within(c80, rules["coverage_80"]) and within(c90, rules["coverage_90"]),
|
||||||
|
per_well=rows)
|
||||||
|
claims = {"consistent_improvement": all(s["consistent_improvement"] for s in schemes.values()),
|
||||||
|
"calibrated": all(s["coverage_in_band"] for s in schemes.values())}
|
||||||
|
return dict(evaluated=True, descriptive=True, schemes=schemes, claims=claims, note=g["note"])
|
||||||
|
|
||||||
|
|
||||||
|
def registration_table(p: dict, root: Path, sigmas: list[float]) -> pd.DataFrame:
|
||||||
|
"""Per training set and well: γ, particles, posterior spread and label support per method (fewest and most
|
||||||
|
samples over the members; training wells only)."""
|
||||||
|
rows = []
|
||||||
|
for names in fold_sets(p):
|
||||||
|
for sa in sigmas:
|
||||||
|
meta = json.loads(reg_path(root, names, sa).with_suffix(".json").read_text(encoding="utf-8"))
|
||||||
|
for d in meta["diagnostics"]:
|
||||||
|
rows.append(dict(training_wells=";".join(names), sigma_a_ms=sa, phase0=meta["phase0"],
|
||||||
|
phase_R=meta["phase_R"], lam=meta["lambda"], tau_c=meta["tau_c"],
|
||||||
|
wall_seconds=meta["wall_seconds"], lik_start_ms=d["lik_ms"][0],
|
||||||
|
lik_stop_ms=d["lik_ms"][1],
|
||||||
|
**{k: v for k, v in d.items() if not isinstance(v, (list, dict))},
|
||||||
|
**{f"label_samples_{m}": n for m, n in d["label_samples"].items()},
|
||||||
|
**{f"label_samples_max_{m}": n for m, n in d["label_samples_max"].items()}))
|
||||||
|
return pd.DataFrame(rows)
|
||||||
|
|
||||||
|
|
||||||
|
def summarize(p: dict, root: Path, sigmas: list[float], arrays: dict | None = None) -> dict:
|
||||||
|
arrays = load_arrays() if arrays is None else arrays
|
||||||
|
pred, sel = neural_predictions(p, root, arrays, sigmas)
|
||||||
|
full = VolveData(p, arrays=arrays)
|
||||||
|
frame = pd.DataFrame([score(full, a, ref, p) for a in pred for ref in references(full, a["test_well"], p)])
|
||||||
|
selections = pd.DataFrame(sel)
|
||||||
|
gate = gate_gd(frame, selections, p)
|
||||||
|
smoke = root.name == "smoke"
|
||||||
|
if smoke:
|
||||||
|
gate = {"evaluated": False, "reason": "Smoke run; not the registered P4 experiment", "pipeline_check": gate}
|
||||||
|
dest = root / "summary"
|
||||||
|
dest.mkdir(parents=True, exist_ok=True)
|
||||||
|
frame.to_csv(dest / "metrics.csv", index=False)
|
||||||
|
selections.to_csv(dest / "selection.csv", index=False)
|
||||||
|
registration_table(p, root, sigmas).to_csv(dest / "registration.csv", index=False)
|
||||||
|
ens = frame[(frame.seed.astype(str) == "ensemble") & frame.scored.astype(bool)]
|
||||||
|
groups = ens.groupby(["scheme", "sigma_a_ms", "reference", "method"])
|
||||||
|
macro = groups[COLUMNS].mean().join(groups.size().rename("n_wells")).reset_index()
|
||||||
|
macro.to_csv(dest / "macro.csv", index=False)
|
||||||
|
shifts = [{k: v for k, v in a.items() if k not in ("mu", "sigma")}
|
||||||
|
| best_shift(full, a, p["data"]["primary_reference"], p["metrics"]["best_shift_max_samples"])
|
||||||
|
for a in pred if a["seed"] == "ensemble"]
|
||||||
|
pd.DataFrame(shifts).to_csv(dest / "best_shift_DIAGNOSTIC_ONLY.csv", index=False)
|
||||||
|
saved = {}
|
||||||
|
for i, a in enumerate(pred):
|
||||||
|
saved[f"{i}/mu"], saved[f"{i}/sigma"] = a["mu"], a["sigma"]
|
||||||
|
np.savez_compressed(dest / "predictions.npz", times_ms=full.t_main, **saved)
|
||||||
|
write_json(dest / "prediction_index.json", [{k: v for k, v in a.items() if k not in ("mu", "sigma")} for a in pred])
|
||||||
|
write_json(dest / "gate_gd.json", gate)
|
||||||
|
main = macro[(macro.reference == p["data"]["primary_reference"])
|
||||||
|
& (macro.sigma_a_ms == p["registration"]["sigma_a_ms"])]
|
||||||
|
text = ["# P4 Volve — nested blind folds (" + ", ".join(p["split"]["schemes"]) + ")", "",
|
||||||
|
"Smoke only; no scientific result." if smoke else
|
||||||
|
"Registered protocol_volve; outer-test labels are scoring-only.", "",
|
||||||
|
"G-D (descriptive): " + json.dumps(gate, ensure_ascii=False, default=str), "",
|
||||||
|
f"## Macro over wells, {p['data']['primary_reference']} reference, "
|
||||||
|
f"σ_a = {p['registration']['sigma_a_ms']:g} ms (p.u.)", "",
|
||||||
|
main.to_markdown(index=False, floatfmt=".4f"), "",
|
||||||
|
"Per-well, per-seed and reference-sensitivity results: metrics.csv and macro.csv. Budgets: selection.csv. "
|
||||||
|
"Registration diagnostics (training wells only): registration.csv.",
|
||||||
|
f"band_* is a high-pass of reference runs of at least {p['metrics']['desc_band_min_samples']} samples, "
|
||||||
|
"shorter than one period at f_c: descriptive only. Best-shift is diagnostic only and never alters a score.",
|
||||||
|
"Six wells in three slots: per-well results are the replication unit; no p-values."]
|
||||||
|
(dest / "summary.md").write_text("\n".join(text) + "\n", encoding="utf-8")
|
||||||
|
plot_results(full, p, pred, gate.get("pipeline_check", gate), dest)
|
||||||
|
return gate
|
||||||
|
|
||||||
|
|
||||||
|
def plot_results(full: VolveData, p: dict, pred: list[dict], gate: dict, dest: Path) -> None:
|
||||||
|
import matplotlib
|
||||||
|
matplotlib.use("Agg")
|
||||||
|
import matplotlib.pyplot as plt
|
||||||
|
|
||||||
|
sa, ref, wells = p["registration"]["sigma_a_ms"], p["data"]["primary_reference"], p["data"]["wells"]
|
||||||
|
files = []
|
||||||
|
for scheme in p["split"]["schemes"]:
|
||||||
|
chosen = {r["well"]: r["competitor"] for r in gate.get("schemes", {}).get(scheme, {}).get("per_well", [])}
|
||||||
|
fig, axes = plt.subplots(1, len(wells), figsize=(2.5 * len(wells), 6), sharey=True, sharex=True,
|
||||||
|
layout="constrained")
|
||||||
|
for ax, w in zip(axes, wells):
|
||||||
|
ax.plot(100 * full.y(w, ref), full.t_main, "k", label="Reference")
|
||||||
|
competitor = chosen.get(w, "B3b")
|
||||||
|
for method, color, style, name in ((competitor, "#0072B2", "--", "Selected B3"),
|
||||||
|
("B3d-Sa", "#8F5800", ":", "B3d-Sa"), ("M2-Sa", "#CC3311", "-", "M2-Sa")):
|
||||||
|
rows = [a for a in pred if a["scheme"] == scheme and a["test_well"] == w and a["method"] == method
|
||||||
|
and a["seed"] == "ensemble" and a["sigma_a_ms"] == sa]
|
||||||
|
if not rows:
|
||||||
|
continue
|
||||||
|
a = rows[0]
|
||||||
|
ax.plot(100 * a["mu"], full.t_main, color=color, linestyle=style, label=name)
|
||||||
|
if method == "M2-Sa":
|
||||||
|
ax.fill_betweenx(full.t_main, 100 * (a["mu"] - Z90 * a["sigma"]),
|
||||||
|
100 * (a["mu"] + Z90 * a["sigma"]), color=color, alpha=0.18)
|
||||||
|
ax.set(title=f"{w}\n(B3: {competitor})", xlabel="PHIF (p.u.)")
|
||||||
|
ax.grid(alpha=0.2)
|
||||||
|
axes[0].set_ylabel("TWT (ms)")
|
||||||
|
axes[0].invert_yaxis()
|
||||||
|
axes[0].legend(fontsize=8)
|
||||||
|
for ext in ("png", "pdf"):
|
||||||
|
fig.savefig(dest / f"wells_{scheme}.{ext}", dpi=160)
|
||||||
|
files.append(f"wells_{scheme}.{ext}")
|
||||||
|
plt.close(fig)
|
||||||
|
write_json(dest / "figure_manifest.json", {
|
||||||
|
"files": files, "source": "predictions.npz and prediction_index.json",
|
||||||
|
"reference": "marker-calibrated vertical sonic (TVD-integrated DT) of the held-out well",
|
||||||
|
"uncertainty": "nominal 90% moment-matched Gaussian predictive interval of M2-Sa; calibration is evaluated "
|
||||||
|
"separately",
|
||||||
|
"replication_unit": "well (n=6, three slots); network seeds are computational repeats",
|
||||||
|
"transform": "porosity fraction multiplied by 100", "filters": "none for plotting",
|
||||||
|
"publisher_requirements": "not yet verified",
|
||||||
|
"description": "One panel per held-out well and blind scheme: reference over its support and blind "
|
||||||
|
"predictions over the main window against downward-increasing two-way time; the B3 line is the "
|
||||||
|
"point competitor selected by inner validation."})
|
||||||
74
ml_porosity/volve/folds.py
Normal file
74
ml_porosity/volve/folds.py
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
"""Nested blind folds for P4 (plan §5.2).
|
||||||
|
|
||||||
|
Outer fold: test well u, training wells T_out = blind_training_wells(u, scheme) (`lowo`: every other well; `slot`:
|
||||||
|
every well outside the slot group of u). Inner folds: leave one well of T_out out, under both schemes — under
|
||||||
|
`slot` an inner validation well may share a slot with inner training wells, so inner validation can be optimistic
|
||||||
|
there (recorded deviation in protocol_volve).
|
||||||
|
|
||||||
|
Every model sees seismic only through blind keys: the input of a non-training well u under key K is placed in time
|
||||||
|
by the TD model of the wells K, with T_in ⊆ K ⊆ W∖{u} (never u's own picks or DT). Validation of v in T_out uses
|
||||||
|
K = T_in; the outer test of u uses K = T_out. Training wells use their calibrated reference path.
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import itertools
|
||||||
|
|
||||||
|
from ml_porosity.data.volve_wells import blind_key, blind_training_wells
|
||||||
|
|
||||||
|
|
||||||
|
def outer_folds(wells: list[str], scheme: str, p4: dict) -> list[tuple[str, tuple[str, ...]]]:
|
||||||
|
"""[(test well u, T_out)] in `wells` order; T_out sorted."""
|
||||||
|
out = []
|
||||||
|
for u in wells:
|
||||||
|
train = tuple(sorted(blind_training_wells(u, scheme, p4)))
|
||||||
|
if u in train or not train:
|
||||||
|
raise RuntimeError(f"invalid outer fold for {u}: {train}")
|
||||||
|
out.append((u, train))
|
||||||
|
return out
|
||||||
|
|
||||||
|
|
||||||
|
def inner_folds(outer_train: tuple[str, ...]) -> list[tuple[str, tuple[str, ...]]]:
|
||||||
|
"""[(validation well v, T_in = T_out ∖ {v})], leave-one-well-out within the outer training set."""
|
||||||
|
train = tuple(sorted(outer_train))
|
||||||
|
if len(train) < 2:
|
||||||
|
raise ValueError("inner LOWO needs at least two outer training wells")
|
||||||
|
return [(v, tuple(w for w in train if w != v)) for v in train]
|
||||||
|
|
||||||
|
|
||||||
|
def nested_folds(wells: list[str], schemes: list[str], p4: dict) -> list[dict]:
|
||||||
|
"""Every (scheme, test well, validation well, T_out, T_in), with the blind key of each role."""
|
||||||
|
rows = []
|
||||||
|
for scheme in schemes:
|
||||||
|
for u, t_out in outer_folds(wells, scheme, p4):
|
||||||
|
for v, t_in in inner_folds(t_out):
|
||||||
|
if u in t_in or v in t_in:
|
||||||
|
raise RuntimeError("held-out well entered an inner training set")
|
||||||
|
rows.append(dict(scheme=scheme, test=u, validation=v, outer_train=t_out, inner_train=t_in,
|
||||||
|
validation_key=blind_key(t_in), test_key=blind_key(t_out)))
|
||||||
|
return rows
|
||||||
|
|
||||||
|
|
||||||
|
def training_sets(wells: list[str], schemes: list[str], p4: dict) -> list[tuple[str, ...]]:
|
||||||
|
"""Distinct inner training sets over all schemes (one trajectory per set, method, seed and σ_a arm)."""
|
||||||
|
return sorted({f["inner_train"] for f in nested_folds(wells, schemes, p4)}, key=lambda s: (-len(s), s))
|
||||||
|
|
||||||
|
|
||||||
|
def prediction_targets(wells: list[str], train: tuple[str, ...]) -> list[tuple[str, str]]:
|
||||||
|
"""(well, key) inputs predicted by a model trained on `train`: training wells on their reference path
|
||||||
|
(key 'reference'), every other well u on every blind key K with train ⊆ K ⊆ W∖{u}. Covers the validation
|
||||||
|
(K = T_in) and outer-test (K = T_out ⊋ T_in) inputs of every fold that trains on `train`."""
|
||||||
|
train = tuple(sorted(train))
|
||||||
|
out = [(w, "reference") for w in train]
|
||||||
|
for u in wells:
|
||||||
|
if u in train:
|
||||||
|
continue
|
||||||
|
rest = [w for w in wells if w != u and w not in train]
|
||||||
|
for k in range(len(rest) + 1):
|
||||||
|
for extra in itertools.combinations(rest, k):
|
||||||
|
out.append((u, blind_key(train + extra)))
|
||||||
|
return out
|
||||||
|
|
||||||
|
|
||||||
|
def target_name(well: str, key: str) -> str:
|
||||||
|
return f"{well}|{key}"
|
||||||
93
ml_porosity/volve/losses.py
Normal file
93
ml_porosity/volve/losses.py
Normal file
@@ -0,0 +1,93 @@
|
|||||||
|
"""Bank losses with label masks (P4: Volve labels cover 16–37 of the 126 main-window samples).
|
||||||
|
|
||||||
|
Member s of the bank of training well b places the same label run at its own times, so it has its own support
|
||||||
|
mask M_bs (L); a (B, L) mask is shared by all members. For window j, n_bjs = Σ_{i ∈ j} M_bsi and n̄_bj = mean_s n_bjs:
|
||||||
|
|
||||||
|
ℓ_bjs = (n̄_bj / n_bjs) Σ_{i ∈ j} M_bsi log N(y_bs,i; μ_i, σ_i²) (members compared at a common count)
|
||||||
|
RML: L_b = −Σ_j (1/λ) log Σ_s π_bs exp(λ ℓ_bjs) / Σ_j n̄_bj
|
||||||
|
hard-min: L_b = −Σ_j max_s ℓ_bjs / Σ_j n̄_bj
|
||||||
|
|
||||||
|
and the loss is the mean of L_b over wells. A window where some member has no valid sample contributes nothing.
|
||||||
|
With a shared mask the count factor is 1; with every sample valid the loss equals losses.rml.bank_loss.
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import numpy as np
|
||||||
|
import torch
|
||||||
|
from scipy import signal
|
||||||
|
|
||||||
|
from ml_porosity.losses.rml import LOG_2PI, gather_windows
|
||||||
|
|
||||||
|
|
||||||
|
def masked_window_loglik(mu, sigma, Y, mask, starts, win: int) -> tuple[torch.Tensor, torch.Tensor]:
|
||||||
|
"""mu, sigma (B, L); Y (B, S, L), any value where the mask is False; mask (B, L) or (B, S, L)
|
||||||
|
→ summed ℓ (B, J, S) and valid counts n (B, J, S)."""
|
||||||
|
if mask.dim() == 2:
|
||||||
|
mask = mask[:, None, :].expand(Y.shape)
|
||||||
|
if mask.shape != Y.shape:
|
||||||
|
raise ValueError("mask must be (B, L) or match the bank (B, S, L)")
|
||||||
|
y = torch.where(mask, Y, torch.zeros((), dtype=Y.dtype, device=Y.device))
|
||||||
|
m = gather_windows(mu, starts, win)[:, :, None, :]
|
||||||
|
s = gather_windows(sigma, starts, win)[:, :, None, :]
|
||||||
|
w = gather_windows(mask.to(mu.dtype), starts, win)
|
||||||
|
term = -torch.log(s) - 0.5 * ((gather_windows(y, starts, win) - m) / s) ** 2 - 0.5 * LOG_2PI
|
||||||
|
return (term * w).sum(-1), w.sum(-1)
|
||||||
|
|
||||||
|
|
||||||
|
def masked_bank_loss(mu, sigma, Y, logpi, mask, starts, win: int, lam: float | None) -> torch.Tensor:
|
||||||
|
"""lam = None → hard-min (max ℓ); otherwise RML with power λ. Every well needs a window in which every member
|
||||||
|
has a valid sample."""
|
||||||
|
ll, n = masked_window_loglik(mu, sigma, Y, mask, starts, win)
|
||||||
|
use = (n > 0).all(-1)
|
||||||
|
nbar = n.mean(-1)
|
||||||
|
ll = torch.where(use[..., None], ll * nbar[..., None] / n.clamp(min=1), torch.zeros((), dtype=ll.dtype,
|
||||||
|
device=ll.device))
|
||||||
|
total = (nbar * use).sum(1)
|
||||||
|
if not bool((total > 0).all()):
|
||||||
|
raise ValueError("a training well has no labelled sample in any window")
|
||||||
|
v = ll.max(-1).values if lam is None else torch.logsumexp(logpi[:, None, :] + lam * ll, dim=-1) / lam
|
||||||
|
v = torch.where(use, v, torch.zeros((), dtype=v.dtype, device=v.device))
|
||||||
|
return -(v.sum(1) / total).mean()
|
||||||
|
|
||||||
|
|
||||||
|
def highpass_segment(y: np.ndarray, f_c_hz: float, dt_ms: float = 4.0, order: int = 4) -> np.ndarray:
|
||||||
|
"""y minus its zero-phase Butterworth low band below f_c, as eval.metrics.split_bands (identical for ≥ 16
|
||||||
|
samples at order 4); shorter segments use the longest even padding scipy accepts."""
|
||||||
|
y = np.asarray(y, dtype=float)
|
||||||
|
sos = signal.butter(order, f_c_hz, fs=1000.0 / dt_ms, output="sos")
|
||||||
|
pad = min(3 * (2 * len(sos) + 1), y.size - 1)
|
||||||
|
return y - signal.sosfiltfilt(sos, y, padtype="even", padlen=pad)
|
||||||
|
|
||||||
|
|
||||||
|
def segment_lambda(segments: list[np.ndarray], f_c_hz: float = 6.0, dt_ms: float = 4.0,
|
||||||
|
max_lag: int = 32) -> tuple[float, float]:
|
||||||
|
"""losses.rml.effective_lambda for label segments of any length ≥ 2: λ = 1/τ_c, τ_c = 1 + 2 Σ_k ρ(k)², with ρ
|
||||||
|
the ACF of the high-passed segments pooled as lagged products (a lag longer than a segment adds nothing). Σ runs
|
||||||
|
up to the first lag with ρ ≤ 0. Equals effective_lambda when every segment has more than max_lag samples."""
|
||||||
|
acc = np.zeros(max_lag + 1)
|
||||||
|
for y in segments:
|
||||||
|
y = np.asarray(y, dtype=float)
|
||||||
|
if y.size < 2 or not np.isfinite(y).all():
|
||||||
|
raise ValueError("segments must be finite with at least two samples")
|
||||||
|
hi = highpass_segment(y, f_c_hz, dt_ms)
|
||||||
|
hi = hi - hi.mean()
|
||||||
|
a = np.correlate(hi, hi, "full")[hi.size - 1: hi.size + max_lag]
|
||||||
|
acc[: a.size] += a
|
||||||
|
rho = acc / acc[0]
|
||||||
|
k = np.argmax(rho[1:] <= 0) + 1 if np.any(rho[1:] <= 0) else max_lag + 1
|
||||||
|
tau_c = 1.0 + 2.0 * float(np.sum(rho[1:k] ** 2))
|
||||||
|
return 1.0 / tau_c, tau_c
|
||||||
|
|
||||||
|
|
||||||
|
def finite_runs(y: np.ndarray) -> list[tuple[int, int]]:
|
||||||
|
"""[start, stop) of the maximal runs of finite samples of a series (NaN separates runs)."""
|
||||||
|
ok = np.isfinite(np.asarray(y, dtype=float))
|
||||||
|
edges = np.flatnonzero(np.diff(np.r_[0, ok.astype(int), 0]))
|
||||||
|
return [(int(a), int(b)) for a, b in zip(edges[::2], edges[1::2])]
|
||||||
|
|
||||||
|
|
||||||
|
def label_segments(y: np.ndarray) -> list[np.ndarray]:
|
||||||
|
"""Maximal runs of finite samples of a series."""
|
||||||
|
y = np.asarray(y, dtype=float)
|
||||||
|
return [y[a:b] for a, b in finite_runs(y)]
|
||||||
123
ml_porosity/volve/protocol.py
Normal file
123
ml_porosity/volve/protocol.py
Normal file
@@ -0,0 +1,123 @@
|
|||||||
|
"""Protocol locking and resume fingerprints for P4 (Volve), separate from the frozen P3 lock.
|
||||||
|
|
||||||
|
Paths in the stamp are relative to their root (repo, outputs or Volve data directory), so a lock is portable between
|
||||||
|
checkouts; it is still bound to one environment, as in P3. Before the lock exists, `current_stamp` gives the same
|
||||||
|
stamp without writing it (smoke runs only).
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import json
|
||||||
|
from datetime import datetime, timezone
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
import yaml
|
||||||
|
|
||||||
|
from ml_porosity.f3.protocol import digest, environment, fingerprint
|
||||||
|
from ml_porosity.paths import REPO_ROOT, outputs_dir, volve_root
|
||||||
|
|
||||||
|
__all__ = ["CONFIG", "LOCK", "current_stamp", "fingerprint", "freeze", "load_protocol", "source_config"]
|
||||||
|
|
||||||
|
CONFIG = REPO_ROOT / "configs/protocol_volve.yaml"
|
||||||
|
LOCK = REPO_ROOT / "configs/protocol_volve.lock.json"
|
||||||
|
SCRIPTS = ("scripts/23_build_volve_wells.py", "scripts/24_run_volve.py", "scripts/run_p4.ps1", "scripts/run_p4.sh")
|
||||||
|
PROTECTED = ("wavelets.npz", "p2/warp_prior_f3.json")
|
||||||
|
RESULTS = ("registration", "train", "summary")
|
||||||
|
|
||||||
|
|
||||||
|
def load_protocol() -> dict:
|
||||||
|
return yaml.safe_load(CONFIG.read_text(encoding="utf-8"))
|
||||||
|
|
||||||
|
|
||||||
|
def source_config(p: dict) -> dict:
|
||||||
|
"""configs/d3_volve.yaml, which built the dataset; its p4 section holds the slot groups of the blind folds."""
|
||||||
|
cfg = yaml.safe_load((REPO_ROOT / p["data"]["source_config"]).read_text(encoding="utf-8"))
|
||||||
|
if list(cfg["p4"]["wells"]) != list(p["data"]["wells"]) or cfg["p4"]["label"] != p["data"]["label"]:
|
||||||
|
raise RuntimeError("protocol_volve and its source configuration disagree on wells or label")
|
||||||
|
if not set(p["split"]["schemes"]) <= set(cfg["p4"]["blind_schemes"]):
|
||||||
|
raise RuntimeError("Unknown blind scheme in protocol_volve")
|
||||||
|
return cfg
|
||||||
|
|
||||||
|
|
||||||
|
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:
|
||||||
|
import hashlib
|
||||||
|
|
||||||
|
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 input_files(p: dict) -> list[Path]:
|
||||||
|
"""Derived dataset, its configuration and every raw file the build reads, except the cube (checked against the
|
||||||
|
data manifest at the first lock)."""
|
||||||
|
cfg = source_config(p)
|
||||||
|
root, p4 = volve_root(), cfg["p4"]
|
||||||
|
files = [outputs_dir() / "volve/volve_wells.npz", outputs_dir() / "volve/volve_wells_summary.json",
|
||||||
|
root / cfg["picks"], root / cfg["horizons_twt"] / cfg["grid_horizon"]]
|
||||||
|
for spec in p4["wells"].values():
|
||||||
|
files.append(root / p4["survey_dir"] / spec["survey"])
|
||||||
|
logs = root / cfg["well_logs_dir"] / spec["logs"] / p4["log_subdir"]
|
||||||
|
files += [logs / p4["las_input"], logs / p4["las_output"]]
|
||||||
|
files += [root / cfg["well_logs_dir"] / cfg["checkshots"][spec["picks"]][kind]
|
||||||
|
for kind in spec.get("checkshots", [])]
|
||||||
|
return files
|
||||||
|
|
||||||
|
|
||||||
|
def portable_name(path: Path) -> str:
|
||||||
|
"""Portable name: 'repo:', 'outputs:' or 'volve:' plus the POSIX path relative to that root."""
|
||||||
|
path = path.resolve()
|
||||||
|
for prefix, base in (("volve", volve_root()), ("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, outputs and Volve roots: {path}")
|
||||||
|
|
||||||
|
|
||||||
|
def current_stamp(p: dict | None = None) -> dict:
|
||||||
|
p = load_protocol() if p is None else p
|
||||||
|
missing = [f for f in input_files(p) + [outputs_dir() / a for a in PROTECTED] if not f.exists()]
|
||||||
|
if missing:
|
||||||
|
raise FileNotFoundError(f"P4 inputs missing (sync data/ and outputs/ first): {[str(f) for f in missing]}")
|
||||||
|
config = REPO_ROOT / p["data"]["source_config"]
|
||||||
|
return {"protocol_sha256": digest(CONFIG, True), "code_sha256": source_hash(), "environment": environment(),
|
||||||
|
"protected_artifacts": {portable_name(outputs_dir() / a): digest(outputs_dir() / a) for a in PROTECTED},
|
||||||
|
"inputs": {portable_name(f): digest(f, f == config) for f in [config] + input_files(p)}}
|
||||||
|
|
||||||
|
|
||||||
|
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"P4 lock mismatch: {k}. Preserve results and create a new protocol version.")
|
||||||
|
return old
|
||||||
|
if check:
|
||||||
|
raise RuntimeError("P4 is not locked. Run the lock stage before registration/training.")
|
||||||
|
if any((outputs_dir() / "p4" / d).exists() for d in RESULTS):
|
||||||
|
raise RuntimeError("Refusing a first lock after P4 results already exist.")
|
||||||
|
cfg = source_config(p)
|
||||||
|
manifest = json.loads((REPO_ROOT / "data_manifest/volve.json").read_text(encoding="utf-8"))
|
||||||
|
expected = manifest["files"][cfg["cube"]]["sha256"]
|
||||||
|
cube = volve_root() / cfg["cube"]
|
||||||
|
if not cube.exists() or digest(cube) != expected:
|
||||||
|
raise RuntimeError(f"Volve cube missing or different from the audited source: {cube}")
|
||||||
|
stamp |= {"locked_utc": datetime.now(timezone.utc).isoformat(), "segy_sha256": expected,
|
||||||
|
"canonical_text": "UTF-8, CRLF normalized to LF for code, protocol and source configuration; "
|
||||||
|
"binary inputs exact",
|
||||||
|
"wells": p["data"]["wells"]}
|
||||||
|
LOCK.write_text(json.dumps(stamp, indent=2), encoding="utf-8")
|
||||||
|
CONFIG.with_suffix(".sha256").write_text(stamp["protocol_sha256"] + " configs/protocol_volve.yaml\n",
|
||||||
|
encoding="utf-8")
|
||||||
|
return stamp
|
||||||
171
ml_porosity/volve/registration.py
Normal file
171
ml_porosity/volve/registration.py
Normal file
@@ -0,0 +1,171 @@
|
|||||||
|
"""Training-set-only P4 registration and label banks. No held-out well is passed to this module.
|
||||||
|
|
||||||
|
Follows ml_porosity.f3.registration.register_set with three recorded deviations (protocol_volve):
|
||||||
|
|
||||||
|
- Likelihood window: AI exists only over the logged interval (45–151 of the 301 ext samples), so the tie
|
||||||
|
likelihood of a well (phase grid, SMC, γ) is evaluated on `lik`, the ext samples from the first to the last
|
||||||
|
finite calibrated AI sample of that well; outside it the constant AI extension gives a zero synthetic that would
|
||||||
|
only fit noise. B3c/B3c-R keep the F3 full-window local shifts: windows without synthetic energy have r = NaN and
|
||||||
|
are dropped by r_min.
|
||||||
|
- Particle validity: labels cover 16–37 of the 126 main samples, so a particle only has to invert over the main
|
||||||
|
window (F3 also required full label support there).
|
||||||
|
- Member support: every member keeps the samples where its own warp places the label run (NaN elsewhere), so
|
||||||
|
no label is extrapolated and the run is not trimmed to the intersection of all members (which loses both ends
|
||||||
|
of a 16-sample run under the posterior spread). A member with fewer than `min_label_samples` is an error. The
|
||||||
|
intersection over members and methods is recorded as a diagnostic only.
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import gc
|
||||||
|
import time
|
||||||
|
from types import SimpleNamespace
|
||||||
|
|
||||||
|
import numpy as np
|
||||||
|
|
||||||
|
from ml_porosity.data.wavelet import rotate_phase, statistical_wavelet
|
||||||
|
from ml_porosity.registration.labels import antialias, invert_warps, labels_for_warps
|
||||||
|
from ml_porosity.registration.pipeline import PHASES, fit_cell_hyper
|
||||||
|
from ml_porosity.registration.sampler import sample_warps
|
||||||
|
from ml_porosity.registration.smc import TiePosterior, gamma_acf, phase_basis, phase_wavelet
|
||||||
|
from ml_porosity.registration.tie_likelihood import fine_wavelet, fit_phase, profile_loglik, synth_for_warps
|
||||||
|
from ml_porosity.registration.ties import tie_b3b, tie_b3c
|
||||||
|
from ml_porosity.volve.data import VolveData
|
||||||
|
from ml_porosity.volve.losses import label_segments, segment_lambda
|
||||||
|
|
||||||
|
METHODS = ("B3b", "B3c", "B3c-R", "B3d-Sa", "M2-Sa")
|
||||||
|
|
||||||
|
|
||||||
|
def valid_warps(data: VolveData, warps: np.ndarray) -> np.ndarray:
|
||||||
|
"""Warps whose inverse τ(t) exists over the whole main window."""
|
||||||
|
return np.isfinite(invert_warps(warps, data.tau, data.t_main)).all(axis=1)
|
||||||
|
|
||||||
|
|
||||||
|
def window_phase_loglik(syn0: np.ndarray, seis: np.ndarray, lik: np.ndarray, phases=PHASES) -> np.ndarray:
|
||||||
|
"""(P, S) as tie_likelihood.phase_loglik, with the phase rotated on the full ext synthetic and the profile
|
||||||
|
likelihood taken over the samples `lik` only."""
|
||||||
|
syn0 = np.atleast_2d(syn0)
|
||||||
|
return np.stack([profile_loglik(rotate_phase(syn0, p)[:, lik], seis[lik]) for p in phases])
|
||||||
|
|
||||||
|
|
||||||
|
def label_fn(data: VolveData, obs: dict, y_filtered: np.ndarray):
|
||||||
|
"""t(τ) warps (S, n_tau) → labels (S, L) on the main window, NaN where the label is not supported."""
|
||||||
|
valid = obs["label_valid"][data.label].astype(float)
|
||||||
|
|
||||||
|
def lab(warps):
|
||||||
|
warps = np.atleast_2d(warps)
|
||||||
|
tau_at = invert_warps(warps, data.tau, data.t_main)
|
||||||
|
support = np.interp(np.nan_to_num(tau_at, nan=data.tau[0] - 1.0), data.tau, valid, left=0, right=0)
|
||||||
|
out = labels_for_warps(data.tau, y_filtered, warps, data.t_main)
|
||||||
|
return np.where(np.isfinite(tau_at) & (support >= 1 - 1e-9), out, np.nan)
|
||||||
|
return lab
|
||||||
|
|
||||||
|
|
||||||
|
def register_set(data: VolveData, names: tuple[str, ...], p: dict, device: str,
|
||||||
|
sigma_a: float = 7.0) -> tuple[dict, dict]:
|
||||||
|
import torch
|
||||||
|
from ml_porosity.registration.smc_torch import TiePosteriorTorch, smc_fit_phase, smc_tie_posterior
|
||||||
|
|
||||||
|
started = time.perf_counter()
|
||||||
|
names = tuple(sorted(names))
|
||||||
|
r = p["registration"] | {"sigma_a_ms": sigma_a}
|
||||||
|
label = data.label
|
||||||
|
obs = data.training_observations(names)
|
||||||
|
if tuple(o["name"] for o in obs) != names:
|
||||||
|
raise RuntimeError("Unexpected training-well payload")
|
||||||
|
h, hinfo = fit_cell_hyper(SimpleNamespace(grid=data.grid), obs, r, r["smc_seed"])
|
||||||
|
f = r["fine_dt_ms"]
|
||||||
|
fac = int(round(data.dt / f))
|
||||||
|
w0 = statistical_wavelet(np.stack([o["seis"] for o in obs]), data.dt, r["wavelet_ms"])
|
||||||
|
B = phase_basis(w0, fac)
|
||||||
|
cover = (data.t_main[0], data.t_main[-1])
|
||||||
|
samples, Ts, Zs, LL, anchor_valid = [], [], [], [], []
|
||||||
|
for i, o in enumerate(obs):
|
||||||
|
smp = sample_warps(data.grid, h, o["tau_k"], o["t_k"], r["particles"], r["g_max"],
|
||||||
|
np.random.default_rng([r["smc_seed"], i, 13]))
|
||||||
|
samples.append(smp)
|
||||||
|
tg = data.grid.t_of_tau(smp["b"][:r["S"]], smp["g"][:r["S"]], data.tau)
|
||||||
|
valid = valid_warps(data, tg)
|
||||||
|
if not valid.any():
|
||||||
|
raise ValueError(f"No anchor sample covers the main window: {o['name']}")
|
||||||
|
anchor_valid.append(valid)
|
||||||
|
syn = synth_for_warps(data.tau, o["ai_log"], tg, data.t_fine, data.t, fine_wavelet(w0, fac))
|
||||||
|
LL.append(window_phase_loglik(syn, o["seis"], o["lik"]))
|
||||||
|
phase0 = float(PHASES[fit_phase(LL, anchor_valid, PHASES)])
|
||||||
|
for o, smp in zip(obs, samples):
|
||||||
|
T = TiePosteriorTorch(TiePosterior(data.grid, h, o["tau_k"], o["t_k"], r["g_max"], data.tau, o["ai_log"],
|
||||||
|
data.t_fine, data.t[o["lik"]], phase_wavelet(B, phase0),
|
||||||
|
o["seis"][o["lik"]], cover), device)
|
||||||
|
Zs.append(T.z(smp["u"]))
|
||||||
|
Ts.append(T)
|
||||||
|
phase_r, ph = smc_fit_phase(Ts, Zs, B, phase0, [r["smc_seed"], 19], step=r["phase_step"],
|
||||||
|
half_width=r["phase_half_width"], max_extra=r["phase_max_extra"],
|
||||||
|
n_moves=r["smc_moves"])
|
||||||
|
wf = phase_wavelet(B, phase_r)
|
||||||
|
post, diag = [], []
|
||||||
|
for i, (o, T0, z0) in enumerate(zip(obs, Ts, Zs)):
|
||||||
|
T = T0.with_wavelet(wf)
|
||||||
|
gamma = gamma_acf(T, z0, T.parts(z0)[1])
|
||||||
|
res = smc_tie_posterior(T, z0, [gamma], np.random.default_rng([r["smc_seed"], i, 17]),
|
||||||
|
n_moves=r["smc_moves"])
|
||||||
|
u = T.u(res["Z"][gamma])
|
||||||
|
tg = data.grid.t_of_tau(u[:, 0], u[:, 1:], data.tau)
|
||||||
|
valid = valid_warps(data, tg)
|
||||||
|
if valid.sum() < min(256, r["particles"]):
|
||||||
|
raise ValueError(f"Insufficient posterior particles covering the main window: {o['name']}, "
|
||||||
|
f"{valid.sum()} valid")
|
||||||
|
post.append(tg[valid])
|
||||||
|
diag.append({"well": o["name"], "gamma": gamma, "n_stages": len(res["stages"]),
|
||||||
|
"valid_particles": int(valid.sum()), "particles": len(valid),
|
||||||
|
"n_anchors": len(o["tau_k"]), "lik_samples": int(o["lik"].sum()),
|
||||||
|
"lik_ms": [float(data.t[o["lik"]][0]), float(data.t[o["lik"]][-1])]})
|
||||||
|
|
||||||
|
bundle = {"wells": np.asarray(names), "phase0": np.asarray(phase0), "phase_R": np.asarray(phase_r)}
|
||||||
|
banks = {m: [] for m in METHODS}
|
||||||
|
logpi = []
|
||||||
|
filtered = [antialias(o["labels"][label], f, data.dt) for o in obs]
|
||||||
|
normsel = (data.tau >= data.t_main[0]) & (data.tau <= data.t_main[-1])
|
||||||
|
vals = np.concatenate([y[normsel & o["label_valid"][label]] for o, y in zip(obs, filtered)])
|
||||||
|
bundle[f"{label}/norm"] = np.array([vals.mean(), max(vals.std(), 1e-8)])
|
||||||
|
for i, (o, tg, y) in enumerate(zip(obs, post, filtered)):
|
||||||
|
lab = label_fn(data, o, y)
|
||||||
|
b3b = tie_b3b(o["tau_k"], o["t_k"], data.tau)
|
||||||
|
ties = {"B3b": b3b, "B3d-Sa": tg.mean(axis=0)}
|
||||||
|
for name, phase in (("B3c", phase0), ("B3c-R", phase_r)):
|
||||||
|
syn = synth_for_warps(data.tau, o["ai_log"], b3b, data.t_fine, data.t,
|
||||||
|
fine_wavelet(rotate_phase(w0, phase), fac))[0]
|
||||||
|
ties[name] = tie_b3c(b3b, data.tau, syn, o["seis"], data.t, data.dt)
|
||||||
|
per = {m: lab(t) for m, t in ties.items()}
|
||||||
|
sub = np.random.default_rng([r["smc_seed"], i, 29]).choice(len(tg), r["S"], replace=False)
|
||||||
|
per["M2-Sa"] = lab(tg[sub])
|
||||||
|
counts = {m: np.isfinite(a).sum(axis=1) for m, a in per.items()}
|
||||||
|
short = {m: int(c.min()) for m, c in counts.items() if c.min() < p["data"]["min_label_samples"]}
|
||||||
|
if short:
|
||||||
|
raise ValueError(f"Label support too short: {o['name']}, fewest samples per member {short}")
|
||||||
|
for m in METHODS:
|
||||||
|
banks[m].append(per[m])
|
||||||
|
common = np.logical_and.reduce([np.isfinite(a).all(axis=0) for a in per.values()])
|
||||||
|
union = np.isfinite(per["M2-Sa"]).any(axis=0)
|
||||||
|
logpi.append(np.full(r["S"], -np.log(r["S"])))
|
||||||
|
tau_at = invert_warps(tg, data.tau, data.t_main)
|
||||||
|
q = np.diff(np.quantile(tau_at, [0.05, 0.95], axis=0), axis=0)[0] / 3.29
|
||||||
|
diag[i] |= {"sigma_post_ms": float(np.mean(q)), "sigma_post_label_ms": float(np.mean(q[union])),
|
||||||
|
"common_samples": int(common.sum()),
|
||||||
|
"label_samples": {m: int(c.min()) for m, c in counts.items()},
|
||||||
|
"label_samples_max": {m: int(c.max()) for m, c in counts.items()}}
|
||||||
|
for m in METHODS:
|
||||||
|
bundle[f"{label}/{m}"] = np.stack(banks[m]).astype(np.float32)
|
||||||
|
bundle[f"{label}/M2-Sa/logpi"] = np.stack(logpi).astype(np.float32)
|
||||||
|
segments = [s for y in bundle[f"{label}/B3b"][:, 0] for s in label_segments(y) if s.size >= 2]
|
||||||
|
lam, tau_c = segment_lambda(segments, p["metrics"]["f_c_hz"], data.dt)
|
||||||
|
bundle[f"{label}/lambda"], bundle[f"{label}/tau_c"] = np.asarray(lam), np.asarray(tau_c)
|
||||||
|
for o, tg in zip(obs, post):
|
||||||
|
bundle[f"posterior/{o['name']}/tau_at_main"] = invert_warps(tg, data.tau, data.t_main)
|
||||||
|
meta = {"training_wells": list(names), "sigma_a_ms": sigma_a, "phase0": phase0, "phase_R": phase_r,
|
||||||
|
"phase_info": ph, "hyper": h.as_dict(), "hyper_info": hinfo, "diagnostics": diag,
|
||||||
|
"lambda": lam, "tau_c": tau_c, "wall_seconds": time.perf_counter() - started}
|
||||||
|
del Ts, Zs, T, T0
|
||||||
|
gc.collect()
|
||||||
|
if torch.cuda.is_available():
|
||||||
|
torch.cuda.empty_cache()
|
||||||
|
return bundle, meta
|
||||||
283
ml_porosity/volve/runner.py
Normal file
283
ml_porosity/volve/runner.py
Normal file
@@ -0,0 +1,283 @@
|
|||||||
|
"""Resumable P4 stages. A worker only ever loads the data view of its own training wells and selects nothing.
|
||||||
|
|
||||||
|
Progress goes to outputs/p4/<root>/progress.json (retried when Windows locks the file, and never fatal), not to the
|
||||||
|
P3 dashboard.
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import copy
|
||||||
|
import itertools
|
||||||
|
import json
|
||||||
|
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
|
||||||
|
|
||||||
|
from ml_porosity.f3.progress import write_json
|
||||||
|
from ml_porosity.paths import outputs_dir
|
||||||
|
from ml_porosity.volve.data import VolveData
|
||||||
|
from ml_porosity.volve.folds import prediction_targets, target_name, training_sets
|
||||||
|
from ml_porosity.volve.protocol import current_stamp, digest, fingerprint, freeze, source_config
|
||||||
|
from ml_porosity.volve.registration import METHODS
|
||||||
|
|
||||||
|
|
||||||
|
def set_name(names) -> str:
|
||||||
|
"""'F-1A__F-1B__F-11A__F-12': sorted well names without spaces."""
|
||||||
|
return "__".join(sorted(n.replace(" ", "") for n in names))
|
||||||
|
|
||||||
|
|
||||||
|
def reg_path(root: Path, names, sigma_a: float = 7) -> Path:
|
||||||
|
return root / "registration" / f"{set_name(names)}_sa{sigma_a:g}.npz"
|
||||||
|
|
||||||
|
|
||||||
|
def job_path(root: Path, names, method: str, label: str, seed: int, sigma_a: float = 7) -> Path:
|
||||||
|
return root / "train" / f"{set_name(names)}__{method}__{label}__s{seed}__sa{sigma_a:g}.npz"
|
||||||
|
|
||||||
|
|
||||||
|
def load_bundle(path: Path) -> dict:
|
||||||
|
with np.load(path) as z:
|
||||||
|
return {k: z[k] for k in z.files}
|
||||||
|
|
||||||
|
|
||||||
|
def nan_allowed(key: str) -> bool:
|
||||||
|
"""Label banks are NaN outside each member's label support; every other numeric array must be finite."""
|
||||||
|
parts = key.split("/")
|
||||||
|
return len(parts) == 2 and parts[1] in METHODS
|
||||||
|
|
||||||
|
|
||||||
|
def check_arrays(path: Path, arrays: dict) -> None:
|
||||||
|
if not arrays:
|
||||||
|
raise RuntimeError(f"Empty completed artifact: {path}")
|
||||||
|
for k, a in arrays.items():
|
||||||
|
if not np.issubdtype(a.dtype, np.number):
|
||||||
|
continue
|
||||||
|
if np.isinf(a).any() or (np.isnan(a).any() and not nan_allowed(k)) or np.isnan(a).all():
|
||||||
|
raise RuntimeError(f"Corrupt/non-finite artifact: {path}/{k}")
|
||||||
|
|
||||||
|
|
||||||
|
def reusable(path: Path, key: str) -> bool:
|
||||||
|
meta = path.with_suffix(".json")
|
||||||
|
if not path.exists() or 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: {path}. Use a new output directory.")
|
||||||
|
if stored.get("artifact_sha256") is None or digest(path) != stored["artifact_sha256"]:
|
||||||
|
raise RuntimeError(f"Missing or mismatched completed-artifact checksum: {path}")
|
||||||
|
if path.parent.name == "train":
|
||||||
|
ckpt = path.with_suffix(".pt")
|
||||||
|
if not ckpt.exists() or digest(ckpt) != stored.get("checkpoint_sha256"):
|
||||||
|
raise RuntimeError(f"Missing or mismatched model checkpoint: {ckpt}")
|
||||||
|
check_arrays(path, load_bundle(path))
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
def save_npz(path: Path, arrays: dict) -> None:
|
||||||
|
path.parent.mkdir(parents=True, exist_ok=True)
|
||||||
|
tmp = path.with_suffix(".tmp.npz")
|
||||||
|
np.savez_compressed(tmp, **arrays)
|
||||||
|
tmp.replace(path)
|
||||||
|
|
||||||
|
|
||||||
|
def registration_worker(job: dict) -> dict:
|
||||||
|
import torch
|
||||||
|
from ml_porosity.volve.registration import register_set
|
||||||
|
|
||||||
|
torch.set_num_threads(job["p"]["runtime"]["cpu_threads_per_worker"])
|
||||||
|
path = reg_path(Path(job["root"]), job["names"], job["sa"])
|
||||||
|
if reusable(path, job["key"]):
|
||||||
|
return {"cached": True, "path": str(path)}
|
||||||
|
data = VolveData(job["p"], training_wells=tuple(job["names"]))
|
||||||
|
bundle, meta = register_set(data, tuple(job["names"]), job["p"], job["device"], job["sa"])
|
||||||
|
check_arrays(path, bundle)
|
||||||
|
save_npz(path, bundle)
|
||||||
|
write_json(path.with_suffix(".json"), meta | {"fingerprint": job["key"], "artifact_sha256": digest(path)})
|
||||||
|
return {"cached": False, "path": str(path), **meta}
|
||||||
|
|
||||||
|
|
||||||
|
def training_worker(job: dict) -> dict:
|
||||||
|
from ml_porosity.volve.training import method_spec, train_trajectory
|
||||||
|
|
||||||
|
root, p = Path(job["root"]), job["p"]
|
||||||
|
label, names = p["data"]["label"], tuple(sorted(job["names"]))
|
||||||
|
path = job_path(root, names, job["method"], label, job["seed"], job["sa"])
|
||||||
|
if reusable(path, job["key"]):
|
||||||
|
return {"cached": True, "path": str(path)}
|
||||||
|
data = VolveData(p, training_wells=names)
|
||||||
|
bundle = load_bundle(reg_path(root, names, job["sa"]))
|
||||||
|
if tuple(bundle["wells"]) != names:
|
||||||
|
raise RuntimeError("Registration cache contains different wells")
|
||||||
|
targets = prediction_targets(data.wells, names)
|
||||||
|
X = np.stack([data.X(w, "reference") for w in names])
|
||||||
|
X_targets = np.stack([data.X(w, k) for w, k in targets])
|
||||||
|
spec = method_spec(bundle, label, job["method"])
|
||||||
|
ckpt = path.with_suffix(".pt")
|
||||||
|
ckpt.parent.mkdir(parents=True, exist_ok=True)
|
||||||
|
pred, meta = train_trajectory(X, X_targets, spec, job["method"], p["training"], job["seed"],
|
||||||
|
p["training"]["budgets"], job["device"], ckpt,
|
||||||
|
p["runtime"]["cpu_threads_per_worker"])
|
||||||
|
mean, sd = bundle[f"{label}/norm"]
|
||||||
|
pred = {k: v * sd + (mean if k.endswith("/mu") else 0) for k, v in pred.items()}
|
||||||
|
pred |= {"targets": np.asarray([target_name(w, k) for w, k in targets]), "wells": np.asarray(names),
|
||||||
|
"norm": bundle[f"{label}/norm"]}
|
||||||
|
check_arrays(path, pred)
|
||||||
|
save_npz(path, pred)
|
||||||
|
write_json(path.with_suffix(".json"), meta | {
|
||||||
|
"fingerprint": job["key"], "artifact_sha256": digest(path), "checkpoint_sha256": digest(ckpt),
|
||||||
|
"training_wells": list(names), "label": label, "method": job["method"], "seed": job["seed"],
|
||||||
|
"sigma_a_ms": job["sa"], "n_targets": len(targets)})
|
||||||
|
return {"cached": False, "path": str(path), **meta}
|
||||||
|
|
||||||
|
|
||||||
|
def progress(root: Path, **values) -> None:
|
||||||
|
path = root / "progress.json"
|
||||||
|
for attempt in range(20):
|
||||||
|
try:
|
||||||
|
old = json.loads(path.read_text(encoding="utf-8")) if path.exists() else {}
|
||||||
|
write_json(path, old | values | {"updated": datetime.now().astimezone().isoformat(timespec="seconds")})
|
||||||
|
return
|
||||||
|
except (PermissionError, json.JSONDecodeError):
|
||||||
|
time.sleep(0.25 * (attempt + 1))
|
||||||
|
print(f"warning: progress file not updated: {path}", flush=True)
|
||||||
|
|
||||||
|
|
||||||
|
def run_jobs(jobs: list[dict], fn, workers: int, stage: str) -> list[dict]:
|
||||||
|
if not jobs:
|
||||||
|
return []
|
||||||
|
root = Path(jobs[0]["root"])
|
||||||
|
started, results = time.perf_counter(), []
|
||||||
|
progress(root, stage=stage, 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, status="failed; pending jobs cancelled", error=f"{futures[fut]['key'][:12]}: {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, completed=len(results), cached=len(results) - fresh, elapsed_seconds=elapsed,
|
||||||
|
eta_seconds=eta)
|
||||||
|
print(f"{stage} {len(results)}/{len(jobs)} {'cached ' if result.get('cached') else ''}"
|
||||||
|
f"{result['path']}", flush=True)
|
||||||
|
progress(root, status="done", eta_seconds=0)
|
||||||
|
return results
|
||||||
|
|
||||||
|
|
||||||
|
def sigma_arms(p: dict, arms: str) -> list[float]:
|
||||||
|
"""'primary' → [σ_a], 'sensitivity' → the misspecification arms, 'all' → both."""
|
||||||
|
primary, extra = [p["registration"]["sigma_a_ms"]], list(p["registration"]["sigma_a_sensitivity_ms"])
|
||||||
|
return {"primary": primary, "sensitivity": extra, "all": primary + extra}[arms]
|
||||||
|
|
||||||
|
|
||||||
|
def fold_sets(p: dict) -> list[tuple[str, ...]]:
|
||||||
|
return training_sets(p["data"]["wells"], p["split"]["schemes"], source_config(p)["p4"])
|
||||||
|
|
||||||
|
|
||||||
|
def registration_jobs(p: dict, stamp: dict, root: Path, device: str, arms: str = "primary") -> list[dict]:
|
||||||
|
jobs = []
|
||||||
|
for names, sa in itertools.product(fold_sets(p), sigma_arms(p, arms)):
|
||||||
|
settings = dict(names=list(names), sa=sa)
|
||||||
|
jobs.append(dict(p=p, root=str(root), device=device, **settings,
|
||||||
|
key=fingerprint(stamp, stage="registration", **settings)))
|
||||||
|
return jobs
|
||||||
|
|
||||||
|
|
||||||
|
def arm_methods(p: dict, sa: float) -> list[str]:
|
||||||
|
main = sa == p["registration"]["sigma_a_ms"]
|
||||||
|
return list(p["methods"]["main"] if main else p["registration"]["sensitivity_methods"])
|
||||||
|
|
||||||
|
|
||||||
|
def training_jobs(p: dict, stamp: dict, root: Path, device: str, arms: str = "primary") -> list[dict]:
|
||||||
|
jobs = []
|
||||||
|
for names, sa in itertools.product(fold_sets(p), sigma_arms(p, arms)):
|
||||||
|
for method, seed in itertools.product(arm_methods(p, sa), p["split"]["seeds"]):
|
||||||
|
settings = dict(names=list(names), method=method, label=p["data"]["label"], seed=seed, sa=sa)
|
||||||
|
jobs.append(dict(p=p, root=str(root), device=device, **settings,
|
||||||
|
key=fingerprint(stamp, stage="train", **settings)))
|
||||||
|
return jobs
|
||||||
|
|
||||||
|
|
||||||
|
def smoke_protocol(p: dict) -> dict:
|
||||||
|
"""Reduced settings for a pipeline check; outputs go to outputs/p4/smoke and are never results."""
|
||||||
|
p = copy.deepcopy(p)
|
||||||
|
p["split"]["seeds"] = [0]
|
||||||
|
p["registration"].update(particles=16, S=8, hyper_starts=1, smc_moves=1, phase_half_width=0,
|
||||||
|
phase_max_extra=0, sigma_a_sensitivity_ms=[])
|
||||||
|
p["training"]["budgets"] = [2, 4]
|
||||||
|
return p
|
||||||
|
|
||||||
|
|
||||||
|
def benchmark(p: dict, device: str, steps: int = 100) -> dict:
|
||||||
|
"""Runtime pilot outside the result tree: one registration of the first (largest) training set and `steps`
|
||||||
|
training steps of B3b and M2-Sa on it. Training wells only; no held-out label, nothing selected."""
|
||||||
|
from ml_porosity.volve.training import method_spec, train_trajectory
|
||||||
|
|
||||||
|
root, sa, label = outputs_dir() / "p4" / "benchmark", p["registration"]["sigma_a_ms"], p["data"]["label"]
|
||||||
|
sets = fold_sets(p)
|
||||||
|
names = sets[0]
|
||||||
|
stamp = current_stamp(p) | {"benchmark_only": True}
|
||||||
|
registration_worker(dict(p=p, root=str(root), device=device, names=list(names), sa=sa,
|
||||||
|
key=fingerprint(stamp, stage="registration", names=list(names), sa=sa)))
|
||||||
|
seconds = json.loads(reg_path(root, names, sa).with_suffix(".json").read_text(encoding="utf-8"))["wall_seconds"]
|
||||||
|
data = VolveData(p, training_wells=names)
|
||||||
|
bundle = load_bundle(reg_path(root, names, sa))
|
||||||
|
X = np.stack([data.X(w, "reference") for w in names])
|
||||||
|
X_targets = np.stack([data.X(w, k) for w, k in prediction_targets(data.wells, names)])
|
||||||
|
per_step = {m: train_trajectory(X, X_targets, method_spec(bundle, label, m), m, p["training"], 0, [steps], device,
|
||||||
|
None, p["runtime"]["cpu_threads_per_worker"])[1]["seconds_per_step"]
|
||||||
|
for m in ("B3b", "M2-Sa")}
|
||||||
|
# Registration cost grows with the number of wells; the largest set gives the training-step upper bound.
|
||||||
|
reg_primary = seconds * sum(len(s) for s in sets) / len(names)
|
||||||
|
n_sens = len(p["registration"]["sigma_a_sensitivity_ms"])
|
||||||
|
steps_per_job = max(p["training"]["budgets"]) * max(per_step.values())
|
||||||
|
jobs = {"primary": len(sets) * len(p["methods"]["main"]) * len(p["split"]["seeds"]),
|
||||||
|
"sensitivity": len(sets) * len(p["registration"]["sensitivity_methods"]) * len(p["split"]["seeds"]) * n_sens}
|
||||||
|
out = {"device": device, "training_wells": list(names), "registration_seconds_largest_set": seconds,
|
||||||
|
"seconds_per_step": per_step, "registration_jobs": {"primary": len(sets), "sensitivity": len(sets) * n_sens},
|
||||||
|
"training_jobs": jobs,
|
||||||
|
"sequential_seconds": {"registration_primary": reg_primary, "registration_sensitivity": reg_primary * n_sens,
|
||||||
|
"training_primary": jobs["primary"] * steps_per_job,
|
||||||
|
"training_sensitivity": jobs["sensitivity"] * steps_per_job},
|
||||||
|
"note": "One-worker extrapolation from one real training set; parallel workers on one GPU speed this up "
|
||||||
|
"sublinearly. Not a confidence interval."}
|
||||||
|
write_json(outputs_dir() / "p4" / "benchmark.json", out)
|
||||||
|
return out
|
||||||
|
|
||||||
|
|
||||||
|
def run(stage: str, p: dict, device: str, workers: int, smoke: bool = False, arms: str = "primary") -> None:
|
||||||
|
root = outputs_dir() / "p4"
|
||||||
|
if smoke:
|
||||||
|
if arms != "primary":
|
||||||
|
raise ValueError("Smoke runs use the primary σ_a arm only")
|
||||||
|
p = smoke_protocol(p)
|
||||||
|
root = root / "smoke"
|
||||||
|
if stage == "summarize":
|
||||||
|
# Scores held-out PHIF: only once the design is frozen.
|
||||||
|
stamp = freeze(check=True) | {"smoke": p}
|
||||||
|
else:
|
||||||
|
stamp = current_stamp() | {"smoke": p, "unlocked_draft": True}
|
||||||
|
else:
|
||||||
|
stamp = freeze(check=True)
|
||||||
|
if stage == "register":
|
||||||
|
run_jobs(registration_jobs(p, stamp, root, device, arms), registration_worker, workers, stage)
|
||||||
|
elif stage == "train":
|
||||||
|
run_jobs(training_jobs(p, stamp, root, device, arms), training_worker, workers, stage)
|
||||||
|
elif stage == "summarize":
|
||||||
|
from ml_porosity.volve.evaluation import summarize
|
||||||
|
# The G-D report always needs the primary arm.
|
||||||
|
summarize(p, root, sigma_arms(p, "primary" if arms == "primary" else "all"))
|
||||||
|
else:
|
||||||
|
raise ValueError(stage)
|
||||||
87
ml_porosity/volve/training.py
Normal file
87
ml_porosity/volve/training.py
Normal file
@@ -0,0 +1,87 @@
|
|||||||
|
"""P4 trajectories: masked bank losses, a checkpoint at every registered budget, no held-out label.
|
||||||
|
|
||||||
|
Mirrors ml_porosity.f3.training.train_trajectory for the bank methods (same model, optimiser, seeding and
|
||||||
|
checkpoints); the loss is volve.losses.masked_bank_loss on the label support of each bank member (finite samples).
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import time
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
import numpy as np
|
||||||
|
import torch
|
||||||
|
from torch import nn
|
||||||
|
|
||||||
|
from ml_porosity.f3.training import ensemble, make_model
|
||||||
|
from ml_porosity.models.bank_train import window_starts_fixed
|
||||||
|
from ml_porosity.models.train import predict
|
||||||
|
from ml_porosity.volve.losses import masked_bank_loss
|
||||||
|
|
||||||
|
__all__ = ["ensemble", "method_spec", "train_trajectory"]
|
||||||
|
|
||||||
|
|
||||||
|
def method_spec(bundle: dict, label: str, method: str) -> dict:
|
||||||
|
"""Normalised bank (NaN outside each member's label support), log prior weights, the member support masks
|
||||||
|
(B, S, L) and λ. Single-member banks reduce to the masked Gaussian NLL for any λ."""
|
||||||
|
m0, s0 = bundle[f"{label}/norm"]
|
||||||
|
Y = bundle[f"{label}/{method}"]
|
||||||
|
lp = bundle.get(f"{label}/{method}/logpi", np.full(Y.shape[:2], -np.log(Y.shape[1])))
|
||||||
|
if lp.shape != Y.shape[:2]:
|
||||||
|
raise ValueError(f"Bank weights do not match the bank: {label}/{method}")
|
||||||
|
if np.isinf(Y).any():
|
||||||
|
raise ValueError(f"Label bank is not finite on its support: {label}/{method}")
|
||||||
|
mask = np.isfinite(Y)
|
||||||
|
if not mask.any(axis=2).all():
|
||||||
|
raise ValueError(f"A bank member has no label support: {label}/{method}")
|
||||||
|
return dict(Y=(Y - m0) / s0, logpi=lp, mask=mask, lam=float(bundle[f"{label}/lambda"]))
|
||||||
|
|
||||||
|
|
||||||
|
def train_trajectory(X, X_targets, spec: dict, method: str, cfg: dict, seed: int, budgets: list[int],
|
||||||
|
device: str, checkpoint: Path | None = None, threads: int = 2) -> tuple[dict, dict]:
|
||||||
|
torch.set_num_threads(threads)
|
||||||
|
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)
|
||||||
|
tensor = lambda a: torch.as_tensor(np.asarray(a), dtype=torch.float32, device=device)
|
||||||
|
x, y, logpi = tensor(X), tensor(spec["Y"]), tensor(spec["logpi"])
|
||||||
|
mask = torch.as_tensor(np.asarray(spec["mask"], bool), device=device)
|
||||||
|
N, _, L = X.shape
|
||||||
|
win = cfg["window_samples"]
|
||||||
|
starts = torch.as_tensor(np.tile(window_starts_fixed(L, win, cfg["window_step"]), (N, 1)), device=device)
|
||||||
|
model = make_model(method, X.shape[1], cfg).to(device)
|
||||||
|
opt = torch.optim.Adam(model.parameters(), lr=cfg["lr"])
|
||||||
|
outputs, states = {}, {}
|
||||||
|
if torch.device(device).type == "cuda":
|
||||||
|
torch.cuda.synchronize()
|
||||||
|
torch.cuda.reset_peak_memory_stats()
|
||||||
|
begin = time.perf_counter()
|
||||||
|
for step in range(1, max(budgets) + 1):
|
||||||
|
model.train()
|
||||||
|
opt.zero_grad(set_to_none=True)
|
||||||
|
mu, sigma = model(x)
|
||||||
|
loss = masked_bank_loss(mu[:, 0], sigma[:, 0], y, logpi, mask, starts, win, spec["lam"])
|
||||||
|
if not torch.isfinite(loss):
|
||||||
|
raise FloatingPointError(f"Non-finite loss in {method}, step {step}")
|
||||||
|
loss.backward()
|
||||||
|
nn.utils.clip_grad_norm_(model.parameters(), cfg["grad_clip"])
|
||||||
|
opt.step()
|
||||||
|
if step in budgets:
|
||||||
|
m, s = predict(model, X_targets, device)
|
||||||
|
outputs[f"{step}/mu"], outputs[f"{step}/sigma"] = m, s
|
||||||
|
if checkpoint is not None:
|
||||||
|
states[step] = {k: v.detach().cpu().clone() for k, v in model.state_dict().items()}
|
||||||
|
if torch.device(device).type == "cuda":
|
||||||
|
torch.cuda.synchronize()
|
||||||
|
elapsed = time.perf_counter() - begin
|
||||||
|
if checkpoint is not None:
|
||||||
|
tmp = checkpoint.with_suffix(".pt.tmp")
|
||||||
|
torch.save({"states": states, "method": method, "channels": X.shape[1], "config": cfg}, tmp)
|
||||||
|
tmp.replace(checkpoint)
|
||||||
|
return outputs, {"wall_seconds": elapsed, "steps": max(budgets), "seconds_per_step": elapsed / max(budgets),
|
||||||
|
"parameters": sum(v.numel() for v in model.parameters()),
|
||||||
|
"peak_vram_bytes": torch.cuda.max_memory_allocated() if torch.device(device).type == "cuda" else 0}
|
||||||
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()
|
||||||
8
paper/.gitignore
vendored
Normal file
8
paper/.gitignore
vendored
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
*.aux
|
||||||
|
*.bbl
|
||||||
|
*.blg
|
||||||
|
*.log
|
||||||
|
*.out
|
||||||
|
*.toc
|
||||||
|
*.synctex.gz
|
||||||
|
main.pdf
|
||||||
101
paper/README.md
Normal file
101
paper/README.md
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
# Manuscript draft
|
||||||
|
|
||||||
|
Build (no latexmk on the server):
|
||||||
|
|
||||||
|
```
|
||||||
|
pdflatex main && bibtex main && pdflatex main && pdflatex main
|
||||||
|
```
|
||||||
|
|
||||||
|
Red text (`\todo`, `\todoblock`, `\figplaceholder`) marks parts that are not ready.
|
||||||
|
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,
|
||||||
|
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
|
||||||
|
|
||||||
|
| 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.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. 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; 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.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` |
|
||||||
|
| 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. 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.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.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, 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.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, 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.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.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.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 ("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` 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, `tab:f3all` last row ("No band content", post hoc) | RMS over each test well of the 6 Hz high-pass (`split_bands`) marker-calibrated `PHIE_DT` reference (via `F3Data`), macro over wells = 1.224 p.u.; computed after the run, scale only |
|
||||||
|
| 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 (leave-one-anchor-out) | `outputs/p3/diagnostics/loao.csv` |
|
||||||
|
| 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: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 (bias split, within-well SD, constant vs networks per well) | `outputs/p4/posthoc/wells.csv` (post hoc) |
|
||||||
|
| 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 (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`), `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.
|
||||||
|
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,
|
||||||
|
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 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.
BIN
paper/figures/f3_volume.pdf
Normal file
BIN
paper/figures/f3_volume.pdf
Normal file
Binary file not shown.
BIN
paper/figures/p2_h1.pdf
Normal file
BIN
paper/figures/p2_h1.pdf
Normal file
Binary file not shown.
BIN
paper/figures/p2_phase.pdf
Normal file
BIN
paper/figures/p2_phase.pdf
Normal file
Binary file not shown.
BIN
paper/figures/p2r_grid.pdf
Normal file
BIN
paper/figures/p2r_grid.pdf
Normal file
Binary file not shown.
BIN
paper/figures/p2r_h2b.pdf
Normal file
BIN
paper/figures/p2r_h2b.pdf
Normal file
Binary file not shown.
BIN
paper/figures/td_drift.pdf
Normal file
BIN
paper/figures/td_drift.pdf
Normal file
Binary file not shown.
5
paper/highlights.txt
Normal file
5
paper/highlights.txt
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
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
|
||||||
|
A calibrated posterior bank recovers the oracle optimum; its gain is fourth order
|
||||||
|
In one tested regime, tie-posterior label gains fail if anchor error is off twofold
|
||||||
|
In simulation, blind-well tests need ~1 ms references; tested field data lack them
|
||||||
88
paper/main.tex
Normal file
88
paper/main.tex
Normal file
@@ -0,0 +1,88 @@
|
|||||||
|
% Draft manuscript. Build: pdflatex main && bibtex main && pdflatex main && pdflatex main
|
||||||
|
% Red text marks parts that are not ready (results pending, figures missing, checks to do).
|
||||||
|
% Every number in this draft comes from outputs/*/summary* or docs/plan.md; see paper/README.md.
|
||||||
|
\documentclass[11pt,a4paper]{article}
|
||||||
|
|
||||||
|
\usepackage[utf8]{inputenc}
|
||||||
|
\usepackage[T1]{fontenc}
|
||||||
|
\IfFileExists{lmodern.sty}{\usepackage{lmodern}}{}
|
||||||
|
\usepackage[margin=2.5cm]{geometry}
|
||||||
|
\usepackage{amsmath,amssymb,amsthm}
|
||||||
|
\usepackage{bm}
|
||||||
|
\usepackage{graphicx}
|
||||||
|
\usepackage{booktabs}
|
||||||
|
\usepackage{multirow}
|
||||||
|
\usepackage{array}
|
||||||
|
\usepackage{xcolor}
|
||||||
|
\usepackage{caption}
|
||||||
|
\usepackage[authoryear,round]{natbib}
|
||||||
|
\usepackage[colorlinks=true,linkcolor=blue!50!black,citecolor=blue!50!black,urlcolor=blue!50!black]{hyperref}
|
||||||
|
\usepackage{setspace}
|
||||||
|
\onehalfspacing
|
||||||
|
|
||||||
|
\graphicspath{{figures/}}
|
||||||
|
|
||||||
|
% ---------------------------------------------------------------------------
|
||||||
|
% Red notes for unfinished parts
|
||||||
|
\newcommand{\todo}[1]{\textcolor{red}{[TODO: #1]}}
|
||||||
|
\newcommand{\todoblock}[1]{%
|
||||||
|
\par\smallskip\noindent
|
||||||
|
\fcolorbox{red}{red!6}{\parbox{\dimexpr\linewidth-2\fboxsep-2\fboxrule}{\color{red}\textbf{TODO.} #1}}%
|
||||||
|
\par\smallskip}
|
||||||
|
\newcommand{\figplaceholder}[1]{%
|
||||||
|
\fcolorbox{red}{red!6}{\parbox[c][4.5cm][c]{0.9\linewidth}{\centering\color{red}\textbf{Figure not ready.}\\[2pt] #1}}}
|
||||||
|
|
||||||
|
% ---------------------------------------------------------------------------
|
||||||
|
% Notation
|
||||||
|
\newcommand{\E}{\mathbb{E}}
|
||||||
|
\newcommand{\Var}{\operatorname{Var}}
|
||||||
|
\newcommand{\Cov}{\operatorname{Cov}}
|
||||||
|
\newcommand{\sd}{\operatorname{sd}}
|
||||||
|
\newcommand{\PCC}{\operatorname{PCC}}
|
||||||
|
\newcommand{\RML}{\mathrm{RML}}
|
||||||
|
\newcommand{\N}{\mathcal{N}}
|
||||||
|
\newcommand{\dd}{\,\mathrm{d}}
|
||||||
|
\newcommand{\aaf}{\mathcal{A}} % anti-alias filter
|
||||||
|
\newcommand{\sigpost}{\sigma_{\mathrm{post}}}
|
||||||
|
|
||||||
|
% Method names; change here to rename everywhere (repository codes: paper/README.md)
|
||||||
|
\newcommand{\mPM}{SMC mean} % labels at the SMC posterior-mean warp (repository code B3d-Sa)
|
||||||
|
\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}
|
||||||
|
\newtheorem{proposition}{Proposition}
|
||||||
|
\newtheorem{lemma}{Lemma}
|
||||||
|
\newtheorem{corollary}{Corollary}
|
||||||
|
\theoremstyle{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}
|
||||||
|
\author{\todo{author list, affiliations, ORCID, corresponding author}}
|
||||||
|
\date{Draft, \today}
|
||||||
|
|
||||||
|
\begin{document}
|
||||||
|
\maketitle
|
||||||
|
|
||||||
|
\input{sections/00_abstract}
|
||||||
|
\input{sections/01_introduction}
|
||||||
|
\input{sections/02_related}
|
||||||
|
\input{sections/03_data}
|
||||||
|
\input{sections/04_method}
|
||||||
|
\input{sections/05_theory}
|
||||||
|
\input{sections/06_experiments}
|
||||||
|
\input{sections/07_discussion}
|
||||||
|
\input{sections/08_conclusion}
|
||||||
|
|
||||||
|
\bibliographystyle{plainnat}
|
||||||
|
\bibliography{refs}
|
||||||
|
|
||||||
|
\appendix
|
||||||
|
\input{sections/A_proofs}
|
||||||
|
\input{sections/B_field}
|
||||||
|
\input{sections/C_record}
|
||||||
|
|
||||||
|
\end{document}
|
||||||
691
paper/refs.bib
Normal file
691
paper/refs.bib
Normal file
@@ -0,0 +1,691 @@
|
|||||||
|
% Selective ML-Porosity survey; cutoff 2026-10-23.
|
||||||
|
% F = relevant full-text sections inspected; A = original abstract/metadata only.
|
||||||
|
% These entries are bibliographic records, not evidence of reproduced experiments.
|
||||||
|
|
||||||
|
@article{prabowo2025f3,
|
||||||
|
author = {Prabowo, Urip Nurwijayanto and Sudarmaji and Setyowiyoto, Jarot and Sismanto},
|
||||||
|
title = {{Comparison of Porosity Prediction from Seismic Data in the F3 Block, Netherlands using Machine Learning}},
|
||||||
|
journal = {Rudarsko-geološko-naftni zbornik},
|
||||||
|
year = {2025},
|
||||||
|
volume = {40},
|
||||||
|
number = {2},
|
||||||
|
pages = {15--26},
|
||||||
|
doi = {10.17794/rgn.2025.2.2},
|
||||||
|
url = {https://doi.org/10.17794/rgn.2025.2.2},
|
||||||
|
annote = {P01; survey evidence level F; accessed 2026-10-23}
|
||||||
|
}
|
||||||
|
|
||||||
|
@article{tao2025structural,
|
||||||
|
author = {Tao, Bo-Cheng and Zhou, Huai-Lai and Wu, Wen-Yue and Zhang, Gan and Liu, Bing and Liu, Xing-Ye},
|
||||||
|
title = {{Porosity prediction based on improved structural modeling deep learning method guided by petrophysical information}},
|
||||||
|
journal = {Petroleum Science},
|
||||||
|
year = {2025},
|
||||||
|
volume = {22},
|
||||||
|
pages = {2325--2338},
|
||||||
|
doi = {10.1016/j.petsci.2025.03.035},
|
||||||
|
url = {https://doi.org/10.1016/j.petsci.2025.03.035},
|
||||||
|
annote = {P02; survey evidence level F; accessed 2026-10-23}
|
||||||
|
}
|
||||||
|
|
||||||
|
@article{xu2024sts,
|
||||||
|
author = {Xu, Minghui and Zhao, Luanxiao and Liu, Jingyu and Geng, Jianhua},
|
||||||
|
title = {{Enhancing seismic porosity estimation through 3D sequence-to-sequence deep learning with data augmentation, spatial constraints, and geologic constraints}},
|
||||||
|
journal = {Geophysics},
|
||||||
|
year = {2024},
|
||||||
|
volume = {89},
|
||||||
|
number = {4},
|
||||||
|
pages = {M93--M108},
|
||||||
|
doi = {10.1190/geo2023-0614.1},
|
||||||
|
url = {https://doi.org/10.1190/geo2023-0614.1},
|
||||||
|
annote = {P03; survey evidence level A; full text added 2026-10-26 (refs/xu2024sts.pdf): labels matched to seismic with time-depth from well-to-seismic ties taken as given; carbonate reservoir, 48 wells}
|
||||||
|
}
|
||||||
|
|
||||||
|
@article{chen2024multidimensional,
|
||||||
|
author = {Chen, Hongling and Wu, Baohai and Sacchi, Mauricio D. and Wang, Zhiqiang and Gao, Jinghuai},
|
||||||
|
title = {{Multidimensional Petrophysical Seismic Inversion Based on Knowledge-Driven Semi-Supervised Deep Learning}},
|
||||||
|
journal = {IEEE Transactions on Geoscience and Remote Sensing},
|
||||||
|
year = {2024},
|
||||||
|
volume = {62},
|
||||||
|
pages = {1--15},
|
||||||
|
doi = {10.1109/TGRS.2024.3460184},
|
||||||
|
url = {https://doi.org/10.1109/TGRS.2024.3460184},
|
||||||
|
annote = {P04; survey evidence level A; accessed 2026-10-23; full text not obtainable (confirmed 2026-10-28): cite as abstract-only}
|
||||||
|
}
|
||||||
|
|
||||||
|
@article{li2024bpinn,
|
||||||
|
author = {Li, Peng and Grana, Dario and Liu, Mingliang},
|
||||||
|
title = {{Bayesian neural network and Bayesian physics-informed neural network via variational inference for seismic petrophysical inversion}},
|
||||||
|
journal = {Geophysics},
|
||||||
|
year = {2024},
|
||||||
|
volume = {89},
|
||||||
|
number = {6},
|
||||||
|
pages = {M185--M196},
|
||||||
|
doi = {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 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,
|
||||||
|
author = {Ntibahanana, M. and Jianguo, S. and Luemba, M. and Tondozi, K. and Imani, G. and Mohamed, B.},
|
||||||
|
title = {{Ensemble of Neural Networks Utilizing Seismic Attributes for Rock‐Property Inversion With Uncertainty Estimation}},
|
||||||
|
journal = {Earth and Space Science},
|
||||||
|
year = {2024},
|
||||||
|
volume = {11},
|
||||||
|
number = {6},
|
||||||
|
eid = {e2023EA003101},
|
||||||
|
doi = {10.1029/2023EA003101},
|
||||||
|
url = {https://doi.org/10.1029/2023EA003101},
|
||||||
|
annote = {P06; survey evidence level F; accessed 2026-10-23}
|
||||||
|
}
|
||||||
|
|
||||||
|
@article{di2023welltie,
|
||||||
|
author = {Di, Haibin and Abubakar, Aria},
|
||||||
|
title = {{Automating seismic‐well tie via self‐supervised learning}},
|
||||||
|
journal = {Geophysical Prospecting},
|
||||||
|
year = {2023},
|
||||||
|
volume = {71},
|
||||||
|
number = {4},
|
||||||
|
pages = {698--712},
|
||||||
|
doi = {10.1111/1365-2478.13333},
|
||||||
|
url = {https://doi.org/10.1111/1365-2478.13333},
|
||||||
|
annote = {P07; survey evidence level F; accessed 2026-10-23; full text not obtainable (confirmed 2026-10-28): cite as abstract-only}
|
||||||
|
}
|
||||||
|
|
||||||
|
@article{li2025cascadedtie,
|
||||||
|
author = {Li, Mengcheng and Huang, Xuri and Cao, Weiping and Wo, Yukai and Xu, Minghua and Ren, Mengyu and Lu, Shunkang},
|
||||||
|
title = {{Automatic seismic-well tie based on cascaded matching optimization method}},
|
||||||
|
journal = {Frontiers in Earth Science},
|
||||||
|
year = {2025},
|
||||||
|
volume = {13},
|
||||||
|
eid = {1547087},
|
||||||
|
doi = {10.3389/feart.2025.1547087},
|
||||||
|
url = {https://doi.org/10.3389/feart.2025.1547087},
|
||||||
|
annote = {P08; survey evidence level F; accessed 2026-10-23}
|
||||||
|
}
|
||||||
|
|
||||||
|
@article{dou2024seismae,
|
||||||
|
author = {Dou, Yimin and Li, Kewen},
|
||||||
|
title = {{3D seismic mask auto encoder: Seismic inversion using transformer-based reconstruction representation learning}},
|
||||||
|
journal = {Computers and Geotechnics},
|
||||||
|
year = {2024},
|
||||||
|
volume = {169},
|
||||||
|
pages = {106194},
|
||||||
|
eid = {106194},
|
||||||
|
doi = {10.1016/j.compgeo.2024.106194},
|
||||||
|
url = {https://doi.org/10.1016/j.compgeo.2024.106194},
|
||||||
|
annote = {P09; survey evidence level A; accessed 2026-10-23; full text not obtainable (confirmed 2026-10-28): cite as abstract-only}
|
||||||
|
}
|
||||||
|
|
||||||
|
@article{li2026leakage,
|
||||||
|
author = {Li, Zhibin and Liu, Jingxian and Li, Xuece and He, Tongtong and Li, Kangning and Zhang, Yuanning and Pan, Zhongkui and Lei, Xiangjun and Wang, Shuheng and Zhang, Zhaojia},
|
||||||
|
title = {{Leakage-aware full-section evaluation and label-efficient semi-supervised seismic facies segmentation for subsurface geological modeling}},
|
||||||
|
journal = {Frontiers in Earth Science},
|
||||||
|
year = {2026},
|
||||||
|
volume = {14},
|
||||||
|
eid = {1910345},
|
||||||
|
doi = {10.3389/feart.2026.1910345},
|
||||||
|
url = {https://doi.org/10.3389/feart.2026.1910345},
|
||||||
|
annote = {P10; survey evidence level F; accessed 2026-10-23}
|
||||||
|
}
|
||||||
|
|
||||||
|
@article{rezaei2026krigingrf,
|
||||||
|
author = {Rezaei, Mohammadali and La Croix, Andrew D. and Emami Niri, Mohammad and Asghari, Omid},
|
||||||
|
title = {{Seismic Porosity Estimation Using Geologically-Informed Seismic Attributes and a Kriging-Enhanced Random Forest: Application to a Shallow-Marine Carbonate Reservoir}},
|
||||||
|
journal = {Natural Resources Research},
|
||||||
|
year = {2026},
|
||||||
|
doi = {10.1007/s11053-026-10694-z},
|
||||||
|
url = {https://doi.org/10.1007/s11053-026-10694-z},
|
||||||
|
annote = {P11; survey evidence level F; accessed 2026-10-23}
|
||||||
|
}
|
||||||
|
|
||||||
|
@article{sukar2026uncertainty,
|
||||||
|
author = {Sukar, Boshara and Côrte, Gustavo and MacBeth, Colin},
|
||||||
|
title = {{Dynamic Reservoir Property Estimation With Uncertainty Quantification From 4D Seismic Data Using Bayesian Neural Networks}},
|
||||||
|
journal = {Geophysical Prospecting},
|
||||||
|
year = {2026},
|
||||||
|
volume = {74},
|
||||||
|
number = {6},
|
||||||
|
eid = {e70228},
|
||||||
|
doi = {10.1111/1365-2478.70228},
|
||||||
|
url = {https://doi.org/10.1111/1365-2478.70228},
|
||||||
|
annote = {P12; survey evidence level F; accessed 2026-10-23}
|
||||||
|
}
|
||||||
|
|
||||||
|
@article{liu2023lowfrequency,
|
||||||
|
author = {Liu, Jingyu and Zhao, Luanxiao and Xu, Minghui and Zhao, Xiangyuan and You, Yuchun and Geng, Jianhua},
|
||||||
|
title = {{Porosity prediction from prestack seismic data via deep learning: incorporating a low-frequency porosity model}},
|
||||||
|
journal = {Journal of Geophysics and Engineering},
|
||||||
|
year = {2023},
|
||||||
|
volume = {20},
|
||||||
|
number = {5},
|
||||||
|
pages = {1016--1029},
|
||||||
|
doi = {10.1093/jge/gxad063},
|
||||||
|
url = {https://doi.org/10.1093/jge/gxad063},
|
||||||
|
annote = {P13; survey evidence level A; accessed 2026-10-23}
|
||||||
|
}
|
||||||
|
|
||||||
|
@article{corrales2024seis2rock,
|
||||||
|
author = {Corrales, M. and Hoteit, H. and Ravasi, M.},
|
||||||
|
title = {{Seis2Rock: A Data-Driven Approach to Direct Petrophysical Inversion of Pre-Stack Seismic Data}},
|
||||||
|
journal = {Earth and Space Science},
|
||||||
|
year = {2024},
|
||||||
|
volume = {11},
|
||||||
|
number = {2},
|
||||||
|
eid = {e2023EA003301},
|
||||||
|
doi = {10.1029/2023EA003301},
|
||||||
|
url = {https://doi.org/10.1029/2023EA003301},
|
||||||
|
annote = {P14; survey evidence level F; accessed 2026-10-23}
|
||||||
|
}
|
||||||
|
|
||||||
|
@misc{vashisth2022rwpinn,
|
||||||
|
author = {Vashisth, Divakar and Mukerji, Tapan},
|
||||||
|
title = {{Direct Estimation of Porosity from Seismic Data using Rock and Wave Physics Informed Neural Networks (RW-PINN)}},
|
||||||
|
year = {2022},
|
||||||
|
eprint = {2210.00042},
|
||||||
|
archivePrefix = {arXiv},
|
||||||
|
primaryClass = {physics.geo-ph},
|
||||||
|
url = {https://arxiv.org/abs/2210.00042},
|
||||||
|
annote = {P15; survey uses this arXiv version as a background paper; relevant full-text sections inspected; accessed 2026-10-23}
|
||||||
|
}
|
||||||
|
|
||||||
|
% --- 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).
|
||||||
|
% Not included (no full text, or no verifiable record): White & Simm 2003,
|
||||||
|
% 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,
|
||||||
|
author = {Buland, Arild and Omre, Henning},
|
||||||
|
title = {{Bayesian wavelet estimation from seismic and well data}},
|
||||||
|
journal = {Geophysics},
|
||||||
|
year = {2003},
|
||||||
|
volume = {68},
|
||||||
|
number = {6},
|
||||||
|
pages = {2000--2009},
|
||||||
|
doi = {10.1190/1.1635053},
|
||||||
|
url = {https://doi.org/10.1190/1.1635053},
|
||||||
|
annote = {Full text read; marker mistie modeled as latent time shifts with a triangular prior, estimated jointly with the wavelet by MCMC; refs/buland2003bayesianwavelet.pdf}
|
||||||
|
}
|
||||||
|
|
||||||
|
@article{gunning2006waveletextractor,
|
||||||
|
author = {Gunning, James and Glinsky, Michael E.},
|
||||||
|
title = {{Wavelet extractor: A Bayesian well-tie and wavelet extraction program}},
|
||||||
|
journal = {Computers \& Geosciences},
|
||||||
|
year = {2006},
|
||||||
|
volume = {32},
|
||||||
|
pages = {681--695},
|
||||||
|
doi = {10.1016/j.cageo.2005.10.001},
|
||||||
|
url = {https://doi.org/10.1016/j.cageo.2005.10.001},
|
||||||
|
annote = {Full text read (added 2026-10-26); MAP estimate of wavelet jointly with checkshot/marker times (Gaussian prior), registration shift and lateral positioning error per well, Laplace posterior, wavelet span by marginal likelihood; refs/gunning2006waveletextractor.pdf}
|
||||||
|
}
|
||||||
|
|
||||||
|
@article{wu2017multiwelltie,
|
||||||
|
author = {Wu, Xinming and Caumon, Guillaume},
|
||||||
|
title = {{Simultaneous multiple well-seismic ties using flattened synthetic and real seismograms}},
|
||||||
|
journal = {Geophysics},
|
||||||
|
year = {2017},
|
||||||
|
volume = {82},
|
||||||
|
number = {1},
|
||||||
|
pages = {IM13--IM20},
|
||||||
|
doi = {10.1190/geo2016-0295.1},
|
||||||
|
url = {https://doi.org/10.1190/geo2016-0295.1},
|
||||||
|
annote = {Full text read (HAL version, refs/wu2017multiwelltie.pdf); first published online 2016-11-09}
|
||||||
|
}
|
||||||
|
|
||||||
|
@article{tschannen2022partialtie,
|
||||||
|
author = {Tschannen, Valentin and Ghanim, Ammar and Ettrich, Norman},
|
||||||
|
title = {{Partial automation of the seismic to well tie with deep learning and Bayesian optimization}},
|
||||||
|
journal = {Computers \& Geosciences},
|
||||||
|
year = {2022},
|
||||||
|
volume = {164},
|
||||||
|
pages = {105120},
|
||||||
|
doi = {10.1016/j.cageo.2022.105120},
|
||||||
|
url = {https://doi.org/10.1016/j.cageo.2022.105120},
|
||||||
|
annote = {Full text read; variational CNN for wavelet (phase uncertainty), Bayesian optimization of bulk shift within user bounds; refs/tschannen2022partialtie.pdf}
|
||||||
|
}
|
||||||
|
|
||||||
|
@article{ali2025syntheticpseudowells,
|
||||||
|
author = {Ali, Muhammad and Changxingyue, He and Wei, Ning and Jiang, Ren and Zhu, Peimin and Hao, Zhang and Hussain, Wakeel and Ashraf, Umar},
|
||||||
|
title = {{Optimizing seismic-based reservoir property prediction: a synthetic data-driven approach using convolutional neural networks and transfer learning with real data integration}},
|
||||||
|
journal = {Artificial Intelligence Review},
|
||||||
|
year = {2025},
|
||||||
|
volume = {58},
|
||||||
|
number = {1},
|
||||||
|
eid = {31},
|
||||||
|
doi = {10.1007/s10462-024-11030-8},
|
||||||
|
url = {https://doi.org/10.1007/s10462-024-11030-8},
|
||||||
|
annote = {Full text read; target is P-impedance from prestack gathers, not porosity; published online 2024-11-30; refs/ali2025syntheticpseudowells.pdf}
|
||||||
|
}
|
||||||
|
|
||||||
|
@misc{herrera2012automatedtie,
|
||||||
|
author = {Herrera, Roberto Henry and van der Baan, Mirko},
|
||||||
|
title = {{Automated seismic-to-well ties?}},
|
||||||
|
year = {2012},
|
||||||
|
eprint = {1209.0201},
|
||||||
|
archivePrefix = {arXiv},
|
||||||
|
primaryClass = {physics.geo-ph},
|
||||||
|
url = {https://arxiv.org/abs/1209.0201},
|
||||||
|
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,
|
||||||
|
author = {Cuturi, Marco and Blondel, Mathieu},
|
||||||
|
title = {{Soft-DTW: a Differentiable Loss Function for Time-Series}},
|
||||||
|
booktitle = {Proceedings of the 34th International Conference on Machine Learning},
|
||||||
|
series = {Proceedings of Machine Learning Research},
|
||||||
|
volume = {70},
|
||||||
|
pages = {894--903},
|
||||||
|
year = {2017},
|
||||||
|
eprint = {1703.01541},
|
||||||
|
archivePrefix = {arXiv},
|
||||||
|
url = {https://proceedings.mlr.press/v70/cuturi17a.html},
|
||||||
|
annote = {refs/cuturi2017softdtw.pdf}
|
||||||
|
}
|
||||||
|
|
||||||
|
@inproceedings{leguen2019dilate,
|
||||||
|
author = {Le Guen, Vincent and Thome, Nicolas},
|
||||||
|
title = {{Shape and Time Distortion Loss for Training Deep Time Series Forecasting Models}},
|
||||||
|
booktitle = {Advances in Neural Information Processing Systems 32},
|
||||||
|
year = {2019},
|
||||||
|
eprint = {1909.09020},
|
||||||
|
archivePrefix = {arXiv},
|
||||||
|
url = {https://arxiv.org/abs/1909.09020},
|
||||||
|
annote = {DILATE; refs/leguen2019dilate.pdf}
|
||||||
|
}
|
||||||
|
|
||||||
|
@inproceedings{lakshminarayanan2017deepensembles,
|
||||||
|
author = {Lakshminarayanan, Balaji and Pritzel, Alexander and Blundell, Charles},
|
||||||
|
title = {{Simple and Scalable Predictive Uncertainty Estimation using Deep Ensembles}},
|
||||||
|
booktitle = {Advances in Neural Information Processing Systems 30},
|
||||||
|
year = {2017},
|
||||||
|
eprint = {1612.01474},
|
||||||
|
archivePrefix = {arXiv},
|
||||||
|
url = {https://arxiv.org/abs/1612.01474},
|
||||||
|
annote = {refs/lakshminarayanan2017deepensembles.pdf}
|
||||||
|
}
|
||||||
|
|
||||||
|
@inproceedings{kendall2017uncertainties,
|
||||||
|
author = {Kendall, Alex and Gal, Yarin},
|
||||||
|
title = {{What Uncertainties Do We Need in Bayesian Deep Learning for Computer Vision?}},
|
||||||
|
booktitle = {Advances in Neural Information Processing Systems 30},
|
||||||
|
year = {2017},
|
||||||
|
eprint = {1703.04977},
|
||||||
|
archivePrefix = {arXiv},
|
||||||
|
url = {https://arxiv.org/abs/1703.04977},
|
||||||
|
annote = {refs/kendall2017uncertainties.pdf}
|
||||||
|
}
|
||||||
|
|
||||||
|
@article{gneiting2007scoringrules,
|
||||||
|
author = {Gneiting, Tilmann and Raftery, Adrian E.},
|
||||||
|
title = {{Strictly Proper Scoring Rules, Prediction, and Estimation}},
|
||||||
|
journal = {Journal of the American Statistical Association},
|
||||||
|
year = {2007},
|
||||||
|
volume = {102},
|
||||||
|
number = {477},
|
||||||
|
pages = {359--378},
|
||||||
|
doi = {10.1198/016214506000001437},
|
||||||
|
url = {https://doi.org/10.1198/016214506000001437},
|
||||||
|
annote = {Proper scoring rules and CRPS; refs/gneiting2007scoringrules.pdf}
|
||||||
|
}
|
||||||
|
|
||||||
|
@inproceedings{murray2010ess,
|
||||||
|
author = {Murray, Iain and Adams, Ryan Prescott and MacKay, David J. C.},
|
||||||
|
title = {{Elliptical slice sampling}},
|
||||||
|
booktitle = {Proceedings of the 13th International Conference on Artificial Intelligence and Statistics},
|
||||||
|
series = {Proceedings of Machine Learning Research},
|
||||||
|
volume = {9},
|
||||||
|
pages = {541--548},
|
||||||
|
year = {2010},
|
||||||
|
eprint = {1001.0175},
|
||||||
|
archivePrefix = {arXiv},
|
||||||
|
url = {https://proceedings.mlr.press/v9/murray10a.html},
|
||||||
|
annote = {refs/murray2010ess.pdf}
|
||||||
|
}
|
||||||
|
|
||||||
|
@article{ravasi2020pylops,
|
||||||
|
author = {Ravasi, Matteo and Vasconcelos, Ivan},
|
||||||
|
title = {{PyLops---A linear-operator Python library for scalable algebra and optimization}},
|
||||||
|
journal = {SoftwareX},
|
||||||
|
year = {2020},
|
||||||
|
volume = {11},
|
||||||
|
pages = {100361},
|
||||||
|
doi = {10.1016/j.softx.2019.100361},
|
||||||
|
url = {https://doi.org/10.1016/j.softx.2019.100361},
|
||||||
|
annote = {Local copy is the arXiv version (1907.12349); refs/ravasi2020pylops.pdf}
|
||||||
|
}
|
||||||
|
|
||||||
|
@inproceedings{alfarraj2019semisupervised,
|
||||||
|
author = {Alfarraj, Motaz and AlRegib, Ghassan},
|
||||||
|
title = {{Semi-supervised learning for acoustic impedance inversion}},
|
||||||
|
booktitle = {SEG Technical Program Expanded Abstracts 2019},
|
||||||
|
pages = {2298--2302},
|
||||||
|
year = {2019},
|
||||||
|
doi = {10.1190/segam2019-3215902.1},
|
||||||
|
url = {https://doi.org/10.1190/segam2019-3215902.1},
|
||||||
|
annote = {Local copy is the arXiv version (1905.13412); refs/alfarraj2019semisupervised.pdf}
|
||||||
|
}
|
||||||
|
|
||||||
|
% --- Added 2026-10-28 for the manuscript (metadata from docs/theory.md, OpenAlex lookup of 2026-10-26).
|
||||||
|
% Pauli et al. 2011 and Ribatet et al. 2012 have not been read in full: verify before submission.
|
||||||
|
|
||||||
|
@inproceedings{mensch2018diffdp,
|
||||||
|
author = {Mensch, Arthur and Blondel, Mathieu},
|
||||||
|
title = {{Differentiable Dynamic Programming for Structured Prediction and Attention}},
|
||||||
|
booktitle = {Proceedings of the 35th International Conference on Machine Learning},
|
||||||
|
series = {Proceedings of Machine Learning Research},
|
||||||
|
volume = {80},
|
||||||
|
year = {2018},
|
||||||
|
eprint = {1802.03676},
|
||||||
|
archivePrefix = {arXiv},
|
||||||
|
url = {https://arxiv.org/abs/1802.03676}
|
||||||
|
}
|
||||||
|
|
||||||
|
@article{pauli2011composite,
|
||||||
|
author = {Pauli, Francesco and Racugno, Walter and Ventura, Laura},
|
||||||
|
title = {{Bayesian composite marginal likelihoods}},
|
||||||
|
journal = {Statistica Sinica},
|
||||||
|
year = {2011},
|
||||||
|
volume = {21},
|
||||||
|
pages = {149--164},
|
||||||
|
annote = {not read in full}
|
||||||
|
}
|
||||||
|
|
||||||
|
@article{ribatet2012composite,
|
||||||
|
author = {Ribatet, Mathieu and Cooley, Daniel and Davison, Anthony C.},
|
||||||
|
title = {{Bayesian inference from composite likelihoods, with an application to spatial extremes}},
|
||||||
|
journal = {Statistica Sinica},
|
||||||
|
year = {2012},
|
||||||
|
volume = {22},
|
||||||
|
pages = {813--845},
|
||||||
|
eprint = {0911.5357},
|
||||||
|
archivePrefix = {arXiv},
|
||||||
|
annote = {not read in full}
|
||||||
|
}
|
||||||
|
|
||||||
|
@article{sakoe1978dp,
|
||||||
|
author = {Sakoe, Hiroaki and Chiba, Seibi},
|
||||||
|
title = {{Dynamic programming algorithm optimization for spoken word recognition}},
|
||||||
|
journal = {IEEE Transactions on Acoustics, Speech, and Signal Processing},
|
||||||
|
year = {1978},
|
||||||
|
volume = {26},
|
||||||
|
number = {1},
|
||||||
|
pages = {43--49},
|
||||||
|
doi = {10.1109/TASSP.1978.1163055}
|
||||||
|
}
|
||||||
|
|
||||||
|
% --- Added 2026-10-28: SEG/EAGE expanded-abstract scan 2024--2026 (plan section 2.4, item 4).
|
||||||
|
% Metadata checked against Crossref on 2026-10-28; abstracts read via OpenAlex (EarthDoc and the
|
||||||
|
% SEG Library block automated access). No full text for any of these: cite as abstract-only.
|
||||||
|
% IMAGE 2025 proceedings were issued online 2026-02-10; the conference year is used.
|
||||||
|
|
||||||
|
@inproceedings{lim2025awsm,
|
||||||
|
author = {Lim, Un Young and Van Wagoner, Tom and Cardona, Reynaldo},
|
||||||
|
title = {{Automated Well-tie SysteM (AWSM) for seismic depth calibration and wavelet estimation using parallel tempering MCMC (PT-MCMC): A Midland Basin case study}},
|
||||||
|
booktitle = {Fifth International Meeting for Applied Geoscience \& Energy Expanded Abstracts},
|
||||||
|
publisher = {Society of Exploration Geophysicists},
|
||||||
|
year = {2025},
|
||||||
|
pages = {16--20},
|
||||||
|
doi = {10.1190/image2025-4304877.1},
|
||||||
|
url = {https://doi.org/10.1190/image2025-4304877.1},
|
||||||
|
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,
|
||||||
|
author = {Lim, Un Young and Cardona, Reynaldo},
|
||||||
|
title = {{Enhancing AVA inversion accuracy through deep neural network bootstrapping (BootNet): A novel approach for quantifying data uncertainty}},
|
||||||
|
booktitle = {Fifth International Meeting for Applied Geoscience \& Energy Expanded Abstracts},
|
||||||
|
publisher = {Society of Exploration Geophysicists},
|
||||||
|
year = {2025},
|
||||||
|
pages = {56--60},
|
||||||
|
doi = {10.1190/image2025-4304887.1},
|
||||||
|
url = {https://doi.org/10.1190/image2025-4304887.1},
|
||||||
|
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,
|
||||||
|
author = {Quesada, Jorge and Prabhushankar, Mohit and AlRegib, Ghassan},
|
||||||
|
title = {{Uncertainty-aware seismic fault annotations can reveal insights into label expertise and confidence}},
|
||||||
|
booktitle = {Fourth International Meeting for Applied Geoscience \& Energy Expanded Abstracts},
|
||||||
|
publisher = {Society of Exploration Geophysicists},
|
||||||
|
year = {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, 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,
|
||||||
|
author = {Huff, O. and Evensen, A. and Lie, J. E. and Bugge, A. J. and Sablon, R. and Thorkildsen, V.},
|
||||||
|
title = {{Efficient angle stack conditioning using a convolutional neural network}},
|
||||||
|
booktitle = {85th EAGE Annual Conference \& Exhibition},
|
||||||
|
publisher = {European Association of Geoscientists \& Engineers},
|
||||||
|
year = {2024},
|
||||||
|
pages = {1--5},
|
||||||
|
doi = {10.3997/2214-4609.202410580},
|
||||||
|
url = {https://doi.org/10.3997/2214-4609.202410580},
|
||||||
|
annote = {Abstract only (OpenAlex). 1-D CNN trained on synthetic angle stacks moveout-corrected with true vs perturbed velocities; North Sea field test}
|
||||||
|
}
|
||||||
|
|
||||||
|
@inproceedings{thiebaud2024lfc,
|
||||||
|
author = {Thiebaud, J. and Aker, E. and Kj{\o}nsberg, H.},
|
||||||
|
title = {{Consistent porosity prediction using a probabilistic litho-facies inversion}},
|
||||||
|
booktitle = {85th EAGE Annual Conference \& Exhibition},
|
||||||
|
publisher = {European Association of Geoscientists \& Engineers},
|
||||||
|
year = {2024},
|
||||||
|
pages = {1--5},
|
||||||
|
doi = {10.3997/2214-4609.202410490},
|
||||||
|
url = {https://doi.org/10.3997/2214-4609.202410490},
|
||||||
|
annote = {Abstract only (OpenAlex). Bayesian inversion for posterior lithology-fluid classes and porosity distributions; northern North Sea}
|
||||||
|
}
|
||||||
|
|
||||||
|
@inproceedings{rizzuti2024waveletflows,
|
||||||
|
author = {Rizzuti, G. and Vasconcelos, I.},
|
||||||
|
title = {{Multiscale uncertainty quantification for post-stack seismic inversion with wavelet flows}},
|
||||||
|
booktitle = {85th EAGE Annual Conference \& Exhibition},
|
||||||
|
publisher = {European Association of Geoscientists \& Engineers},
|
||||||
|
year = {2024},
|
||||||
|
pages = {1--5},
|
||||||
|
doi = {10.3997/2214-4609.202410525},
|
||||||
|
url = {https://doi.org/10.3997/2214-4609.202410525},
|
||||||
|
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,
|
||||||
|
author = {Cordoba, N. and Goyes, P. and Castro, L.},
|
||||||
|
title = {{Reservoir porosity estimation from post-stack seismic using deep learning constrained by well-porosity: A near-field application}},
|
||||||
|
booktitle = {86th EAGE Annual Conference \& Exhibition},
|
||||||
|
publisher = {European Association of Geoscientists \& Engineers},
|
||||||
|
year = {2025},
|
||||||
|
pages = {1--5},
|
||||||
|
doi = {10.3997/2214-4609.2025101450},
|
||||||
|
url = {https://doi.org/10.3997/2214-4609.2025101450},
|
||||||
|
annote = {Abstract only (OpenAlex). NN from post-stack seismic to porosity with a well-porosity loss term; seismic-noise sensitivity tests; Illinois Basin-Decatur Project. Abstract does not mention the well tie}
|
||||||
|
}
|
||||||
|
|
||||||
|
@inproceedings{mirza2025labelquality,
|
||||||
|
author = {Mirza, S. and Gala, A. and Devarakota, P. and Shah, S.},
|
||||||
|
title = {{Seismic and label quality assessment: A framework for improving AI models for seismic interpretation}},
|
||||||
|
booktitle = {86th EAGE Annual Conference \& Exhibition},
|
||||||
|
publisher = {European Association of Geoscientists \& Engineers},
|
||||||
|
year = {2025},
|
||||||
|
pages = {1--5},
|
||||||
|
doi = {10.3997/2214-4609.2025101452},
|
||||||
|
url = {https://doi.org/10.3997/2214-4609.2025101452},
|
||||||
|
annote = {Abstract only (OpenAlex). Seismic image quality metrics plus variability of manual salt interpretations}
|
||||||
|
}
|
||||||
|
|
||||||
|
@inproceedings{rizzuti2025uhr,
|
||||||
|
author = {Rizzuti, G. and Telling, R. and Vasconcelos, I.},
|
||||||
|
title = {{Enabling deep-learning-based uncertainty quantification at scale for post-stack UHR seismic inversion}},
|
||||||
|
booktitle = {86th EAGE Annual Conference \& Exhibition},
|
||||||
|
publisher = {European Association of Geoscientists \& Engineers},
|
||||||
|
year = {2025},
|
||||||
|
pages = {1--5},
|
||||||
|
doi = {10.3997/2214-4609.202510205},
|
||||||
|
url = {https://doi.org/10.3997/2214-4609.202510205},
|
||||||
|
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,
|
||||||
|
author = {Guillon, S{\'e}bastien and Joncour, Fr{\'e}d{\'e}ric and Barrallon, Pierre-Emmanuel and Castani{\'e}, Laurent},
|
||||||
|
title = {{Ground-truth uncertainty-aware metrics for machine learning applications on seismic image interpretation: Application to faults and horizon extraction}},
|
||||||
|
journal = {The Leading Edge},
|
||||||
|
year = {2020},
|
||||||
|
volume = {39},
|
||||||
|
number = {10},
|
||||||
|
pages = {734--741},
|
||||||
|
doi = {10.1190/tle39100734.1},
|
||||||
|
url = {https://doi.org/10.1190/tle39100734.1},
|
||||||
|
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,
|
||||||
|
author = {Berkson, Joseph},
|
||||||
|
title = {{Are there Two Regressions?}},
|
||||||
|
journal = {Journal of the American Statistical Association},
|
||||||
|
year = {1950},
|
||||||
|
volume = {45},
|
||||||
|
number = {250},
|
||||||
|
pages = {164--180},
|
||||||
|
doi = {10.1080/01621459.1950.10483349},
|
||||||
|
url = {https://doi.org/10.1080/01621459.1950.10483349},
|
||||||
|
annote = {Origin of the Berkson error model (error independent of the assigned value); metadata verified via Crossref 2026-10-29}
|
||||||
|
}
|
||||||
|
|
||||||
|
@book{carroll2006measurement,
|
||||||
|
author = {Carroll, Raymond J. and Ruppert, David and Stefanski, Leonard A. and Crainiceanu, Ciprian M.},
|
||||||
|
title = {{Measurement Error in Nonlinear Models: A Modern Perspective}},
|
||||||
|
edition = {2nd},
|
||||||
|
publisher = {Chapman and Hall/CRC},
|
||||||
|
year = {2006},
|
||||||
|
doi = {10.1201/9781420010138},
|
||||||
|
url = {https://doi.org/10.1201/9781420010138},
|
||||||
|
annote = {Classical versus Berkson measurement error; metadata verified via Crossref 2026-10-29}
|
||||||
|
}
|
||||||
|
|
||||||
|
@book{fuller1987measurement,
|
||||||
|
author = {Fuller, Wayne A.},
|
||||||
|
title = {{Measurement Error Models}},
|
||||||
|
publisher = {Wiley},
|
||||||
|
year = {1987},
|
||||||
|
doi = {10.1002/9780470316665},
|
||||||
|
url = {https://doi.org/10.1002/9780470316665},
|
||||||
|
annote = {Errors-in-variables models; metadata verified via Crossref 2026-10-29}
|
||||||
|
}
|
||||||
|
|
||||||
|
@article{frenay2014label,
|
||||||
|
author = {Fr{\'e}nay, Beno{\^i}t and Verleysen, Michel},
|
||||||
|
title = {{Classification in the Presence of Label Noise: A Survey}},
|
||||||
|
journal = {IEEE Transactions on Neural Networks and Learning Systems},
|
||||||
|
year = {2014},
|
||||||
|
volume = {25},
|
||||||
|
number = {5},
|
||||||
|
pages = {845--869},
|
||||||
|
doi = {10.1109/TNNLS.2013.2292894},
|
||||||
|
url = {https://doi.org/10.1109/TNNLS.2013.2292894},
|
||||||
|
annote = {Label-noise survey (classification); metadata verified via Crossref 2026-10-29}
|
||||||
|
}
|
||||||
|
|
||||||
|
@article{song2023noisy,
|
||||||
|
author = {Song, Hwanjun and Kim, Minseok and Park, Dongmin and Shin, Yooju and Lee, Jae-Gil},
|
||||||
|
title = {{Learning From Noisy Labels With Deep Neural Networks: A Survey}},
|
||||||
|
journal = {IEEE Transactions on Neural Networks and Learning Systems},
|
||||||
|
year = {2023},
|
||||||
|
volume = {34},
|
||||||
|
number = {11},
|
||||||
|
pages = {8135--8153},
|
||||||
|
doi = {10.1109/TNNLS.2022.3152527},
|
||||||
|
url = {https://doi.org/10.1109/TNNLS.2022.3152527},
|
||||||
|
annote = {Deep learning with noisy labels survey; metadata verified via Crossref 2026-10-29}
|
||||||
|
}
|
||||||
|
|
||||||
|
@misc{bader2017teapot,
|
||||||
|
author = {Bader, Sean},
|
||||||
|
title = {{Teapot Dome Well Tie}},
|
||||||
|
howpublished = {Texas Data Repository, dataset},
|
||||||
|
year = {2017},
|
||||||
|
doi = {10.18738/T8/21WDU8},
|
||||||
|
url = {https://doi.org/10.18738/T8/21WDU8}
|
||||||
|
}
|
||||||
|
|
||||||
|
@inproceedings{mnih2012aerial,
|
||||||
|
author = {Mnih, Volodymyr and Hinton, Geoffrey E.},
|
||||||
|
title = {{Learning to Label Aerial Images from Noisy Data}},
|
||||||
|
booktitle = {Proceedings of the 29th International Conference on Machine Learning (ICML 2012)},
|
||||||
|
address = {Edinburgh, Scotland, UK},
|
||||||
|
year = {2012},
|
||||||
|
url = {https://mlanthology.org/icml/2012/mnih2012icml-learning/},
|
||||||
|
annote = {Full text read 2026-10-29 (Ghostscript text of http://icml.cc/2012/papers/318.pdf). Sec. 5: registration noise modelled as a translated crop of the true map, t in {0, 8 translations by t_max}, p(t=0)=theta_t; likelihood marginalized over t (Eq. 8) and fitted by EM; p(t) set on a validation set. Sec. 6.1: precision/recall with a 3-pixel buffer because the ground truth is misregistered. Sec. 6.3: lower precision of ABN/ABN-P at low recall on URBAN2, "likely because the test set is poorly registered". No page numbers found.}
|
||||||
|
}
|
||||||
|
|
||||||
|
@article{balakrishnan1962jitter,
|
||||||
|
author = {Balakrishnan, A. V.},
|
||||||
|
title = {{On the Problem of Time Jitter in Sampling}},
|
||||||
|
journal = {IRE Transactions on Information Theory},
|
||||||
|
year = {1962},
|
||||||
|
volume = {8},
|
||||||
|
number = {3},
|
||||||
|
pages = {226--236},
|
||||||
|
doi = {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".}
|
||||||
|
}
|
||||||
|
|
||||||
|
% ---- 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).}
|
||||||
|
}
|
||||||
5
paper/sections/00_abstract.tex
Normal file
5
paper/sections/00_abstract.tex
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
\begin{abstract}
|
||||||
|
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}
|
||||||
|
|
||||||
|
\noindent\textbf{Keywords:} well tie; registration error; errors-in-variables; seismic porosity prediction; synthetic benchmark; blind-well validation; statistical power
|
||||||
20
paper/sections/01_introduction.tex
Normal file
20
paper/sections/01_introduction.tex
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
\section{Introduction}
|
||||||
|
\label{sec:intro}
|
||||||
|
|
||||||
|
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 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 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}
|
||||||
|
\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 \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 \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 \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}
|
||||||
|
|
||||||
|
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 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}).
|
||||||
58
paper/sections/02_related.tex
Normal file
58
paper/sections/02_related.tex
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
\section{Related work}
|
||||||
|
\label{sec:related}
|
||||||
|
|
||||||
|
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 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, 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.
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
\paragraph{Learned property prediction takes the tie as given.}
|
||||||
|
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.
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
\paragraph{Alignment losses use no anchors and no physical tie.}
|
||||||
|
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.}
|
||||||
|
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]
|
||||||
|
\centering
|
||||||
|
\caption{Positioning. DL: learned property prediction; Tie: automated tie; Tie UQ: posterior or uncertainty of the tie; UQ$\to$train: tie uncertainty used in training; Reg.\ eval.: evaluation that accounts for registration error; seg.: segmentation of seismic or aerial images; transl.: likelihood marginalized over a few label translations; tol.: spatial tolerance between prediction and label in the metric. \textsuperscript{a}Assessed from the abstract only.}
|
||||||
|
\label{tab:positioning}
|
||||||
|
\small
|
||||||
|
\begin{tabular}{>{\raggedright\arraybackslash}p{0.42\textwidth}ccccc}
|
||||||
|
\toprule
|
||||||
|
Work & DL & Tie & Tie UQ & UQ$\to$train & Reg.\ eval. \\
|
||||||
|
\midrule
|
||||||
|
\citet{prabowo2025f3,tao2025structural,xu2024sts,liu2023lowfrequency,corrales2024seis2rock} & \checkmark & -- & -- & -- & -- \\
|
||||||
|
\citet{cordoba2025porosity}\textsuperscript{a} & \checkmark & -- & -- & -- & -- \\
|
||||||
|
\citet{li2024bpinn,sukar2026uncertainty} & \checkmark & -- & -- & -- & -- \\
|
||||||
|
\citet{rizzuti2024waveletflows,rizzuti2025uhr,lim2025bootnet} & \checkmark & -- & -- & -- & -- \\
|
||||||
|
\citet{ali2025syntheticpseudowells} & \checkmark & -- & avoided & -- & -- \\
|
||||||
|
\citet{di2023welltie}\textsuperscript{a}, \citet{li2025cascadedtie}, \citet{dacostasilva2026autotie}\textsuperscript{a} & -- & \checkmark & -- & -- & -- \\
|
||||||
|
\citet{tschannen2022partialtie} & -- & \checkmark & partial & -- & -- \\
|
||||||
|
\citet{wu2017multiwelltie,herrera2012automatedtie} & -- & \checkmark & -- & -- & -- \\
|
||||||
|
\citet{buland2003bayesianwavelet,gunning2006waveletextractor} & -- & \checkmark & \checkmark & -- & -- \\
|
||||||
|
\citet{lim2025awsm} & -- & \checkmark & \checkmark & -- & -- \\
|
||||||
|
Soft-DTW, DILATE & generic & soft & -- & -- & -- \\
|
||||||
|
\citet{mnih2012aerial} & seg. & -- & -- & transl. & tol. \\
|
||||||
|
\citet{quesada2024faultlabels}\textsuperscript{a}, \citet{mirza2025labelquality}\textsuperscript{a} & seg. & -- & -- & -- & -- \\
|
||||||
|
\citet{guillon2020gtmetrics} & seg. & -- & -- & -- & tol. \\
|
||||||
|
This work & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark \\
|
||||||
|
\bottomrule
|
||||||
|
\end{tabular}
|
||||||
|
\end{table}
|
||||||
|
|
||||||
|
\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.)}
|
||||||
67
paper/sections/03_data.tex
Normal file
67
paper/sections/03_data.tex
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
\section{Data and audit}
|
||||||
|
\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}
|
||||||
|
\label{sec:data:f3}
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
An audit of the well data before any modelling changed how we use them (Table~\ref{tab:audit}).
|
||||||
|
|
||||||
|
\begin{table}[t]
|
||||||
|
\centering
|
||||||
|
\caption{Audit of the F3 wells in the 600--1100\,ms window. $\Delta t_{\mathrm{DT}}$: TWT from integrated sonic minus TD-marker TWT, over the markers in the window (range, and change within the window). $\max|\Delta t_{\mathrm{wlt}}|$: largest deviation of the distributed OpendTect time--depth model from the markers. $K$: TD markers in the window. Label: relation of PHIE to the logs.}
|
||||||
|
\label{tab:audit}
|
||||||
|
\small
|
||||||
|
\setlength{\tabcolsep}{3pt}
|
||||||
|
\begin{tabular}{lcccccl}
|
||||||
|
\toprule
|
||||||
|
Well & IL/XL & $\Delta t_{\mathrm{DT}}$ (ms) & change (ms) & $\max|\Delta t_{\mathrm{wlt}}|$ (ms) & $K$ & Label \\
|
||||||
|
\midrule
|
||||||
|
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 & 9.6 & 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.5 & 10 & $-0.2018+0.0011\,\mathrm{DT}$ \\
|
||||||
|
\bottomrule
|
||||||
|
\end{tabular}
|
||||||
|
\end{table}
|
||||||
|
|
||||||
|
\paragraph{Well spacing is uneven.}
|
||||||
|
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{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}). 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]
|
||||||
|
\centering
|
||||||
|
\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 set of distributed model files of unknown provenance (DT model). The shaded band is the 600--1100\,ms target window.}
|
||||||
|
\label{fig:tddrift}
|
||||||
|
\end{figure}
|
||||||
|
|
||||||
|
\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$, 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.
|
||||||
|
|
||||||
|
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}
|
||||||
|
|
||||||
|
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$). 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}
|
||||||
|
\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 \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 \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}
|
||||||
|
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.
|
||||||
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.
|
||||||
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.
|
||||||
412
paper/sections/06_experiments.tex
Normal file
412
paper/sections/06_experiments.tex
Normal file
@@ -0,0 +1,412 @@
|
|||||||
|
\section{Experiments}
|
||||||
|
\label{sec:experiments}
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
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}
|
||||||
|
|
||||||
|
\paragraph{Design.}
|
||||||
|
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{The test failed: the anchor bank did not beat the best deterministic tie.}
|
||||||
|
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]
|
||||||
|
\centering
|
||||||
|
\includegraphics[width=\linewidth]{p2_phase.pdf}
|
||||||
|
\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}
|
||||||
|
\end{figure}
|
||||||
|
|
||||||
|
\begin{table}[t]
|
||||||
|
\centering
|
||||||
|
\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}
|
||||||
|
\small
|
||||||
|
\begin{tabular}{llcccc}
|
||||||
|
\toprule
|
||||||
|
& & \multicolumn{2}{c}{band RMSE (p.u.)} & \multicolumn{2}{c}{band PCC} \\
|
||||||
|
\cmidrule(lr){3-4}\cmidrule(lr){5-6}
|
||||||
|
Family & Method & $N = 4$ & $N = 16$ & $N = 4$ & $N = 16$ \\
|
||||||
|
\midrule
|
||||||
|
Deterministic tie & Sonic tie & 1.480 & 1.420 & 0.202 & 0.258 \\
|
||||||
|
& Calibrated sonic & 0.937 & 0.774 & 0.729 & 0.826 \\
|
||||||
|
& Correlation tie & \textbf{0.716} & 0.569 & \textbf{0.855} & 0.914 \\
|
||||||
|
Posterior mean & Anchor mean & 0.759 & 0.627 & 0.833 & 0.891 \\
|
||||||
|
\midrule
|
||||||
|
Anchor-free & Hard-min shift & 1.304 & 1.184 & 0.429 & 0.526 \\
|
||||||
|
& Soft-min shift & 1.289 & 1.103 & 0.436 & 0.583 \\
|
||||||
|
& Soft-DTW & 0.978 & 0.743 & 0.704 & 0.838 \\
|
||||||
|
& DILATE & 0.967 & 0.731 & 0.714 & 0.844 \\
|
||||||
|
\midrule
|
||||||
|
Anchor bank & Anchor bank & 0.805 & 0.589 & 0.809 & 0.905 \\
|
||||||
|
& Reweighted anchor bank & 0.735 & \textbf{0.560} & 0.849 & \textbf{0.917} \\
|
||||||
|
\midrule
|
||||||
|
Ceiling & Oracle & 0.612 & 0.451 & 0.897 & 0.948 \\
|
||||||
|
\bottomrule
|
||||||
|
\end{tabular}
|
||||||
|
\end{table}
|
||||||
|
|
||||||
|
\paragraph{Anchor-free losses fitted 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.}
|
||||||
|
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{The bank was not better calibrated.}
|
||||||
|
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{Why Experiment 1 failed}
|
||||||
|
\label{sec:exp:diag}
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
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}).
|
||||||
|
|
||||||
|
\subsection{Experiment 2: SMC tie posterior}
|
||||||
|
\label{sec:exp:p2r}
|
||||||
|
|
||||||
|
\paragraph{Design.}
|
||||||
|
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}
|
||||||
|
\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{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{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}
|
||||||
|
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{Posterior-mean labels beat the best deterministic tie in all three full-anchor settings.}
|
||||||
|
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]
|
||||||
|
\centering
|
||||||
|
\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}
|
||||||
|
\small
|
||||||
|
\begin{tabular}{lcccccc}
|
||||||
|
\toprule
|
||||||
|
& \multicolumn{2}{c}{$N = 4$} & \multicolumn{2}{c}{$N = 16$} & & \\
|
||||||
|
\cmidrule(lr){2-3}\cmidrule(lr){4-5}
|
||||||
|
SNR & ratio & $\Delta$PCC & ratio & $\Delta$PCC & zero-drift & with anchor mean \\
|
||||||
|
\midrule
|
||||||
|
10\,dB & 0.857 [0.805, 0.922] & +0.039 & 0.782 [0.748, 0.813] & +0.037 & 0.809 & 2/2 \\
|
||||||
|
0\,dB & 0.888 [0.856, 0.926] & +0.078 & 0.888 [0.870, 0.909] & +0.060 & 0.851 & 1/2 \\
|
||||||
|
$-5$\,dB & 0.915 [0.883, 0.953] & +0.102 & 0.923 [0.908, 0.940] & +0.089 & 0.878 & 0/2 \\
|
||||||
|
\bottomrule
|
||||||
|
\end{tabular}
|
||||||
|
\end{table}
|
||||||
|
|
||||||
|
\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 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]
|
||||||
|
\centering
|
||||||
|
\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}
|
||||||
|
\small
|
||||||
|
\setlength{\tabcolsep}{4pt}
|
||||||
|
\begin{tabular}{ccccccc}
|
||||||
|
\toprule
|
||||||
|
$\sigma_a^{\mathrm{reg}}$ (ms) & ratio $N = 4$ & ratio $N = 16$ & cells pass & $\sigpost$ (ms) & warp RMSE (ms) & cov$_{90}$ \\
|
||||||
|
\midrule
|
||||||
|
3.5 & 0.977 [0.908, 1.038] & 1.141 [1.094, 1.194] & 0/2 & 2.52 & 4.80 & 0.62 \\
|
||||||
|
7 & 0.857 [0.805, 0.922] & 0.782 [0.748, 0.813] & 2/2 & 0.59 & 0.63 & 0.89 \\
|
||||||
|
14 & 0.985 [0.897, 1.067] & 0.928 [0.867, 1.004] & 0/2 & 0.92 & 2.81 & 0.52 \\
|
||||||
|
\bottomrule
|
||||||
|
\end{tabular}
|
||||||
|
\end{table}
|
||||||
|
|
||||||
|
\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). 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).
|
||||||
|
|
||||||
|
\begin{table}[t]
|
||||||
|
\centering
|
||||||
|
\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}
|
||||||
|
\small
|
||||||
|
\setlength{\tabcolsep}{4pt}
|
||||||
|
\begin{tabular}{lcccccccc}
|
||||||
|
\toprule
|
||||||
|
Setting & $c$ & $\sigpost$ (ms) & ratio & 95\% CI & $\rhoCl$ & $\rhoBk$ & warp RMSE (ms) & cov$_{90}$ \\
|
||||||
|
\midrule
|
||||||
|
0\,dB & 1 & 1.53 & 0.967 & [0.956, 0.979] & 0.999 & 0.982 & 1.86 & 0.86 \\
|
||||||
|
half-anchor & 1 & 1.72 & 0.970 & [0.953, 0.989] & 0.996 & 0.972 & 2.36 & 0.83 \\
|
||||||
|
two-anchor & 1 & 1.92 & 0.890 & [0.866, 0.915] & 0.964 & 0.893 & 4.78 & 0.53 \\
|
||||||
|
$-5$\,dB & 1 & 2.56 & 0.982 & [0.966, 0.995] & 1.000 & 0.904 & 2.91 & 0.86 \\
|
||||||
|
0\,dB & 2$^\dagger$ & 2.79 & 0.952 & [0.940, 0.962] & 0.968 & -- & 2.72 & 0.94 \\
|
||||||
|
$-5$\,dB & 2$^\dagger$ & 3.96 & 0.964 & [0.953, 0.977] & 0.980 & -- & 3.92 & 0.91 \\
|
||||||
|
half-anchor & 2$^\dagger$ & 4.18 & 0.904 & [0.889, 0.925] & 0.910 & -- & 4.10 & 0.94 \\
|
||||||
|
two-anchor & 2$^\dagger$ & 11.49 & 0.667 & [0.615, 0.713] & 0.634$^\ddagger$ & -- & 19.08 & 0.62 \\
|
||||||
|
\bottomrule
|
||||||
|
\end{tabular}
|
||||||
|
\end{table}
|
||||||
|
|
||||||
|
\begin{figure}[t]
|
||||||
|
\centering
|
||||||
|
\includegraphics[width=\linewidth]{p2r_h2b.pdf}
|
||||||
|
\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}
|
||||||
|
\end{figure}
|
||||||
|
|
||||||
|
\paragraph{Whether the bank gain exceeds a population correction depends on the error structure.}
|
||||||
|
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]
|
||||||
|
\centering
|
||||||
|
\includegraphics[width=\linewidth]{p2r_grid.pdf}
|
||||||
|
\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}
|
||||||
|
\end{figure}
|
||||||
|
|
||||||
|
\paragraph{Seed ensembles under-covered, and more so with better labels.}
|
||||||
|
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.
|
||||||
|
|
||||||
|
\begin{table}[t]
|
||||||
|
\centering
|
||||||
|
\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}
|
||||||
|
\small
|
||||||
|
\setlength{\tabcolsep}{4pt}
|
||||||
|
\begin{tabular}{lcccccccc}
|
||||||
|
\toprule
|
||||||
|
& & \multicolumn{4}{c}{10\,dB, $c = 1$, $N = 16$} & \multicolumn{3}{c}{$\xi_j - \xi_O$} \\
|
||||||
|
\cmidrule(lr){3-6}\cmidrule(lr){7-9}
|
||||||
|
Ensemble & iterations & rms $\hat\sigma$ & RMSE & $\xi$ & cov$_{90}$ & $c = 0$ & $c = 1$ & $c = 2$ \\
|
||||||
|
\midrule
|
||||||
|
Oracle & 500 & 0.48 & 1.13 & 0.189 & 0.48 & -- & -- & -- \\
|
||||||
|
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 \\
|
||||||
|
\mRML{} & 250 & 0.60 & 1.16 & 0.275 & 0.58 & 0.031 & 0.046 & 0.054 \\
|
||||||
|
Anchor mean & 250 & 0.76 & 1.24 & 0.379 & 0.65 & 0.041 & 0.072 & 0.064 \\
|
||||||
|
Correlation tie & 250 & 0.74 & 1.23 & 0.372 & 0.64 & 0.058 & 0.072 & 0.064 \\
|
||||||
|
Calibrated-sonic ens.\ & 125 & 1.10 & 1.36 & 0.662 & 0.79 & 0.199 & 0.199 & 0.179 \\
|
||||||
|
\bottomrule
|
||||||
|
\end{tabular}
|
||||||
|
\end{table}
|
||||||
|
|
||||||
|
\subsection{Where the bank gain comes from (exploratory)}
|
||||||
|
\label{sec:exp:mech}
|
||||||
|
|
||||||
|
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)}
|
||||||
|
\label{sec:exp:detect}
|
||||||
|
|
||||||
|
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.}
|
||||||
|
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.}
|
||||||
|
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{The number of wells needed rises quickly with the reference error.}
|
||||||
|
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]
|
||||||
|
\centering
|
||||||
|
\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}
|
||||||
|
\small
|
||||||
|
\setlength{\tabcolsep}{3pt}
|
||||||
|
\begin{tabular}{llccccccccccc}
|
||||||
|
\toprule
|
||||||
|
& & \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}
|
||||||
|
Cell & Competitor & win & ratio & ICC & 4\,ms & 8\,ms & 0 & 0.5 & 1 & 1.5 & 2 & $\ge 3$ \\
|
||||||
|
\midrule
|
||||||
|
10\,dB, $N = 4$ & Correlation & 0.81 & 0.85 & 0.45 & 0.53 & 0.39 & -- & -- & -- & -- & -- & -- \\
|
||||||
|
10\,dB, $N = 16$ & Phase-est.\ corr. & 0.97 & 0.80 & 0.00 & 0.46 & 0.22 & 5 & 5 & 11 & 23 & -- & -- \\
|
||||||
|
0\,dB, $N = 4$ & Phase-est.\ corr. & 0.95 & 0.87 & 0.07 & 0.64 & 0.39 & 5 & 8 & 11 & 13 & 23 & -- \\
|
||||||
|
0\,dB, $N = 16$ & Phase-est.\ corr. & 0.97 & 0.87 & 0.00 & 0.48 & 0.27 & 5 & 8 & 13 & 18 & 37 & -- \\
|
||||||
|
$-5$\,dB, $N = 4$ & Calibrated sonic & 0.84 & 0.92 & 0.39 & 0.60 & 0.44 & 18 & 30 & -- & -- & -- & -- \\
|
||||||
|
$-5$\,dB, $N = 16$ & Phase-est.\ corr. & 0.89 & 0.92 & 0.08 & 0.51 & 0.31 & 11 & 16 & 30 & -- & -- & -- \\
|
||||||
|
\bottomrule
|
||||||
|
\end{tabular}
|
||||||
|
\end{table}
|
||||||
|
|
||||||
|
\subsection{Field cases: what they can and cannot show}
|
||||||
|
\label{sec:exp:scope}
|
||||||
|
|
||||||
|
\paragraph{Neither field test met its pass rule.}
|
||||||
|
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.}
|
||||||
|
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{With more wells, the reference error remains the binding constraint.}
|
||||||
|
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.
|
||||||
67
paper/sections/07_discussion.tex
Normal file
67
paper/sections/07_discussion.tex
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
\section{Discussion}
|
||||||
|
\label{sec:discussion}
|
||||||
|
|
||||||
|
\paragraph{What held.}
|
||||||
|
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.}
|
||||||
|
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{Practical advice: training on an uncertain tie.}
|
||||||
|
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{Practical advice: comparing tie methods in the field.}
|
||||||
|
Proposition~\ref{prop:reference} and the detectability analysis turn the field failures into four requirements, derived under the benchmark simulator.
|
||||||
|
\begin{enumerate}
|
||||||
|
\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.
|
||||||
|
\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).
|
||||||
|
\item \emph{Networks with skill in the seismic band at blind wells,} shown before registration is compared.
|
||||||
|
\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.}
|
||||||
|
\begin{itemize}
|
||||||
|
\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{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{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{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{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{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{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{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.} 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}
|
||||||
26
paper/sections/08_conclusion.tex
Normal file
26
paper/sections/08_conclusion.tex
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
\section{Conclusions}
|
||||||
|
\label{sec:conclusion}
|
||||||
|
|
||||||
|
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 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 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.}
|
||||||
|
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.}
|
||||||
|
\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.}
|
||||||
|
|
||||||
|
\paragraph{CRediT authorship contribution statement.}
|
||||||
|
\todo{Author contributions.}
|
||||||
|
|
||||||
|
\paragraph{Declaration of competing interest.}
|
||||||
|
\todo{Competing interests.}
|
||||||
|
|
||||||
|
\paragraph{Declaration of generative AI and AI-assisted technologies.}
|
||||||
|
\todo{Elsevier requires authors to disclose the use of generative AI in preparing the manuscript. The authors must write this statement.}
|
||||||
|
|
||||||
|
\paragraph{Acknowledgements.}
|
||||||
|
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.}
|
||||||
278
paper/sections/A_proofs.tex
Normal file
278
paper/sections/A_proofs.tex
Normal file
@@ -0,0 +1,278 @@
|
|||||||
|
\section{Formal results and proofs}
|
||||||
|
\label{app:proofs}
|
||||||
|
|
||||||
|
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$.
|
||||||
|
|
||||||
|
\subsection{Blur}
|
||||||
|
|
||||||
|
\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 $\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*}
|
||||||
|
\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*}
|
||||||
|
With $\langle\cdot\rangle$ the average weighted by $S_{m_b}$,
|
||||||
|
\begin{equation*}
|
||||||
|
\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
|
||||||
|
\PCC_b(\tilde m) = \frac{\langle\operatorname{Re}P\rangle}{\sqrt{\langle|P|^2\rangle}}\,\frac{\sd m_b}{\sd y_b},
|
||||||
|
\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_{\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{Variance matching}
|
||||||
|
|
||||||
|
\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\,(\tilde m - \E\tilde m)$ for some $a \ge 0$.
|
||||||
|
\end{corollary}
|
||||||
|
|
||||||
|
\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$
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
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{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$.
|
||||||
|
|
||||||
|
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{Two modes}
|
||||||
|
|
||||||
|
\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$
|
||||||
|
|
||||||
|
|
||||||
|
\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.
|
||||||
|
|
||||||
|
(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 z\hat\sigma) = \Pr(|Z| \le z\sqrt\xi) = 2\Phi(z\sqrt\xi) - 1$. \hfill$\square$
|
||||||
|
|
||||||
|
|
||||||
|
\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*}
|
||||||
|
\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*}
|
||||||
|
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{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:sandwich}.} Let $\Lambda(\lambda) = \log\E_\pi e^{\lambda\ell} = \lambda M(\lambda)$, and let $r_\lambda \propto \pi e^{\lambda\ell}$ be the tilted distribution. Then $\Lambda' = \E_{r_\lambda}\ell$, and $\lambda\Lambda' - \Lambda = \E_{r_\lambda}[\lambda\ell - \Lambda] = \mathrm{KL}(r_\lambda\|\pi)$. Hence $M'(\lambda) = (\lambda\Lambda' - \Lambda)/\lambda^2 = \mathrm{KL}(r_\lambda\|\pi)/\lambda^2 \ge 0$. As $\lambda \to 0$, $\Lambda(\lambda) = \lambda\E_\pi\ell + O(\lambda^2)$. As $\lambda \to \infty$, $\Lambda(\lambda)/\lambda \to \max_s\ell_s$. Monotonicity gives the two inequalities. For uniform $\pi$, $\E_\pi e^{\lambda\ell} \ge e^{\lambda\max\ell}/S$, which gives the gap bound. The bound is attained in the limit where every $\ell_s$ except the largest tends to $-\infty$. \hfill$\square$
|
||||||
|
|
||||||
|
\paragraph{Lemma~\ref{lem:grad}.} Differentiating $-\frac{1}{\lambda n}\log\sum_s\pi_s e^{\lambda\ell_s}$ with respect to $\theta$ gives
|
||||||
|
\begin{equation*}
|
||||||
|
-\frac{1}{\lambda n}\sum_s \frac{\pi_s e^{\lambda\ell_s}}{\sum_{s'}\pi_{s'}e^{\lambda\ell_{s'}}}\,\lambda\nabla_\theta\ell_s . \tag*{$\square$}
|
||||||
|
\end{equation*}
|
||||||
|
|
||||||
|
\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{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*}
|
||||||
|
\mathrm{sDTW}_\gamma(D) = -\gamma\log\sum_{A\in\mathcal P}e^{-\langle A,D\rangle_w/\gamma}.
|
||||||
|
\end{equation*}
|
||||||
|
Substituting $\ell_A = -\frac12\langle A,D\rangle_w$, $\pi_A = |\mathcal P|^{-1}$ and $\lambda = 2/\gamma$ into \eqref{eq:rml} gives
|
||||||
|
\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| .
|
||||||
|
\end{equation*}
|
||||||
|
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$
|
||||||
255
paper/sections/B_field.tex
Normal file
255
paper/sections/B_field.tex
Normal file
@@ -0,0 +1,255 @@
|
|||||||
|
\section{Field cases in detail}
|
||||||
|
\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 (Appendix~\ref{app:record}), both pass rules failed, and nothing was changed after the test wells were scored.
|
||||||
|
|
||||||
|
\subsection{F3 field data}
|
||||||
|
\label{sec:exp:f3}
|
||||||
|
|
||||||
|
\paragraph{No learned model beat a depth--time trend in total RMSE.}
|
||||||
|
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.
|
||||||
|
|
||||||
|
\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, $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.
|
||||||
|
|
||||||
|
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{Both conditions failed.}
|
||||||
|
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]
|
||||||
|
\centering
|
||||||
|
\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}
|
||||||
|
\small
|
||||||
|
\begin{tabular}{lccccc}
|
||||||
|
\toprule
|
||||||
|
Outer well & competitor & ratio & improved & cov$_{80}$ & cov$_{90}$ \\
|
||||||
|
\midrule
|
||||||
|
F02-1 & Phase-est.\ corr. & 1.008 & no & 0.222 & 0.333 \\
|
||||||
|
F03-2 & Phase-est.\ corr. & 1.000 & no & 0.746 & 0.802 \\
|
||||||
|
F03-4 & Phase-est.\ corr. & 0.981 & yes & 0.746 & 0.802 \\
|
||||||
|
F06-1 & Phase-est.\ corr. & 1.070 & no & 0.381 & 0.500 \\
|
||||||
|
\midrule
|
||||||
|
Macro & & & 1/4 & 0.524 & 0.609 \\
|
||||||
|
Required & & & $\ge 3/4$ & $[0.75, 0.85]$ & $[0.85, 0.95]$ \\
|
||||||
|
\bottomrule
|
||||||
|
\end{tabular}
|
||||||
|
\end{table}
|
||||||
|
|
||||||
|
\paragraph{Two features of F3 limit what the test can detect.}
|
||||||
|
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]
|
||||||
|
\centering
|
||||||
|
\caption{F3 nested leave-one-well-out, all methods (label $\mathrm{PHIE}_{\mathrm{DT}}$, marker-calibrated reference, $\sigma_a = 7$\,ms, combined ensembles). Macro over four wells; RMSE in p.u. Coverage is descriptive. Last row: a prediction with no content above $f_c$, whose band RMSE equals the RMS of the band component of the reference; computed after the run, for scale only.}
|
||||||
|
\label{tab:f3all}
|
||||||
|
\small
|
||||||
|
\begin{tabular}{lcccccc}
|
||||||
|
\toprule
|
||||||
|
Method & band RMSE & band PCC & RMSE & PCC & cov$_{80}$ & cov$_{90}$ \\
|
||||||
|
\midrule
|
||||||
|
Depth--time trend & 1.239 & $-0.13$ & \textbf{2.48} & 0.81 & -- & -- \\
|
||||||
|
Ridge & 1.271 & \textbf{0.24} & 2.58 & \textbf{0.83} & -- & -- \\
|
||||||
|
Random forest & 1.511 & $-0.03$ & 2.67 & 0.79 & -- & -- \\
|
||||||
|
Gradient boosting & 1.537 & 0.01 & 2.68 & 0.78 & -- & -- \\
|
||||||
|
Impedance inversion & 3.090 & $-0.02$ & 3.60 & 0.44 & -- & -- \\
|
||||||
|
Composite loss & 1.252 & 0.19 & 3.09 & 0.53 & 0.38 & 0.44 \\
|
||||||
|
\midrule
|
||||||
|
Sonic tie & 1.348 & $-0.01$ & 3.13 & 0.44 & 0.47 & 0.57 \\
|
||||||
|
Calibrated sonic & 1.284 & 0.16 & 3.07 & 0.52 & 0.50 & 0.59 \\
|
||||||
|
Correlation tie & 1.282 & 0.20 & 3.14 & 0.45 & 0.48 & 0.58 \\
|
||||||
|
Phase-est.\ corr. & 1.256 & 0.20 & 2.98 & 0.59 & 0.51 & 0.59 \\
|
||||||
|
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 \\
|
||||||
|
\midrule
|
||||||
|
Hard-min shift & 1.232 & 0.18 & 3.24 & 0.39 & 0.49 & 0.58 \\
|
||||||
|
Soft-min shift & \textbf{1.211} & 0.22 & 3.17 & 0.43 & 0.49 & 0.60 \\
|
||||||
|
Soft-DTW & 1.237 & 0.22 & 3.12 & 0.57 & 0.42 & 0.52 \\
|
||||||
|
DILATE & 1.254 & 0.21 & 3.14 & 0.57 & 0.47 & 0.58 \\
|
||||||
|
\midrule
|
||||||
|
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} \\
|
||||||
|
\midrule
|
||||||
|
No band content & 1.224 & -- & -- & -- & -- & -- \\
|
||||||
|
\bottomrule
|
||||||
|
\end{tabular}
|
||||||
|
\end{table}
|
||||||
|
|
||||||
|
\paragraph{The networks predicted little of the seismic band.}
|
||||||
|
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{Sensitivity analyses did not change the outcome.}
|
||||||
|
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 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, 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, 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.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]
|
||||||
|
\centering
|
||||||
|
\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}
|
||||||
|
\small
|
||||||
|
\begin{tabular}{lccccccc}
|
||||||
|
\toprule
|
||||||
|
Variant & F02-1 & F03-2 & F03-4 & F06-1 & improved & cov$_{80}$ & cov$_{90}$ \\
|
||||||
|
\midrule
|
||||||
|
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 & -- & -- \\
|
||||||
|
$\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 \\
|
||||||
|
OpendTect reference & 1.022 & 1.018 & 0.974 & 1.071 & 1/4 & 0.50 & 0.60 \\
|
||||||
|
$f_c = 5$\,Hz & 1.002 & 1.000 & 0.980 & 1.079 & 1/4 & -- & -- \\
|
||||||
|
$f_c = 8$\,Hz & 1.014 & 0.997 & 0.979 & 1.060 & 2/4 & -- & -- \\
|
||||||
|
PHIE label & 0.992 & 0.911 & 1.025 & 0.943 & 3/4 & 0.45 & 0.50 \\
|
||||||
|
\bottomrule
|
||||||
|
\end{tabular}
|
||||||
|
\end{table}
|
||||||
|
|
||||||
|
\paragraph{The posterior was wide, followed the anchor uncertainty and left the phase poorly identified.}
|
||||||
|
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.
|
||||||
|
|
||||||
|
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 moved the band score by more than the gap under test.}
|
||||||
|
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]
|
||||||
|
\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. The anchor-only variant is identical to the anchor bank by construction.}
|
||||||
|
\label{tab:f3abl}
|
||||||
|
\small
|
||||||
|
\begin{tabular}{l>{\raggedright\arraybackslash}p{5.4cm}cccc}
|
||||||
|
\toprule
|
||||||
|
Variant & change from \mRML & band RMSE & RMSE & cov$_{80}$ & cov$_{90}$ \\
|
||||||
|
\midrule
|
||||||
|
\mRML & pre-registered method: 64 SMC labels, CNN--GRU backbone & 1.272 & 3.12 & 0.52 & 0.61 \\
|
||||||
|
\midrule
|
||||||
|
Anchor only & 64 anchor-only warps (= anchor bank) & 1.286 & 3.14 & 0.50 & 0.58 \\
|
||||||
|
No anchors & no anchor conditioning; prior hyperparameters at the pre-declared medians & 1.247 & 3.23 & 0.48 & 0.56 \\
|
||||||
|
Bulk shift only & sonic integration plus a constant shift, resampled by the seismic likelihood & 1.251 & 3.16 & 0.49 & 0.58 \\
|
||||||
|
$\lambda = 1$ & $\lambda = 1$ instead of $1/\tau_c$ & 1.257 & 3.09 & 0.52 & 0.62 \\
|
||||||
|
1 label & 1 SMC label & 1.273 & 3.08 & 0.48 & 0.57 \\
|
||||||
|
8 labels & 8 SMC labels & 1.256 & 3.11 & 0.48 & 0.59 \\
|
||||||
|
256 labels & 256 SMC labels & 1.257 & 3.10 & 0.50 & 0.58 \\
|
||||||
|
Fixed $\sigma$ & $\sigma$ fixed at the training-label standard deviation & 1.242 & 3.08 & 0.87 & 0.92 \\
|
||||||
|
Composite loss added & composite loss on the bank mean added & 1.243 & 3.11 & 0.41 & 0.49 \\
|
||||||
|
TCN & four dilated convolutions, no GRU & 1.245 & 3.10 & 0.38 & 0.48 \\
|
||||||
|
\mPM{}, TCN & \mPM{} with the TCN backbone & 1.250 & 3.13 & 0.40 & 0.49 \\
|
||||||
|
Low-frequency input & low-pass mean training label as an extra input & 1.309 & 2.62 & 0.40 & 0.50 \\
|
||||||
|
\bottomrule
|
||||||
|
\end{tabular}
|
||||||
|
\end{table}
|
||||||
|
|
||||||
|
\paragraph{Predicted volume.}
|
||||||
|
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.
|
||||||
|
|
||||||
|
\subsection{Volve field data}
|
||||||
|
\label{sec:exp:volve}
|
||||||
|
|
||||||
|
\paragraph{Data.}
|
||||||
|
\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.}
|
||||||
|
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{Neither condition held.}
|
||||||
|
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]
|
||||||
|
\centering
|
||||||
|
\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}
|
||||||
|
\small
|
||||||
|
\setlength{\tabcolsep}{4pt}
|
||||||
|
\begin{tabular}{llcccccc}
|
||||||
|
\toprule
|
||||||
|
Scheme & Outer well & $n$ & competitor & ratio & improved & cov$_{80}$ & cov$_{90}$ \\
|
||||||
|
\midrule
|
||||||
|
lowo & F-1 & 37 & Calibrated sonic & 1.035 & no & 0.459 & 0.541 \\
|
||||||
|
& F-1 A & 20 & Calibrated sonic & 1.004 & no & 0.450 & 0.550 \\
|
||||||
|
& F-1 B & 25 & Calibrated sonic & 0.989 & yes & 0.680 & 0.720 \\
|
||||||
|
& F-11 A & 16 & Calibrated sonic & 1.046 & no & 0.188 & 0.313 \\
|
||||||
|
& F-11 T2 & 23 & Calibrated sonic & 0.985 & yes & 0.261 & 0.435 \\
|
||||||
|
& F-12 & 29 & Calibrated sonic & 1.043 & no & 0.276 & 0.310 \\
|
||||||
|
& Macro & & & & 2/6 & 0.386 & 0.478 \\
|
||||||
|
\midrule
|
||||||
|
slot & F-1 & 37 & Correlation tie & 0.852 & yes & 0.270 & 0.432 \\
|
||||||
|
& F-1 A & 20 & Correlation tie & 1.034 & no & 0.450 & 0.600 \\
|
||||||
|
& F-1 B & 25 & Correlation tie & 0.897 & yes & 0.600 & 0.720 \\
|
||||||
|
& F-11 A & 16 & Calibrated sonic & 1.002 & no & 0.188 & 0.375 \\
|
||||||
|
& F-11 T2 & 23 & Calibrated sonic & 0.988 & yes & 0.304 & 0.391 \\
|
||||||
|
& F-12 & 29 & Calibrated sonic & 1.043 & no & 0.276 & 0.310 \\
|
||||||
|
& Macro & & & & 3/6 & 0.348 & 0.472 \\
|
||||||
|
\midrule
|
||||||
|
\multicolumn{5}{l}{Required, under both schemes} & $\ge 5/6$ & $[0.75, 0.85]$ & $[0.85, 0.95]$ \\
|
||||||
|
\bottomrule
|
||||||
|
\end{tabular}
|
||||||
|
\end{table}
|
||||||
|
|
||||||
|
\paragraph{No method had blind-well skill, because the between-well level dominates.}
|
||||||
|
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]
|
||||||
|
\centering
|
||||||
|
\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}
|
||||||
|
\small
|
||||||
|
\begin{tabular}{lcccccccc}
|
||||||
|
\toprule
|
||||||
|
& \multicolumn{4}{c}{lowo} & \multicolumn{4}{c}{slot} \\
|
||||||
|
\cmidrule(lr){2-5}\cmidrule(lr){6-9}
|
||||||
|
Method & RMSE & $R^2$ & cov$_{80}$ & cov$_{90}$ & RMSE & $R^2$ & cov$_{80}$ & cov$_{90}$ \\
|
||||||
|
\midrule
|
||||||
|
Calibrated sonic & 6.36 & $-0.84$ & 0.38 & 0.46 & 7.29 & $-1.64$ & 0.32 & 0.43 \\
|
||||||
|
Correlation tie & 6.55 & $-0.97$ & 0.32 & 0.40 & 7.32 & $-1.71$ & 0.33 & 0.40 \\
|
||||||
|
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 \\
|
||||||
|
\mRML & 6.50 & $-0.92$ & 0.39 & 0.48 & 7.13 & $-1.48$ & 0.35 & 0.47 \\
|
||||||
|
\midrule
|
||||||
|
Constant (training mean) & \textbf{6.03} & $-0.70$ & -- & -- & \textbf{6.59} & $-1.14$ & -- & -- \\
|
||||||
|
\bottomrule
|
||||||
|
\end{tabular}
|
||||||
|
\end{table}
|
||||||
|
|
||||||
|
\paragraph{The anchor uncertainty barely changed the error.}
|
||||||
|
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]
|
||||||
|
\centering
|
||||||
|
\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}
|
||||||
|
\small
|
||||||
|
\setlength{\tabcolsep}{2.5pt}
|
||||||
|
\begin{tabular}{lcccccccc}
|
||||||
|
\toprule
|
||||||
|
& \multicolumn{4}{c}{lowo} & \multicolumn{4}{c}{slot} \\
|
||||||
|
\cmidrule(lr){2-5}\cmidrule(lr){6-9}
|
||||||
|
$\sigma_a$ (ms) & \mRML & Phase-est.\ corr. & improved & cov$_{90}$ & \mRML & Phase-est.\ corr. & improved & cov$_{90}$ \\
|
||||||
|
\midrule
|
||||||
|
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 \\
|
||||||
|
14 & 6.55 & 6.52 & 3/6 & 0.52 & 7.09 & 7.27 & 4/6 & 0.46 \\
|
||||||
|
\bottomrule
|
||||||
|
\end{tabular}
|
||||||
|
\end{table}
|
||||||
|
|
||||||
|
\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$ 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,18 +1,31 @@
|
|||||||
# 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)
|
||||||
|
|
||||||
P03 (Xu et al. 2024) đã được tải tay ngày 26/10/2026. Các bài open access từng bị chặn tải tự động (P01, P06, P11, P12, P13, Tschannen 2022, AI Review 2024, Wu & Caumon 2017) đã được tải tay và nằm trong thư mục này. Gunning & Glinsky 2006 (C&G 32, 681–695) có toàn văn từ 26/10/2026 (`j.cageo.2005.10.001.pdf`). Còn lại:
|
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`.
|
||||||
|
|
||||||
|
P03 (Xu et al. 2024) đã được tải tay ngày 26/10/2026. Các bài open access từng bị chặn tải tự động (P01, P06, P11, P12, P13, Tschannen 2022, AI Review 2024, Wu & Caumon 2017) đã được tải tay và nằm trong thư mục này. Gunning & Glinsky 2006 (C&G 32, 681–695) có toàn văn từ 26/10/2026 (`gunning2006waveletextractor.pdf`). Còn lại:
|
||||||
|
|
||||||
## 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. 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 |
|
||||||
| — | Herrera & van der Baan 2014, Geophysics 79(3) | 10.1190/GEO2013-0248.1 (chỉ có preprint arXiv 2012) |
|
| — | Herrera & van der Baan 2014, Geophysics 79(3) | 10.1190/GEO2013-0248.1 (chỉ có preprint arXiv 2012) |
|
||||||
|
|
||||||
|
## 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 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
|
||||||
|
|
||||||
- Muñoz & Hale (2015) và RING 2025: không tìm thấy, bỏ qua.
|
- Muñoz & Hale (2015) và RING 2025: không tìm thấy, bỏ qua.
|
||||||
|
|||||||
162
report.html
162
report.html
@@ -100,7 +100,7 @@ footer{margin-top:32px;color:var(--mute);font-size:12px}
|
|||||||
<header>
|
<header>
|
||||||
<div>
|
<div>
|
||||||
<h1>Theo dõi tiến độ ML-Porosity</h1>
|
<h1>Theo dõi tiến độ ML-Porosity</h1>
|
||||||
<div class="sub">Dự đoán porosity từ seismic khi việc căn chỉnh giếng với seismic (well tie) không chắc chắn · lịch nén: 26/10 đến hết thứ 7, 31/10/2026 · nguồn: <code>docs/plan.md</code></div>
|
<div class="sub">Dự đoán porosity từ seismic khi việc căn chỉnh giếng với seismic (well tie) không chắc chắn · lịch: 26/10 đến hết thứ 7, 14/11/2026 (Pivot 1 mức B, dời ngày 29/10 từ 31/10) · nguồn: <code>docs/plan.md</code></div>
|
||||||
<div class="sub" id="today"></div>
|
<div class="sub" id="today"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="btns">
|
<div class="btns">
|
||||||
@@ -127,12 +127,44 @@ footer{margin-top:32px;color:var(--mute);font-size:12px}
|
|||||||
<p>Band RMSE macro của M2-Sa là 1,272 p.u., so với B3c-R 1,256 p.u. Khoảng dự đoán chưa bao phủ đủ nhãn tham chiếu; không claim calibration hoặc ưu thế trên field. Giữ nguyên ngưỡng, không chọn lại phương pháp theo test. Volume chỉ có tính mô tả.</p>
|
<p>Band RMSE macro của M2-Sa là 1,272 p.u., so với B3c-R 1,256 p.u. Khoảng dự đoán chưa bao phủ đủ nhãn tham chiếu; không claim calibration hoặc ưu thế trên field. Giữ nguyên ngưỡng, không chọn lại phương pháp theo test. Volume chỉ có tính mô tả.</p>
|
||||||
<p class="sub">Hoàn tất toàn bộ lúc 06:50 ngày 28/10. Lượt đầu dừng lúc 03:57 vì Windows khóa file dashboard sau 132/649 inline. Đã phục hồi riêng volume; một lần khóa file tái diễn được retry thành công. Giữ nguyên code khoa học, mô hình, G-C và byte của 132 inline cũ. <a href="outputs/p3/volume_recovery.json">Nhật ký phục hồi</a> · <a href="outputs/p3/completion_checks.json">Kiểm tra hoàn tất</a> · <a href="outputs/p3/summary/summary.md">Bảng kết quả</a> · <a href="outputs/p3/summary/wells.png">Hình bốn giếng</a>.</p>
|
<p class="sub">Hoàn tất toàn bộ lúc 06:50 ngày 28/10. Lượt đầu dừng lúc 03:57 vì Windows khóa file dashboard sau 132/649 inline. Đã phục hồi riêng volume; một lần khóa file tái diễn được retry thành công. Giữ nguyên code khoa học, mô hình, G-C và byte của 132 inline cũ. <a href="outputs/p3/volume_recovery.json">Nhật ký phục hồi</a> · <a href="outputs/p3/completion_checks.json">Kiểm tra hoàn tất</a> · <a href="outputs/p3/summary/summary.md">Bảng kết quả</a> · <a href="outputs/p3/summary/wells.png">Hình bốn giếng</a>.</p>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="card" style="margin-bottom:14px">
|
||||||
|
<b>Kết quả P4 Volve ngày 29/10: G-D không đạt tiêu chí claim nào</b>
|
||||||
|
<p>Sáu giếng nghiêng, nhãn PHIF (dẫn xuất từ density, không phụ thuộc sonic), hai scheme blind: <i>lowo</i> (bỏ một giếng) và <i>slot</i> (bỏ cả nhóm giếng chung lỗ khoan). G-D chỉ mô tả; tham chiếu calibrated, σ_a = 7 ms, ensemble gộp.</p>
|
||||||
|
<div class="tw"><table><thead><tr><th>Tiêu chí đã khóa</th><th>lowo</th><th>slot</th><th>Kết luận</th></tr></thead><tbody>
|
||||||
|
<tr><td>M2-Sa có RMSE thấp hơn B3 được chọn bằng inner validation ở ≥ 5/6 giếng</td><td>2/6 (đối thủ B3b ở cả 6)</td><td>3/6 (B3c ở nhóm F-1, B3b ở còn lại)</td><td>Không đạt</td></tr>
|
||||||
|
<tr><td>Coverage 80% trong 75–85%</td><td>38,6%</td><td>34,8%</td><td>Không đạt</td></tr>
|
||||||
|
<tr><td>Coverage 90% trong 85–95%</td><td>47,8%</td><td>47,2%</td><td>Không đạt</td></tr>
|
||||||
|
</tbody></table></div>
|
||||||
|
<p>RMSE macro của M2-Sa là 6,50 p.u. (lowo) và 7,13 p.u. (slot), so với 6,36 và 7,32 của B3 được chọn, 6,52 và 7,26 của B3d-Sa. R² macro âm với mọi phương pháp (−0,84 đến −1,71), PCC 0,12–0,24. Nhánh σ_a = 3,5 và 14 ms làm RMSE macro của M2-Sa đổi tối đa 0,06 p.u.</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>
|
||||||
|
</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 (chốt 26/10/2026, bỏ bước chờ GVHD)</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>
|
||||||
@@ -213,7 +245,7 @@ footer{margin-top:32px;color:var(--mute);font-size:12px}
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
/* ===================== DATA (sửa ở đây) ===================== */
|
/* ===================== DATA (sửa ở đây) ===================== */
|
||||||
const START = "2026-10-26", END = "2026-10-31"; // END tính cả ngày; mục tiêu: xong bài trước thứ 7 31/10/2026
|
const START = "2026-10-26", END = "2026-11-14"; // END tính cả ngày; mục tiêu: nộp bài thứ 7 14/11/2026 (dời ngày 29/10 từ 31/10, Pivot 1 mức B)
|
||||||
const STATES = {todo:"Chưa làm", doing:"Đang làm", done:"Xong", blocked:"Bị chặn"};
|
const STATES = {todo:"Chưa làm", doing:"Đang làm", done:"Xong", blocked:"Bị chặn"};
|
||||||
|
|
||||||
const PHASES = [
|
const PHASES = [
|
||||||
@@ -256,7 +288,7 @@ const PHASES = [
|
|||||||
{id:"p2-b45", t:"Baseline B4, B5", s:"done", n:"26/10: B4a hard-min ±8 mẫu (σ học được), B4b soft-min, B4c soft-DTW (losses/softdtw.py), B4d DILATE; B5 = ensemble 5 seed của B3b. Thêm hai đối thủ mạnh hơn: B3c (B3b + dịch cục bộ theo tương quan synthetic–seismic) và B3d (một nhãn từ warp trung bình của M2)."},
|
{id:"p2-b45", t:"Baseline B4, B5", s:"done", n:"26/10: B4a hard-min ±8 mẫu (σ học được), B4b soft-min, B4c soft-DTW (losses/softdtw.py), B4d DILATE; B5 = ensemble 5 seed của B3b. Thêm hai đối thủ mạnh hơn: B3c (B3b + dịch cục bộ theo tương quan synthetic–seismic) và B3d (một nhãn từ warp trung bình của M2)."},
|
||||||
{id:"p2-grid", t:"Lưới D2 chính, bản đồ pha v1, cổng G-B", s:"done", n:"26/10: scripts/11_run_d2.py --main trên cuda:1, 89 phút. 128 ô (8 realization × c ∈ {0, 0.5, 1, 2} × N ∈ {2, 4, 8, 16}), mỗi ô 11 phương pháp × 5 seed, chấm trên 8 giếng test (56 960 dòng, gồm cả biến thể không anchor cho H4). Số bước huấn luyện chọn trên realization dev 900/901 và khoá trong protocol_p2 (sha256 07336200…) trước khi chạy. scripts/13 vẽ bản đồ pha v1 (outputs/figures/p2_phase.png), p2_band_lines.png, p2_h1.png, p2_h3.png. G-B không đạt; xem Kết quả P2."},
|
{id:"p2-grid", t:"Lưới D2 chính, bản đồ pha v1, cổng G-B", s:"done", n:"26/10: scripts/11_run_d2.py --main trên cuda:1, 89 phút. 128 ô (8 realization × c ∈ {0, 0.5, 1, 2} × N ∈ {2, 4, 8, 16}), mỗi ô 11 phương pháp × 5 seed, chấm trên 8 giếng test (56 960 dòng, gồm cả biến thể không anchor cho H4). Số bước huấn luyện chọn trên realization dev 900/901 và khoá trong protocol_p2 (sha256 07336200…) trước khi chạy. scripts/13 vẽ bản đồ pha v1 (outputs/figures/p2_phase.png), p2_band_lines.png, p2_h1.png, p2_h3.png. G-B không đạt; xem Kết quả P2."},
|
||||||
{id:"p2-diag", t:"Chẩn đoán sau G-B (đến hết 27/10/2026), rồi chuyển hướng nếu vẫn trượt", s:"done", n:"Xong 27/10, xem mục Chốt P2 (σ_b và rock physics sai chưa kiểm). Đã xong (1)–(3) trên dev 900/901, xem mục Chẩn đoán sau G-B. (1) Sampler nhắm thẳng posterior có seismic: SMC tempering + elliptical slice, ước lượng lại pha (registration/smc.py, smc_torch.py; scripts/14). (2) Chọn γ theo tự tương quan phần dư thay cho luật ESS ≥ S/4. (3) Quét λ ∈ {0.37, 1, 3, ∞} (scripts/15). Kết quả: sai số căn chỉnh về mức trần; nhãn SMC đạt gate với đối thủ của protocol_p2 nhưng không hơn nhãn warp trung bình cùng posterior (B3d-S); λ ít quan trọng khi posterior tốt. Còn lại: (4) học σ_a, σ_b như plan §4.1; (5) lưới stress (SNR thấp, ít anchor, rock physics sai) để tìm vùng posterior rộng. Sau đó khoá protocol_p2r (đối thủ B3d-S, realization mới, nhiều hạt hơn) hoặc Pivot 1. Luật: protocol cho tối đa 2 tuần, lịch nén rút còn đến hết 27/10/2026; chỉ dùng realization dev (thêm dev mới nếu cần), không đụng realization 0–7 của lưới chính. Nếu vẫn trượt thì chuyển hướng theo §9, nhiều khả năng Pivot 1 (bài phân tích) cùng claim của R1: khi nào vấn đề này quan trọng, và cách làm không gây hại."},
|
{id:"p2-diag", t:"Chẩn đoán sau G-B (đến hết 27/10/2026), rồi chuyển hướng nếu vẫn trượt", s:"done", n:"Xong 27/10, xem mục Chốt P2 (σ_b và rock physics sai chưa kiểm). Đã xong (1)–(3) trên dev 900/901, xem mục Chẩn đoán sau G-B. (1) Sampler nhắm thẳng posterior có seismic: SMC tempering + elliptical slice, ước lượng lại pha (registration/smc.py, smc_torch.py; scripts/14). (2) Chọn γ theo tự tương quan phần dư thay cho luật ESS ≥ S/4. (3) Quét λ ∈ {0.37, 1, 3, ∞} (scripts/15). Kết quả: sai số căn chỉnh về mức trần; nhãn SMC đạt gate với đối thủ của protocol_p2 nhưng không hơn nhãn warp trung bình cùng posterior (B3d-S); λ ít quan trọng khi posterior tốt. Còn lại: (4) học σ_a, σ_b như plan §4.1; (5) lưới stress (SNR thấp, ít anchor, rock physics sai) để tìm vùng posterior rộng. Sau đó khoá protocol_p2r (đối thủ B3d-S, realization mới, nhiều hạt hơn) hoặc Pivot 1. Luật: protocol cho tối đa 2 tuần, lịch nén rút còn đến hết 27/10/2026; chỉ dùng realization dev (thêm dev mới nếu cần), không đụng realization 0–7 của lưới chính. Nếu vẫn trượt thì chuyển hướng theo §9, nhiều khả năng Pivot 1 (bài phân tích) cùng claim của R1: khi nào vấn đề này quan trọng, và cách làm không gây hại."},
|
||||||
{id:"p2-p2r", t:"Khoá protocol_p2r và chạy lại D2 trên realization mới, hoặc quyết định Pivot 1", s:"done", n:"Xong 27/10 (11:29 giờ máy chủ). Đã khoá protocol_p2r (tag protocol-p2r) và chạy lưới chính trên realization 8–15 (cuda:0 + cuda:1; scripts/run_p2r_main.sh, scripts/18_summarize_p2r.py → outputs/p2r/summary/). Không Pivot 1. Kết quả theo luật đã khoá: H2a ĐẠT (R10 c = 1: band RMSE B3d-Sa / point tie tốt nhất 0.857 / 0.782 ở N = 4 / 16; R0 và Rm5 cũng đạt). So với cả B3d: chỉ R10 đạt (R0 1/2 ô, Rm5 0/2). Nhánh σ_a trượt (σ_a = 3.5 ms: 0.98 / 1.14; 14 ms: 0.99 / 0.93), nên bài phải nói H2a cần σ_a đúng. H2b ĐẠT (N = 16: 8/8 ô posterior rộng, ρ = −0.85, p = 1e-4, ô hẹp 0.996). Lưu ý: B3d-Sa đã hơn point tie ngay ở c = 0 (≈ 0.81), nên phần lợi gắn với drift là B3d-Sa giữ nguyên khi drift tăng còn B3d xấu đi; ở phần lớn ô rộng c = 1 lợi của H2b vượt cận 1/B(σ_post). H3 chỉ mô tả: mọi ensemble, kể cả Oracle, under-cover."}
|
{id:"p2-p2r", t:"Khoá protocol_p2r và chạy lại D2 trên realization mới, hoặc quyết định Pivot 1", s:"done", n:"Xong 27/10 (11:29 giờ máy chủ). Đã khoá protocol_p2r (tag protocol-p2r) và chạy lưới chính trên realization 8–15 (cuda:0 + cuda:1; scripts/run_p2r_main.sh, scripts/18_summarize_p2r.py → outputs/p2r/summary/). Không Pivot 1. Kết quả theo luật đã khoá: H2a ĐẠT (R10 c = 1: band RMSE B3d-Sa / point tie tốt nhất 0.857 / 0.782 ở N = 4 / 16; R0 và Rm5 cũng đạt). So với cả B3d: chỉ R10 đạt (R0 1/2 ô, Rm5 0/2). Nhánh σ_a trượt (σ_a = 3.5 ms: 0.98 / 1.14; 14 ms: 0.99 / 0.93), nên bài phải nói H2a cần σ_a đúng. H2b ĐẠT (N = 16: 8/8 ô posterior rộng, ρ = −0.85, p = 1e-4, ô hẹp 0.996). Lưu ý: B3d-Sa đã hơn point tie ngay ở c = 0 (≈ 0.81), nên phần lợi gắn với drift là B3d-Sa giữ nguyên khi drift tăng còn B3d xấu đi; ở phần lớn ô rộng c = 1 lợi của H2b vượt cận 1/B(σ_post) đã đăng ký (cận classical; sửa 29/10: với cận Berkson post hoc chỉ 3/8 ô rộng vượt, hai ô sát cận, và tối đa 1/8 tại sai số warp; xem FINDS). H3 chỉ mô tả: mọi ensemble, kể cả Oracle, under-cover."}
|
||||||
]},
|
]},
|
||||||
{id:"P3", name:"P3 F3 thật", start:"2026-10-28", end:"2026-10-28", weeks:"T4 28/10",
|
{id:"P3", name:"P3 F3 thật", start:"2026-10-28", end:"2026-10-28", weeks:"T4 28/10",
|
||||||
out:"bảng và hình cho F3",
|
out:"bảng và hình cho F3",
|
||||||
@@ -272,24 +304,47 @@ const PHASES = [
|
|||||||
]},
|
]},
|
||||||
{id:"P4", name:"P4 Field thứ hai (Volve)", start:"2026-10-28", end:"2026-10-29", weeks:"T4–T5 28–29/10",
|
{id:"P4", name:"P4 Field thứ hai (Volve)", start:"2026-10-28", end:"2026-10-29", weeks:"T4–T5 28–29/10",
|
||||||
out:"bảng kết quả field 2",
|
out:"bảng kết quả field 2",
|
||||||
gate:{label:"G-D", date:"2026-10-29", text:"Báo cáo kết quả field 2 dù tốt hay xấu; thu hẹp phạm vi claim theo kết quả."},
|
gate:{label:"G-D", date:"2026-10-29", text:"Báo cáo kết quả field 2 dù tốt hay xấu; thu hẹp phạm vi claim theo kết quả. Claim \"cải thiện nhất quán\" cần ≥ 5/6 giếng ở cả lowo và slot; \"hiệu chuẩn\" cần coverage 80/90% trong [75, 85]% và [85, 95]% ở cả hai scheme.", res:"KHÔNG ĐẠT tiêu chí claim: cải thiện 2/6 (lowo) và 3/6 (slot) giếng; coverage 80/90% là 38,6/47,8% (lowo) và 34,8/47,2% (slot). Không phương pháp nào có kỹ năng ở giếng blind (R² < 0)."},
|
||||||
tasks:[
|
tasks:[
|
||||||
{id:"p4-roi", t:"Vùng quan tâm (ROI) của Volve, tie, pipeline", s:"todo", n:"Đã có cube ST10010 FULL_T (ROI IL 10020–10303, XL 2089–2440, TWT 2000–3200 ms). Thời gian–độ sâu: marker TWT từ well picks cho cả 10 giếng, checkshot ở F-11 T2 và F-15 A; 6 giếng đủ log."},
|
{id:"p4-roi", t:"Vùng quan tâm (ROI) của Volve, tie, pipeline", s:"done", n:"28/10: lớp dữ liệu giếng nghiêng (survey minimum curvature, TDR thời gian thẳng đứng hiệu chỉnh theo marker, patch 3×3 dọc đường giếng; scripts/23 → outputs/volve/volve_wells.npz) và pipeline ml_porosity/volve/ (fold lồng lowo/slot, bank loss có mask, chống rò nhãn bằng view). 6 giếng, PHIF 16–37 mẫu/giếng (tổng 150), cửa sổ 2400–2900 ms. Protocol <a href=\"configs/protocol_volve.yaml\">protocol_volve</a> khóa 01:17:42 UTC 29/10 (<a href=\"configs/protocol_volve.lock.json\">bản khóa</a>)."},
|
||||||
{id:"p4-run", t:"Chạy tập con B1, B3, B4, B5, M2", s:"todo", n:"T5 29/10. Nếu trễ: chỉ B3 tốt nhất, B3d-S và M2."}
|
{id:"p4-run", t:"Chạy tập con B1, B3, B4, B5, M2", s:"done", n:"Xong 02:21 UTC 29/10 trên server Linux (H200): nhánh chính cuda:1 (22 registration + 550 job), nhánh σ_a 3,5/14 ms song song trên cuda:0 (44 + 660 job), không job nào lỗi. Theo scope cut 5: B3b, B3c, B3c-R, B3d-Sa, M2-Sa (bỏ B1, B4, B5). <a href=\"outputs/p4/summary/summary.md\">Tổng hợp</a>, <a href=\"outputs/p4/summary/gate_gd.json\">G-D</a>, <a href=\"outputs/p4/posthoc/macro.csv\">post hoc</a>."},
|
||||||
|
{id:"p4-x", t:"Exploratory P4x: biến thể mô hình trên Volve (post hoc, không claim)", s:"done", n:"Khai báo trước ở <a href=\"docs/research/p4-exploratory.md\">p4-exploratory.md</a> (02:40 UTC, trước mọi lần train P4x). V0 tái lập P4 khớp tới 1,8e-15; V1a, V1b, V2a, V2b chạy dở. Bỏ hẳn ngày 29/10 (D-10), xem task kế tiếp."},
|
||||||
|
{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-30", weeks:"T5–T6 29–30/10",
|
{id:"P5", name:"P5 Viết bài", start:"2026-10-29", end:"2026-10-31", weeks:"T5–T7 29–31/10",
|
||||||
out:"draft v1 (cuối 29/10), v2 (cuối 30/10); gói tái lập", 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", s:"todo", n:"Cuối T5 29/10. Khung bài và các mục audit F3, lý thuyết, D2 viết dần từ 27/10 vì số liệu đã có."},
|
{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-d2", t:"Draft v2, phụ lục chứng minh", s:"todo", n:"Cuối T6 30/10."},
|
{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-repro", t:"Gói tái lập (code, config, dữ liệu dẫn xuất)", s:"todo"}
|
{id:"p5-a2", t:"T1, T4, T8 viết thành mệnh đề (hệ quả của Mệnh đề 1 và Bổ đề 2)", s:"done", n:"29/10. T1 thành Mệnh đề 3 (sai số classical làm mờ, Berkson làm sắc; tie trung bình posterior gần Berkson) và Mệnh đề 4 (bank hiệu chỉnh; lợi ích quần thể so với nhãn điểm bậc bốn theo σ). T4 thành Mệnh đề 5 (coverage qua tỉ số ξ). T8 thành Hệ quả 3 (hai mode, đảo dấu trong băng). Thêm Nhận xét 1 (λ > 0), Mệnh đề 6 và Hệ quả 4 (reference lệch; dung sai σ_r < σ/√2). Bản tiếng Việt ở docs/theory.md mục 6; chứng minh ở Phụ lục A."},
|
||||||
|
{id:"p5-a3", t:"T4: tách σ_aleatoric và Var_seed từ outputs/p2r/train/*/cells/*.npz", s:"done", n:"29/10, post hoc: scripts/30_t4_coverage.py → outputs/t4/ (bài mục 6.3, bảng tab:t4). Mọi ensemble quá hẹp (ξ 0,19 ở Oracle, tối đa 0,66). Độ dài huấn luyện lẫn với nguồn nhãn, nên phần (b), (c) của Mệnh đề 5 chưa kiểm. Không claim hiệu chỉnh."},
|
||||||
|
{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-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:"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:"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:"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 Review và nộp", start:"2026-10-31", end:"2026-10-31", weeks:"T7 31/10",
|
{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; các mục kết quả trong bài (xong 02/11, trừ deposit Zenodo)", gate:null,
|
||||||
|
tasks:[
|
||||||
|
{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:"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:"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:"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:"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:"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:"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-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-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",
|
||||||
out:"bản nộp", gate:null,
|
out:"bản nộp", gate:null,
|
||||||
tasks:[
|
tasks:[
|
||||||
{id:"p6-rev", t:"GVHD và một người làm địa vật lý đọc góp ý", s:"todo"},
|
{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:"p6-nov", t:"Kiểm tra tính mới lần cuối, tra quartile của venue", s:"todo"},
|
{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:"p6-sub", t:"Đăng preprint và nộp", s:"todo"}
|
{id:"p7-sub", t:"Nộp Computers & Geosciences", s:"todo", n:"T7 14/11."}
|
||||||
]}
|
]}
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -302,12 +357,12 @@ 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:"todo", r:"Từ khoá: well tie uncertainty, misalignment, label noise, porosity, impedance."},
|
{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:"todo", r:"Cần toàn văn để kiểm lại các ô trong bảng định vị literature."},
|
{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/j.cageo.2005.10.001.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."},
|
||||||
{name:"Bài RING 2025, bài EAGE 2023", where:"mục 2.4 (1, 3)", s:"drop", r:"Bỏ ngày 26/10/2026 vì không tìm thấy hoặc không xác định được bài."}
|
{name:"Bài RING 2025, bài EAGE 2023", where:"mục 2.4 (1, 3)", s:"drop", r:"Bỏ ngày 26/10/2026 vì không tìm thấy hoặc không xác định được bài."}
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -315,7 +370,18 @@ const DECISIONS = [
|
|||||||
{id:"D-1", q:"Dùng nhãn porosity nào?", p:"Nhãn chính là PHIE_DT (porosity suy từ sonic, ghi rõ như vậy trong bài). PHIE gốc làm nhãn phụ để so với luận văn. φ_D = (2650 − RHOB đo)/1600 chỉ để kiểm độ nhạy ở F02-1 và F03-4. Giữ cả 4 giếng.", n:"So φ_D với PHIE_DT trong 600–1100 ms (scripts/08): R² 0.27–0.59, RMS 3.9–5.0 p.u., tức nhãn density khác nhãn sonic. Nhưng RHOB đo chỉ có ở 2/4 giếng demo, còn PHIE_DT có ở cả 4 và chuỗi rock physics chính xác. Hoãn F03-03 và F03-06: chưa có marker làm anchor, TZ có thể là dữ liệu thời gian–độ sâu đã qua xử lý, F03-06 có DRHO cao. Việc kiểm tra với nhãn độc lập với sonic giao cho D3 (PHIF của Volve). Protocol v2 không phải đổi."},
|
{id:"D-1", q:"Dùng nhãn porosity nào?", p:"Nhãn chính là PHIE_DT (porosity suy từ sonic, ghi rõ như vậy trong bài). PHIE gốc làm nhãn phụ để so với luận văn. φ_D = (2650 − RHOB đo)/1600 chỉ để kiểm độ nhạy ở F02-1 và F03-4. Giữ cả 4 giếng.", n:"So φ_D với PHIE_DT trong 600–1100 ms (scripts/08): R² 0.27–0.59, RMS 3.9–5.0 p.u., tức nhãn density khác nhãn sonic. Nhưng RHOB đo chỉ có ở 2/4 giếng demo, còn PHIE_DT có ở cả 4 và chuỗi rock physics chính xác. Hoãn F03-03 và F03-06: chưa có marker làm anchor, TZ có thể là dữ liệu thời gian–độ sâu đã qua xử lý, F03-06 có DRHO cao. Việc kiểm tra với nhãn độc lập với sonic giao cho D3 (PHIF của Volve). Protocol v2 không phải đổi."},
|
||||||
{id:"D-2", q:"Cửa sổ thời gian", p:"600–1100 ms là cửa sổ chính, thêm một cửa sổ mở rộng (theo đề xuất).", n:"Phổ ổn định trong 200–1100 ms. Sau 1100 ms phổ đổi (đỉnh ~7 Hz), cần xem kỹ trước khi mở rộng xuống sâu."},
|
{id:"D-2", q:"Cửa sổ thời gian", p:"600–1100 ms là cửa sổ chính, thêm một cửa sổ mở rộng (theo đề xuất).", n:"Phổ ổn định trong 200–1100 ms. Sau 1100 ms phổ đổi (đỉnh ~7 Hz), cần xem kỹ trước khi mở rộng xuống sâu."},
|
||||||
{id:"D-3", q:"Field thứ hai", p:"Volve.", n:"PHIF của Volve phụ thuộc density nên đáp ứng yêu cầu nhãn độc lập với sonic. Cube ST10010 có sẵn và khớp horizon. Marker TWT có cho cả 10 giếng nên không phải mượn dữ liệu thời gian–độ sâu (TWT của pick là minh giải của operator, không phải đo độc lập). Giếng nghiêng 30–86° nên phải chiếu quỹ đạo 3D lên trace. Các giếng chung slot (F-1/1A/1B, F-11 A/T2) phải được giữ cùng nhóm khi cross-validation."},
|
{id:"D-3", q:"Field thứ hai", p:"Volve.", n:"PHIF của Volve phụ thuộc density nên đáp ứng yêu cầu nhãn độc lập với sonic. Cube ST10010 có sẵn và khớp horizon. Marker TWT có cho cả 10 giếng nên không phải mượn dữ liệu thời gian–độ sâu (TWT của pick là minh giải của operator, không phải đo độc lập). Giếng nghiêng 30–86° nên phải chiếu quỹ đạo 3D lên trace. Các giếng chung slot (F-1/1A/1B, F-11 A/T2) phải được giữ cùng nhóm khi cross-validation."},
|
||||||
{id:"D-4", q:"Venue đích và ngưỡng các cổng", p:"Geophysical Prospecting hoặc J. Applied Geophysics (giữ đề xuất).", n:"Chưa tra quartile."}
|
{id:"D-4", q:"Venue đích và ngưỡng các cổng", p:"Geophysical Prospecting hoặc J. Applied Geophysics (giữ đề xuất).", n:"Chưa tra quartile. 29/10: thay bằng D-9."},
|
||||||
|
{id:"D-5", q:"Hướng bài sau khi G-C và G-D không đạt", p:"Pivot 1: bài lý thuyết + benchmark synthetic. 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. F3 và Volve là hai trường hợp giới hạn phạm vi, không phải bằng chứng ủng hộ hay chống RML.", n:"Phần đứng được là lý thuyết (Mệnh đề 1 khớp trong 1%, Mệnh đề 2) và P2r (H2a, H2b, nhánh σ_a). Hai field test không có lực phân biệt: F3 chênh 0,016 p.u. giữa phương pháp so với 0,13 p.u. giữa seed; Volve hằng số thắng mọi mạng. Phân tích ở docs/research/pivot-theory-benchmark.md; plan mục 12 ý 22."},
|
||||||
|
{id:"D-6", q:"Hạn nộp", p:"Mức B: dời sang thứ 7, 14/11/2026. Ngưỡng và luật của mọi cổng không đổi.", n:"Mức A (31/10) chỉ cho một controlled study chưa đầy lưới. Lịch theo ngày ở plan mục 6.1. Người dùng chốt."},
|
||||||
|
{id:"D-7", q:"Trục misspecification (S2) có bắt buộc không?", p:"Bắt buộc, phạm vi hẹp: ba trục (rock physics sai hệ số; wavelet sai pha và băng thông; σ_b / prior drift sai) × regime R10, Rm5 × c = 1 × N ∈ {4, 16}, realization 8–15, dev trên 902–905, phương pháp Oracle, B3c-R, B3d-Sa, M2-Sa. Khoá trong configs/protocol_bench.yaml trước lần chạy đầu.", n:"Rủi ro lớn nhất của bài benchmark là cùng simulator với phương pháp. Nếu đến 10/11 chưa xong S2 thì bài gọi là controlled synthetic study."},
|
||||||
|
{id:"D-8", q:"T2 (cơ chế lợi ích của bank) là confirmatory hay exploratory?", p:"Exploratory, trên realization 8–15 với bank P2r đã có; khai báo trước ở docs/research/t2-mechanism.md. Trong bài là mechanism analysis kèm Mệnh đề 3. Không sinh realization 16–23 cho T2.", n:"Giả thuyết tái đăng ký ngầm hình thành sau khi thấy H2b; một lượt SMC riêng cho T2 không vừa hai tuần. (29/10: đánh số lúc lập kế hoạch; trong bài, giả thuyết tái đăng ký ngầm là Nhận xét 1, còn Mệnh đề 3 của bài là hai cấu trúc sai số của tie.)"},
|
||||||
|
{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-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-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 = [
|
||||||
@@ -344,7 +410,18 @@ const FINDS = [
|
|||||||
{h:"Volve phá vỡ cấu trúc \"porosity = hàm của sonic\"", p:"PHIF phụ thuộc density: corr(PHIF, RHOB) từ −0.92 đến −0.99; thêm DT không cải thiện (≤ 0.009 R²). Giấy phép CC BY-NC-SA 4.0."},
|
{h:"Volve phá vỡ cấu trúc \"porosity = hàm của sonic\"", p:"PHIF phụ thuộc density: corr(PHIF, RHOB) từ −0.92 đến −0.99; thêm DT không cải thiện (≤ 0.009 R²). Giấy phép CC BY-NC-SA 4.0."},
|
||||||
{h:"Well picks gỡ được vướng mắc về thời gian–độ sâu", p:"Cả 10 giếng D3 có <b>6–13 marker TWT</b> từ Ty đến Hugin/Skagerrak (2295–2807 ms), cùng loại anchor với marker F3. Pick không gắn cờ khớp horizon ST10010 trong ±10 ms ở BCU và Hugin; F-11 T2 lệch VSP −6 đến +4 ms. Pick nông (Utsira, Hordaland) lệch tới ~110 ms nên bỏ. Ở F-15 A, pick trùng checkshot (0.0 ms) vì checkshot ghi MD từ MSL và pick được suy từ chính checkshot đó."},
|
{h:"Well picks gỡ được vướng mắc về thời gian–độ sâu", p:"Cả 10 giếng D3 có <b>6–13 marker TWT</b> từ Ty đến Hugin/Skagerrak (2295–2807 ms), cùng loại anchor với marker F3. Pick không gắn cờ khớp horizon ST10010 trong ±10 ms ở BCU và Hugin; F-11 T2 lệch VSP −6 đến +4 ms. Pick nông (Utsira, Hordaland) lệch tới ~110 ms nên bỏ. Ở F-15 A, pick trùng checkshot (0.0 ms) vì checkshot ghi MD từ MSL và pick được suy từ chính checkshot đó."},
|
||||||
{h:"Cube Volve: segyio đọc sai mốc thời gian thêm 8 ms", p:"Byte 215 của SEG-Y ghi 3, không phải hệ số thời gian hợp lệ, nhưng segyio vẫn nhân delay 4 ms với nó, nên báo mẫu đầu ở <b>12 ms</b>; EBCDIC ghi 4 ms. Lệch 8 ms cùng cỡ với sai lệch đang nghiên cứu. Đã sửa trong SeismicCube và kiểm bằng dữ liệu: biên độ trung bình dọc Ty, Shetland, BCU, Hugin top và base đạt cực trị ở lag 0 đến +2 ms. Toạ độ header khớp lưới horizon trong 0.15 m."},
|
{h:"Cube Volve: segyio đọc sai mốc thời gian thêm 8 ms", p:"Byte 215 của SEG-Y ghi 3, không phải hệ số thời gian hợp lệ, nhưng segyio vẫn nhân delay 4 ms với nó, nên báo mẫu đầu ở <b>12 ms</b>; EBCDIC ghi 4 ms. Lệch 8 ms cùng cỡ với sai lệch đang nghiên cứu. Đã sửa trong SeismicCube và kiểm bằng dữ liệu: biên độ trung bình dọc Ty, Shetland, BCU, Hugin top và base đạt cực trị ở lag 0 đến +2 ms. Toạ độ header khớp lưới horizon trong 0.15 m."},
|
||||||
{h:"Gunning & Glinsky (2006) đã có posterior thời gian–độ sâu", p:"Thời gian checkshot/marker là tham số có prior Gauss, được ước lượng cùng wavelet, phép dịch căn chỉnh và sai số định vị giếng; bất định tính theo Laplace. Vậy bất định của tie không mới; điểm mới của đề tài là đưa posterior đó vào bước học. Anchor cứng của ta là giới hạn σ_t → 0; wavelet chung cho nhiều giếng là hướng xử lý cho B1."}
|
{h:"Gunning & Glinsky (2006) đã có posterior thời gian–độ sâu", p:"Thời gian checkshot/marker là tham số có prior Gauss, được ước lượng cùng wavelet, phép dịch căn chỉnh và sai số định vị giếng; bất định tính theo Laplace. Vậy bất định của tie không mới; điểm mới của đề tài là đưa posterior đó vào bước học. Anchor cứng của ta là giới hạn σ_t → 0; wavelet chung cho nhiều giếng là hướng xử lý cho B1."},
|
||||||
|
{h:"Volve: không phương pháp nào có kỹ năng ở giếng blind", p:"29/10, P4: R² macro âm với mọi phương pháp ở cả lowo và slot. Hằng số bằng trung bình PHIF của giếng train (post hoc, không dùng seismic) có RMSE <b>6,03 / 6,59 p.u.</b>, thấp hơn mọi mạng (6,36–7,32). Mức trung bình PHIF giữa các giếng lệch nhau tới 8,5 p.u.; độ lệch trung bình của mạng ở mỗi giếng bám độ lệch của hằng số (F-12: −6,8 so với −6,0 p.u.). Khác biệt giữa các tie ≤ 0,25 p.u."},
|
||||||
|
{h:"Volve: posterior tie hẹp hơn và pha xác định tốt hơn F3", p:"σ_post trung vị 4,3 ms (1,9–9,3 ms) và gần như không theo σ_a (3,8 / 4,3 / 4,1 ms ở 3,5 / 7 / 14 ms), khác F3. Pha wavelet của 22 tập train nằm trong cung 43° (F3: 214°). Gợi ý registration không phải nút thắt trên Volve; không kiểm tra được với warp thật."},
|
||||||
|
{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:"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, 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:"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 = [
|
||||||
@@ -475,7 +552,48 @@ const LOG = [
|
|||||||
["2026-10-27","Nén lịch: mục tiêu xong toàn bộ bài trước thứ 7, 31/10/2026 (thay lịch 24 tuần đến 02/05/2027). Chẩn đoán sau G-B đến hết 27/10; P3 F3 ngày 28/10 (G-C); P4 Volve 28–29/10 (G-D); viết 29–30/10; review và nộp 31/10. Ngưỡng các cổng giữ nguyên; thứ tự cắt phạm vi nếu trễ ghi ở plan §6. Cập nhật plan.md, technical_overview.md và báo cáo này. Thêm việc p2-p2r."],
|
["2026-10-27","Nén lịch: mục tiêu xong toàn bộ bài trước thứ 7, 31/10/2026 (thay lịch 24 tuần đến 02/05/2027). Chẩn đoán sau G-B đến hết 27/10; P3 F3 ngày 28/10 (G-C); P4 Volve 28–29/10 (G-D); viết 29–30/10; review và nộp 31/10. Ngưỡng các cổng giữ nguyên; thứ tự cắt phạm vi nếu trễ ghi ở plan §6. Cập nhật plan.md, technical_overview.md và báo cáo này. Thêm việc p2-p2r."],
|
||||||
["2026-10-27","Dev cho bản chạy lại P2 (H2a/H2b, ổn định SMC P = 1024, stress σ_a, H3 với posterior SMC, F3 trên trục σ_post) và khoá protocol. Bản khoá đầu tên protocol_p3, trùng với pha P3 F3 nên đổi thành protocol_p2r (P2 rerun) trước khi sinh realization 8–15. Thêm mục Chốt P2."],
|
["2026-10-27","Dev cho bản chạy lại P2 (H2a/H2b, ổn định SMC P = 1024, stress σ_a, H3 với posterior SMC, F3 trên trục σ_post) và khoá protocol. Bản khoá đầu tên protocol_p3, trùng với pha P3 F3 nên đổi thành protocol_p2r (P2 rerun) trước khi sinh realization 8–15. Thêm mục Chốt P2."],
|
||||||
["2026-10-27","Bắt đầu lưới chính P2r trên realization 8–15 (cuda:1): runner scripts/run_p2r_main.sh, tổng hợp scripts/18_summarize_p2r.py (chạy thử trên dev khớp số dev đã ghi trong protocol). Scripts 14/15 chỉ nhận 8–15 khi protocol_p2r và input khớp SHA-256. Sửa trạng thái công việc: lựa chọn thủ công lưu trong trình duyệt không còn che cập nhật mới trong DATA."],
|
["2026-10-27","Bắt đầu lưới chính P2r trên realization 8–15 (cuda:1): runner scripts/run_p2r_main.sh, tổng hợp scripts/18_summarize_p2r.py (chạy thử trên dev khớp số dev đã ghi trong protocol). Scripts 14/15 chỉ nhận 8–15 khi protocol_p2r và input khớp SHA-256. Sửa trạng thái công việc: lựa chọn thủ công lưu trong trình duyệt không còn che cập nhật mới trong DATA."],
|
||||||
["2026-10-27","Đổi tham chiếu thư mục code luận văn thành code_thesis/; bổ sung outputs_thesis/ và manifest 7 artifact. Volume đọc được (651 × 951 × 126), checkpoint có metadata v2. Tính lại dự đoán F06-1 đã lưu: PCC 0.0295, MSE 0.0018715, R² −0.3460, không dịch thời gian. Cập nhật plan, README và audit; chưa chạy lại checkpoint vì môi trường hiện chưa có Python/PyTorch."]
|
["2026-10-27","Đổi tham chiếu thư mục code luận văn thành code_thesis/; bổ sung outputs_thesis/ và manifest 7 artifact. Volume đọc được (651 × 951 × 126), checkpoint có metadata v2. Tính lại dự đoán F06-1 đã lưu: PCC 0.0295, MSE 0.0018715, R² −0.3460, không dịch thời gian. Cập nhật plan, README và audit; chưa chạy lại checkpoint vì môi trường hiện chưa có Python/PyTorch."],
|
||||||
|
["2026-10-28","P3 F3 hoàn tất 06:50 (+07:00): 1.320 trajectory nested LOWO, ablation, diagnostics, 20 mô hình triển khai, volume 649 inline. G-C KHÔNG ĐẠT (1/4 giếng; coverage 52,38/60,91%). Lượt đầu dừng ở 132/649 inline vì Windows khóa progress.js; phục hồi riêng phần inference, qua kiểm tra."],
|
||||||
|
["2026-10-28","Bản thảo bài (paper/) với kết quả F3; scripts/22_paper_figures.py. Quét SEG/EAGE 2024–2026; đóng mục kiểm tra abstract P04/P05/P07/P09."],
|
||||||
|
["2026-10-28","P4 Volve: lớp dữ liệu giếng nghiêng (ml_porosity/data/deviated.py, volve_wells.py, scripts/23), pipeline ml_porosity/volve/ và scripts/24, nháp protocol_volve; smoke CPU 22/22 registration, 110/110 job. Deviation member_support phát hiện ở smoke, sửa trước khóa."],
|
||||||
|
["2026-10-29","P4 trên server Linux: benchmark 01:16 UTC, khóa protocol_volve 01:17:42 UTC, chạy nhánh chính (cuda:1) và nhánh σ_a (cuda:0) song song, xong 02:21 UTC. G-D: 2/6 và 3/6 giếng, coverage90 ≈ 0,47–0,48; không claim cải thiện, không claim hiệu chuẩn."],
|
||||||
|
["2026-10-29","Post hoc P4 (scripts/25_p4_posthoc.py → outputs/p4/posthoc/): hằng số trung bình train thắng mọi mạng; sai số do mức giữa giếng chi phối. Bắt đầu exploratory P4x (khai báo trước ở docs/research/p4-exploratory.md; chỉ mô tả)."],
|
||||||
|
["2026-10-29","P5: viết các mục Volve của bài và đặt trục bài vào lý thuyết + benchmark synthetic; F3 và Volve là kiểm tra thực tế giới hạn phạm vi. Cập nhật report.html, plan.md, README, AGENTS.md, technical_overview.md."],
|
||||||
|
["2026-10-29","Khảo sát dataset field public (docs/research/field-dataset-survey.md): 12 ứng viên theo 7 tiêu chí; chưa có dataset nào xác nhận đủ điều kiện (điểm nghẽn là checkshot ở giếng test); Teapot Dome và Groningen là ứng viên cần kiểm kê sau. Không thêm field test trong bài này."],
|
||||||
|
["2026-10-29","Chốt Pivot 1 (D-5 đến D-10): bài lý thuyết + benchmark; dời hạn sang 14/11 (mức B); S2 bắt buộc dưới protocol_bench khoá trước; T2 exploratory; venue Computers & Geosciences; bỏ hẳn P4x (job đang chạy để tự kết thúc, kết quả không dùng). Cập nhật plan.md mục 0, 6.1, 8, 9, 12 ý 22; AGENTS.md; docs/research/pivot-theory-benchmark.md mục 6."],
|
||||||
|
["2026-10-29","Dừng job P4x ở 670/921 (khoảng 04:05 UTC) và kill để trả cuda:0; nhánh B3d-Sa và V3 chưa chạy. Theo D-10, phần output train dở chỉ giữ làm hồ sơ, không dùng; bản tổng hợp dở tạo lúc 04:07 UTC đã xóa."],
|
||||||
|
["2026-10-29","Điều kiện áp dụng C1–C4 (khai báo trước ở docs/research/applicability-teapot.md, exploratory): F3 và Volve trượt C1, đạt C2 (scripts/26). T3 power (scripts/27): cần 5–18 giếng blind với reference chính xác; σ_ref ≥ 3 ms thì 40 giếng không đủ. Teapot Dome: 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). Thêm data/Teapot/ (1,7 GB) vào .gitignore."],
|
||||||
|
["2026-10-29","Viết xong mức A sớm (A1–A5, plan §12 ý 24): khung bài Pivot 1; Mệnh đề 3–6, Hệ quả 3–4, Nhận xét 1; sửa cách đọc cận 1/B(σ_post) (tie trung bình posterior gần Berkson); T4 (scripts/30) và kiểm cận post hoc (scripts/31) ở mục 6.3; T3 ở mục 6.5; F3, Volve sang Phụ lục B; related work về label noise. Bài 54 trang, build sạch. Rủi ro độ dài (D-12)."],
|
||||||
|
["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","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","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)
|
||||||
|
|
||||||
305
scripts/22_paper_figures.py
Normal file
305
scripts/22_paper_figures.py
Normal file
@@ -0,0 +1,305 @@
|
|||||||
|
"""Journal-style figures for the manuscript (paper/figures/*.pdf), drawn from the locked summaries only.
|
||||||
|
|
||||||
|
python scripts/22_paper_figures.py [--only td_drift,h1,p2_phase,h2b,p2r_grid,f3_volume]
|
||||||
|
|
||||||
|
Reads: F3 wells (TD QC), outputs/p2/h1/, outputs/p2/summary/main/cells.csv, outputs/p2r/summary/{h2b,band_rmse}.csv,
|
||||||
|
outputs/p3/volume/{metadata.json,mean.npy,sigma.npy}, outputs/f3_wells.npz (well inline/crossline).
|
||||||
|
No titles or verdicts inside the figures (captions carry them); Computer Modern text to match the manuscript;
|
||||||
|
palette of ml_porosity.eval.figstyle (validated, colour-blind safe) on a white surface.
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import argparse
|
||||||
|
import importlib.util
|
||||||
|
|
||||||
|
import matplotlib
|
||||||
|
|
||||||
|
matplotlib.use("Agg")
|
||||||
|
import matplotlib as mpl
|
||||||
|
import matplotlib.pyplot as plt
|
||||||
|
import numpy as np
|
||||||
|
import pandas as pd
|
||||||
|
from matplotlib.colors import LinearSegmentedColormap, Normalize
|
||||||
|
from matplotlib.lines import Line2D
|
||||||
|
from matplotlib.patches import Rectangle
|
||||||
|
|
||||||
|
from ml_porosity.eval import figstyle as fs
|
||||||
|
from ml_porosity.paths import REPO_ROOT, outputs_dir
|
||||||
|
|
||||||
|
FIG = REPO_ROOT / "paper" / "figures"
|
||||||
|
WIDTH = 6.3 # in; \textwidth of the manuscript (A4, 2.5 cm margins)
|
||||||
|
WHITE = "#ffffff"
|
||||||
|
SEQ_BLUE = LinearSegmentedColormap.from_list("seq_blue", ["#f0f5fc", "#86b6ef", "#2a78d6", "#104281"])
|
||||||
|
RAMP4 = ["#86b6ef", "#5598e7", "#256abf", "#104281"] # ordinal ramp for σ (as in scripts/13)
|
||||||
|
REGIMES = ["R10", "R0", "Rm5", "R0h", "R10tb"]
|
||||||
|
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):
|
||||||
|
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
|
||||||
|
|
||||||
|
|
||||||
|
def style() -> None:
|
||||||
|
fs.apply()
|
||||||
|
mpl.rcParams.update({
|
||||||
|
"figure.facecolor": WHITE, "axes.facecolor": WHITE, "savefig.facecolor": WHITE,
|
||||||
|
"font.family": "serif", "font.serif": ["cmr10"], "mathtext.fontset": "cm", "axes.unicode_minus": False,
|
||||||
|
"axes.formatter.use_mathtext": True, "font.size": 8, "axes.labelsize": 8, "xtick.labelsize": 7.5,
|
||||||
|
"ytick.labelsize": 7.5, "legend.fontsize": 7.5, "axes.titlesize": 8.5, "axes.titlelocation": "left",
|
||||||
|
"pdf.fonttype": 42, "lines.linewidth": 1.4,
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
def panel(ax, letter: str) -> None:
|
||||||
|
ax.set_title(f"({letter})", loc="left", fontsize=8.5, color=fs.INK, pad=4)
|
||||||
|
|
||||||
|
|
||||||
|
def text_on(rgba) -> str:
|
||||||
|
return fs.INK if 0.2126 * rgba[0] + 0.7152 * rgba[1] + 0.0722 * rgba[2] > 0.55 else WHITE
|
||||||
|
|
||||||
|
|
||||||
|
def save(fig, name: str) -> None:
|
||||||
|
FIG.mkdir(parents=True, exist_ok=True)
|
||||||
|
fig.savefig(FIG / f"{name}.pdf", bbox_inches="tight", pad_inches=0.02)
|
||||||
|
plt.close(fig)
|
||||||
|
print("wrote", FIG / f"{name}.pdf")
|
||||||
|
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------- Fig. TD drift (Section 3)
|
||||||
|
def td_drift() -> None:
|
||||||
|
from ml_porosity.data.las_io import F3_WELLS, load_td_source, load_well
|
||||||
|
from ml_porosity.data.tdr import TDR, legacy_sonic_tdr, misfit_at_anchors
|
||||||
|
|
||||||
|
src = [("legacy", "Integrated DT", fs.ORANGE, "o"), ("wlt", "OpendTect TD model", fs.BLUE, "s"),
|
||||||
|
("dt_model", "DT model", fs.AQUA, "^")]
|
||||||
|
fig, axes = plt.subplots(1, len(F3_WELLS), figsize=(WIDTH, 2.9), sharey=True, sharex=True)
|
||||||
|
for ax, name in zip(axes, F3_WELLS):
|
||||||
|
w = load_well(name)
|
||||||
|
cs = w.checkshot
|
||||||
|
tdrs = {"legacy": legacy_sonic_tdr(w.md, w.curve("DT")),
|
||||||
|
"wlt": TDR.from_pairs(load_td_source(name, "wlt"), drop_flat=True),
|
||||||
|
"dt_model": TDR.from_pairs(load_td_source(name, "dt_model"))}
|
||||||
|
ax.axhspan(600, 1100, color=fs.GRID, alpha=0.55, lw=0, zorder=0)
|
||||||
|
ax.axvline(0, color=fs.AXIS, lw=0.8, zorder=1)
|
||||||
|
for key, lab, col, mk in src:
|
||||||
|
ax.plot(misfit_at_anchors(tdrs[key], cs.md, cs.twt_ms), cs.twt_ms, marker=mk, ms=3, lw=1.1, color=col,
|
||||||
|
label=lab, zorder=3)
|
||||||
|
ax.set_title(name, loc="center", fontsize=8, color=fs.INK)
|
||||||
|
ax.set_xlabel("offset from marker (ms)")
|
||||||
|
axes[0].set_ylabel("marker TWT (ms)")
|
||||||
|
axes[0].set_ylim(1300, 400)
|
||||||
|
fig.legend(*axes[0].get_legend_handles_labels(), loc="lower center", ncol=3, bbox_to_anchor=(0.5, -0.06))
|
||||||
|
fig.tight_layout(rect=(0, 0.06, 1, 1), w_pad=0.6)
|
||||||
|
save(fig, "td_drift")
|
||||||
|
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------- Fig. H1 (Section 4)
|
||||||
|
def h1() -> None:
|
||||||
|
s11, s12, s13 = load_script("11_run_d2.py"), load_script("12_h1_blur.py"), load_script("13_summarize_p2.py")
|
||||||
|
P = s11.load_protocol(check=True)
|
||||||
|
h = s13.h1_summary(P, s12)
|
||||||
|
f, tab = h["f"], h["table"]
|
||||||
|
fig, (ax, bx) = plt.subplots(1, 2, figsize=(WIDTH, 2.6), gridspec_kw={"width_ratios": [1.55, 1]})
|
||||||
|
sig = [s for s in sorted(h["use"]) if s > 0]
|
||||||
|
for s, col in zip(sig, RAMP4):
|
||||||
|
th, H, u = np.array(h["theory"][s]), np.array(h["H"][s]), h["use"][s]
|
||||||
|
ax.plot(f, th, color=col, lw=0.9, ls="--")
|
||||||
|
ax.plot(f[u], H[u], color=col, lw=1.5, marker="o", ms=2.2)
|
||||||
|
left = s == max(sig)
|
||||||
|
i = int(u.sum()) // 2 if left else -1
|
||||||
|
ax.annotate(rf"$\sigma = {s:g}$ ms", (f[u][i], H[u][i]), xytext=(7, 4) if left else (4, 0), textcoords="offset points",
|
||||||
|
va="center", ha="left", fontsize=7, color=fs.INK2, zorder=4,
|
||||||
|
bbox=dict(fc=WHITE, ec="none", pad=0.6, alpha=0.9))
|
||||||
|
ax.axvspan(0, 6, color=fs.GRID, alpha=0.7, lw=0)
|
||||||
|
ax.set(xlim=(0, 60), ylim=(-0.1, 1.15), xlabel="frequency (Hz)", ylabel="transfer function")
|
||||||
|
ax.legend(handles=[Line2D([], [], color=fs.INK2, lw=1.5, marker="o", ms=2.2, label=r"estimated $\hat H_\sigma(f)$"),
|
||||||
|
Line2D([], [], color=fs.INK2, lw=0.9, ls="--", label=r"$e^{-2\pi^2\sigma^2 f^2}$")],
|
||||||
|
loc="upper right")
|
||||||
|
panel(ax, "a")
|
||||||
|
s = tab.index[tab.index > 0]
|
||||||
|
bx.axhspan(0.5, 2.0, color=fs.GRID, alpha=0.7, lw=0)
|
||||||
|
bx.axhline(1.0, color=fs.AXIS, lw=0.9)
|
||||||
|
bx.vlines(s, tab.loc[s, "r_lo"], tab.loc[s, "r_hi"], color=fs.BLUE, lw=1.4)
|
||||||
|
bx.plot(s, tab.loc[s, "r"], "o", color=fs.BLUE, ms=4.5)
|
||||||
|
for x, r, n in zip(s, tab.loc[s, "r"], tab.loc[s, "n_freq"]):
|
||||||
|
bx.annotate(f"{r:.3f}\n({n} freq.)", (x, r), xytext=(0, 7), textcoords="offset points", ha="center",
|
||||||
|
va="bottom", fontsize=6.5, color=fs.INK2)
|
||||||
|
bx.set_xscale("log", base=2)
|
||||||
|
bx.set_yscale("log", base=2)
|
||||||
|
bx.set_xticks(list(s), [f"{x:g}" for x in s])
|
||||||
|
bx.set_yticks([0.5, 1, 2], ["0.5", "1", "2"])
|
||||||
|
bx.minorticks_off()
|
||||||
|
bx.set(xlim=(3, 45), ylim=(0.4, 2.5), xlabel=r"$\sigma$ (ms)", ylabel=r"$r(\sigma)$")
|
||||||
|
panel(bx, "b")
|
||||||
|
fig.tight_layout(w_pad=1.5)
|
||||||
|
save(fig, "p2_h1")
|
||||||
|
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------- Fig. Experiment 1 (Section 6.1)
|
||||||
|
def p2_phase() -> None:
|
||||||
|
cells = pd.read_csv(outputs_dir() / "p2" / "summary" / "main" / "cells.csv")
|
||||||
|
cs, Ns = sorted(cells.c.unique()), sorted(cells.n_train.unique())
|
||||||
|
ix = cells.set_index(["c", "n_train"])
|
||||||
|
fig, axes = plt.subplots(1, 2, figsize=(WIDTH, 0.75 + 0.62 * len(cs)), layout="constrained")
|
||||||
|
panels = [("ratio", fs.diverging_norm(0.8, 1.0, 1.2), fs.DIVERGING, "{:.3f}", "{:.2f}", [0.90, 1.0], "band RMSE ratio"),
|
||||||
|
("dpcc", fs.diverging_norm(-0.1, 0.0, 0.1), fs.DIVERGING.reversed(), "{:+.3f}", "{:+.2f}", [0.0, 0.05],
|
||||||
|
"band PCC difference")]
|
||||||
|
for ax, (k, norm, cmap, fmt, fci, ticks, clabel), letter in zip(axes, panels, "ab"):
|
||||||
|
Z = ix[k].unstack("n_train").reindex(index=cs, columns=Ns).to_numpy()
|
||||||
|
im = ax.imshow(Z, cmap=cmap, norm=norm, origin="lower", aspect="auto")
|
||||||
|
for i, c in enumerate(cs):
|
||||||
|
for j, N in enumerate(Ns):
|
||||||
|
r = ix.loc[(c, N)]
|
||||||
|
col = text_on(cmap(norm(r[k])))
|
||||||
|
ax.text(j, i + 0.2, fmt.format(r[k]), ha="center", va="center", fontsize=7.5, color=col)
|
||||||
|
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)
|
||||||
|
if k == "ratio":
|
||||||
|
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)
|
||||||
|
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(xlabel=r"training wells $N$", ylabel=r"drift factor $c$")
|
||||||
|
ax.grid(False)
|
||||||
|
for sp in ax.spines.values():
|
||||||
|
sp.set_visible(False)
|
||||||
|
ax.tick_params(length=0)
|
||||||
|
if 1.0 in cs:
|
||||||
|
ax.add_patch(Rectangle((-0.5, cs.index(1.0) - 0.5), len(Ns), 1, fill=False, ec=fs.INK, lw=1.2))
|
||||||
|
cb = fig.colorbar(im, ax=ax, shrink=0.9, extend="both", pad=0.02)
|
||||||
|
for t in ticks:
|
||||||
|
cb.ax.axhline(t, color=fs.INK, lw=0.9)
|
||||||
|
cb.set_label(clabel, color=fs.INK2)
|
||||||
|
cb.outline.set_visible(False)
|
||||||
|
panel(ax, letter)
|
||||||
|
save(fig, "p2_phase")
|
||||||
|
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------- Fig. H2b (Section 6.3)
|
||||||
|
def h2b() -> None:
|
||||||
|
d = pd.read_csv(outputs_dir() / "p2r" / "summary" / "h2b.csv")
|
||||||
|
shapes = {0.0: "o", 1.0: "s", 2.0: "^"}
|
||||||
|
cols = {16: fs.BLUE, 4: fs.ORANGE}
|
||||||
|
fig, (ax, bx) = plt.subplots(1, 2, figsize=(WIDTH, 2.8))
|
||||||
|
for (N, c), g in d.groupby(["n_train", "c"]):
|
||||||
|
kw = dict(marker=shapes[c], s=26, zorder=3)
|
||||||
|
kw |= dict(color=cols[N], lw=0) if N == 16 else dict(facecolor="none", edgecolor=cols[N], lw=1.0)
|
||||||
|
ax.errorbar(g.sigma_post_ms, g.ratio, yerr=[g.ratio - g.ratio_lo, g.ratio_hi - g.ratio], fmt="none",
|
||||||
|
ecolor=cols[N], elinewidth=0.7, alpha=0.6, zorder=2)
|
||||||
|
ax.scatter(g.sigma_post_ms, g.ratio, **kw)
|
||||||
|
bx.scatter(g["bound_1/B"], g.ratio, **kw)
|
||||||
|
ax.axvline(1.5, color=fs.INK2, lw=0.8, ls="--")
|
||||||
|
ax.text(1.55, 0.62, "1.5 ms", fontsize=7, color=fs.INK2)
|
||||||
|
ax.axhline(1.0, color=fs.AXIS, lw=0.9)
|
||||||
|
ax.set_xscale("log")
|
||||||
|
ax.set_xticks([0.3, 0.5, 1, 2, 5, 10], ["0.3", "0.5", "1", "2", "5", "10"])
|
||||||
|
ax.minorticks_off()
|
||||||
|
ax.set(xlabel=r"posterior width $\sigma_{\mathrm{post}}$ (ms)", ylabel="band RMSE ratio, SMC bank / SMC mean",
|
||||||
|
ylim=(0.6, 1.05))
|
||||||
|
panel(ax, "a")
|
||||||
|
lo, hi = 0.6, 1.05
|
||||||
|
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.set(xlim=(lo, hi), ylim=(lo, hi), aspect="equal", xlabel=r"classical bound $\rho^\star_{\mathrm{cl}}(\sigma_{\mathrm{post}})$",
|
||||||
|
ylabel="band RMSE ratio, SMC bank / SMC mean")
|
||||||
|
panel(bx, "b")
|
||||||
|
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$")]
|
||||||
|
handles += [Line2D([], [], ls="", marker=m, color=fs.INK2, mfc="none", label=rf"$c = {c:g}$")
|
||||||
|
for c, m in shapes.items()]
|
||||||
|
fig.legend(handles=handles, loc="lower center", ncol=5, bbox_to_anchor=(0.5, -0.04))
|
||||||
|
fig.tight_layout(rect=(0, 0.06, 1, 1), w_pad=2.0)
|
||||||
|
save(fig, "p2r_h2b")
|
||||||
|
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------- Fig. Experiment 2 overview (Section 6.3)
|
||||||
|
def p2r_grid() -> None:
|
||||||
|
d = pd.read_csv(outputs_dir() / "p2r" / "summary" / "band_rmse.csv")
|
||||||
|
d = d[d.setting.isin(REGIMES)]
|
||||||
|
cs = sorted(d.c.unique())
|
||||||
|
cols = [(r, c) for r in REGIMES for c in cs]
|
||||||
|
vals = []
|
||||||
|
for N in (4, 16):
|
||||||
|
t = d[d.n_train == N].set_index(["setting", "c"])
|
||||||
|
vals.append(np.array([[t.loc[(r, c), m] / t.loc[(r, c), "Oracle"] for r, c in cols] for m, _ in METHODS]))
|
||||||
|
norm = Normalize(1.0, 2.0) # R10tb at c = 2 reaches 3.2; clipped so that 1.0-1.6 stays readable
|
||||||
|
fig, axes = plt.subplots(2, 1, figsize=(WIDTH, 4.3), layout="constrained")
|
||||||
|
for ax, V, N, letter in zip(axes, vals, (4, 16), "ab"):
|
||||||
|
im = ax.imshow(V, cmap=SEQ_BLUE, norm=norm, aspect="auto")
|
||||||
|
for i in range(V.shape[0]):
|
||||||
|
for j in range(V.shape[1]):
|
||||||
|
ax.text(j, i, f"{V[i, j]:.2f}", ha="center", va="center", fontsize=6,
|
||||||
|
color=text_on(SEQ_BLUE(norm(V[i, j]))))
|
||||||
|
ax.set_yticks(range(len(METHODS)), [lab for _, lab in METHODS])
|
||||||
|
ax.set_xticks(range(len(cols)), [f"{c:g}" for _, c in cols])
|
||||||
|
sec = ax.secondary_xaxis("top")
|
||||||
|
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.spines["top"].set_visible(False)
|
||||||
|
for k in range(1, len(REGIMES)):
|
||||||
|
ax.axvline(len(cs) * k - 0.5, color=WHITE, lw=2.5)
|
||||||
|
ax.grid(False)
|
||||||
|
for sp in ax.spines.values():
|
||||||
|
sp.set_visible(False)
|
||||||
|
ax.tick_params(length=0)
|
||||||
|
ax.set_xlabel(r"drift factor $c$")
|
||||||
|
ax.set_title(f"({letter}) $N = {N}$", loc="left", fontsize=8.5, color=fs.INK, pad=14)
|
||||||
|
cb = fig.colorbar(im, ax=axes, shrink=0.8, pad=0.01, extend="max")
|
||||||
|
cb.set_label("band RMSE / Oracle", color=fs.INK2)
|
||||||
|
cb.outline.set_visible(False)
|
||||||
|
save(fig, "p2r_grid")
|
||||||
|
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------- Fig. F3 volume (Section 6.4)
|
||||||
|
def f3_volume(well: str = "F03-4") -> None:
|
||||||
|
import json
|
||||||
|
|
||||||
|
root = outputs_dir() / "p3" / "volume"
|
||||||
|
meta = json.loads((root / "metadata.json").read_text(encoding="utf-8"))
|
||||||
|
il, xl, t = (np.asarray(meta[k], float) for k in ("ilines", "xlines", "times_ms"))
|
||||||
|
with np.load(outputs_dir() / "f3_wells.npz") as z:
|
||||||
|
w_il, w_xl = int(z[f"{well}/il"]), int(z[f"{well}/xl"])
|
||||||
|
i = int(np.flatnonzero(il == w_il)[0])
|
||||||
|
fields = [100 * np.asarray(np.load(root / f"{k}.npy", mmap_mode="r")[i]) for k in ("mean", "sigma")] # (xline, t), p.u.
|
||||||
|
dt = t[1] - t[0]
|
||||||
|
extent = [xl[0] - 0.5, xl[-1] + 0.5, t[-1] + dt / 2, t[0] - dt / 2]
|
||||||
|
fig, axes = plt.subplots(1, 2, figsize=(WIDTH, 2.5), sharey=True, layout="constrained")
|
||||||
|
specs = [("viridis", np.nanpercentile(fields[0], [1, 99]), "both", "mean (p.u.)"),
|
||||||
|
(SEQ_BLUE, (0.0, np.nanpercentile(fields[1], 99)), "max", "standard deviation (p.u.)")]
|
||||||
|
for ax, v, (cmap, (lo, hi), ext, lab), letter in zip(axes, fields, specs, "ab"):
|
||||||
|
cm = (mpl.colormaps[cmap] if isinstance(cmap, str) else cmap).with_extremes(bad=WHITE)
|
||||||
|
im = ax.imshow(v.T, cmap=cm, vmin=lo, vmax=hi, aspect="auto", interpolation="nearest", extent=extent)
|
||||||
|
ax.axvline(w_xl, color=fs.INK, lw=0.8, ls=(0, (4, 2)))
|
||||||
|
ax.text(w_xl, t[0] - dt, well, ha="center", va="bottom", fontsize=7, color=fs.INK)
|
||||||
|
ax.grid(False)
|
||||||
|
ax.set_xlabel(f"crossline (inline {w_il})")
|
||||||
|
panel(ax, letter)
|
||||||
|
cb = fig.colorbar(im, ax=ax, pad=0.01, extend=ext)
|
||||||
|
cb.set_label(lab, color=fs.INK2)
|
||||||
|
cb.outline.set_visible(False)
|
||||||
|
axes[0].set_ylabel("TWT (ms)")
|
||||||
|
save(fig, "f3_volume")
|
||||||
|
|
||||||
|
|
||||||
|
FIGURES = {"td_drift": td_drift, "h1": h1, "p2_phase": p2_phase, "h2b": h2b, "p2r_grid": p2r_grid,
|
||||||
|
"f3_volume": f3_volume}
|
||||||
|
|
||||||
|
|
||||||
|
def main() -> None:
|
||||||
|
ap = argparse.ArgumentParser()
|
||||||
|
ap.add_argument("--only", default="", help="comma-separated subset of " + ",".join(FIGURES))
|
||||||
|
args = ap.parse_args()
|
||||||
|
style()
|
||||||
|
for k in (args.only.split(",") if args.only else FIGURES):
|
||||||
|
FIGURES[k]()
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
282
scripts/23_build_volve_wells.py
Normal file
282
scripts/23_build_volve_wells.py
Normal file
@@ -0,0 +1,282 @@
|
|||||||
|
"""Build the P4 Volve well dataset (6 deviated wells) in the seismic time domain.
|
||||||
|
|
||||||
|
python scripts/23_build_volve_wells.py [--config configs/d3_volve.yaml]
|
||||||
|
|
||||||
|
Outputs (outputs/volve/):
|
||||||
|
volve_wells.npz flat keys "<well>/<item>", no allow_pickle needed. Time series lie on `ext_window_ms`;
|
||||||
|
`main_mask` marks the main window.
|
||||||
|
Public for a held-out well (built without its logs or picks):
|
||||||
|
times_ms, main_mask, kb_msl, survey/{md,inc,azi,tvd,x,y}
|
||||||
|
blind/<key>/{seismic_patch,md,il,xl,beyond}
|
||||||
|
input along the well path placed in time by the mean TVDSS–TWT relation of the calibrated
|
||||||
|
TDRs of the wells in <key> (`blind_key`), for every non-empty set of other wells
|
||||||
|
Private (the well's own logs and picks):
|
||||||
|
il, xl, x, y nearest bin and position at the middle of the label interval (display only)
|
||||||
|
log/md, log/<curve> depth-domain logs over the valid DT range (DT µs/m, RHOB kg/m³)
|
||||||
|
anchors_{md,tvd,twt_ms,surface,in_dt}
|
||||||
|
tdr/<name>/{md,twt_ms}, support/<name> TDR and the MD range [lo, hi] over which it places logs
|
||||||
|
<name>/<curve> log in time under TDR <name>, NaN outside its support
|
||||||
|
reference/{seismic_patch,md,tvd,il,xl,beyond}
|
||||||
|
input along the path placed by the calibrated TDR: training wells, and the
|
||||||
|
calibration-assisted setting of plan §5.2 for a test well
|
||||||
|
volve_wells_summary.json configuration and per-well QC. No statistic of the label values is computed.
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import argparse
|
||||||
|
import itertools
|
||||||
|
import json
|
||||||
|
|
||||||
|
import numpy as np
|
||||||
|
import yaml
|
||||||
|
|
||||||
|
from ml_porosity.data.deviated import (anchor_tdr, calibrated_vertical_tdr, composite_patch, path_at_times,
|
||||||
|
tdr_from_tvdss, tvdss_td_model, vertical_sonic_tdr)
|
||||||
|
from ml_porosity.data.resample import log_to_time
|
||||||
|
from ml_porosity.data.seismic_io import SeismicCube
|
||||||
|
from ml_porosity.data.tdr import TDR, calibrate_to_anchors, sonic_tdr
|
||||||
|
from ml_porosity.data.volve_io import read_checkshot, read_horizon, read_well_picks
|
||||||
|
from ml_porosity.data.volve_wells import VolveWell, blind_key, blind_training_wells, load_volve_well
|
||||||
|
from ml_porosity.paths import REPO_ROOT, outputs_dir, volve_root
|
||||||
|
|
||||||
|
|
||||||
|
def r_(v, nd: int = 2):
|
||||||
|
"""Rounded float or list of floats for the JSON summary."""
|
||||||
|
a = np.round(np.asarray(v, dtype=float), nd)
|
||||||
|
return a.tolist() if a.ndim else float(a)
|
||||||
|
|
||||||
|
|
||||||
|
def rel_rms(a: np.ndarray, b: np.ndarray) -> float:
|
||||||
|
"""RMS(a − b) / RMS(b)."""
|
||||||
|
return float(np.sqrt(np.mean((a - b) ** 2) / np.mean(b ** 2)))
|
||||||
|
|
||||||
|
|
||||||
|
def build_tdrs(w: VolveWell, cfg: dict) -> tuple[dict[str, TDR], dict[str, tuple[float, float]]]:
|
||||||
|
"""TDRs of `w` and the MD range over which each places logs (no extrapolation of a TDR carries a log)."""
|
||||||
|
p4 = cfg["p4"]
|
||||||
|
lo, hi = w.valid_range("DT")
|
||||||
|
seg = w.logs.loc[lo:hi]
|
||||||
|
md, dt = seg.index.to_numpy(), seg["DT"].to_numpy()
|
||||||
|
za, ta = w.anchors.md.to_numpy(), w.anchors.twt_ms.to_numpy()
|
||||||
|
k = np.flatnonzero((za >= lo) & (za <= hi))[0]
|
||||||
|
tdrs, support = {}, {}
|
||||||
|
for name in p4["tdrs"]:
|
||||||
|
if name == "calibrated":
|
||||||
|
tdrs[name], support[name] = calibrated_vertical_tdr(w.traj, md, dt, za, ta, p4["edge_m"]), (lo, hi)
|
||||||
|
elif name == "sonic":
|
||||||
|
tdrs[name], support[name] = vertical_sonic_tdr(md, w.traj.at(md)[0], dt, za[k], ta[k]), (lo, hi)
|
||||||
|
elif name == "anchors":
|
||||||
|
tdrs[name], support[name] = anchor_tdr(w.traj, za, ta), (za[0], za[-1])
|
||||||
|
else:
|
||||||
|
raise ValueError(f"unsupported TDR: {name}")
|
||||||
|
for kind in p4["wells"][w.name].get("checkshots", []):
|
||||||
|
cs = read_checkshot(volve_root() / cfg["well_logs_dir"] / cfg["checkshots"][w.pick_name][kind])
|
||||||
|
tdrs[kind] = TDR.from_pairs(cs[["md", "twt_ms"]].to_numpy(), kind, drop_flat=True)
|
||||||
|
support[kind] = (float(cs.md.min()), float(cs.md.max()))
|
||||||
|
return tdrs, support
|
||||||
|
|
||||||
|
|
||||||
|
def survey_qc(w: VolveWell, picks, support: tuple[float, float]) -> dict:
|
||||||
|
tr, head = w.traj, w.header
|
||||||
|
r = tr.recompute()
|
||||||
|
s = np.linspace(*support, 200)
|
||||||
|
inc = np.interp(s, tr.md, tr.inc)
|
||||||
|
p = picks[(picks.well == w.pick_name) & picks.md.between(tr.md[0], tr.md[-1]) & picks.x.notna()]
|
||||||
|
tvd, x, y = tr.at(p.md)
|
||||||
|
return {"stations": len(tr.md), "md": r_([tr.md[0], tr.md[-1]]), "bh_tvd": r_(tr.tvd[-1]),
|
||||||
|
"header_bh_md_tvd": [head.get("Bottom Hole MD"), head.get("Bottom Hole TVD")],
|
||||||
|
"drilled_from": head.get("Drilled From"), "kick_off": head.get("Kick Off Depth"),
|
||||||
|
"recompute_max_dtvd_m": r_(np.abs(r[:, 2] - tr.tvd).max(), 3),
|
||||||
|
"recompute_max_dxy_m": r_(np.hypot(r[:, 0] - tr.x, r[:, 1] - tr.y).max(), 3),
|
||||||
|
"min_tvd_step_m": r_(np.diff(tr.tvd).min(), 3), "max_inc_deg": r_(tr.inc.max(), 1),
|
||||||
|
"inc_over_label_deg": r_([inc.min(), inc.max()], 1), "max_dls_deg_30m": r_(tr.dls().max()),
|
||||||
|
"picks_vs_survey": {"n": len(p), "max_dtvd_m": r_(np.abs(p.tvd - tvd).max(), 3),
|
||||||
|
"max_dxy_m": r_(np.hypot(p.x - x, p.y - y).max(), 3)}}
|
||||||
|
|
||||||
|
|
||||||
|
def anchor_qc(w: VolveWell, tdrs: dict[str, TDR], support: tuple[float, float]) -> dict:
|
||||||
|
"""Drift and stretch of the vertical sonic at the anchors, against the MD-integrated sonic of the F3 code."""
|
||||||
|
lo, hi = w.valid_range("DT")
|
||||||
|
seg = w.logs.loc[lo:hi]
|
||||||
|
A = w.anchors
|
||||||
|
za, ta = A.md.to_numpy(), A.twt_ms.to_numpy()
|
||||||
|
inside = (za >= lo) & (za <= hi)
|
||||||
|
zi, ti = za[inside], ta[inside]
|
||||||
|
cal, son = tdrs["calibrated"], tdrs["sonic"]
|
||||||
|
md_son = sonic_tdr(seg.index.to_numpy(), seg["DT"].to_numpy(), zi[0], ti[0])
|
||||||
|
md_cal = calibrate_to_anchors(md_son, zi, ti)
|
||||||
|
s = seg.index.to_numpy()[(seg.index >= support[0]) & (seg.index <= support[1])]
|
||||||
|
tvd_a = w.traj.at(za)[0]
|
||||||
|
fp = w.excluded[w.excluded.qlf.eq("FP") & w.excluded.md.between(lo, hi)]
|
||||||
|
return {"kept": [{"surface": r.surface, "qlf": r.qlf, "md": r.md, "twt_ms": r.twt_ms, "in_dt": bool(i)}
|
||||||
|
for r, i in zip(A.itertuples(), inside)],
|
||||||
|
"excluded": [{"surface": r.surface, "qlf": r.qlf, "md": r.md, "twt_ms": r.twt_ms, "reason": r.reason}
|
||||||
|
for r in w.excluded.itertuples()],
|
||||||
|
"calibrated_max_abs_misfit_ms": r_(np.abs(cal.time_at(za) - ta).max(), 4),
|
||||||
|
"sonic_drift_ms": r_(son.time_at(zi) - ti),
|
||||||
|
"stretch_vertical": r_(np.diff(ti) / np.diff(son.time_at(zi)), 3),
|
||||||
|
"stretch_md_sonic": r_(np.diff(ti) / np.diff(md_son.time_at(zi)), 3),
|
||||||
|
"vint_between_anchors_m_s": r_(2000.0 * np.diff(tvd_a) / np.diff(ta), 0),
|
||||||
|
"fp_misfit_ms": {r.surface: r_(cal.time_at(r.md) - r.twt_ms) for r in fp.itertuples()},
|
||||||
|
"md_minus_vertical_calibrated_ms": r_([np.min(md_cal.time_at(s) - cal.time_at(s)),
|
||||||
|
np.max(md_cal.time_at(s) - cal.time_at(s))]),
|
||||||
|
"label_below_last_anchor_m": r_(max(support[1] - za[-1], 0.0), 1),
|
||||||
|
"anchors_above_dt": A.surface[za < lo].tolist()}
|
||||||
|
|
||||||
|
|
||||||
|
def checkshot_qc(w: VolveWell, cfg: dict, cal: TDR, support: tuple[float, float]) -> dict:
|
||||||
|
out = {}
|
||||||
|
for kind, rel in cfg["checkshots"].get(w.pick_name, {}).items():
|
||||||
|
cs = read_checkshot(volve_root() / cfg["well_logs_dir"] / rel)
|
||||||
|
cs = cs[cs.md.between(w.traj.md[0], w.traj.md[-1])]
|
||||||
|
d = cal.time_at(cs.md) - cs.twt_ms.to_numpy()
|
||||||
|
lab = cs.md.between(*support).to_numpy()
|
||||||
|
upper = cs.twt_ms.between(2000, 2300).to_numpy()
|
||||||
|
za, ta = w.anchors.md.to_numpy(), w.anchors.twt_ms.to_numpy()
|
||||||
|
ok = (za >= cs.md.min()) & (za <= cs.md.max())
|
||||||
|
out[kind] = {"n": len(cs), "md": r_([cs.md.min(), cs.md.max()]),
|
||||||
|
"max_tvdss_vs_survey_m": r_(np.abs(cs.tvdss - w.traj.tvdss(cs.md)).max()),
|
||||||
|
"calibrated_minus_cs_label_ms": r_([d[lab].min(), d[lab].max()]) if lab.any() else None,
|
||||||
|
"calibrated_minus_cs_2000_2300ms": r_([d[upper].min(), d[upper].max()]) if upper.any() else None,
|
||||||
|
"picks_minus_cs_ms": r_(ta[ok] - np.interp(za[ok], cs.md, cs.twt_ms))}
|
||||||
|
return out
|
||||||
|
|
||||||
|
|
||||||
|
def path_qc(path: dict, il: np.ndarray, xl: np.ndarray, sel: np.ndarray, dt: float) -> dict:
|
||||||
|
"""Lateral extent and drift rate of the path over the samples `sel` (steps across gaps in `sel` excluded)."""
|
||||||
|
step = np.hypot(np.diff(il), np.diff(xl))[sel[:-1] & sel[1:]]
|
||||||
|
return {"extent_bins": r_(np.hypot(np.ptp(il[sel]), np.ptp(xl[sel]))),
|
||||||
|
"max_bins_per_10ms": r_(step.max() * 10.0 / dt, 3) if step.size else 0.0,
|
||||||
|
"beyond_td_frac": r_(path["beyond"][sel].mean(), 3)}
|
||||||
|
|
||||||
|
|
||||||
|
def main() -> None:
|
||||||
|
ap = argparse.ArgumentParser()
|
||||||
|
ap.add_argument("--config", default=str(REPO_ROOT / "configs" / "d3_volve.yaml"))
|
||||||
|
cfg = yaml.safe_load(open(ap.parse_args().config))
|
||||||
|
p4, root = cfg["p4"], volve_root()
|
||||||
|
names, label, rad = list(p4["wells"]), p4["label"], p4["patch_radius"]
|
||||||
|
centre = (2 * rad + 1) ** 2 // 2
|
||||||
|
picks = read_well_picks(root / cfg["picks"])
|
||||||
|
geom = read_horizon(root / cfg["horizons_twt"] / cfg["grid_horizon"]).geometry()
|
||||||
|
wells = {n: load_volve_well(n, cfg, picks) for n in names}
|
||||||
|
built = {n: build_tdrs(w, cfg) for n, w in wells.items()}
|
||||||
|
cal = {n: built[n][0]["calibrated"] for n in names}
|
||||||
|
z = np.arange(np.floor(min(w.traj.tvdss(w.traj.md[0]) for w in wells.values())),
|
||||||
|
np.ceil(max(w.traj.tvdss(w.traj.md[-1]) for w in wells.values())) + 1.0)
|
||||||
|
arrays: dict[str, np.ndarray] = {}
|
||||||
|
summary = {"config": {k: cfg[k] for k in ("cube", "picks", "grid_horizon", "anchor_exclude_surfaces")} | {"p4": p4},
|
||||||
|
"grid": {"x_coef": geom.x_coef, "y_coef": geom.y_coef, "bin_m": geom.bin_spacing()}, "wells": {}}
|
||||||
|
cache: dict = {}
|
||||||
|
|
||||||
|
with SeismicCube(root / cfg["cube"]) as cube:
|
||||||
|
win = cube.window(*p4["ext_window_ms"])
|
||||||
|
t = cube.times_ms[win]
|
||||||
|
main = (t >= p4["main_window_ms"][0]) & (t <= p4["main_window_ms"][1])
|
||||||
|
summary["samples"] = {"ext": int(t.size), "main": int(main.sum()), "dt_ms": cube.dt_ms}
|
||||||
|
for n, w in wells.items():
|
||||||
|
tdrs, support = built[n]
|
||||||
|
lab = w.label_support(label)
|
||||||
|
tr = w.traj
|
||||||
|
_, x0, y0 = tr.at(0.5 * (lab[0] + lab[1]))
|
||||||
|
il0, xl0 = geom.nearest_bin(float(x0), float(y0))
|
||||||
|
lo, hi = w.valid_range("DT")
|
||||||
|
seg = w.logs.loc[lo:hi]
|
||||||
|
A = w.anchors
|
||||||
|
a = {"times_ms": t, "main_mask": main, "kb_msl": np.float64(tr.kb_msl),
|
||||||
|
"il": np.int32(il0), "xl": np.int32(xl0), "x": np.float64(x0), "y": np.float64(y0),
|
||||||
|
"log/md": seg.index.to_numpy(dtype=float),
|
||||||
|
"anchors_md": A.md.to_numpy(), "anchors_tvd": A.tvd.to_numpy(), "anchors_twt_ms": A.twt_ms.to_numpy(),
|
||||||
|
"anchors_surface": A.surface.to_numpy(dtype=str), "anchors_in_dt": A.md.between(lo, hi).to_numpy()}
|
||||||
|
a |= {f"survey/{k}": getattr(tr, k) for k in ("md", "inc", "azi", "tvd", "x", "y")}
|
||||||
|
a |= {f"log/{c}": seg[c].to_numpy(dtype=float) for c in p4["curves"]}
|
||||||
|
labels = {}
|
||||||
|
for name, tdr in tdrs.items():
|
||||||
|
a[f"tdr/{name}/md"], a[f"tdr/{name}/twt_ms"] = tdr.md, tdr.twt_ms
|
||||||
|
a[f"support/{name}"] = np.asarray(support[name], dtype=float)
|
||||||
|
part = w.logs.loc[support[name][0]:support[name][1]]
|
||||||
|
for c in p4["curves"]:
|
||||||
|
a[f"{name}/{c}"] = log_to_time(part.index.to_numpy(), part[c].to_numpy(), tdr, t, **p4["resample"])
|
||||||
|
ok = np.isfinite(a[f"{name}/{label}"])
|
||||||
|
labels[name] = {"n_main": int(ok[main].sum()), "n_outside_main": int(ok[~main].sum()),
|
||||||
|
"t_ms": r_([t[ok].min(), t[ok].max()], 0) if ok.any() else None}
|
||||||
|
|
||||||
|
# input along the calibrated path (reference) and along the blind paths
|
||||||
|
ref = path_at_times(tr, cal[n], t)
|
||||||
|
il, xl = geom.xy_to_bin(ref["x"], ref["y"])
|
||||||
|
patch = composite_patch(cube, il, xl, t, rad, p4["patch_method"], cache)
|
||||||
|
a |= {"reference/seismic_patch": patch, "reference/md": ref["md"], "reference/tvd": ref["tvd"],
|
||||||
|
"reference/il": il, "reference/xl": xl, "reference/beyond": ref["beyond"]}
|
||||||
|
nearest = composite_patch(cube, il, xl, t, rad, "nearest", cache)
|
||||||
|
vertical = cube.patch(il0, xl0, rad)[:, win]
|
||||||
|
sel_lab = np.isfinite(a[f"calibrated/{label}"])
|
||||||
|
others = [v for v in names if v != n]
|
||||||
|
for k in range(1, len(others) + 1):
|
||||||
|
for S in itertools.combinations(others, k):
|
||||||
|
tb = tdr_from_tvdss(tr, z, tvdss_td_model([wells[v].traj for v in S], [cal[v] for v in S], z))
|
||||||
|
pb = path_at_times(tr, tb, t)
|
||||||
|
ib, jb = geom.xy_to_bin(pb["x"], pb["y"])
|
||||||
|
key = f"blind/{blind_key(S)}"
|
||||||
|
a |= {f"{key}/seismic_patch": composite_patch(cube, ib, jb, t, rad, p4["patch_method"], cache),
|
||||||
|
f"{key}/md": pb["md"], f"{key}/il": ib, f"{key}/xl": jb, f"{key}/beyond": pb["beyond"]}
|
||||||
|
blind = {}
|
||||||
|
za, ta = A.md.to_numpy(), A.twt_ms.to_numpy()
|
||||||
|
s = seg.index.to_numpy()[(seg.index >= lab[0]) & (seg.index <= lab[1])]
|
||||||
|
for scheme in p4["blind_schemes"]:
|
||||||
|
S = blind_training_wells(n, scheme, p4)
|
||||||
|
key = f"blind/{blind_key(S)}"
|
||||||
|
tb = tdr_from_tvdss(tr, z, tvdss_td_model([wells[v].traj for v in S], [cal[v] for v in S], z))
|
||||||
|
pb = path_at_times(tr, tb, t)
|
||||||
|
off = np.hypot(pb["x"] - ref["x"], pb["y"] - ref["y"])[sel_lab]
|
||||||
|
blind[scheme] = {"training_wells": list(S),
|
||||||
|
"td_misfit_at_anchors_ms": r_([np.mean(tb.time_at(za) - ta),
|
||||||
|
np.abs(tb.time_at(za) - ta).max()]),
|
||||||
|
"minus_calibrated_over_label_ms": r_([np.min(tb.time_at(s) - cal[n].time_at(s)),
|
||||||
|
np.max(tb.time_at(s) - cal[n].time_at(s))]),
|
||||||
|
"max_offset_from_reference_m": r_(off.max(), 1),
|
||||||
|
"rel_rms_vs_reference_main": r_(rel_rms(a[f"{key}/seismic_patch"][centre][main],
|
||||||
|
patch[centre][main]), 3)}
|
||||||
|
|
||||||
|
dt_lab = w.logs.loc[lab[0]:lab[1], "DT"]
|
||||||
|
ok_dt = dt_lab.notna().to_numpy()
|
||||||
|
# beyond this range the calibrated TDR (and so the reference path) is an extension at constant velocity
|
||||||
|
constrained = [min(lo, za[0]), max(hi, za[-1])]
|
||||||
|
info = {"survey": survey_qc(w, picks, lab),
|
||||||
|
"logs": w.qc | {"dt_md": r_([lo, hi], 1), "label_md": r_(lab, 1),
|
||||||
|
"label_twt_ms": r_(cal[n].time_at(np.asarray(lab)), 1),
|
||||||
|
"calibrated_constrained_twt_ms": r_(cal[n].time_at(np.asarray(constrained)), 1),
|
||||||
|
"dt_nan_frac_in_label": r_(1 - ok_dt.mean(), 3),
|
||||||
|
"dt_longest_gap_in_label_m": r_(np.diff(dt_lab.index.to_numpy()[ok_dt]).max(), 2)},
|
||||||
|
"anchors": anchor_qc(w, tdrs, lab),
|
||||||
|
"checkshots": checkshot_qc(w, cfg, cal[n], lab),
|
||||||
|
"label_samples": labels,
|
||||||
|
"bin": [il0, xl0], "xy": r_([x0, y0], 1),
|
||||||
|
"path": {"label": path_qc(ref, il, xl, sel_lab, cube.dt_ms),
|
||||||
|
"main": path_qc(ref, il, xl, main, cube.dt_ms),
|
||||||
|
"ext": path_qc(ref, il, xl, np.ones_like(main), cube.dt_ms)},
|
||||||
|
"seismic": {"rel_rms_bilinear_vs_nearest_main": r_(rel_rms(nearest[centre][main],
|
||||||
|
patch[centre][main]), 3),
|
||||||
|
"rel_rms_vertical_vs_composite_main": r_(rel_rms(vertical[centre][main],
|
||||||
|
patch[centre][main]), 3),
|
||||||
|
"rel_rms_vertical_vs_composite_label": r_(rel_rms(vertical[centre][sel_lab],
|
||||||
|
patch[centre][sel_lab]), 3)},
|
||||||
|
"blind": blind}
|
||||||
|
summary["wells"][n] = info
|
||||||
|
arrays |= {f"{n}/{k}": v for k, v in a.items()}
|
||||||
|
q = info["anchors"]
|
||||||
|
print(f"{n}: {len(A)} anchors ({sum(r['in_dt'] for r in q['kept'])} in DT), label {lab[0]:.1f}–{lab[1]:.1f} m"
|
||||||
|
f" = {labels['calibrated']['n_main']} samples, {q['label_below_last_anchor_m']:.0f} m below last"
|
||||||
|
f" anchor; path {info['path']['label']['extent_bins']:.1f} bins over the label;"
|
||||||
|
f" blind lowo/slot misfit {blind['lowo']['td_misfit_at_anchors_ms'][1]:.1f}/"
|
||||||
|
f"{blind['slot']['td_misfit_at_anchors_ms'][1]:.1f} ms max")
|
||||||
|
|
||||||
|
out = outputs_dir() / "volve"
|
||||||
|
out.mkdir(parents=True, exist_ok=True)
|
||||||
|
np.savez_compressed(out / "volve_wells.npz", **arrays)
|
||||||
|
(out / "volve_wells_summary.json").write_text(json.dumps(summary, indent=1, ensure_ascii=False, default=float))
|
||||||
|
print(f"-> {out / 'volve_wells.npz'} ({len(arrays)} arrays)")
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
69
scripts/24_run_volve.py
Normal file
69
scripts/24_run_volve.py
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
"""P4 Volve: lock -> register -> train -> summarize (configs/protocol_volve.yaml).
|
||||||
|
|
||||||
|
Full run on the run machine: python scripts/24_run_volve.py all --device cuda:0 --workers 4
|
||||||
|
Then the σ_a arms: python scripts/24_run_volve.py all --arms sensitivity, then summarize --arms all
|
||||||
|
Smoke (CPU, reduced settings, outputs/p4/smoke): register/train only until the protocol is locked; never a result.
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import argparse
|
||||||
|
import os
|
||||||
|
import traceback
|
||||||
|
|
||||||
|
os.environ.setdefault("OMP_NUM_THREADS", "2")
|
||||||
|
os.environ.setdefault("MKL_NUM_THREADS", "2")
|
||||||
|
os.environ.setdefault("OPENBLAS_NUM_THREADS", "2")
|
||||||
|
os.environ.setdefault("NUMBA_NUM_THREADS", "2")
|
||||||
|
os.environ.setdefault("PYTHONHASHSEED", "0")
|
||||||
|
os.environ.setdefault("PYTHONUTF8", "1")
|
||||||
|
os.environ.setdefault("CUBLAS_WORKSPACE_CONFIG", ":4096:8")
|
||||||
|
|
||||||
|
|
||||||
|
def main() -> None:
|
||||||
|
from ml_porosity.paths import outputs_dir
|
||||||
|
from ml_porosity.volve.protocol import freeze, load_protocol
|
||||||
|
from ml_porosity.volve.runner import benchmark, progress, run
|
||||||
|
|
||||||
|
ap = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)
|
||||||
|
ap.add_argument("stage", choices=["status", "benchmark", "lock", "register", "train", "summarize", "all"])
|
||||||
|
ap.add_argument("--device", default="cuda:0")
|
||||||
|
ap.add_argument("--workers", type=int, default=4)
|
||||||
|
ap.add_argument("--arms", choices=["primary", "sensitivity", "all"], default="primary")
|
||||||
|
ap.add_argument("--smoke", action="store_true")
|
||||||
|
ap.add_argument("--benchmark-steps", type=int, default=100)
|
||||||
|
args = ap.parse_args()
|
||||||
|
if args.workers < 1:
|
||||||
|
ap.error("--workers must be positive")
|
||||||
|
p = load_protocol()
|
||||||
|
root = outputs_dir() / "p4" / ("smoke" if args.smoke else "")
|
||||||
|
if os.name == "nt":
|
||||||
|
import ctypes
|
||||||
|
# Prevent automatic system sleep only while this process is alive.
|
||||||
|
ctypes.windll.kernel32.SetThreadExecutionState(0x80000001)
|
||||||
|
try:
|
||||||
|
if args.stage == "status":
|
||||||
|
path = root / "progress.json"
|
||||||
|
print(path.read_text(encoding="utf-8") if path.exists() else "P4 has not started.")
|
||||||
|
elif args.stage == "benchmark":
|
||||||
|
print(benchmark(p, args.device, args.benchmark_steps))
|
||||||
|
elif args.stage == "lock":
|
||||||
|
print(freeze())
|
||||||
|
else:
|
||||||
|
stages = ["register", "train", "summarize"] if args.stage == "all" else [args.stage]
|
||||||
|
if args.smoke and args.stage == "all":
|
||||||
|
stages = ["register", "train"] # summarize needs the lock, see runner.run
|
||||||
|
for stage in stages:
|
||||||
|
run(stage, p, args.device, args.workers, args.smoke, args.arms)
|
||||||
|
except Exception as exc:
|
||||||
|
if args.stage not in ("status", "lock", "benchmark"):
|
||||||
|
progress(root, status=f"error in {args.stage}; completed jobs can resume", error=str(exc))
|
||||||
|
traceback.print_exc()
|
||||||
|
raise SystemExit(1)
|
||||||
|
finally:
|
||||||
|
if os.name == "nt":
|
||||||
|
ctypes.windll.kernel32.SetThreadExecutionState(0x80000000)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user