Skip to main content

Module bayesian_ga

Module bayesian_ga 

Source
Expand description

A single-level Bayesian adaptive genetic algorithm

This module replaces the former “HBGA” heuristic (which collapsed its priors to their means and adapted with a fixed ×1.05 / ×0.95 rule) with a genuine Bayesian treatment of the operator hyperparameters.

§The model

Each mutation operator k (a coordinate-wise Gaussian with its own step size σ_k) has an unknown per-application success probability θ_k — the probability that applying it to a parent yields a fitter child. We place a conjugate Beta(α_k, β_k) prior on θ_k and treat each offspring as a Bernoulli improvement trial, so the posterior is the exact conjugate update

    α_k ← α_k + (# improving children),   β_k ← β_k + (# non-improving).

Operator selection is Thompson sampling: every generation we draw one θ̃_k ~ Beta(α_k, β_k) from each current posterior and apply the operator with the largest draw. This replaces the fixed heuristic with hyperparameters sampled from the current posterior each generation.

In addition, a Gamma(shape, rate) posterior tracks the rate λ of improvement events per generation via the conjugate Gamma–Poisson update (shape ← shape + count, rate ← rate + 1 each generation). It is reported as a learned diagnostic of how “improvable” the search currently is.

This is a single-level Bayesian model (independent conjugate posteriors, no hyperprior over the Beta/Gamma parameters), hence the honest name BayesianAdaptiveGA rather than “hierarchical Bayesian”.

Structs§

BayesianAdaptiveGA
A single-level Bayesian adaptive genetic algorithm.
BayesianAdaptiveGAResult
Result of a BayesianAdaptiveGA run.
BetaSuccessPosterior
Conjugate Beta(α, β) posterior over a Bernoulli success probability.
GammaRatePosterior
Conjugate Gamma(shape, rate) posterior over a Poisson rate λ.
OperatorArm
A mutation operator arm: a Gaussian step size with its own success posterior.