Giter Site home page Giter Site logo

multi-armed-bandit's Introduction

Multi-Armed Bandit Problem

Written by Shu Ishida

This project is developed as a part of a course work assignment to compare different bandit algorithms. It implements the explore and exploit algorithm, $\epsilon$-greedy, successive elimination, UCB1 and UCB2. Implementation follows the algorithms described in Introduction to Multi-Armed Bandits by Aleksandrs Slivkins [https://arxiv.org/pdf/1904.07272.pdf].

Setup

We store experiments that have been run as pickle files. Make a directory called data to store these.

git clone https://github.com/c16192/Multi-Armed-Bandit.git
cd Multi-Armed-Bandit
mkdir data

How to run the experiments

python main.py --exp <experiment number> --bandit <type of bandit>

main.py takes other optional arguments, which can be checked by running the following:

python main.py -h

Experiment numbers are as follows: 0. Explore-exploit algorithm

  1. Optimal explore-exploit algorithm
  2. Epsilon-greedy algorithm
  3. Successive elimination algorithm
  4. UCB1 algorithm
  5. UCB2 algorithm
  6. Comparing all of the above

Types of bandits are:

  • bernoulli (default): bandit arms have bernoulli distributed rewards
  • normal: bandit arms have Gaussian distributed rewards
  • bernoulli periodic: success probability of the bernoulli distribution oscillates as a sinusoid.

How to visualise the experiments

Once the experiments have been run, they will be stored as pickle files under the data directory. While running an experiment can take a certain amount of time, plotting these results are easy.

python main.py --plot .\data\<path to pickle file>.p

multi-armed-bandit's People

Contributors

shuishida avatar

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.