equation discovery · symbolic regression
KD A platform for Knowledge Discovery
KD is a plug-in platform for equation discovery. It gives different discovery algorithms a consistent, easy-to-use interface and provides shared services such as visualization, evaluation, and experiment management, while leaving each algorithm free to implement its own search procedure.
\(u_t =\)\(-u\,u_x\)\(-0.0025\,u_{xxx}\)
An SGA-PDE run on the KdV dataset, showing the field it was given and the equation it returned.
scroll
Quick start
Install KD and run your first equation-discovery experiment in a few lines of Python. The example below uses a Burgers dataset bundled with KD.
1 install
git clone -b trunk https://github.com/Scientific-Artificial-Intelligence-Lab/kd.git
cd kd && uv sync
2 fit
import kd
# a 256 × 201 (x, t) field; for your own arrays, PDEDataset.from_arrays
data = kd.load_burgers()
model = kd.Model(algorithm="sga", generations=5, seed=0)
model.fit(data)
5 generations · AIC -28.78
\(u_t =\)\(-u\,u_x\)\(+0.1002\,u_{xx}\)
Examples

notebook
Getting started
Load a bundled benchmark, fit in one call, read the result.

worked exampleDISCOVERPySR
Column chromatography
Two algorithms on one 74-row table, both recovering the published formula.

notebook
Use your own data
Two coordinate arrays and one field array, from NumPy to a fitted equation.

notebookEqGPT
Breaking waves
The published EqGPT equation, reproduced on 12 wave-tank experiments.
Algorithms
KD currently provides seven equation-discovery algorithms through a common interface.
AICmediumfinite_diff autograd
SGA-PDE
A genetic search over expression trees; the coefficients come from the algorithm's own sparse regression.
DLGA fitnessheavyautograd
DLGA-PDE
A neural network fits the field and supplies derivatives; a genetic algorithm searches term sets over a candidate library.
rewardheavyfinite_diff
DISCOVER
A recurrent controller writes expression trees token by token and is trained on its own best-rewarded draws; the coefficients come from a platform refit.
EqGPT rewardheavyfinite_diff
EqGPT
A pretrained transformer reads the field and proposes equations, then fine-tunes on reward.
LLM4ED sparse rewardmediumfinite_diff
LLM4ED
A large language model proposes and revises candidate equations round by round, filtered by a sparse reward.
NMSEmediumfinite_diffexternal package
PySR
Multi-population evolutionary search returning a complexity/error Pareto front.
NMSElightfinite_diffexternal package
PySINDy
Sparse regression over a supplied candidate library, solved in one pass.
Design
design
Platform and plugins
Seven algorithms as plugins over one set of shared services, and the decisions that let them share it.
data
Data requirements
Fields, coordinate axes, grid or scattered points, and how the left-hand side is chosen.
score
Score conventions and comparability
Each algorithm builds its own final score. Refit the terms in one shared context before comparing.