Session 25 · Mon Nov 30 · Book section 4.7 (game, §4–7)
🎲
Five training runs on five geoscience systems each hide one error. From the evidence alone, can your team name the error, fix it, and say which number shows that the fix worked?
| 1 | local earthquakes at one seismic station |
| 2 | igneous rocks of a continental arc |
| 3 | a volcano during a seismic swarm |
| 4 | a GNSS station moving with its plate |
| 5 | igneous rocks along a differentiation trend |
Review of Chapter 4 · game: 4.7 (game) What went wrong? · then 4.7 §4–7 · Ch 5 flipped reading assigned today (quiz closes Thu Dec 3)
Each layer assumes how its inputs are related. Choose the one whose assumption holds for your data.
Start from one data sample and ask what it is. The answer chooses the network and the baseline it must beat.
| Data (notebook) | Network | Baseline | Verdict |
|---|---|---|---|
| PNW features (4.1) | 89.2% | forest 88.5% | tie |
| P395 summaries (4.2) | 0.70 mm | linear 0.63 | linear |
| waveforms (4.3) | SNR 1.4 | STA/LTA ≈ 9 | network |
| warming maps (4.3) | 0.008 | known terms 0.009 | tie |
| GNSS series (4.4) | 1.87–1.95 mm | persistence 2.10 | network |
| shaking at stations (4.5) | 0.137 | IDW 0.182 | network |
| CO₂ (4.9) | MASE 0.327 | SARIMA 0.256 | SARIMA |
| Step | Practice | Rubric |
|---|---|---|
| Before | split, scale, baseline, ranges | A3–A7 |
| Start | seeded random weights | D1 |
| Loss | fits Y and its errors; class weights if unbalanced | D2 |
| Optimizer | Adam at 0.001; look at the curve | D5 |
| Stop | lowest validation loss; checkpoint | D4, D6 |
| Report | three seeds; test once; ties are ties | D7, D8, E3 |
| Training loss | Validation loss | Diagnosis | First fix |
|---|---|---|---|
| high, flat | high, flat | learns nothing | learning rate; check the inputs |
| jumps | jumps | learning rate too large | divide it by 3 to 10 |
| falls | falls with it | still learning | more epochs |
| falls | lowest, then rises | overfitting | checkpoint; smaller network; dropout |
| low | far above, from the start | validation unlike training | the split, the ranges (A4, A7) |
Five training runs, each with one hidden error.
| Each case: 4 minutes, teams of 3 or 4 | points |
|---|---|
| Name the cause | 1 |
| Propose a fix | 1 |
| Say which number would show that the fix worked | 1 |
Then the reveal: the cause, the fix, and the number before and after.
Notebook 4.7 (game) What went wrong?: edit c<k>_fix() and run the evaluation cell until it prints PASS. The whole notebook runs in under a minute on a laptop CPU.
| Data | 2000 records of 30 s, half earthquakes; 5 windows of 25 s each, shifted by 0.5 s |
| Split | the 10 000 windows shuffled, then 60 / 20 / 20 |
| Model | spectrum in 20 bands → 64 → 64 → 2 |
| Claim | validation 0.962, test 0.971 |
Windows of one record fell on both sides of the split. Split the records first: validation 0.779, new events 0.792.
| Data | 4,000 rocks: oxides in wt%, K in ppm, density in kg/m³, susceptibility in 10⁻⁶ SI |
| Split | random, stratified: 2,400 / 800 / 800 |
| Model | 9 → 32 → 32 → 3, SGD, learning rate 0.1, 40 epochs |
| Claim | “validation 0.556: the measurements cannot separate the rocks” |
Columns from 0.01 to 73,000 entered the network unscaled. Standardized on the training rows: test accuracy 0.985 instead of 0.557, andesite recall 0.939 instead of 0.
| Data | one volcano station, 7983 windows of 30 s (66.5 h), 183 earthquakes |
| Split | in time: 50% training, 25% validation, last 16.6 h test |
| Model | small convolutional network, fires at probability ≥ 0.5 |
| Claim | “test accuracy 0.98, ready for the observatory” |
Earthquakes are 2.3% of the windows, and calling every window noise lowers the loss most. Weighted loss, threshold 0.44 set on validation: 40 of 42 found, 18.8 false alarms per day.
| Data | daily east position of a station moving 12 mm/yr, 2015-2024 |
| Split | train 2015-21, validation Apr/Aug/Dec 2015-21, test 2022-24 |
| Model | last 30 days → 32 → 32 → tomorrow, tanh |
| Claim | validation MAE 1.34 mm, persistence 1.44 mm |
Test positions lie above every position seen in training. Forecasting the daily change: test MAE 1.31 mm (persistence 1.53, researcher 8.57), 2024/2022 ratio 1.02.
| Data | 3000 igneous rocks, 9 measurements, 3 rock types (synthetic) |
| Split | random, 2250 training / 750 validation |
| Model | 9 → 64 → 64 → 3, Adam 0.001, 30 epochs, own epoch loop |
| Claim | “validation 0.939, below logistic regression (0.951)” |
Compare it with the loop you wrote in 4.7 section 2.4: one update per batch, from the loss of that batch.
No opt.zero_grad(): each update used the sum of all gradients since the start. Fixed: validation 0.953, last training loss 0.105.
| Symptom | Cause | Check of the fix | |
|---|---|---|---|
| 1 | test 0.97, new events 0.76 | windows cut before the split | validation ≈ new events |
| 2 | every rock called granite | unscaled ppm next to wt% | test 0.985 against 0.974 (raw-column logistic); andesite recall 0.939 |
| 3 | 0 of 42 earthquakes found | rare class, unweighted loss | recall, false alarms/day |
| 4 | test error grows each year | beyond the training range | error flat 2022 to 2024 |
| 5 | loss rises after epoch 5 | no opt.zero_grad() |
the reference run’s curve |
✓ Deep ensembles: train the same network from several seeds and use the disagreement of the members as the uncertainty.
Lakshminarayanan, B., Pritzel, A., & Blundell, C. (2017). Simple and scalable predictive uncertainty estimation using deep ensembles. NeurIPS 30.
✓ Monte Carlo (MC) dropout: keep dropout on at prediction time; one trained model gives an uncertainty from repeated passes.
Gal, Y., & Ghahramani, Z. (2016). Dropout as a Bayesian approximation: Representing model uncertainty in deep learning. ICML.
✗ Deep image classifiers state confidences higher than their accuracy; the paper measures the gap on several networks.
Guo, C., Pleiss, G., Sun, Y., & Weinberger, K. Q. (2017). On calibration of modern neural networks. ICML.
📖 Ensembles, dropout and other methods compared on test data shifted away from the training data; deep ensembles did best on most shifted test sets.
Ovadia, Y., et al. (2019). Can you trust your model’s uncertainty? Evaluating predictive uncertainty under dataset shift. NeurIPS 32.
5-member ensemble: test accuracy 0.952, ECE 0.010. One MC dropout model: 0.953, ECE 0.017. In the fifth of samples with the largest spread, accuracy is about 0.8 for both.
Error rate: 0.050 in the trained range, 0.076 at 1 to 2 standard deviations, 0.085 beyond. Mean disagreement: 0.011, 0.015, 0.019.
Wed: forecasting shootout (4.9), leaderboard opens · Ch 5 quiz closes Thu Dec 3 · HW-DL due Fri Dec 4
ESS 469/569 · Machine Learning in the Geosciences · Autumn 2026