evox.operators.selection.find_pbest
¶
Module Contents¶
Functions¶
Selects a random personal-best vector from the population for each individual. |
API¶
- evox.operators.selection.find_pbest.select_rand_pbest(percent: float, population: torch.Tensor, fitness: torch.Tensor) torch.Tensor [source]¶
Selects a random personal-best vector from the population for each individual.
- Parameters:
percent – The proportion of the population to consider as best. Must be between 0 and 1.
population – The population tensor of shape
(pop_size, dim)
.fitness – The fitness tensor of shape
(pop_size,)
.
- Returns:
A tensor containing the selected personal-best vector for each individual.