Expand description
Mutation operators for real-valued genomes.
Every mutation is an in-place-ish tensor transform: it consumes a
population tensor and returns a new one with noise added per gene.
The noise is sampled from a caller-supplied host rng and
materialised via Tensor::from_data, rather than seeding the
process-wide backend RNG (B::seed + Tensor::random). Host
sampling keeps results reproducible across thread schedules: the
global Flex RNG mutex would otherwise interleave draws with sibling
tests under the parallel runner.
Functions§
- bit_
flip_ mutation - Bit-flip mutation on a binary
Tensor<B, 2, Int>population. - gaussian_
mutation - Isotropic Gaussian mutation with a scalar step-size σ.
- gaussian_
mutation_ per_ row - Per-individual anisotropic Gaussian mutation.
- uniform_
reset - Uniform-reset mutation: replace each gene with a fresh sample from
U(lo, hi)with probabilityp.