Expand description
Parent-selection operators.
Selection operators turn a fitness slice into winner indices that the
caller uses (via Tensor::select) to gather parents out of the
population. The baseline is host-side sampling + a single device
gather; a fused kernel variant is tracked as
follow-up work.
All operators that draw random numbers accept an explicit &mut dyn Rng
(the host-RNG convention). Operators never touch thread-local or
process-wide backend RNG state (B::seed / Tensor::random), which
would race with sibling tests under the parallel test runner.
§Fitness convention
Fitness values are interpreted as “lower is better” (cost).
Tournament selection retains the smallest fitness seen across all
candidates in a single draw; truncation selection returns the top_k
entries with the smallest fitnesses.
Functions§
- tournament_
indices_ host - K-ary tournament selection over a fitness slice.
- tournament_
select - Gathers
n_winnersrows out of a population tensor by tournament. - truncation_
indices_ host - Returns the indices of the
top_klowest-fitness members. - truncation_
select - Gathers the
top_klowest-fitness rows out of a population tensor.