Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 20 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#LibBandit
# LibBandit

LibBandit is a C++ library designed for efficiently simulating multi-armed bandit algorithms.
LibBandit is a C++ library designed for efficiently simulating [multi-armed bandit](https://en.wikipedia.org/wiki/Multi-armed_bandit) algorithms, by [Tor Lattimore](https://github.com/tor).

Currently the following algorithms are implemented:

* UCB
* Optimally confident UCB
* Optimally confident UCB (OCUCB)
* Almost optimally confident UCB
* Thompson sampling (Gaussian prior)
* MOSS
Expand All @@ -15,38 +16,34 @@ Currently the following algorithms are implemented:
Defining new noise models is as simple as extending a base class and implementing the reward function.


##Compiling

You will need a C++11 compliant compiler such as g++ 4.8 or clang 5.

LibBandit uses the Scons build system. With this installed you should be able to compile all sources by typing `scons`


##Using the Library
## Compiling

LibBandit is easy to use. See the examples/ folder.
You will need a C++11 compliant compiler such as `g++` 4.8 or `clang` 5.

LibBandit uses the [Scons build system](http://scons.org/). With this installed, you should be able to compile all sources by typing `scons`

##Gittins Index

The library includes code for efficiently generating Gittins indices for a Gaussian prior and noise model. Included is a precomputed
table of indices for horizons up to 5,000. See the examples/ folder for details on how to use this data.
## Using the Library

To compute the indices yourself use `makegittins build <file> <horizon> <tolerance> <maxthreads>`
LibBandit is easy to use. See the [examples/ folder](examples/).

The tolerance should be chosen as small as possible. The pre-computed table used tolerance = 0.000005.

You can lookup the Gittins index in a table with `makegittins lookup <file> <horizon> <T>` where <horizon> is the number of rounds
remaining and <T> is the number of samples from that arm.
## Gittins Index

A larger pre-computed table for horizon 10,000 and tolerance 0.000005 is available for download from http://downloads.tor-lattimore.com/gittins/10000.zip.
The library includes code for efficiently generating Gittins indices for a Gaussian prior and noise model.
Included is a precomputed table of indices for horizons up to `5,000`. See the [examples/ folder](examples/) for details on how to use this data.

To compute the indices yourself use `makegittins build <file> <horizon> <tolerance> <maxthreads>`.

The tolerance should be chosen as small as possible. The pre-computed table used `tolerance = 0.000005`.

##Contributing
You can lookup the Gittins index in a table with `makegittins lookup <file> <horizon> <T>` where `<horizon>` is the number of rounds remaining and `<T>` is the number of samples from that arm.

If you implement a new algorithm please (a) test it against existing algorithms and (b) contact me to become a
contributor so others can easily test against your algorithm.
A *larger* pre-computed table for horizon `10,000` and tolerance `0.000005` is available for download from http://downloads.tor-lattimore.com/gittins/10000.zip.

## Contributing

If you implement a new algorithm, please

1. test it against existing algorithms and
2. contact me to become a contributor so others can easily test against your algorithm.