|
k-Armed Bandit 1.0.0
A collection of k-armed bandits and assoicated agents for reinforcement learning
|
This bandit draws a reward from a set normal distribution each time an arm is chosen. More...
Public Member Functions | |
| None | __init__ (self, int k) |
| Construct the class. | |
| select (self, index) | |
| Select one or several arms to obtain a reward from. | |
| trueValues (self) | |
| Return the distribution parameters for the arms. | |
Public Member Functions inherited from bandit.base_bandit.BaseBandit | |
| int | k (self) |
| Return the number of arms this bandit has. | |
Protected Attributes | |
| _std | |
| _mean | |
Protected Attributes inherited from bandit.base_bandit.BaseBandit | |
| _k | |
This bandit draws a reward from a set normal distribution each time an arm is chosen.
Each arm has its own distribution that is fixed upon construction. Each distribution has a standard deviation of 1 and a mean randomly drawn from the uniform range [-1, 1).
| None bandit.normal.Normal.__init__ | ( | self, | |
| int | k | ||
| ) |
Construct the class.
This includes defining the normal distribution parameters for each arm. There is a different distribution for each arm. The means are sampled from the uniform range [-1, 1). The standard deviations are 1.0.
| k | The number of arms this bandit should have. This must be an int greater than 0. |
Reimplemented from bandit.base_bandit.BaseBandit.
Reimplemented in bandit.random_walk.RandomWalk.
| bandit.normal.Normal.select | ( | self, | |
| index | |||
| ) |
Select one or several arms to obtain a reward from.
| index | Any numpy valid indexing method to select which arms a reward should be drawn from. None can also be passed, but will only return a reward of None. |
Reimplemented from bandit.base_bandit.BaseBandit.
Reimplemented in bandit.random_walk.RandomWalk.
| bandit.normal.Normal.trueValues | ( | self | ) |
Return the distribution parameters for the arms.
Reimplemented from bandit.base_bandit.BaseBandit.