|
| 1 | +.. summary-start |
| 2 | +
|
| 3 | +.. _logo-adaptive: |
| 4 | + |
| 5 | +|image0| adaptive |
| 6 | +================= |
| 7 | + |
| 8 | +|PyPI| |Conda| |Downloads| |pipeline status| |DOI| |Binder| |Join the |
| 9 | +chat at https://gitter.im/python-adaptive/adaptive| |
| 10 | + |
| 11 | +**Tools for adaptive parallel sampling of mathematical functions.** |
| 12 | + |
| 13 | +``adaptive`` is an open-source Python library designed to |
| 14 | +make adaptive parallel function evaluation simple. With ``adaptive`` you |
| 15 | +just supply a function with its bounds, and it will be evaluated at the |
| 16 | +“best” points in parameter space. With just a few lines of code you can |
| 17 | +evaluate functions on a computing cluster, live-plot the data as it |
| 18 | +returns, and fine-tune the adaptive sampling algorithm. |
| 19 | + |
| 20 | +Check out the ``adaptive`` example notebook |
| 21 | +`learner.ipynb <https://github.com/python-adaptive/adaptive/blob/master/learner.ipynb>`_ (or run it `live on |
| 22 | +Binder <https://mybinder.org/v2/gh/python-adaptive/adaptive/master?filepath=learner.ipynb>`_) |
| 23 | +to see examples of how to use ``adaptive``. |
| 24 | + |
| 25 | +.. summary-end |
| 26 | +
|
| 27 | +**WARNING: adaptive is still in a beta development stage** |
| 28 | + |
| 29 | +.. implemented-algorithms-start |
| 30 | +
|
| 31 | +Implemented algorithms |
| 32 | +---------------------- |
| 33 | + |
| 34 | +The core concept in ``adaptive`` is that of a *learner*. A *learner* |
| 35 | +samples a function at the best places in its parameter space to get |
| 36 | +maximum “information” about the function. As it evaluates the function |
| 37 | +at more and more points in the parameter space, it gets a better idea of |
| 38 | +where the best places are to sample next. |
| 39 | + |
| 40 | +Of course, what qualifies as the “best places” will depend on your |
| 41 | +application domain! ``adaptive`` makes some reasonable default choices, |
| 42 | +but the details of the adaptive sampling are completely customizable. |
| 43 | + |
| 44 | +The following learners are implemented: |
| 45 | + |
| 46 | +- ``Learner1D``, for 1D functions ``f: ℝ → ℝ^N``, |
| 47 | +- ``Learner2D``, for 2D functions ``f: ℝ^2 → ℝ^N``, |
| 48 | +- ``LearnerND``, for ND functions ``f: ℝ^N → ℝ^M``, |
| 49 | +- ``AverageLearner``, For stochastic functions where you want to |
| 50 | + average the result over many evaluations, |
| 51 | +- ``IntegratorLearner``, for |
| 52 | + when you want to intergrate a 1D function ``f: ℝ → ℝ``, |
| 53 | +- ``BalancingLearner``, for when you want to run several learners at once, |
| 54 | + selecting the “best” one each time you get more points. |
| 55 | + |
| 56 | +In addition to the learners, ``adaptive`` also provides primitives for |
| 57 | +running the sampling across several cores and even several machines, |
| 58 | +with built-in support for |
| 59 | +`concurrent.futures <https://docs.python.org/3/library/concurrent.futures.html>`_, |
| 60 | +`ipyparallel <https://ipyparallel.readthedocs.io/en/latest/>`_ and |
| 61 | +`distributed <https://distributed.readthedocs.io/en/latest/>`_. |
| 62 | + |
| 63 | +.. implemented-algorithms-end |
| 64 | +
|
| 65 | +Examples |
| 66 | +-------- |
| 67 | + |
| 68 | +.. raw:: html |
| 69 | + |
| 70 | + <img src="https://user-images.githubusercontent.com/6897215/38739170-6ac7c014-3f34-11e8-9e8f-93b3a3a3d61b.gif" width='20%'> </img> <img src="https://user-images.githubusercontent.com/6897215/35219611-ac8b2122-ff73-11e7-9332-adffab64a8ce.gif" width='40%'> </img> |
| 71 | + |
| 72 | + |
| 73 | +Installation |
| 74 | +------------ |
| 75 | + |
| 76 | +``adaptive`` works with Python 3.6 and higher on Linux, Windows, or Mac, |
| 77 | +and provides optional extensions for working with the Jupyter/IPython |
| 78 | +Notebook. |
| 79 | + |
| 80 | +The recommended way to install adaptive is using ``conda``: |
| 81 | + |
| 82 | +.. code:: bash |
| 83 | +
|
| 84 | + conda install -c conda-forge adaptive |
| 85 | +
|
| 86 | +``adaptive`` is also available on PyPI: |
| 87 | + |
| 88 | +.. code:: bash |
| 89 | +
|
| 90 | + pip install adaptive[notebook] |
| 91 | +
|
| 92 | +The ``[notebook]`` above will also install the optional dependencies for |
| 93 | +running ``adaptive`` inside a Jupyter notebook. |
| 94 | + |
| 95 | +Development |
| 96 | +----------- |
| 97 | + |
| 98 | +Clone the repository and run ``setup.py develop`` to add a link to the |
| 99 | +cloned repo into your Python path: |
| 100 | + |
| 101 | +.. code:: bash |
| 102 | +
|
| 103 | + git clone git@github.com:python-adaptive/adaptive.git |
| 104 | + cd adaptive |
| 105 | + python3 setup.py develop |
| 106 | +
|
| 107 | +We highly recommend using a Conda environment or a virtualenv to manage |
| 108 | +the versions of your installed packages while working on ``adaptive``. |
| 109 | + |
| 110 | +In order to not pollute the history with the output of the notebooks, |
| 111 | +please setup the git filter by executing |
| 112 | + |
| 113 | +.. code:: bash |
| 114 | +
|
| 115 | + python ipynb_filter.py |
| 116 | +
|
| 117 | +in the repository. |
| 118 | + |
| 119 | +Credits |
| 120 | +------- |
| 121 | + |
| 122 | +We would like to give credits to the following people: |
| 123 | + |
| 124 | +- Pedro Gonnet for his implementation of `CQUAD <https://www.gnu.org/software/gsl/manual/html_node/CQUAD-doubly_002dadaptive-integration.html>`_, |
| 125 | + “Algorithm 4” as described in “Increasing the Reliability of Adaptive |
| 126 | + Quadrature Using Explicit Interpolants”, P. Gonnet, ACM Transactions on |
| 127 | + Mathematical Software, 37 (3), art. no. 26, 2010. |
| 128 | +- Pauli Virtanen for his ``AdaptiveTriSampling`` script (no longer |
| 129 | + available online since SciPy Central went down) which served as |
| 130 | + inspiration for the ``~adaptive.Learner2D``. |
| 131 | + |
| 132 | +For general discussion, we have a `Gitter chat |
| 133 | +channel <https://gitter.im/python-adaptive/adaptive>`_. If you find any |
| 134 | +bugs or have any feature suggestions please file a GitLab |
| 135 | +`issue <https://gitlab.kwant-project.org/qt/adaptive/issues/new?issue>`_ |
| 136 | +or submit a `merge |
| 137 | +request <https://gitlab.kwant-project.org/qt/adaptive/merge_requests>`_. |
| 138 | + |
| 139 | +.. references-start |
| 140 | +.. |image0| image:: https://gitlab.kwant-project.org/qt/adaptive/uploads/d20444093920a4a0499e165b5061d952/logo.png |
| 141 | +.. |PyPI| image:: https://img.shields.io/pypi/v/adaptive.svg |
| 142 | + :target: https://pypi.python.org/pypi/adaptive |
| 143 | +.. |Conda| image:: https://anaconda.org/conda-forge/adaptive/badges/installer/conda.svg |
| 144 | + :target: https://anaconda.org/conda-forge/adaptive |
| 145 | +.. |Downloads| image:: https://anaconda.org/conda-forge/adaptive/badges/downloads.svg |
| 146 | + :target: https://anaconda.org/conda-forge/adaptive |
| 147 | +.. |pipeline status| image:: https://gitlab.kwant-project.org/qt/adaptive/badges/master/pipeline.svg |
| 148 | + :target: https://gitlab.kwant-project.org/qt/adaptive/pipelines |
| 149 | +.. |DOI| image:: https://zenodo.org/badge/113714660.svg |
| 150 | + :target: https://zenodo.org/badge/latestdoi/113714660 |
| 151 | +.. |Binder| image:: https://mybinder.org/badge.svg |
| 152 | + :target: https://mybinder.org/v2/gh/python-adaptive/adaptive/master?filepath=learner.ipynb |
| 153 | +.. |Join the chat at https://gitter.im/python-adaptive/adaptive| image:: https://img.shields.io/gitter/room/nwjs/nw.js.svg |
| 154 | + :target: https://gitter.im/python-adaptive/adaptive |
| 155 | +.. references-end |
0 commit comments