evox.operators.selection.non_dominate
¶
Module Contents¶
Functions¶
Return the domination relation matrix A, where A_{ij} is True if x_i dominates y_j. |
|
Update the dominate count and ranks for the current Pareto front. |
|
Compute the non-domination rank for a set of solutions in multi-objective optimization. |
|
Compute the crowding distance for a set of solutions in multi-objective optimization. |
|
Perform environmental selection based on non-domination rank and crowding distance. |
API¶
- evox.operators.selection.non_dominate.dominate_relation(x: torch.Tensor, y: torch.Tensor) torch.Tensor [source]¶
Return the domination relation matrix A, where A_{ij} is True if x_i dominates y_j.
- Parameters:
x – An array with shape (n1, m) where n1 is the population size and m is the number of objectives.
y – An array with shape (n2, m) where n2 is the population size and m is the number of objectives.
- Returns:
The domination relation matrix of x and y.
- evox.operators.selection.non_dominate.update_dc_and_rank(dominate_relation_matrix: torch.Tensor, dominate_count: torch.Tensor, pareto_front: torch.BoolTensor, rank: torch.Tensor, current_rank: int)[source]¶
Update the dominate count and ranks for the current Pareto front.
- Parameters:
dominate_relation_matrix – The domination relation matrix between individuals.
dominate_count – The count of how many individuals dominate each individual.
pareto_front – A tensor indicating which individuals are in the current Pareto front.
rank – A tensor storing the rank of each individual.
current_rank – The current Pareto front rank.
- Returns:
rank: Updated rank tensor.
dominate_count: Updated dominate count tensor.
- evox.operators.selection.non_dominate._igr_fake(dominate_relation_matrix: torch.Tensor, dominate_count: torch.Tensor, rank: torch.Tensor, pareto_front: torch.Tensor, compiling: bool) torch.Tensor [source]¶
- evox.operators.selection.non_dominate._igr_fake_vmap(dominate_relation_matrix: torch.Tensor, dominate_count: torch.Tensor, rank: torch.Tensor, pareto_front: torch.Tensor, compiling: bool) torch.Tensor [source]¶
- evox.operators.selection.non_dominate._vmap_iterative_get_ranks_compile(dominate_relation_matrix: torch.Tensor, dominate_count: torch.Tensor, rank: torch.Tensor, pareto_front: torch.Tensor) torch.Tensor [source]¶
- evox.operators.selection.non_dominate._vmap_iterative_get_ranks(dominate_relation_matrix: torch.Tensor, dominate_count: torch.Tensor, rank: torch.Tensor, pareto_front: torch.Tensor, compiling: bool) torch.Tensor [source]¶
- evox.operators.selection.non_dominate._iterative_get_ranks_compile(dominate_relation_matrix: torch.Tensor, dominate_count: torch.Tensor, rank: torch.Tensor, pareto_front: torch.Tensor) torch.Tensor [source]¶
- evox.operators.selection.non_dominate._iterative_get_ranks(dominate_relation_matrix: torch.Tensor, dominate_count: torch.Tensor, rank: torch.Tensor, pareto_front: torch.Tensor, compiling: bool) torch.Tensor ¶
- evox.operators.selection.non_dominate.non_dominate_rank(x: torch.Tensor) torch.Tensor [source]¶
Compute the non-domination rank for a set of solutions in multi-objective optimization.
The non-domination rank is a measure of the Pareto optimality of each solution.
- Parameters:
f – A 2D tensor where each row represents a solution, and each column represents an objective.
- Returns:
A 1D tensor containing the non-domination rank for each solution.
- evox.operators.selection.non_dominate.crowding_distance(costs: torch.Tensor, mask: torch.Tensor)[source]¶
Compute the crowding distance for a set of solutions in multi-objective optimization.
The crowding distance is a measure of the diversity of solutions within a Pareto front.
- Parameters:
costs – A 2D tensor where each row represents a solution, and each column represents an objective.
mask – A 1D boolean tensor indicating which solutions should be considered.
- Returns:
A 1D tensor containing the crowding distance for each solution.
- evox.operators.selection.non_dominate.nd_environmental_selection(x: torch.Tensor, f: torch.Tensor, topk: int)[source]¶
Perform environmental selection based on non-domination rank and crowding distance.
- Parameters:
x – A 2D tensor where each row represents a solution, and each column represents a decision variable.
f – A 2D tensor where each row represents a solution, and each column represents an objective.
topk – The number of solutions to select.
- Returns:
A tuple of four tensors:
x: The selected solutions.
f: The corresponding objective values.
rank: The non-domination rank of the selected solutions.
crowding_dis: The crowding distance of the selected solutions.