Solvers.NSGA2.SolverNSGA2#
molass.Solvers.NSGA2.SolverNSGA2
Multi-objective NSGA-II solver wrapping pymoo.
Instead of minimizing the synthesized scalar fv, this solver treats the 7 raw score components as separate objectives and lets NSGA-II maintain a Pareto front across all of them simultaneously.
After the run, synthesize() is applied to each Pareto-optimal solution to pick the best — but the search itself never saw the synthesized scalar.
This sidesteps the risk that synthesize()’s weighting creates a misleading landscape that causes BH and CMA-ES to converge to wrong basins.
Interface matches SolverCMA / SolverDE so it can be wired into BasicOptimizer.solve() with method=’nsga2’.
Parameters are in the normalized [0, 10] space used throughout the molass-legacy optimizer infrastructure.
Copyright (c) 2026, SAXS Team, KEK-PF
- class SolverNSGA2(optimizer, pop_size=100)#
Bases:
objectNSGA-II solver using pymoo.
Treats the 7 raw score components as separate objectives. After the run, applies synthesize() to each Pareto member and returns the best as if it were a single-objective result — so RunInfo / callback.txt / load_best() all work unchanged.
- Parameters:
optimizer (BasicOptimizer) – Fully constructed optimizer with objective_func and minima_callback.
pop_size (int) – NSGA-II population size. Default 100.
- minimize(objective, init_params, niter=100, seed=1234, bounds=None, narrow_bounds=False, show_history=False)#
Run NSGA-II minimization on the 7 raw score components.
- Parameters:
objective (callable) – The synthesized scalar objective (used only for minima_callback and as fallback). NOT used for the NSGA-II search itself.
init_params (ndarray) – Initial parameter vector in normalized [0, 10] space.
niter (int) – Budget: max_fevals = niter * FEVALS_PER_NITER.
seed (int) – RNG seed.
bounds – Same API as SolverBH / SolverCMA (bounds used; others ignored).
narrow_bounds – Same API as SolverBH / SolverCMA (bounds used; others ignored).
show_history – Same API as SolverBH / SolverCMA (bounds used; others ignored).
- Returns:
.x — best parameter vector (lowest synthesize() across Pareto front) .fun — synthesized fv at that point .nit — NSGA-II generations completed .nfev— total function evaluations
- Return type: