Model inspection#

This gallery focuses on model-inspection helpers in GeoPrior.

Unlike the examples in figure_generation/, the pages collected here do not primarily aim to build publication-style figures. Unlike the examples in tables_and_summaries/, they are not mainly about producing reusable CSV, JSON, or geospatial artifacts.

Instead, this section teaches the compact helper functions used to inspect what happened during training, what the physics-aware signals look like, how payload values are organized, and which physical parameters the model ultimately learned.

The emphasis is therefore on inspection and interpretation, not on final reporting. These examples help answer questions such as:

  • how training evolved across epochs,

  • whether physics-related losses behaved as expected,

  • how epsilon_* diagnostics changed during optimization,

  • how coordinates and payload arrays can be inspected safely,

  • which learned physical parameters or field summaries can be extracted after training.

In other words, this gallery is about understanding what the model learned and how it behaved during training.

Module guide#

Module

Main output

Purpose

plot_history_in.py

History plots

Plot a training history robustly, with explicit or automatic metric grouping, validation overlays, and safe log-like scaling.

plot_epsilons_in.py

Epsilon diagnostic plot

Plot only the epsilon_* history terms in one compact panel.

plot_physics_losses_in.py

Physics-loss plot

Plot the main physics loss terms together with optional gate or forcing diagnostics from a GeoPrior training history.

autoplot_geoprior_history.py

Standard inspection figures

Automatically save the two standard history-inspection views: epsilon diagnostics and physics loss terms.

gather_coords_flat.py

Flattened coordinate dictionary

Flatten batched (t, x, y) coordinates from dataset-like inputs into a reusable coordinate stream.

plot_physics_values_in.py

Payload inspection plots

Plot selected physics payload arrays as maps, histograms, or both, using explicit coordinates or coordinates gathered from a dataset.

extract_physical_parameters.py

Parameter summary CSV

Extract learned physical parameters from a trained model, optionally summarize GeoPrior field outputs, and export the result for later inspection.

Reading path#

A useful way to move through this gallery is to follow the logic of a real debugging or inspection workflow:

  1. begin with optimization behavior and training history,

  2. move to physics-specific diagnostics,

  3. inspect coordinate-aware payload values,

  4. finish with compact learned-parameter summaries.

That is why the examples are naturally grouped into three broad themes: history inspection, coordinate and payload inspection, and learned parameter extraction.

Why this separation matters#

This gallery deliberately keeps several tasks distinct:

  • model training,

  • model inspection,

  • artifact building,

  • publication plotting.

That separation makes the workflow easier to reason about. It also helps users distinguish between helpers that diagnose behavior, builders that produce reusable outputs, and figure pages that focus on communication and presentation.

Notes#

  • These examples are intentionally compact and lesson-oriented.

  • The functions in this section are helper-level utilities rather than large end-to-end scripts.

  • A useful rule of thumb is:

    • model_inspection/ explains helper-based diagnostics,

    • tables_and_summaries/ builds reusable analysis products,

    • figure_generation/ builds final visual outputs.

  • Several helpers in this section work directly with Keras-style histories, GeoPrior payload dictionaries, or lightweight dataset-like iterables, which makes them especially convenient for notebooks, debugging sessions, and targeted model review.

Flatten (t, x, y) coordinates from dataset batches

Flatten (t, x, y) coordinates from dataset batches

Automatically save the standard GeoPrior history diagnostics

Automatically save the standard GeoPrior history diagnostics

Plot epsilon diagnostics from a GeoPrior training history

Plot epsilon diagnostics from a GeoPrior training history

Plot training history with robust grouping and scale handling

Plot training history with robust grouping and scale handling

Plot physics loss terms from a GeoPrior training history

Plot physics loss terms from a GeoPrior training history

Plot physics payload values as maps and histograms

Plot physics payload values as maps and histograms

Extract learned physical parameters from a trained model

Extract learned physical parameters from a trained model