Skip to main content

Adaptive Experimentation

Project description

Ax Logo

Build Status Build Status Build Status Build Status codecov Build Status

Ax is an accessible, general-purpose platform for understanding, managing, deploying, and automating adaptive experiments.

Adaptive experimentation is the machine-learning guided process of iteratively exploring a (possibly infinite) parameter space in order to identify optimal configurations in a resource-efficient manner. Ax currently supports Bayesian optimization and bandit optimization as exploration strategies. Bayesian optimization in Ax is powered by BoTorch, a modern library for Bayesian optimization research built on PyTorch.

For full documentation and tutorials, see the Ax website

Why Ax?

  • Versatility: Ax supports different kinds of experiments, from dynamic ML-assisted A/B testing, to hyperparameter optimization in machine learning.
  • Customization: Ax makes it easy to add new modeling and decision algorithms, enabling research and development with minimal overhead.
  • Production-completeness: Ax comes with storage integration and ability to fully save and reload experiments.
  • Support for multi-modal and constrained experimentation: Ax allows for running and combining multiple experiments (e.g. simulation with a real-world "online" A/B test) and for constrained optimization (e.g. improving classification accuracy without signifant increase in resource-utilization).
  • Efficiency in high-noise setting: Ax offers state-of-the-art algorithms specifically geared to noisy experiments, such as simulations with reinforcement-learning agents.
  • Ease of use: Ax includes 3 different APIs that strike different balances between lightweight structure and flexibility. Using the most concise Loop API, a whole optimization can be done in just one function call. The Service API integrates easily with external schedulers. The most elaborate Developer API affords full algorithm customization and experiment introspection.

Getting Started

To run a simple optimization loop in Ax (using the Booth response surface as the artificial evaluation function):

>>> from ax import optimize
>>> best_parameters, best_values, experiment, model = optimize(
        parameters=[
          {
            "name": "x1",
            "type": "range",
            "bounds": [-10.0, 10.0],
          },
          {
            "name": "x2",
            "type": "range",
            "bounds": [-10.0, 10.0],
          },
        ],
        # Booth function
        evaluation_function=lambda p: (p["x1"] + 2*p["x2"] - 7)**2 + (2*p["x1"] + p["x2"] - 5)**2,
        minimize=True,
    )

# best_parameters contains {'x1': 1.02, 'x2': 2.97}; the global min is (1, 3)

Installation

Requirements

You need Python 3.6 or later to run Ax.

The required Python dependencies are:

  • botorch
  • jinja2
  • pandas
  • scipy
  • simplejson
  • sklearn
  • plotly

Installation via pip

We recommend installing Ax via pip. To do so, run:

conda install pytorch torchvision -c pytorch  # OSX only
pip3 install ax-platform  # all systems

Recommendation for MacOS users: PyTorch is a required dependency of BoTorch, and can be automatically installed via pip. However, we recommend you install PyTorch manually before installing Ax, using the Anaconda package manager. Installing from Anaconda will link against MKL (a library that optimizes mathematical computation for Intel processors). This will result in up to an order-of-magnitude speed-up for Bayesian optimization, as at the moment, installing PyTorch from pip does not link against MKL. Currently, installation through Anaconda is temporarily required for OSX, as the pip installation of PyTorch is broken.

Installing from source

To install from source:

  1. Make sure you have installed the botorch dependency.
  2. Download Ax from the Git repository.
  3. cd into the ax project and run:
pip3 install -e .

Note: When installing from source, Ax requires a compiler for Cython code.

Optional Dependencies

Depending on your intended use of Ax, you may want to install Ax with optional dependencies.

If using Ax in Jupyter notebooks:

pip3 install git+ssh://git@github.com/facebook/Ax.git#egg=Ax[notebook]

If storing Ax experiments via SQLAlchemy in MySQL or SQLite:

pip3 install git+ssh://git@github.com/facebook/Ax.git#egg=Ax[mysql]

Note that instead of installation from Git, you can also clone a local version of the repo and then pip install with desired flags from the root of the local repo, e.g.:

pip3 install -e .[mysql]

Join the Ax community

See the CONTRIBUTING file for how to help out. You will also need to install the dependencies needed for development, which are listed in DEV_REQUIRES in setup.py, as follows:

pip3 install git+ssh://git@github.com/facebook/Ax.git#egg=Ax[dev]

License

Ax is licensed under the MIT license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

ax_platform-0.1.3-cp37-cp37m-win_amd64.whl (585.9 kB view details)

Uploaded CPython 3.7m Windows x86-64

ax_platform-0.1.3-cp37-cp37m-manylinux1_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.7m

ax_platform-0.1.3-cp37-cp37m-macosx_10_7_x86_64.whl (586.1 kB view details)

Uploaded CPython 3.7m macOS 10.7+ x86-64

ax_platform-0.1.3-cp36-cp36m-win_amd64.whl (585.8 kB view details)

Uploaded CPython 3.6m Windows x86-64

ax_platform-0.1.3-cp36-cp36m-manylinux1_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.6m

ax_platform-0.1.3-cp36-cp36m-macosx_10_13_x86_64.whl (593.0 kB view details)

Uploaded CPython 3.6m macOS 10.13+ x86-64

File details

Details for the file ax_platform-0.1.3-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: ax_platform-0.1.3-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 585.9 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.20.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.6.8

File hashes

Hashes for ax_platform-0.1.3-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 c19fe5a8ebedd99bda5a8e7475bdc448b2a381c5e50a1c5e53874676272eaa95
MD5 9573882e22bac9133db2ee8f05173672
BLAKE2b-256 e344db8f1befed30e93632c98788c90dd8e0a9ae9a3b8b1fa566e3e0db2d1bbb

See more details on using hashes here.

File details

Details for the file ax_platform-0.1.3-cp37-cp37m-manylinux1_x86_64.whl.

File metadata

  • Download URL: ax_platform-0.1.3-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 1.0 MB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for ax_platform-0.1.3-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 5c352fdea478ad330fc0257da83a2996d8c046c5642c65f69974ec7530024a03
MD5 d02ec013d3b8d905df2e986aceb311a5
BLAKE2b-256 1e32fe7b32395a8e2075369ffa826ab3d0e4e71ef13086f6b09fad7104132dc8

See more details on using hashes here.

File details

Details for the file ax_platform-0.1.3-cp37-cp37m-macosx_10_7_x86_64.whl.

File metadata

  • Download URL: ax_platform-0.1.3-cp37-cp37m-macosx_10_7_x86_64.whl
  • Upload date:
  • Size: 586.1 kB
  • Tags: CPython 3.7m, macOS 10.7+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for ax_platform-0.1.3-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 e482b6bb8be567df643a776f8440837f0f960eb42f4f97da66ada9cb40bc6be6
MD5 07a7b860aad3afd0aa4cec52f8ace19c
BLAKE2b-256 c10a05415279394aeef4822a4b78b59d9d89b17cdc190bc719c97530d1921fdb

See more details on using hashes here.

File details

Details for the file ax_platform-0.1.3-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: ax_platform-0.1.3-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 585.8 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.20.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.6.8

File hashes

Hashes for ax_platform-0.1.3-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 3faeb76f795ed0da60ae6e43be3672492a5a74c31d5166d661291d22730fbba5
MD5 63d6e17537ddd857e3f9ef4b2b5316c8
BLAKE2b-256 b06293bf04c810cd3e41b39d9bbc2b28639935611370c44101289b3cf5e0dadf

See more details on using hashes here.

File details

Details for the file ax_platform-0.1.3-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

  • Download URL: ax_platform-0.1.3-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 1.0 MB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for ax_platform-0.1.3-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 b2e570b191b856e14ad965cf419aeb7aeee96d26414ca020281500b8fe215700
MD5 9871797bd881c314eb5fd8ce5068c5c1
BLAKE2b-256 b1704bf0dfd1ce8a1b16e352c767b4467976f1dbf5b36e2449e2a964e8f9f4bb

See more details on using hashes here.

File details

Details for the file ax_platform-0.1.3-cp36-cp36m-macosx_10_13_x86_64.whl.

File metadata

  • Download URL: ax_platform-0.1.3-cp36-cp36m-macosx_10_13_x86_64.whl
  • Upload date:
  • Size: 593.0 kB
  • Tags: CPython 3.6m, macOS 10.13+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for ax_platform-0.1.3-cp36-cp36m-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 f381552841b9a93241dc883be9f0aa318c53c66519442e313466d9628973b22c
MD5 448f361b6283709dc065ffefb89ba79a
BLAKE2b-256 425f11c8c4ea9f5b43dca9a42080f25f662adbb36e90eca90a565698081c70bc

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page