Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speedup Bernoulli Multi-Armed Bandit Example #380

Merged
Merged
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
9 changes: 7 additions & 2 deletions examples/Multi_Armed_Bandit/bernoulli_multi_armed_bandit.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
)
from baybe.surrogates import BetaBernoulliMultiArmedBanditSurrogate
from baybe.targets import BinaryTarget
from baybe.utils.random import set_random_seed

### An Imaginary Use Case

Expand Down Expand Up @@ -61,6 +62,10 @@ def draw_arm(self, arm_index: int) -> bool:

### Setup

# Setting a random seed for reproducibility.

set_random_seed(42)
julianStreibel marked this conversation as resolved.
Show resolved Hide resolved

# For our example, we use a system with a fixed collection of win rates, which we
# assume are unknown to us:

Expand All @@ -83,8 +88,8 @@ def draw_arm(self, arm_index: int) -> bool:
qThompsonSampling(), # Online optimization
PosteriorStandardDeviation(), # Active learning
]
N_MC_RUNS = 2 if SMOKE_TEST else 10
N_ITERATIONS = 2 if SMOKE_TEST else 200
N_MC_RUNS = 3 if SMOKE_TEST else 10
N_ITERATIONS = 50 if SMOKE_TEST else 200


### Building the Model
Expand Down
Loading