Skip to main content

Offline Contextual Bayesian Optimization

Project description

Offline Contextual Bayesian Optimization

Overview

In Bayesian Optimization (BO), many times there are several systems or "tasks" to simultaneously optimize. This repository contains Multi-task Thompson Sampling (MTS), a BO algorithm we developed to pick both tasks and actions to evaluate. Because some tasks are usually more difficult than others, MTS often significantly outperforms standard BO techniques.

Getting Set Up

The code is compatible with python 2.7. First, clone this repo and run

pip install -r requirements

By default the code leverages the Dragonfly library.

Reproducing Synthetic Experiments

The plots in the paper can be reproduced by running ocbo.py and cts_ocbo.py with the appropriate options file.

cd src
mkdir data
python ocbo.py --options <path_to_option_file>

or if continuous

python cts_ocbo.py --options <path_to_option_file>

After the simulation has finished, the plots can be reproduced by

cd scripts
python discrete_plotter.py --write_dir ../data --run_id <options_name>

or

python cts_plotter.py --write_dir ../data --run_id <options_name>

For discrete experiments, use the flag --risk_neutral 1 to show the risk neutral performance instead and use --plot_props 1 flag to show the proportion of resources given to different tasks.

With the exception of the experiment in Section 4, the table below shows the option file the corresponds to a given experiment.

Experiment Option File
Figure 1(a,b) set2d.txt
Figure 1(c) rand4d.txt
Figure 1(d) rand6d.txt
Figure 1(e)/4(a) jointbran.txt
Figure 1(f)/4(b) jointh22.txt
Figure 1(g)/4(c) jointh31.txt
Figure 1(h)/4(d) jointh42.txt
Figure 5(a) contbran.txt
Figure 5(b) conth22.txt
Figure 5(c) conth31.txt
Figure 5(d) conth42.txt
Figure 5(e) contbran_sethps.txt
Figure 5(f) conth22_sethps.txt
Figure 5(g) conth31_sethps.txt
Figure 5(h) conth42_sethps.txt

Citing Work

If you use any code please cite the following:

@inproceedings{char2019offline,
  title={Offline contextual bayesian optimization},
  author={Char, Ian and Chung, Youngseog and Neiswanger, Willie and Kandasamy, Kirthevasan and Nelson, Andrew Oakleigh and Boyer, Mark and Kolemen, Egemen and Schneider, Jeff},
  booktitle={Advances in Neural Information Processing Systems},
  pages={4627--4638},
  year={2019}
}

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

OCBO-0.1.1.tar.gz (45.0 kB view details)

Uploaded Source

File details

Details for the file OCBO-0.1.1.tar.gz.

File metadata

  • Download URL: OCBO-0.1.1.tar.gz
  • Upload date:
  • Size: 45.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5

File hashes

Hashes for OCBO-0.1.1.tar.gz
Algorithm Hash digest
SHA256 facd18abea94f6dea5e7a5eadde0ff14afdb7d99fb3e5685af70d47b439245c6
MD5 585aa0032cf798942bff76969b68f8b0
BLAKE2b-256 5b5e273ce7618809fb847478c99129f5c3f1a1880ccaa8801ddeaec037b23399

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