evox.operators.selection.tournament_selection
¶
Module Contents¶
Functions¶
Perform tournament selection based on multiple fitness values. |
|
Perform tournament selection based on single fitness values. |
API¶
- evox.operators.selection.tournament_selection.tournament_selection_multifit(n_round: int, fitnesses: List[torch.Tensor], tournament_size: int = 2) torch.Tensor [source]¶
Perform tournament selection based on multiple fitness values.
- Parameters:
n_round – Number of rounds of selection (how many solutions to select).
fitnesses – A list of 1D tensors, each representing the fitness values of candidates for different objectives.
tournament_size – Number of candidates in each tournament. Defaults to 2.
- Returns:
Indices of the selected solutions after tournament selection.
This function performs tournament selection by randomly selecting a group of candidates for each round, and selecting the best one from each group based on their fitness values across multiple objectives.
- evox.operators.selection.tournament_selection.tournament_selection(n_round: int, fitness: torch.Tensor, tournament_size: int = 2) torch.Tensor [source]¶
Perform tournament selection based on single fitness values.
- Parameters:
n_round – Number of rounds of selection (how many solutions to select).
fitness – A 1D tensor representing the fitness values of candidates.
tournament_size – Number of candidates in each tournament. Defaults to 2.
- Returns:
Indices of the selected solutions after tournament selection.
This function performs tournament selection by randomly selecting a group of candidates for each round, and selecting the best one from each group based on their fitness values.