← all repositories
python-adaptive/adaptive

Stop brute-forcing your parameter sweeps

A Python library that learns where to sample next instead of grinding through dense grids.

1.2k stars Python ML FrameworksData Tooling
adaptive
Velocity · 7d
+0.4
★ / day
Trend
steady
star history

What it does

Adaptive runs expensive mathematical functions in parallel, but skips the wasteful part: it picks each new evaluation point based on what the function has already revealed. You define the function and bounds; the library decides where to look next, balancing exploration against whatever “interesting” means for your problem. It wraps the whole loop—sampling, learning, parallel dispatch, and live visualization—into a few lines of Python.

The interesting bit

The library treats sampling as an active-learning problem, not a scheduling problem. Each “learner” maintains its own model of where uncertainty or complexity lives, and the runner farms out points to whatever parallel backend you have lying around (from concurrent.futures to mpi4py to Dask). The live Jupyter widgets are genuinely useful for watching a 2D landscape fill in from the edges first, then drilling into the weird bits.

Key highlights

  • Learners for 1D, 2D, ND, stochastic averaging, and numerical integration (including a CQUAD-based integrator)
  • Built-in parallel backends: concurrent.futures, mpi4py, loky, ipyparallel, distributed
  • Live plotting and info widgets inside Jupyter notebooks
  • Custom loss functions to define “interesting” per domain
  • Exports to NumPy arrays or Pandas DataFrames
  • Requires Python 3.7+; conda-forge and PyPI packages available

Caveats

  • Overhead makes it inefficient for functions faster than ~50 ms per evaluation
  • JupyterLab needs manual labextension installs for the live widgets
  • A draft paper exists but is, per the README, still being written

Verdict

Worth a look if you are burning CPU hours on parameter sweeps or expensive simulations with uneven complexity. Skip it if your functions are already fast or your grids are trivially small.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.