🧪 Implemented Algorithms#
The core concept in
adaptive is the learner.
A learner samples a function at the most interesting locations within its parameter space, allowing for optimal sampling of the function.
As the function is evaluated at more points, the learner improves its understanding of the best locations to sample next.
The definition of the “best locations” depends on your application domain.
adaptive provides sensible default choices, the adaptive sampling process can be fully customized.
The following learners are implemented:
Learner1D, for 1D functions
f: ℝ → ℝ^N,
Learner2D, for 2D functions
f: ℝ^2 → ℝ^N,
LearnerND, for ND functions
f: ℝ^N → ℝ^M,
AverageLearner, for random variables where you want to average the result over many evaluations,
AverageLearner1D, for stochastic 1D functions where you want to estimate the mean value of the function at each point,
IntegratorLearner, for when you want to intergrate a 1D function
f: ℝ → ℝ.
BalancingLearner, for when you want to run several learners at once, selecting the “best” one each time you get more points.
Meta-learners (to be used with other learners):
BalancingLearner, for when you want to run several learners at once, selecting the “best” one each time you get more points,
DataSaver, for when your function doesn’t just return a scalar or a vector.
In addition to the learners,
adaptive also provides primitives for running the sampling across several cores and even several machines, with built-in support for
Here are some examples of how Adaptive samples vs. homogeneous sampling. Click on the Play button or move the sliders.
Show code cell content Hide code cell content
import holoviews as hv
import numpy as np
from adaptive.learner.learner1D import default_loss, uniform_loss