geneticengine.algorithms.gp.operators.seda
Smoothed estimation of distribution for grammar-guided GP.
The model is deliberately independent of a particular genotype encoding: representations provide the production choices made by an individual, and SEDA turns elite choices into smoothed production probabilities.
Classes
Learn a smoothed distribution over grammar productions. |
Module Contents
- class geneticengine.algorithms.gp.operators.seda.SEDA
Learn a smoothed distribution over grammar productions.
samplescontains(fitness, choices)pairs. Each choices mapping maps a non-terminal to the productions used while deriving one individual. Lower fitness is considered better whenminimizeis true.- elite_fraction: float = 0.2
- smoothing: float = 0.1
- minimize: bool = True
- probabilities: dict[Any, list[float]]
- __post_init__()
- estimate(samples)
Estimate production probabilities from the best sample fraction.
- Parameters:
samples (collections.abc.Iterable[tuple[float, collections.abc.Mapping[Any, collections.abc.Sequence[Any]]]])
- Return type:
None
- sample(random, nonterminal)
Sample a production for
nonterminalfrom the learned model.- Parameters:
nonterminal (Any)
- Return type:
Any