遺伝的アルゴリズムの目的関数の収束状況の確認方法

8 visualizzazioni (ultimi 30 giorni)
fumito ito
fumito ito il 12 Gen 2018
Commentato: fumito ito il 17 Gen 2018
現在遺伝的アルゴリズムにより目的関数の最適化を行っています. 現在は世代数50,個体数50で実行しており,遺伝的アルゴリズムは50×50つまり2500回で計算が終了しています. しかしそれは目的関数は収束したのか,あるいは世代数50に達したため終了したのかわかりません. そのため目的関数が収束しているのかを知りたいです.収束率的なものを確認する方法, または各世代の最も低い目的関数を知るためにはどのような方法があるでしょうか? よろしくお願いします.

Risposta accettata

michio
michio il 12 Gen 2018
Modificato: michio il 12 Gen 2018
簡単なのは
[x,fval,exitflag] = ga(fitnessfcn,nvars,...)
と実行して exitflag の結果を確認する方法です。exitflag の値とその収束結果との対応は下記を確認ください。
計算が終了した理由が世代数であれば exiitflag は 0 になっているはずです。 Maximum number of generations MaxGenerations exceeded."
他にはオプションで PlotFcn を設定しておくと、収束具合をプロットで確認できるようになります。 例:
A = [1 1; -1 2; 2 1];
b = [2; 2; 3];
lb = zeros(2,1);
options = optimoptions('ga','Display','iter','PlotFcn',@gaplotbestf);
[x,fval,exitflag] = ga(@lincontest6,2,A,b,[],[],lb,[],[],options)
上の例では @gaplotbestf を設定しており、"the best score value and mean score versus generation"をプロットしますが、他にもいろんな選択肢があります。詳細は下記を参照してみてください。
  1 Commento
fumito ito
fumito ito il 17 Gen 2018
ありがとうございました. とてもわかりやすかったです.

Accedi per commentare.

Più risposte (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!