Skip to main content

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.

Metadata

Release files for phoenics 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for phoenics 0.2.0
File Size Uploaded Provenance Actions
phoenics-0.2.0.tar.gz 177.7 kB Without provenance Details for phoenics-0.2.0.tar.gz

Release files / phoenics-0.2.0.tar.gz

Download URL phoenics-0.2.0.tar.gz
Size 177.7 kB
Tags Source
SHA-256 checksum
How to use checksums
cd2129a8781e6dcc21c5bb2cad100de249bb0d8bff5c68afd9774788e1f981a2
BLAKE2b-256 checksum
How to use checksums
49134de55677b426376588d6fa7fb914a96861eec92fc935250e9cd0584eba95
Upload date
Uploaded using Trusted Publishing?
What is 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

Security for phoenics 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page