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
  • sklearn
  • plotly >=2.2.1

Stable Version

Installing via pip

We recommend installing Ax via pip (even if using Conda environment):

conda install pytorch torchvision -c pytorch  # OSX only (details below)
pip3 install ax-platform

Installation will use Python wheels from PyPI, available for OSX, Linux, and Windows.

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.

If you need CUDA on MacOS, you will need to build PyTorch from source. Please consult the PyTorch installation instructions above.

Optional Dependencies

To use Ax with a notebook environment, you will need Jupyter. Install it first:

pip3 install jupyter

If you want to store the experiments in MySQL, you will need SQLAlchemy:

pip3 install SQLAlchemy

Latest Version

Installing from Git

You can install the latest (bleeding edge) version from Git:

pip3 install cython numpy  # needed for compiling Cython code
pip3 install git+ssh://git@github.com/facebook/Ax.git#egg=Ax

See recommendation for installing PyTorch for MacOS users above.

At times, the bleeding edge for Ax can depend on bleeding edge versions of BoTorch (or GPyTorch). We therefore recommend installing those from Git as well:

pip3 install git+https://github.com/cornellius-gp/gpytorch.git
pip3 install git+https://github.com/pytorch/botorch.git

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]

Join the Ax Community

See the CONTRIBUTING file for how to help out.

When contributing to Ax, we recommend cloning the repository and installing all optional dependencies:

# bleeding edge versions of GPyTorch + BoTorch are recommended
pip3 install git+https://github.com/cornellius-gp/gpytorch.git
pip3 install git+https://github.com/pytorch/botorch.git

pip3 install cython numpy  # needed for compiling Cython code
git clone https://github.com/facebook/ax.git
cd ax
pip3 install -e .[notebook,mysql,dev]

See recommendation for installing PyTorch for MacOS users above.

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.5-cp37-cp37m-manylinux1_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.7m

ax_platform-0.1.5-cp37-cp37m-macosx_10_7_x86_64.whl (612.8 kB view details)

Uploaded CPython 3.7m macOS 10.7+ x86-64

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

Uploaded CPython 3.6m

ax_platform-0.1.5-cp36-cp36m-macosx_10_13_x86_64.whl (615.3 kB view details)

Uploaded CPython 3.6m macOS 10.13+ x86-64

File details

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

File metadata

  • Download URL: ax_platform-0.1.5-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.5-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 b4d52cd1304e207758a8e95e89f6d5940ddf4d8ca07bd22488e6afd5e25fc899
MD5 306e9c6b99dee150969ebfc5e97428c0
BLAKE2b-256 6dd72f087dc1fa96ae5fa5b003be762603cb3c8c5e84fe05931c0655f35a6017

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ax_platform-0.1.5-cp37-cp37m-macosx_10_7_x86_64.whl
  • Upload date:
  • Size: 612.8 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.5-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 92a008446da1b904ff57cbf59b036cf25659876d744e547f9d1f48866a1c3240
MD5 90040d138581051d9b8046a512d0f4e4
BLAKE2b-256 edc62903546c1476529b625185597b4f84802d3fb3351d8575d20ba97ddc5c5e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ax_platform-0.1.5-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.5-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 e40c7be6cb697cb3ade567060bd3f58be31fcceebb2c78995d2823e939b2c3fd
MD5 b8f4a6e914b5ca872a4a818b34c75ed2
BLAKE2b-256 9ccf38cdb97dd6225fa3c9e01c5b66f0f6f2616d6ceaecbfb6bf26f3763c3187

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ax_platform-0.1.5-cp36-cp36m-macosx_10_13_x86_64.whl
  • Upload date:
  • Size: 615.3 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.5-cp36-cp36m-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 5365ba66c68d0a389d945b43c42cfd6d20af7d9d3cd5f24da6935e8a110f19fb
MD5 fd11de30db0c54ab6f8cf9f2773475f4
BLAKE2b-256 c22c89582a4602798a30713bfc751e3e5c1aa1cc62583c443426369493ef2725

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