Skip to main content

Phoenics: A deep Bayesian optimizer

Project description

Phoenics

Build Status

Phoenics is an open source optimization algorithm combining ideas from Bayesian optimization with Bayesian Kernel Density estimation [1]. It performs global optimization on expensive to evaluate objectives, such as physical experiments or demanding computations.

Check out the examples folder for detailed descriptions and code examples for:

Example Link
Sequential optimization examples/optimization_sequential

Installation

Environment (Optional)

We suggest to create a new environment for the installation of Phoenics to avoid any compatibility issues with pre-existing python packages. This is optional, but recommended.

This can be done with Venv or Anaconda.

Venv

Create the virtual environment:

python -m venv venv

Activate (Unix):

source venv/bin/activate

Activate (Windows):

.\venv\Scripts\activate

A venv folder will be created in the current directory and the virtual enviroment will be activated.

Note: Edward backend requires Python 3.6 in order to install all needed dependencies. Python version can be specified as follow:

python3.6 -m venv venv

Anaconda

conda create --name venv
conda activate venv

Note: Edward backend requires Python 3.6 in order to install all needed dependencies. Python version can be specified as follow:

conda create --name venv python=3.6

Phoenics as pip module

Phoenics can be installed directly with pip:

apt-get install python-pip
python -m pip install phoenics

Phoenics from source

Phoenics can also be installed from source. This way allows anyone to make and test changes on the code.

git clone https://github.com/chemos-inc/phoenics.git
cd phoenics
python -m pip install -U pip
python -m pip install -r requirements.txt
python -m pip install -e .

Dependencies and requirements

This code has been tested with Python 3.6 and 3.7 on Unix platforms and on Windows 10.

PIP

It requires the following pip packages:

  • numpy
  • pyyaml >= 5.1
  • sqlalchemy >= 1.3
  • watchdog >= 0.9
  • wheel >= 0.33

These will be automatically installed by running the setup.py or by installing Phoenics as a pip module.

Windows

Requirements for Windows:

Backend

Phoenics requires additional modules for the backend of its Bayesian Neural Network. Two options are currently supported: tensorflow-probability and edward.

Tensorflow probability

To use this backend, specify it in the configuration file:

"backend": "tfprob"

Install it with:

python -m pip install tensorflow==1.15
python -m pip install tensorflow-probability==0.8.0

Note: A warning will be generated if a version lower than 41.0.0 of setuptools is installed. To fix the warning run:

python -m pip install setuptools==41.0.0

Edward

To use this backend, specify it in the configuration file:

"backend": "edward"

Install it with:

python -m pip install edward==1.3.5
python -m pip install tensorflow==1.4.1

Note: tensorflow==1.4.1 can not be installed with Python 3.7+.

Run the example

git clone git@github.com:chemos-inc/phoenics.git
cd phoenics
python -m venv venv
source venv/bin/activate # on Windows: .\venv\Scripts\activate
python -m pip install -U pip
python -m pip install setuptools==41.0.0
python -m pip install -r requirements.txt
python -m pip install tensorflow==1.15
python -m pip install tensorflow-probability==0.8.0
python -m pip install -e .
cd examples/optimization_sequential/
python ./optimize_branin.py

Using Phoenics

Phoenics is designed to suggest new parameter points based on prior observations. The suggested parameters can then be passed on to objective evaluations (experiments or involved computation). As soon as the objective values have been determined for a set of parameters, these new observations can again be passed on to Phoenics to request new, more informative parameters.

from phoenics import Phoenics

# create an instance from a configuration file
config_file = 'config.json'
phoenics    = Phoenics(config_file)

# request new parameters from a set of observations
params      = phoenics.recommend(observations = observations)

Detailed examples for specific applications are presented in the examples folder.

Disclaimer

Note: This repository is under construction! We hope to add further details on the method, instructions and more examples in the near future.

Experiencing problems?

Please create a new issue and describe your problem in detail so we can fix it.

References

[1] Häse, F., Roch, L. M., Kreisbeck, C., & Aspuru-Guzik, A. Phoenics: A Bayesian Optimizer for Chemistry. ACS central science 4.6 (2018): 1134-1145.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

phoenics-0.2.0.tar.gz (177.7 kB view details)

Uploaded Source

File details

Details for the file phoenics-0.2.0.tar.gz.

File metadata

  • Download URL: phoenics-0.2.0.tar.gz
  • Upload date:
  • Size: 177.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0.post20200518 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7

File hashes

Hashes for phoenics-0.2.0.tar.gz
Algorithm Hash digest
SHA256 cd2129a8781e6dcc21c5bb2cad100de249bb0d8bff5c68afd9774788e1f981a2
MD5 fc3baefc2f89a912d412d3bbb31396da
BLAKE2b-256 49134de55677b426376588d6fa7fb914a96861eec92fc935250e9cd0584eba95

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