Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

📈 Adaptive: parallel active learning of mathematical functions

License

NotificationsYou must be signed in to change notification settings

python-adaptive/adaptive

 
 

Repository files navigation

logo adaptive

PyPICondaDownloadsPipeline statusDOIBinderGitterDocumentationGitHub

Tools for adaptive parallel sampling of mathematical functions.

adaptive is an open-source Python library designed tomake adaptive parallel function evaluation simple. Withadaptive youjust supply a function with its bounds, and it will be evaluated at the“best” points in parameter space. With just a few lines of code you canevaluate functions on a computing cluster, live-plot the data as itreturns, and fine-tune the adaptive sampling algorithm.

Run theadaptive example notebooklive onBinderto see examples of how to useadaptive or visit thetutorial on Read the Docs.

WARNING: adaptive is still in a beta development stage

Implemented algorithms

The core concept inadaptive is that of alearner. Alearnersamples a function at the best places in its parameter space to getmaximum “information” about the function. As it evaluates the functionat more and more points in the parameter space, it gets a better idea ofwhere the best places are to sample next.

Of course, what qualifies as the “best places” will depend on yourapplication domain!adaptive makes some reasonable default choices,but the details of the adaptive sampling are completely customizable.

The following learners are implemented:

  • Learner1D, for 1D functionsf: ℝ → ℝ^N,
  • Learner2D, for 2D functionsf: ℝ^2 → ℝ^N,
  • LearnerND, for ND functionsf: ℝ^N → ℝ^M,
  • AverageLearner, For stochastic functions where you want toaverage the result over many evaluations,
  • IntegratorLearner, forwhen you want to intergrate a 1D functionf: ℝ → ℝ,
  • BalancingLearner, for when you want to run several learners at once,selecting the “best” one each time you get more points.

In addition to the learners,adaptive also provides primitives forrunning the sampling across several cores and even several machines,with built-in support forconcurrent.futures,ipyparallel anddistributed.

Examples

Installation

adaptive works with Python 3.6 and higher on Linux, Windows, or Mac,and provides optional extensions for working with the Jupyter/IPythonNotebook.

The recommended way to install adaptive is usingconda:

conda install -c conda-forge adaptive

adaptive is also available on PyPI:

pip install adaptive[notebook]

The[notebook] above will also install the optional dependencies forrunningadaptive inside a Jupyter notebook.

Development

Clone the repository and runsetup.py develop to add a link to thecloned repo into your Python path:

git clone git@github.com:python-adaptive/adaptive.gitcd adaptivepython3 setup.py develop

We highly recommend using a Conda environment or a virtualenv to managethe versions of your installed packages while working onadaptive.

In order to not pollute the history with the output of the notebooks,please setup the git filter by executing

python ipynb_filter.py

in the repository.

We implement several other checks in order to maintain a consistent code style. We do this usingpre-commit, execute

pre-commit install

in the repository.

Credits

We would like to give credits to the following people:

  • Pedro Gonnet for his implementation ofCQUAD,“Algorithm 4” as described in “Increasing the Reliability of AdaptiveQuadrature Using Explicit Interpolants”, P. Gonnet, ACM Transactions onMathematical Software, 37 (3), art. no. 26, 2010.
  • Pauli Virtanen for hisAdaptiveTriSampling script (no longeravailable online since SciPy Central went down) which served asinspiration for the ~adaptive.Learner2D.

For general discussion, we have aGitter chatchannel. If you find anybugs or have any feature suggestions please file a GitHubissueor submit apullrequest.


[8]ページ先頭

©2009-2025 Movatter.jp