Skip to content

Visualization

The repository renders environments, transition graphs, learning curves, shield diagnostics, legends, and conceptual diagrams.

Experiment Figures

Experiment notebooks export cumulative and episodic reward/safety comparisons. The standard names are:

  • cumulative.png and episodic.png, including the world-model pretraining prefix where available,
  • cumulative_post.png and episodic_post.png, starting at policy training,
  • matching _no_legend.png files for paper layout, and
  • shield_telemetry.png plus its no-legend variant, and
  • om_bayesian_levels*.png, which overlays the unconstrained Bayesian posterior mode with the monotone shield floor.

Plots truncate algorithms to a shared horizon when requested so a longer run does not distort the comparison. Structured graphs/... outputs use completed EpisodeLog rows at their actual t_end values.

Shield Telemetry

Telemetry separates policy behavior from shield intervention. It can show override and unsafe-proposal counts, missing coverage, proposed/final risk, opponent-level raises, and budget evolution. An apparently safe reward curve is not enough to tell whether the base policy learned safety or the shield replaced many actions.

The Bayesian-level figure deliberately does not call the posterior mode a ground-truth reasoning level. Downward posterior changes and time spent below the irreversible shield floor are diagnostics of the modelling assumption, not violations of the monotone runtime rule.

Experiment runs also export tabular calibration and aggregate diagnostics. World-model reports cover held-out state/reward quality; opponent reports cover observed-action prediction; shield reports cover convergence, coverage, feasibility, and learned-versus-exact agreement where an exact graph is already available. These reports should accompany reward/safety plots when diagnosing a poor condition.

Environment and Graph Rendering

Environment renderers live beside the implementations under src/environments/. Shared gridworld and matrix drawing helpers provide common tiles, panels, score boxes, and overlays. Exact/learned joint graphs can be exported to Graphviz DOT through src.joint_graph.visualise.

Diagram Notebooks

notebooks/diagrams/ contains world-model, IOP, and shielding diagrams. Shared helpers provide graph slicing, state summaries, Graphviz styles, and notebook fallbacks when the dot executable is unavailable. Use these notebooks for explanatory figures without running full training.

Styling and Legends

src.visualisation.styling contains paper, panel, and presentation styles. notebooks/generic/legend_mo.py exports reusable algorithm legends into exports/legends/, which lets paper figures omit repeated in-panel legends.