ax-platform


Nameax-platform JSON
Version 0.3.7 PyPI version JSON
download
home_pagehttps://github.com/facebook/Ax
SummaryAdaptive Experimentation
upload_time2024-03-01 16:28:10
maintainer
docs_urlNone
authorFacebook, Inc.
requires_python>=3.9
licenseMIT
keywords experimentation optimization
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <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. 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](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.9 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": "",
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "",
    "keywords": "Experimentation,Optimization",
    "author": "Facebook, Inc.",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/3e/72/bf17157f48ad1c7f4222f57ac861a4aaa6945aaadc8f7183f1699146a0a9/ax-platform-0.3.7.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 [BoTorch](https://github.com/facebookexternal/botorch),\na modern library for Bayesian 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 ML-assisted A/B testing, to hyperparameter optimization in machine learning.\n* **Customization**: Ax makes it easy to add new modeling and decision algorithms, enabling research and development with minimal overhead.\n* **Production-completeness**: Ax comes with storage integration and ability to fully save and reload experiments.\n* **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).\n* **Efficiency in high-noise setting**: Ax offers state-of-the-art algorithms specifically geared to noisy experiments, such as simulations with reinforcement-learning agents.\n* **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.\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\nYou need Python 3.9 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\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 [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 one from the newly created Conda environment.\nIf you're using a Unix-based OS, you can use `which pip` to check.\n\n*Recommendation for MacOS users*: PyTorch is a required dependency of BoTorch, and can be automatically installed via pip.\nHowever, **we recommend you [install PyTorch manually](https://pytorch.org/get-started/locally/#anaconda-1) before installing Ax, using the Anaconda package manager**.\nInstalling from Anaconda will link against MKL (a library that optimizes mathematical computation for Intel processors).\nThis 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.\n\nIf you need CUDA on MacOS, you will need to build PyTorch from source. Please consult 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```\npip install jupyter\n```\n\nIf you want to store the experiments in MySQL, you will need SQLAlchemy:\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 BoTorch (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) for details and JupyterLab instructions.\n\nIf storing Ax experiments via SQLAlchemy in MySQL or SQLite:\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) 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.\n\n### Contributing\n\nSee the [CONTRIBUTING](CONTRIBUTING.md) file for how to help out.\n\nWhen contributing to Ax, we recommend cloning the [repository](https://github.com/facebook/Ax) and installing all optional dependencies:\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 this\nargument.\n\n## License\n\nAx is licensed under the [MIT license](./LICENSE).\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Adaptive Experimentation",
    "version": "0.3.7",
    "project_urls": {
        "Homepage": "https://github.com/facebook/Ax"
    },
    "split_keywords": [
        "experimentation",
        "optimization"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8f1f875aaed430bd3ca0efc9dd7102c00d445bf0ed07e69f9b74ee949b80af44",
                "md5": "44f8102f7ff86ab965cf958486901c2c",
                "sha256": "efcd18c1d1c9dc5ccf495667d69503d8b33217ebc6b80e9e9b4caeb5dcae6f11"
            },
            "downloads": -1,
            "filename": "ax_platform-0.3.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "44f8102f7ff86ab965cf958486901c2c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 1248571,
            "upload_time": "2024-03-01T16:28:08",
            "upload_time_iso_8601": "2024-03-01T16:28:08.482124Z",
            "url": "https://files.pythonhosted.org/packages/8f/1f/875aaed430bd3ca0efc9dd7102c00d445bf0ed07e69f9b74ee949b80af44/ax_platform-0.3.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3e72bf17157f48ad1c7f4222f57ac861a4aaa6945aaadc8f7183f1699146a0a9",
                "md5": "b13ed3ed9e25f71ce872d1477207393e",
                "sha256": "91f6a7d0eb08826e2f3f6a17fa64d4c9e2980ecd2147ed6418d7340c302961c1"
            },
            "downloads": -1,
            "filename": "ax-platform-0.3.7.tar.gz",
            "has_sig": false,
            "md5_digest": "b13ed3ed9e25f71ce872d1477207393e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 4395534,
            "upload_time": "2024-03-01T16:28:10",
            "upload_time_iso_8601": "2024-03-01T16:28:10.873020Z",
            "url": "https://files.pythonhosted.org/packages/3e/72/bf17157f48ad1c7f4222f57ac861a4aaa6945aaadc8f7183f1699146a0a9/ax-platform-0.3.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-01 16:28:10",
    "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"
}
        
Elapsed time: 0.27703s