Git Product home page Git Product logo

bayesopt-nash-eq's Introduction

bayesopt-nash-eq

Code repository for Approximating Nash Equilibria for Black-Box Games: A Bayesian Optimization Approach

Setup / Python environment

conda install nb_conda
conda env create --file environment.yml

This will create an environment called ne.

To activate this environment, execute:

source activate ne

Running the demo

The demo.ipynb demonstrates the algorithm along with the algorithms considered in the paper. It also demonstrates other utils/plots that can be found in the repo.

jupyter notebook

Running Experiments

The script toy_experiments.py performs experiments on SADDLE and MOP problems. The experiment can be configured according to a configuration files, as follows. cd to the repo directory and do the following:

export PYTHONPATH=.
python ne/experiments/toy_experiments.py -f ne/experiments/configs/saddle_config.yml

As the experiment is running, results of different runs/algorithms/problems will be stored in ne/experiments/res as {experiment_name}_{alg_name}_{dimension}_{run_number}.json, these files are helpful for backup/monitoring purposes. At the end of the experiment a json file {experiment_name}.json will be generated which essentially concatentates all {experiment_name}_*.json

Plotting Results

The demo.ipynb demonstrates how the results can be plotted. Moreover, a json file whose format is similar to that created by toy_experiments.py can be passed to the plot_regret_trace function under ne/utils/plots.py as demonstrated in the main block of ne/utils/plots.py. The results of the saddle_config.yml experiment is stored in ne/experiments/res/saddle_res.json

For the experiment defined above, the plots.py script is set to display its result:

python ne/utils/plots.py

GPGame Interface

To install from Python

from rpy2.robjects.packages import importr
utils = importr('utils')
utils.install_packages('GPGame')

There might be some difficulty in installing the "GPGame" package and interfacing it with Python. Make sure you install the package (and all the required packages) with sudo. Then copy it to the environment's R/library

sudo R
>> install.packages("GPGame")
>> quit()
sudo cp -a ~/R/x86_64-pc-linux-gnu-library/3.2/. ~/anaconda2/envs/ne/lib/R/library/

Running Multithreaded experiments

There is unintended multithreading with numpy ( https://stackoverflow.com/questions/19257070/unintented-multithreading-in-python-scikit-learn )

Check the blas/lapack library used and set the number of threads. E.g.

export OPENBLAS_NUM_THREADS=1

Citation

If you make use of this code and you'd like to cite us, please consider the following:

@article{al2018approximating,
  title={Approximating Nash Equilibria for Black-Box Games: A Bayesian Optimization Approach},
  author={Al-Dujaili, Abdullah and Hemberg, Erik and O'Reilly, Una-May},
  journal={arXiv preprint arXiv:1804.10586},
  year={2018}
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.