Adaptive Experimentation
Project description
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:
- Make sure you have installed the botorch dependency.
- Download Ax from the Git repository.
cd
into theax
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
File details
Details for the file ax_platform-0.1.2-cp37-cp37m-manylinux1_x86_64.whl
.
File metadata
- Download URL: ax_platform-0.1.2-cp37-cp37m-manylinux1_x86_64.whl
- Upload date:
- Size: 985.5 kB
- Tags: CPython 3.7m
- 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 008d46945afe4ef8013460a3564a4bd37b0056335930d5ad93fb0ef0351d3f4e |
|
MD5 | 4d7603f747c2bee128fcfbe17cd80e4b |
|
BLAKE2b-256 | acb4ad78bc5818da496f774d89e13a5fb01a9d6c8d84647bac28a7cc96a0b289 |
File details
Details for the file ax_platform-0.1.2-cp37-cp37m-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: ax_platform-0.1.2-cp37-cp37m-macosx_10_9_x86_64.whl
- Upload date:
- Size: 569.5 kB
- Tags: CPython 3.7m, macOS 10.9+ 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 39a95648b832ec1b91a062bfc6fe03dc3b9b327ce83670e6b8f400f96cebd053 |
|
MD5 | eebba6fe567c82904e890bdd738c5e9e |
|
BLAKE2b-256 | 12c6c459d70812800934aa7c73be02ea71993e80640dce6ca07e4a7740fa10f5 |
File details
Details for the file ax_platform-0.1.2-cp37-cp37m-macosx_10_6_intel.whl
.
File metadata
- Download URL: ax_platform-0.1.2-cp37-cp37m-macosx_10_6_intel.whl
- Upload date:
- Size: 776.3 kB
- Tags: CPython 3.7m, macOS 10.6+ intel
- 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4dc8e4a11f69c38a2f4d3190755cd5625b1be14ad11179fe5befb14bdca21c17 |
|
MD5 | 79052bbc8ec82ec5d3dda8286a810c30 |
|
BLAKE2b-256 | 1c10323eb82f2564a434143d6f17cb1ea27a4647992fc62e37b25f0b46105e88 |
File details
Details for the file ax_platform-0.1.2-cp36-cp36m-manylinux1_x86_64.whl
.
File metadata
- Download URL: ax_platform-0.1.2-cp36-cp36m-manylinux1_x86_64.whl
- Upload date:
- Size: 987.0 kB
- Tags: CPython 3.6m
- 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | aadd55fbf5161aa1477da0f4a4b89a3f518337101d6a8ffa3243abe528b3ef36 |
|
MD5 | 1398bb4bcd48b950e8d4ee8014bc76ec |
|
BLAKE2b-256 | 3649b4102807eed487c83aadea441c35a40030eb19192d43f8157980428de68a |
File details
Details for the file ax_platform-0.1.2-cp36-cp36m-macosx_10_7_x86_64.whl
.
File metadata
- Download URL: ax_platform-0.1.2-cp36-cp36m-macosx_10_7_x86_64.whl
- Upload date:
- Size: 575.5 kB
- Tags: CPython 3.6m, macOS 10.7+ 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a7175b89681dbf6e11bd8fe228d7401981c1ade4d98a82f7db7bd0f789fa0fb |
|
MD5 | c7facae22acc528d658359bc6deb0168 |
|
BLAKE2b-256 | 5a65acb3058267c024324b3f2c1a6ac04d7b2bc7c4565c06c9c792a7a21b1d9e |