<img width="300" src="https://ax.dev/img/ax_logo_lockup.svg" alt="Ax Logo" />
<hr/>
[![Support Ukraine](https://img.shields.io/badge/Support-Ukraine-FFD500?style=flat&labelColor=005BBB)](https://opensource.fb.com/support-ukraine)
[![Build Status](https://img.shields.io/pypi/v/ax-platform.svg)](https://pypi.org/project/ax-platform/)
[![Build Status](https://img.shields.io/pypi/pyversions/ax-platform.svg)](https://pypi.org/project/ax-platform/)
[![Build Status](https://img.shields.io/pypi/wheel/ax-platform.svg)](https://pypi.org/project/ax-platform/)
[![Build Status](https://github.com/facebook/Ax/workflows/Build%20and%20Test%20Workflow/badge.svg)](https://github.com/facebook/Ax/actions?query=workflow%3A%22Build+and+Test+Workflow%22)
[![codecov](https://codecov.io/gh/facebook/Ax/branch/main/graph/badge.svg)](https://codecov.io/gh/facebook/Ax)
[![Build Status](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
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](https://github.com/facebookexternal/botorch), a modern library for
Bayesian optimization research built on PyTorch.
For full documentation and tutorials, see the [Ax website](https://ax.dev)
## 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 significant 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. The Service API (recommended
for the vast majority of use-cases) provides an extensive, robust, and
easy-to-use interface to Ax; the Loop API enables particularly concise usage;
and the Developer API enables advanced experimental and methodological
control.
## Getting Started
To run a simple optimization loop in Ax (using the
[Booth response surface](https://www.sfu.ca/~ssurjano/booth.html) as the
artificial evaluation function):
```python
>>> 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.10 or later to run Ax.
The required Python dependencies are:
- [botorch](https://www.botorch.org)
- 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)
pip install ax-platform
```
Installation will use Python wheels from PyPI, available for
[OSX, Linux, and Windows](https://pypi.org/project/ax-platform/#files).
_Note_: Make sure the `pip` being used to install `ax-platform` is actually the
one from the newly created Conda environment. If you're using a Unix-based OS,
you can use `which pip` to check.
_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](https://pytorch.org/get-started/locally/#anaconda-1)
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:
```
pip install jupyter
```
If you want to store the experiments in MySQL, you will need SQLAlchemy:
```
pip install SQLAlchemy
```
### Latest Version
#### Installing from Git
You can install the latest (bleeding edge) version from Git.
First, 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:
```
pip install git+https://github.com/cornellius-gp/linear_operator.git
pip install git+https://github.com/cornellius-gp/gpytorch.git
export ALLOW_LATEST_GPYTORCH_LINOP=true
pip install git+https://github.com/pytorch/botorch.git
export ALLOW_BOTORCH_LATEST=true
pip install git+https://github.com/facebook/Ax.git#egg=ax-platform
```
#### Optional Dependencies
If using Ax in Jupyter notebooks:
```
pip install git+https://github.com/facebook/Ax.git#egg=ax-platform[notebook]
```
To support plotly-based plotting in newer Jupyter notebook versions
```
pip install "notebook>=5.3" "ipywidgets==7.5"
```
[See Plotly repo's README](https://github.com/plotly/plotly.py#jupyter-notebook-support)
for details and JupyterLab instructions.
If storing Ax experiments via SQLAlchemy in MySQL or SQLite:
```
pip install git+https://github.com/facebook/Ax.git#egg=ax-platform[mysql]
```
## Join the Ax Community
### Getting help
Please open an issue on our [issues page](https://github.com/facebook/Ax/issues)
with any questions, feature requests or bug reports! If posting a bug report,
please include a minimal reproducible example (as a code snippet) that we can
use to reproduce and debug the problem you encountered.
### Contributing
See the [CONTRIBUTING](CONTRIBUTING.md) file for how to help out.
When contributing to Ax, we recommend cloning the
[repository](https://github.com/facebook/Ax) and installing all optional
dependencies:
```
pip install git+https://github.com/cornellius-gp/linear_operator.git
pip install git+https://github.com/cornellius-gp/gpytorch.git
export ALLOW_LATEST_GPYTORCH_LINOP=true
pip install git+https://github.com/pytorch/botorch.git
export ALLOW_BOTORCH_LATEST=true
git clone https://github.com/facebook/ax.git --depth 1
cd ax
pip install -e .[tutorial]
```
See recommendation for installing PyTorch for MacOS users above.
The above example limits the cloned directory size via the
[`--depth`](https://git-scm.com/docs/git-clone#Documentation/git-clone.txt---depthltdepthgt)
argument to `git clone`. If you require the entire commit history you may remove
this argument.
## License
Ax is licensed under the [MIT license](./LICENSE).
Raw data
{
"_id": null,
"home_page": "https://github.com/facebook/Ax",
"name": "ax-platform",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "Experimentation, Optimization",
"author": "Facebook, Inc.",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/08/01/9562a8078e79e065db4abb0b006797c86ff4911cccf842dac2a3f349ede5/ax-platform-0.4.1.tar.gz",
"platform": null,
"description": "<img width=\"300\" src=\"https://ax.dev/img/ax_logo_lockup.svg\" alt=\"Ax Logo\" />\n\n<hr/>\n\n[![Support Ukraine](https://img.shields.io/badge/Support-Ukraine-FFD500?style=flat&labelColor=005BBB)](https://opensource.fb.com/support-ukraine)\n[![Build Status](https://img.shields.io/pypi/v/ax-platform.svg)](https://pypi.org/project/ax-platform/)\n[![Build Status](https://img.shields.io/pypi/pyversions/ax-platform.svg)](https://pypi.org/project/ax-platform/)\n[![Build Status](https://img.shields.io/pypi/wheel/ax-platform.svg)](https://pypi.org/project/ax-platform/)\n[![Build Status](https://github.com/facebook/Ax/workflows/Build%20and%20Test%20Workflow/badge.svg)](https://github.com/facebook/Ax/actions?query=workflow%3A%22Build+and+Test+Workflow%22)\n[![codecov](https://codecov.io/gh/facebook/Ax/branch/main/graph/badge.svg)](https://codecov.io/gh/facebook/Ax)\n[![Build Status](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)\n\nAx is an accessible, general-purpose platform for understanding, managing,\ndeploying, and automating adaptive experiments.\n\nAdaptive experimentation is the machine-learning guided process of iteratively\nexploring a (possibly infinite) parameter space in order to identify optimal\nconfigurations in a resource-efficient manner. Ax currently supports Bayesian\noptimization and bandit optimization as exploration strategies. Bayesian\noptimization in Ax is powered by\n[BoTorch](https://github.com/facebookexternal/botorch), a modern library for\nBayesian optimization research built on PyTorch.\n\nFor full documentation and tutorials, see the [Ax website](https://ax.dev)\n\n## Why Ax?\n\n- **Versatility**: Ax supports different kinds of experiments, from dynamic\n ML-assisted A/B testing, to hyperparameter optimization in machine learning.\n- **Customization**: Ax makes it easy to add new modeling and decision\n algorithms, enabling research and development with minimal overhead.\n- **Production-completeness**: Ax comes with storage integration and ability to\n fully save and reload experiments.\n- **Support for multi-modal and constrained experimentation**: Ax allows for\n running and combining multiple experiments (e.g. simulation with a real-world\n \"online\" A/B test) and for constrained optimization (e.g. improving\n classification accuracy without significant increase in resource-utilization).\n- **Efficiency in high-noise setting**: Ax offers state-of-the-art algorithms\n specifically geared to noisy experiments, such as simulations with\n reinforcement-learning agents.\n- **Ease of use**: Ax includes 3 different APIs that strike different balances\n between lightweight structure and flexibility. The Service API (recommended\n for the vast majority of use-cases) provides an extensive, robust, and\n easy-to-use interface to Ax; the Loop API enables particularly concise usage;\n and the Developer API enables advanced experimental and methodological\n control.\n\n## Getting Started\n\nTo run a simple optimization loop in Ax (using the\n[Booth response surface](https://www.sfu.ca/~ssurjano/booth.html) as the\nartificial evaluation function):\n\n```python\n>>> from ax import optimize\n>>> best_parameters, best_values, experiment, model = optimize(\n parameters=[\n {\n \"name\": \"x1\",\n \"type\": \"range\",\n \"bounds\": [-10.0, 10.0],\n },\n {\n \"name\": \"x2\",\n \"type\": \"range\",\n \"bounds\": [-10.0, 10.0],\n },\n ],\n # Booth function\n evaluation_function=lambda p: (p[\"x1\"] + 2*p[\"x2\"] - 7)**2 + (2*p[\"x1\"] + p[\"x2\"] - 5)**2,\n minimize=True,\n )\n\n# best_parameters contains {'x1': 1.02, 'x2': 2.97}; the global min is (1, 3)\n```\n\n## Installation\n\n### Requirements\n\nYou need Python 3.10 or later to run Ax.\n\nThe required Python dependencies are:\n\n- [botorch](https://www.botorch.org)\n- jinja2\n- pandas\n- scipy\n- sklearn\n- plotly >=2.2.1\n\n### Stable Version\n\n#### Installing via pip\n\nWe recommend installing Ax via pip (even if using Conda environment):\n\n```\nconda install pytorch torchvision -c pytorch # OSX only (details below)\npip install ax-platform\n```\n\nInstallation will use Python wheels from PyPI, available for\n[OSX, Linux, and Windows](https://pypi.org/project/ax-platform/#files).\n\n_Note_: Make sure the `pip` being used to install `ax-platform` is actually the\none from the newly created Conda environment. If you're using a Unix-based OS,\nyou can use `which pip` to check.\n\n_Recommendation for MacOS users_: PyTorch is a required dependency of BoTorch,\nand can be automatically installed via pip. However, **we recommend you\n[install PyTorch manually](https://pytorch.org/get-started/locally/#anaconda-1)\nbefore installing Ax, using the Anaconda package manager**. Installing from\nAnaconda will link against MKL (a library that optimizes mathematical\ncomputation for Intel processors). This will result in up to an\norder-of-magnitude speed-up for Bayesian optimization, as at the moment,\ninstalling PyTorch from pip does not link against MKL.\n\nIf you need CUDA on MacOS, you will need to build PyTorch from source. Please\nconsult the PyTorch installation instructions above.\n\n#### Optional Dependencies\n\nTo use Ax with a notebook environment, you will need Jupyter. Install it first:\n\n```\npip install jupyter\n```\n\nIf you want to store the experiments in MySQL, you will need SQLAlchemy:\n\n```\npip install SQLAlchemy\n```\n\n### Latest Version\n\n#### Installing from Git\n\nYou can install the latest (bleeding edge) version from Git.\n\nFirst, see recommendation for installing PyTorch for MacOS users above.\n\nAt times, the bleeding edge for Ax can depend on bleeding edge versions of\nBoTorch (or GPyTorch). We therefore recommend installing those from Git as well:\n\n```\npip install git+https://github.com/cornellius-gp/linear_operator.git\npip install git+https://github.com/cornellius-gp/gpytorch.git\nexport ALLOW_LATEST_GPYTORCH_LINOP=true\npip install git+https://github.com/pytorch/botorch.git\nexport ALLOW_BOTORCH_LATEST=true\npip install git+https://github.com/facebook/Ax.git#egg=ax-platform\n```\n\n#### Optional Dependencies\n\nIf using Ax in Jupyter notebooks:\n\n```\npip install git+https://github.com/facebook/Ax.git#egg=ax-platform[notebook]\n```\n\nTo support plotly-based plotting in newer Jupyter notebook versions\n\n```\npip install \"notebook>=5.3\" \"ipywidgets==7.5\"\n```\n\n[See Plotly repo's README](https://github.com/plotly/plotly.py#jupyter-notebook-support)\nfor details and JupyterLab instructions.\n\nIf storing Ax experiments via SQLAlchemy in MySQL or SQLite:\n\n```\npip install git+https://github.com/facebook/Ax.git#egg=ax-platform[mysql]\n```\n\n## Join the Ax Community\n\n### Getting help\n\nPlease open an issue on our [issues page](https://github.com/facebook/Ax/issues)\nwith any questions, feature requests or bug reports! If posting a bug report,\nplease include a minimal reproducible example (as a code snippet) that we can\nuse to reproduce and debug the problem you encountered.\n\n### Contributing\n\nSee the [CONTRIBUTING](CONTRIBUTING.md) file for how to help out.\n\nWhen contributing to Ax, we recommend cloning the\n[repository](https://github.com/facebook/Ax) and installing all optional\ndependencies:\n\n```\npip install git+https://github.com/cornellius-gp/linear_operator.git\npip install git+https://github.com/cornellius-gp/gpytorch.git\nexport ALLOW_LATEST_GPYTORCH_LINOP=true\npip install git+https://github.com/pytorch/botorch.git\nexport ALLOW_BOTORCH_LATEST=true\ngit clone https://github.com/facebook/ax.git --depth 1\ncd ax\npip install -e .[tutorial]\n```\n\nSee recommendation for installing PyTorch for MacOS users above.\n\nThe above example limits the cloned directory size via the\n[`--depth`](https://git-scm.com/docs/git-clone#Documentation/git-clone.txt---depthltdepthgt)\nargument to `git clone`. If you require the entire commit history you may remove\nthis argument.\n\n## License\n\nAx is licensed under the [MIT license](./LICENSE).\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Adaptive Experimentation",
"version": "0.4.1",
"project_urls": {
"Homepage": "https://github.com/facebook/Ax"
},
"split_keywords": [
"experimentation",
" optimization"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "8967d7b2aa46b9f7356f12db62601b163522759e8a9f66bd900fd04988bcc0c2",
"md5": "653961e322b5818fcde6514eaceb7b99",
"sha256": "dd1e1e5bee20e742748c8ebe507fbc33fe6719a03a35839a149487f69512953f"
},
"downloads": -1,
"filename": "ax_platform-0.4.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "653961e322b5818fcde6514eaceb7b99",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 1269394,
"upload_time": "2024-07-23T19:26:30",
"upload_time_iso_8601": "2024-07-23T19:26:30.239706Z",
"url": "https://files.pythonhosted.org/packages/89/67/d7b2aa46b9f7356f12db62601b163522759e8a9f66bd900fd04988bcc0c2/ax_platform-0.4.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "08019562a8078e79e065db4abb0b006797c86ff4911cccf842dac2a3f349ede5",
"md5": "c029398fe32e62c0cd3a990c220f222f",
"sha256": "fcc351500b22b0b309ffb6ce1a9046c76e9440e0c7deaacd618837a76c5d71c8"
},
"downloads": -1,
"filename": "ax-platform-0.4.1.tar.gz",
"has_sig": false,
"md5_digest": "c029398fe32e62c0cd3a990c220f222f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 4432201,
"upload_time": "2024-07-23T19:26:32",
"upload_time_iso_8601": "2024-07-23T19:26:32.154159Z",
"url": "https://files.pythonhosted.org/packages/08/01/9562a8078e79e065db4abb0b006797c86ff4911cccf842dac2a3f349ede5/ax-platform-0.4.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-23 19:26:32",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "facebook",
"github_project": "Ax",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "ax-platform"
}