Software companion
Self-Supervised Complex-Wavelet Learning and Statistically Governed Transfer
Overview
The pretext task is masked reconstruction of packed wavelet coefficients, and the interesting engineering is in the data contract around it. Four SST products with different grids, units, conventions and error structures have to enter one pretraining loop without any of them being silently rescaled into another’s variance profile. Each store is canonicalized, regridded to the shared 24×48 grid, converted to anomalies against its own climatology, transformed into the same packed pyramid, and carries its own normalizer, validity mask, exact coefficient schema and source manifest. The multistore loader compares geometry, channel layout, normalization scope and hashes before any coefficient array is read.
Two durable products came out of this report rather than out of its headline. The first is the coefficient-energy audit that explains why reconstruction improvement fails to become forecast improvement. The second is the statistical governance the series then runs under: a paired moving-block bootstrap with a fixed block policy and a resolvability standard, so later claims of improvement have to clear a stated bar rather than a favourable read.
Implementation
- Pretext task
- Masked reconstruction of packed DTCWT coefficients, with deterministic block and whole-month temporal corruption
- Stores
- ERA5 plus the historical reconstructions ERSSTv5, HadISST1 and COBE-SST2, each with source-local per-channel normalization; the ERSSTv5 and HadISST1 stores run to 1980-12 against a 1951–1980 monthly climatology
- Boundary
- Only the 1981–2010 training slice is materialized, then split deterministically into pretext train and holdout; a timestamp audit runs immediately before coefficient arrays load and rejects any maximum after 2010-12
- Statistics
- Paired moving-block bootstrap with a fixed block policy, reported as a delta with a 90% interval
- Tests
- External-store ingestion, pretraining, coefficient-energy and statistics modules each have their own test module
Components
pretraining/masking.py- The deterministic corruption schemes: coefficient blocks and whole months
pretraining/losses.py- Hidden-only coefficient loss plus the reconstruction diagnostics
pretraining/dataset.py- The multistore pretext dataset and its materialization boundary
pretraining/loop.py- The pretext training loop and its held-out selection
pretraining/config.py- Pretext configuration, including store composition and masking policy
data/external_sst.py- The multistore ingestion contract: canonicalization, overlap policy, regridding, per-store normalization, validity masks and manifests
coefficient_energy.py- The energy audit explaining where reconstruction gains land in the pyramid and why they do not transfer
stats.py- The paired moving-block bootstrap and the resolvability standard
decision_reporting.py- Decision records tying each comparison to its bootstrap evidence
scripts/prepare_external_sst_store.py- Store construction from an external product
scripts/compare_evaluations.py- Paired comparison between two existing evaluations
scripts/audit_decision_resolvability.py- Retrospective audit of which past decisions were actually resolvable
Workflow
prepare-storeCanonicalize, regrid and transform one external product into a packed store with its own normalizer and mask.auditVerify geometry, channel layout, normalization scope and hashes across stores before training.pretrainRun masked-coefficient pretraining over the store mixture with held-out selection.transferLoad the pretext checkpoint into the 14-month forecast model, transferring shape-compatible tensors and reporting geometry differences.compareScore transfer against the unpretrained reference under the paired bootstrap.audit-energyDecompose where the reconstruction gain sits in the coefficient pyramid.
Reproducibility and validation
- The three historical reconstructions share underlying ship and buoy observations, so the repository documents them as distinct reconstruction methods rather than as independent data — the pretraining mixture adds uncertainty profiles, not proportionally more effective sample.
- A timestamp audit runs immediately before coefficient arrays are loaded and rejects any store whose maximum date crosses the declared boundary; additional pretext-only stores are permitted only outside both the validation and the test ranges and carry their own declared boundary.
- Transfer into the forecast model reports which tensors moved and which temporal-geometry buffers intentionally stayed at their own initialization, rather than loading silently.
- Comparisons are paired and bootstrapped under a fixed policy, so an improvement either resolves at the stated interval or is recorded as unresolved.
Availability
Not publicly released. The external SST products are public but individually licensed and large; the repository ships the ingestion contract and the store schema rather than the stores themselves.