Expand description
Bayesian building blocks and an online operator-parameter tuner.
This module provides:
- Honest conjugate posteriors that say what they are:
BetaPosterior(Beta-Bernoulli over a probability),GammaPosterior(Gamma-Exponential over a positive rate), andRunningLogMoments(a moment tracker for log-scale quantities — not a Bayesian posterior, and named accordingly). - A
ThompsonSamplingTuner: a genuine multi-armed-bandit tuner for GA operator parameters. Each tunable parameter is discretized into candidate values (“arms”); each arm carries a Beta posterior overP(offspring improves on parents | this value is used). Every generation an arm is Thompson-sampled per parameter and its value is applied to the operators; the observed improvement events are credited back to the arm that produced them.
The Beta draw taken during Thompson sampling is used only to pick an arm;
it is never returned as the parameter value itself. This is the correct
separation that the previous BayesianHyperparameterLearner got wrong (it
sampled a P(improvement) posterior and used the draw as the mutation rate).
Structs§
- Bandit
Arm - One discretized candidate value for a tunable parameter, with a Beta posterior
over
P(offspring improves on parents | this value is used). - Bandit
Parameter - A single tunable parameter, discretized into arms and tuned by Thompson sampling over each arm’s Beta posterior.
- Beta
Posterior - Beta distribution posterior for a probability parameter (Beta-Bernoulli).
- Gamma
Posterior - Gamma posterior for the rate
λof anExponential(λ)likelihood. - Running
LogMoments - Running mean/variance of
ln(x)for positive quantities such as step sizes. - Thompson
Config - Configuration for a
ThompsonSamplingTunerwired into a GA. - Thompson
Sampling Tuner - Thompson-sampling multi-armed-bandit tuner over GA operator parameters.
- Tuner
Snapshot - A snapshot of a tuner’s per-arm posterior means at one generation.
Constants§
- PARAM_
CROSSOVER_ PROB - Canonical parameter name for the whole-genome crossover probability arm set.
- PARAM_
MUTATION_ RATE - Canonical parameter name for the per-gene mutation probability arm set.
Traits§
- Tunable
Mutation - Mutation operators whose per-gene mutation probability can be set by an online
tuner such as
ThompsonSamplingTuner.