Optimization¶
this doc gives an overview over the optimization phases.
Phase I¶
TODO
Phase II¶
- class cobraPhaseII.CobraPhaseII(cobra: CobraInitializer)¶
SACOBRA phase II executor.
Information is communicated via object
CobraInitializercobra(with elements sac_opts and sac_res) and via objectPhase2Varsp2(internal variables needed in phase II).- get_cobra()¶
- Returns:
COBRA variables
- Return type:
- get_p2()¶
- Returns:
phase II variables
- Return type:
- start()¶
Start the main optimization loop of phase II
Perform in a loop, until the budget
fevalis exhausted:select cyclically an element
p2.rofrom DRCXItrain RBF surrogate models on the current set of infill points
select start point
xStart: either current-bestxbestor random start (seeRandomStarter)perform sequential optimization, starting from
xStart. Result isxNew = p2.opt_res['x']evaluate xNew on the real functions + do refine step (if
EQU.active). Result is the updated EvaluatorReal objectp2.ev1calculate p-effect for onlinePLOG
update cobra information (A, Fres, Gres and others)
update and save cobra: data frames
df,df2, elementssac_res['xbest', 'fbest', 'ibest']adjust margins
p2.EPS, \(\mu\) (seeEQUoptions), adjust \(\rho\) (seeRBFoptions) andCfeas,Cinfeas
The result is a modified object
cobra(detailed diagnostic info incobra.df,cobra.df2) and the optimization results can be retrieved fromcobrawith methodsget_fbest(),get_xbest()andget_xbest_cobra().- Returns:
self
- class phase2Vars.Phase2Vars(cobra: CobraInitializer)¶
This class is just a container for variables needed by
CobraPhaseII(in addition toCobraInitializercobra). These variables include:EPS number, the current safety margin EPS in constraint surrogates
currentMu number, the current equality margin \(\mu\), see equHandling.py
num the number of real function evaluations carried out
globalOptCounter counter of the global optimization steps in phase II, excluding repair and trust region
Cfeas how many feasible infills in a row (see adjustMargins, updateInfoAndCounters)
Cinfeas how many infeasible infills in a row (see adjustMargins, updateInfoAndCounters)
fitnessSurrogate the objective surrogate model
constraintSurrogates the constraint surrogate models
Example:
p2 = Phase2Vars; print(p2.num);