Module pareto
Expand description
Multi-objective comparison: dominance, fronts, crowding, constraints and hypervolume.
This is the arithmetic multi-objective optimization rests on, kept free of
any sampler, study or storage state so every piece can be pinned by an
exact golden computed by hand.
Nsga2 is its first consumer;
StudyView::pareto_front is the
second.
| Piece | Answers |
|---|---|
dominates | is a at least as good in every objective and better in one? |
constrained_dominates | the same question, feasibility first |
fast_non_dominated_sort | which front does each point belong to? |
crowding_distance | how isolated is a point inside its front? |
hypervolume | how much objective space does a front cover? |
worst_constraints | what does a multi-seed fan’s feasibility collapse to? |
§Multi-objective is not a bolt-on
The seams were built for this from M1: a trial’s
values is a Vec<f64>,
Scheduler::on_report takes a
values slice so pruning is multi-objective-aware, and
StudyView::best deliberately returns
None for a multi-objective study because there is no total order on a
Pareto front. This module is the answer that replaces it.
§Two decisions that run through everything
A NaN objective never wins. A vector that carries a NaN — or that has
the wrong number of objectives — is incomparable rubbish: it dominates
nothing and is dominated by every well-formed vector, so it sinks to the last
front instead of silently colonising the Pareto set. This matches
Direction::is_better (where NaN is
never better than anything) and the multi-seed aggregates (where NaN
propagates and simply cannot win). ±∞ is an ordinary float here and
compares normally.
Constraints are feasibility-first
(Constraints):
a feasible solution beats an infeasible one whatever
their objectives say, and two infeasible ones are ranked by total violation.
The sign convention is Optuna’s — ≤ 0 is satisfied, > 0 is violated —
and a constraint value is recorded as typed state on the trial
(constraint, TrialCtx::record_constraints),
never as an extra objective column. A trial that is a multi-seed fan
records one vector per replicate and carries their componentwise worst
(worst_constraints), because feasibility has to hold on every seed.
Re-exports§
pub use constraint::CONSTRAINT_BLOB_KIND;pub use constraint::CONSTRAINT_BLOB_VERSION;pub use constraint::TrialConstraints;pub use constraint::constraint_scope;pub use constraint::is_feasible;pub use constraint::total_violation;pub use constraint::worst_constraints;
Modules§
- constraint
- Typed constraints: the sign convention, the arithmetic, and where a trial’s constraint values live.
Structs§
- Point
- One solution as the comparison layer sees it: its objectives and, if it declared any, its constraint values.
Constants§
- MAX_
EXACT_ HYPERVOLUME_ DIM - The highest objective count
hypervolumecomputes exactly.
Functions§
- constrained_
dominates - Feasibility-first dominance (Deb 2000), the relation a constrained multi-objective study ranks by.
- crowding_
distance - The crowding distance of every member of one front (Deb et al. 2002).
- dominates
- Direction-aware Pareto dominance:
adominatesbiff it is no worse in every objective and strictly better in at least one. - fast_
non_ dominated_ sort - Deb’s fast non-dominated sort: partitions
pointsinto fronts, front0being the non-dominated (Pareto) set. - hypervolume
- The hypervolume indicator: the volume of objective space that
pointsdominate, bounded byreference. - nadir_
point - The nadir point of a set of objective vectors: the componentwise worst value observed, in the study’s own orientation.
- non_
domination_ ranks - The non-domination rank of every point:
0for the Pareto front,1for what is left once it is removed, and so on. - pareto_
front_ indices - The indices of the non-dominated (Pareto) set — front
0offast_non_dominated_sort, ascending.