このページは機械翻訳を使用して翻訳されました。最新版の英語を参照するには、ここをクリックします。
反復表示
反復表示の種類
反復表示により、ソルバーの実行中の進行状況に関する情報が提供されます。
反復表示には次の 2 つの種類があります。
グローバルソルバー表示
ローカルソルバー表示
グローバル オプションとローカル オプションに応じて、両方のタイプがコマンド ラインに表示されます。
problem.options フィールドの Display オプションを 'iter' または 'iter-detailed' と optimoptions に設定して、ローカル ソルバー反復表示を取得します。詳細については、反復表示を参照してください。
GlobalSearch または MultiStart オブジェクトの Display プロパティを 'iter' に設定して、グローバル ソルバー反復表示を取得します。
問題構造にこのオプションの値が指定されていない限り、グローバル ソルバーは、ローカル ソルバーのデフォルトの Display オプションを 'off' に設定します。グローバル ソルバーは、ローカル オプションに対して行った設定を上書きしません。
メモ
ローカル ソルバーの Display オプションを 'off' 以外に設定すれば、大量の出力が生成されます。optimoptions(@ によって作成されたデフォルトの solver)Display オプションは 'final' です。
反復表示の種類を調べる
ソルバーを実行する で説明されている例を、GlobalSearch と GlobalSearch 反復表示を使用して実行します。
% Set the random stream to get exactly the same output % rng(14,'twister') gs = GlobalSearch('Display','iter'); opts = optimoptions(@fmincon,'Algorithm','interior-point'); sixmin = @(x)(4*x(1)^2 - 2.1*x(1)^4 + x(1)^6/3 ... + x(1)*x(2) - 4*x(2)^2 + 4*x(2)^4); problem = createOptimProblem('fmincon','x0',[-1,2],... 'objective',sixmin,'lb',[-3,-3],'ub',[3,3],... 'options',opts); [xming,fming,flagg,outptg,manyminsg] = run(gs,problem);
Num Pts Best Current Threshold Local Local
Analyzed F-count f(x) Penalty Penalty f(x) exitflag Procedure
0 34 -1.032 -1.032 1 Initial Point
200 1275 -1.032 -0.2155 1 Stage 1 Local
300 1377 -1.032 248.7 -0.2137 Stage 2 Search
400 1477 -1.032 278 1.134 Stage 2 Search
446 1561 -1.032 1.6 2.073 -0.2155 1 Stage 2 Local
500 1615 -1.032 9.055 0.3214 Stage 2 Search
600 1715 -1.032 -0.7299 -0.7686 Stage 2 Search
700 1815 -1.032 0.3191 -0.7431 Stage 2 Search
800 1915 -1.032 296.4 0.4577 Stage 2 Search
900 2015 -1.032 10.68 0.5116 Stage 2 Search
1000 2115 -1.032 -0.9207 -0.9254 Stage 2 Search
GlobalSearch stopped because it analyzed all the trial points.
All 3 local solver runs converged with a positive local solver exit flag.同じ例を、GlobalSearch 反復表示なし、そして fmincon 反復表示ありで実行します。
gs.Display = 'final'; problem.options.Display = 'iter'; [xming,fming,flagg,outptg,manyminsg] = run(gs,problem);
First-order Norm of
Iter F-count f(x) Feasibility optimality step
0 3 -1.980435e-02 0.000e+00 1.996e+00
1 9 -6.970985e-02 0.000e+00 3.140e+00 2.533e-01
2 13 -8.662720e-02 0.000e+00 2.775e+00 1.229e-01
3 18 -1.176972e-01 0.000e+00 1.629e+00 1.811e-01
4 21 -2.132377e-01 0.000e+00 2.097e-01 8.636e-02
5 24 -2.153982e-01 0.000e+00 7.701e-02 1.504e-02
6 27 -2.154521e-01 0.000e+00 1.547e-02 1.734e-03
7 30 -2.154637e-01 0.000e+00 1.222e-03 1.039e-03
8 33 -2.154638e-01 0.000e+00 1.543e-04 8.413e-05
9 36 -2.154638e-01 0.000e+00 1.543e-06 6.610e-06
10 39 -2.154638e-01 0.000e+00 1.686e-07 7.751e-08
Local minimum found that satisfies the constraints.
Optimization completed because the objective function is non-decreasing in
feasible directions, to within the selected value of the function tolerance,
and constraints were satisfied to within the selected value of the constraint tolerance.
First-order Norm of
Iter F-count f(x) Feasibility optimality step
0 3 -1.980435e-02 0.000e+00 1.996e+00
... MANY ITERATIONS DELETED ...
8 33 -1.031628e+00 0.000e+00 8.742e-07 2.287e-07
Local minimum found that satisfies the constraints.
Optimization completed because the objective function is non-decreasing in
feasible directions, to within the selected value of the function tolerance,
and constraints were satisfied to within the selected value of the constraint tolerance.
<stopping criteria details>
GlobalSearch stopped because it analyzed all the trial points.
All 4 local solver runs converged with a positive local solver exit flag.GlobalSearch 反復表示と fmincon 反復表示を設定すると、両方の表示が混在します。
並列環境での反復表示の例については、並列マルチスタート を参照してください。