Tuning guide¶
The defaults are a sound starting point. Change options only when a run shows a reason to. This page explains how to set options, which ones matter, and what to try for common symptoms.
Setting options¶
from atrfu import TrustRegionSolver
solver = TrustRegionSolver(max_it=300, sample_radius=0.05)
solver = TrustRegionSolver(**{"max it": 300}) # spaces work too
solver = TrustRegionSolver(preset="a-trfu-r2", n_restoration_max=20)
solver = TrustRegionSolver(solver_options={"linear_solver": "ma57"}) # passed to IPOPT
TrustRegionSolver.options() # every option with its default and meaning
TrustRegionSolver.options("Funnel") # one group
The solver checks the options when it is created. An unknown name gets a “did you mean” hint. Values that break a required ordering are rejected with a message that names the ordering:
gamma_c < 1 < gamma_e0 < eta1 < eta2 < 1sigma_dec < 1 < sigma_incsigma_eta3 < 1sample_radius_adjust <= 1delta_min <= ep_deltaanddelta_min <= sample_radiusradius_max >= trust_radiusbeta,kappa_f,gamma_fandgamma_thetaall< 1
The options that matter most¶
Bounds and scaling. With the default scaling=0, distances are
measured in units of each variable’s bound range. The first trust region is
the whole box, and trust_radius is ignored. Bounds that are much wider than
the region of interest therefore make the first steps coarse. Give realistic
bounds. If only the black-box inputs have meaningful bounds, use scaling=1
and set trust_radius in the variables’ units.
sample_radius. This is the finite-difference step used to build the
surrogates (with scaling=0, a fraction of each bound range). The solver
adapts it as the run proceeds. The initial value matters most when the black
boxes are noisy, because a step that is too small then measures the noise
rather than the slope. Use a larger value in that case.
Termination: ep_i, ep_chi, ep_delta, ep_s, max_it.
ep_iis the feasibility tolerance on the black-box errors. Set it to the accuracy you need from the black boxes.ep_chiandep_deltadefine “optimal”.ep_sis the short-step exit.max_itcaps the iterations. Every iteration costs at least one black-box evaluation per input.
efmap grouping and multiple_black_boxes. Give each independent
black box its own efmap entry (see the user guide).
Leave at their defaults unless you have a reason: the radius factors
(gamma_c, gamma_e, eta1, eta2), the funnel and filter parameters, and
the hypervolume factors (sigma_*). They govern how the method converges,
not the problem.
Symptoms and what to try¶
symptom |
what to try |
|---|---|
|
The run stalled rather than converged. Check that independent black boxes have separate |
|
Raise |
|
Check that |
Many rejected steps, slow progress |
Tighten the variable bounds ( |
|
If |
|
The subproblems keep failing. Check that the glass-box model is feasible within the bounds, start from a better point, or raise |
|
IPOPT failed on a subproblem. Pass IPOPT options through |
Noisy black boxes |
Use a larger |
The black boxes are slow |
Watch |