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
Installation
Requirements
You need Python 3.6 or later to run Ax.
The required Python dependencies are:
- botorch
- jinja2
- pandas
- scipy
- simplejson
- sklearn
- plotly >=2.2.1, <3.0
Installation via pip
We recommend installing Ax via pip. To do so, run:
pip3 install ax-platform
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.
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]
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,
minimize=True,
)
{'x1': 1.02, 'x2': 2.97} # global min is (1, 3)
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
Hashes for ax_platform-0.1.0-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce8375d7fc4bb2e6a9fa56f4537db10459aeafda2f540c2c361f2ecdcb2380fa |
|
MD5 | 522152653a003e1784d610c6881427fc |
|
BLAKE2b-256 | 77c8c9b3fcad1208cc964f55d7ad87eeb82783c91f806d5cc369950e889a991e |
Hashes for ax_platform-0.1.0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb14cebf2c71a09284387ac6ca94560ba0647356e047c7dfa1edea9b3ecd9057 |
|
MD5 | 71c702ad488e12e27aced389ea8604ad |
|
BLAKE2b-256 | dbb042bac52afb7fccb0a708977fa577ed31942193a779e66302dd49982d1921 |
Hashes for ax_platform-0.1.0-cp37-cp37m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 860e00c972ceebc9b1b24ab6d6d9f28450b3cc7b7205d24cc325b61a7f1d04b5 |
|
MD5 | ceb4155e3be874bf0f97b78756a9041e |
|
BLAKE2b-256 | 96885d81f7ee25dbf6eb0fe647dedff9be5c4f91acdd3e9873eb20b32d67957e |
Hashes for ax_platform-0.1.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac61e688d379a05492d7e9c8e951b6316a3fe2a70ab056825f5e645fa146d86f |
|
MD5 | cd8185e0ad99e6bf86c8be9e97d6d5a7 |
|
BLAKE2b-256 | 8d4d5c68fbe67864a6ecf38d04b94251d754ba96f3fc8be5e34593819f8f6fc2 |
Hashes for ax_platform-0.1.0-cp36-cp36m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e011b9de9448291398b354f2b8bd05c6fb0ef2d5cbfa2bdb313305a37dd52c2b |
|
MD5 | 9fc5e50923031348783b153306f274cf |
|
BLAKE2b-256 | 9fc5b65cc934c7241a12c1ae1060fb3a0233629eda6fa125d40b821780386372 |