Skip to content

Visualization

KD provides a common visualization interface across algorithms. Each algorithm can also expose diagnostic figures for its own search process, including population statistics, policy training, language-model proposals and sparse fits. This page explains the shared figure types and the algorithm-specific diagnostics. Figure generation covers the calls for your own run; the figure gallery contains all figures and reading notes from one SGA-PDE run.

Platform figures

Whichever algorithm ran, VizEngine draws the same group: best score per iteration, measured against predicted, the equation typeset and as a structure tree, the fitted coefficients, and the residual as a histogram and as a spatial map. Pass the dataset as well and it adds the field comparison, the u_t residual field, time slices and an error heatmap.

The six figures below come from one run: SGA-PDE on the KdV dataset that ships with KD, 200 generations, seed 42.

Heatmap of the KdV field u(x, t)
The observed field over its physical spatial and time coordinates.
Measured u_t, predicted u_t, and the residual between them
The fitted derivative target, its equation prediction, and predicted minus measured values. The first two panels share a color scale; the residual has its own scale, with any clipping disclosed on the figure.
Predicted u_t against measured u_t, with a 45-degree reference line
Predicted values against the measured target, with the diagonal denoting exact agreement and R² computed over the full fit.
Best AIC and population mean AIC per generation
The best native score is shown above the algorithm's population diagnostic, when one is recorded. Each panel retains its own score scale.
Bar chart of the two fitted coefficients on a symmetric log axis
The active fitted coefficients, retaining their signs and any scale changes disclosed by the axis.
The discovered equation drawn as an expression tree
The active equation's operators and derivatives, with coefficient magnitudes shown separately.

model.report("out/report") renders the supported figures into one HTML file, with captions, settings and raw result JSON. In a notebook, the returned report is displayed inline. Browse the figure gallery or open the SGA-PDE report. Every algorithm page links its own report.

Algorithm panels

The shared figures describe the fitted equation and its residuals. Each algorithm also declares diagnostic panels for its search or fitting procedure:

  • SGA-PDE, DLGA-PDE: population-level records, per generation the diversity of the candidates, the term count of the candidate equations and the score spread of the survivors, plus the training loss of the neural-network surrogate (filled in only when the platform trained one). SGA-PDE also draws the genome tree of its best individual.
  • DISCOVER: the policy network's training record, per iteration the reward (one curve for the elite subset, one for the full batch), the entropy regularizer and the reward baseline.
  • EqGPT: the reward of the candidate pool per epoch and its spread, plus the cross-entropy loss of each epoch's fine-tune. In multi-case mode it adds the reward of the discovered structure on every case.
  • LLM4ED: the reward spread of the candidate pool per round, the count of invalid candidates, and the cumulative number of language-model calls.
  • PySR: the Pareto front (complexity against loss), KD's independent re-score of that same front, and the two scores against each other.
  • PySINDy: one comparison figure putting the NMSE of PySINDy's native coefficients next to the NMSE of KD's independent refit.

Each row below is one algorithm's panels, from that algorithm's own worked run.

SGA-PDE offspring diversity, complexity evolution and fitness spread
The algorithm's diagnostic panels, using the same data and plot functions as the full report.
DLGA-PDE population diversity, complexity evolution and fitness spread
The algorithm's diagnostic panels, using the same data and plot functions as the full report.
DISCOVER reward curves and entropy loss
The algorithm's diagnostic panels, using the same data and plot functions as the full report.
EqGPT pool reward spread and fine-tuning loss
The algorithm's diagnostic panels, using the same data and plot functions as the full report.
LLM4ED pool reward spread, invalid proposals and cumulative calls
The algorithm's diagnostic panels, using the same data and plot functions as the full report.

Data shape

Which figures a run gets follows from the shape of its data rather than from the algorithm. Data on a regular grid gets the whole set. Scattered measurements carry point coordinates and no grid, so the field family is left out and the rest draws as usual; the breaking-waves example is a run of that kind. A table of X against y has no field at all, and the coefficient bar follows whether the run returned an equation rather than on the shape of the data. Two-dimensional space plus time adds one more: pass animate=True and render_all writes a GIF of the field evolving.

Whatever is left out is named in report.warnings, one note per figure family, and the same notes appear on the report page.

Figure index

Every figure KD draws, and the call that draws just that one. The platform half runs for any result; the rest belong to the algorithm named beside them. Two are composed at render time and are not listed: SGA-PDE's genome tree, and EqGPT's panels in multi-case and steady mode. At run time plugin.list_plots() returns the complete set for the algorithm that ran.

Figure Call Owner
Coefficient bar kd.viz.plots.plot_coefficient_bar(result) platform
Convergence kd.viz.plots.plot_convergence(result) platform
Equation kd.viz.plots.plot_equation(result) platform
Equation card kd.viz.plots.plot_equation_card(result, dataset) platform
Equation tree kd.viz.plots.plot_equation_tree(result) platform
Error heatmap kd.viz.plots.plot_error_heatmap(dataset, integration_result) platform
Field kd.viz.plots.plot_field(dataset) platform
Field animation kd.viz.plots.plot_field_animation(dataset, integration_result) platform
Field comparison kd.viz.plots.plot_field_comparison(dataset, integration_result) platform
Parity kd.viz.plots.plot_parity(result) platform
Plugin kd.viz.plots.plot_plugin(algorithm, name) platform
Pde residual field kd.viz.plots.plot_pde_residual_field(result) platform
Residual kd.viz.plots.plot_residual(result) platform
Score bar kd.viz.plots.plot_score_bar(results) platform
Search score distribution kd.viz.plots.plot_search_score_distribution(result) platform
Structure comparison kd.viz.plots.plot_structure_comparison(comparison) platform
Summary table kd.viz.plots.plot_summary_table(results) platform
Term presence kd.viz.plots.plot_term_presence(result) platform
Time slices kd.viz.plots.plot_time_slices(dataset, integration_result) platform
Overlaid convergence kd.viz.plots.render_overlaid_convergence(results) platform
Save field animation kd.viz.plots.save_field_animation(dataset, integration_result, output_path) platform
Offspring Diversity plugin.render_plot("population_diversity", ax) SGA-PDE
Complexity Evolution plugin.render_plot("complexity_evolution", ax) SGA-PDE
Fitness Spread plugin.render_plot("fitness_spread", ax) SGA-PDE
Surrogate Training Curve plugin.render_plot("surrogate_training", ax) SGA-PDE
Fitness Spread plugin.render_plot("fitness_spread", ax) DLGA-PDE
Population Diversity plugin.render_plot("population_diversity", ax) DLGA-PDE
Complexity Evolution plugin.render_plot("complexity_evolution", ax) DLGA-PDE
Surrogate Training Curve plugin.render_plot("surrogate_training", ax) DLGA-PDE
Reward (Mean of Top ε) plugin.render_plot("reward_convergence", ax) DISCOVER
Reward (Full-Batch Mean) plugin.render_plot("reward_full_mean", ax) DISCOVER
Entropy Loss plugin.render_plot("entropy_loss_decay", ax) DISCOVER
Reward Baseline plugin.render_plot("baseline_ewma", ax) DISCOVER
Reward Convergence plugin.render_plot("reward_convergence", ax) EqGPT
Pool Reward Spread plugin.render_plot("pool_reward_spread", ax) EqGPT
Fine-tune Loss plugin.render_plot("finetune_loss", ax) EqGPT
Pool Reward Spread plugin.render_plot("pool_reward_spread", ax) LLM4ED
Invalid Count plugin.render_plot("invalid_count", ax) LLM4ED
Cumulative LLM Calls plugin.render_plot("llm_calls", ax) LLM4ED
Pareto Front plugin.render_plot("pareto_front", ax) PySR
KD Audit Path plugin.render_plot("kd_audit_path", ax) PySR
Score Agreement plugin.render_plot("score_agreement", ax) PySR
Native vs Refit NMSE plugin.render_plot("native_refit_agreement", ax) PySINDy