#include <thompson.h>
Definition at line 11 of file thompson.h.
◆ ThompsonSamplingBandit() [1/2]
Brush::MAB::ThompsonSamplingBandit::ThompsonSamplingBandit |
( |
vector< string > | arms, |
|
|
bool | dynamic = false ) |
◆ ThompsonSamplingBandit() [2/2]
Brush::MAB::ThompsonSamplingBandit::ThompsonSamplingBandit |
( |
map< string, float > | arms_probs, |
|
|
bool | dynamic = false ) |
◆ ~ThompsonSamplingBandit()
Brush::MAB::ThompsonSamplingBandit::~ThompsonSamplingBandit |
( |
| ) |
|
|
inline |
◆ choose()
string Brush::MAB::ThompsonSamplingBandit::choose |
( |
| ) |
|
|
virtual |
Chooses an arm based on the given tree and fitness. Should call sample_probs internally.
- Parameters
-
tree | The tree structure used to choose the arm. |
f | The fitness value used to influence the choice. |
- Returns
- The arm with highest probability.
Reimplemented from Brush::MAB::BanditOperator.
Definition at line 54 of file thompson.cpp.
◆ sample_probs()
std::map< string, float > Brush::MAB::ThompsonSamplingBandit::sample_probs |
( |
bool | update | ) |
|
|
virtual |
Samples the probabilities of the arms.
- Parameters
-
update | A boolean indicating whether to update the probabilities. |
- Returns
- A map of arms and their probabilities.
Reimplemented from Brush::MAB::BanditOperator.
Definition at line 27 of file thompson.cpp.
◆ update()
void Brush::MAB::ThompsonSamplingBandit::update |
( |
string | arm, |
|
|
float | reward ) |
|
virtual |
Updates the reward for a specific arm.
- Parameters
-
arm | The arm for which to update the reward. |
reward | The reward value. |
Reimplemented from Brush::MAB::BanditOperator.
Definition at line 60 of file thompson.cpp.
◆ alphas
std::map<string, float> Brush::MAB::ThompsonSamplingBandit::alphas |
|
private |
◆ betas
std::map<string, float> Brush::MAB::ThompsonSamplingBandit::betas |
|
private |
float Brush::MAB::ThompsonSamplingBandit::C = 250 |
|
private |
◆ dynamic_update
bool Brush::MAB::ThompsonSamplingBandit::dynamic_update |
|
private |
The documentation for this class was generated from the following files: