archon-laboratories / obriareus

A Framework for Multi-Armed Bandit Problems
8 stars 4 forks source link

Obriareus

By: Sam Beckmann, Nate Beckemeyer

Framework for testing algorithms in the multi-armed bandit problem with budget constraints.

Changeable Parameters:

Inputting Data

To input a dataset to the program, create a file in a datasets folder your working directory. There are some shortcuts for the syntax of entering data, so the following two sample datasets input the same data:

# Distributions to Run
com.samvbeckmann.obriareus.distributions.Gaussian
com.samvbeckmann.obriareus.distributions.Poisson

# Budgets to Run
50
100
150
200
250
300
350
400
450
500

# Number of Trials
1000

# Number of Arms
10

# Arm Costs
1
1
1
1
1
1
1
1
1
1

# Mean Rewards
.1
.2
.3
.4
.5
.6
.7
.8
.9
1

# Standard Deviations
.3
.3
.3
.3
.3
.3
.3
.3
.3
.3

# Algorithms
com.samvbeckmann.obriareus.algorithms.Greedy
com.samvbeckmann.obriareus.algorithms.EFirst, .1
com.samvbeckmann.obriareus.algorithms.EFirst, .2
com.samvbeckmann.obriareus.algorithms.FKUBE
com.samvbeckmann.obriareus.algorithms.FKDE, 10
com.samvbeckmann.obriareus.algorithms.UCBBV1
com.samvbeckmann.obriareus.algorithms.EProgressive, .1
com.samvbeckmann.obriareus.algorithms.EProgressive, .2
com.samvbeckmann.obriareus.algorithms.LSplit, .5
com.samvbeckmann.obriareus.algorithms.SOAAv, 0
# Distributions to Run
com.samvbeckmann.obriareus.distributions.Gaussian
com.samvbeckmann.obriareus.distributions.Poisson

# Budgets to Run
*
50
500
50

# Number of Trials
1000

# Number of Arms
10

# Arm Costs
*
1

# Mean Rewards
*
linear

# Standard Deviations
*
.3

# Algorithms
com.samvbeckmann.obriareus.algorithms.Greedy
com.samvbeckmann.obriareus.algorithms.EFirst, .1
com.samvbeckmann.obriareus.algorithms.EFirst, .2
com.samvbeckmann.obriareus.algorithms.FKUBE
com.samvbeckmann.obriareus.algorithms.FKDE, 10
com.samvbeckmann.obriareus.algorithms.UCBBV1
com.samvbeckmann.obriareus.algorithms.EProgressive, .1
com.samvbeckmann.obriareus.algorithms.EProgressive, .2
com.samvbeckmann.obriareus.algorithms.LSplit, .5
com.samvbeckmann.obriareus.algorithms.SOAAv, 0

To break down the precise syntax:

Output

The program outputs data in two ways: First, a sample of data is outputted the console. The output lists the distribution, budget, and algorithm that is being evaluated, followed by the normalized and absolute output of the algorithm (normalized output is the algorithm's average utility minus the average utility of of all the algorithms).

For plotting purposes, the data is also outputted to the output folder in the project as a .txt file under the name dataset_distribution_normalized.txt where dataset is the name of the dataset that is being used, distribution being the distribution of rewards for that specific output, and normalized being either normalized or absolute, based on what data the file contains. The file is formatted with the first item in each line is the budget for that line contains the output of, and the remaining items are the rewards of the algorithms, printed in the order the algorithms were initialized in the dataset. All values are separated by commas.

Default Algorithms

Obriareus contains 8 algorithms by default:

Default Distributions

Obriareus contains 3 different value distributions by default:

Extending

It is possible to extend Obriareus to implement your own algorithms and distributions.

To do so, simply import Obriareus as a library or framework, then create your own algorithms and distributions in your project. For algorithms to be recognized by Obriareus, they must implement the IAlgorithms interface. Distributions must implement the IDistribution interface. To call new algorithms and distributions, simply put the fully qualified classpath in the appropriate location in the dataset file.