genetic algorithm matlab minimization

2 ビュー (過去 30 日間)
Anass
Anass 2015 年 11 月 11 日
コメント済み: Anass 2015 年 11 月 12 日
Hi, I would like to use the Optimization-ToolBox of Matlab that provide a tool for the Genetic Algorithms. I have a small equation (Score= alpha*(\sum(L[i])^(1/alpha) + Beta*(\sum(R[i])^(1/Beta)) that compute a score where L and R are vectors of values that I computed before and alpha and beta are parameters that I want to optimize via the GA. The constraint is that the scores should be close to another vector of scores called ground truth. We can formalize this constraint by : " |score - ground_truth_score|_2^{2}=0"
So for every L[i] and R[i], an Alpha and Beta would optimize the constraint defined before.
I'm trying to discover the GA in Matlab, however, I don't know how to formalize the constraint with the fitness function (the equation).

回答 (1 件)

Alan Weiss
Alan Weiss 2015 年 11 月 11 日
Perhaps the constrained minimization example will help.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation
  2 件のコメント
Anass
Anass 2015 年 11 月 11 日
編集済み: Anass 2015 年 11 月 11 日
Hi, thank you for your response, but i've already seen this example, they are talking about the constraint on the input data (variable x of the function), however, in my case, i'm talking about the constraint on the value returned by the function. This one must be close to my ground truth. I don't find a way to make a constraint on this.
Anass
Anass 2015 年 11 月 12 日
I made this objective function to manage the minimization of my problem, however i'm not sure if it's the right answer:
function y=parametrized_fitness_fct(x,ground_truth_score)
y=x(1)*(L^(1/x(1))) + x(2)*(R^(1/x(2))) + ground_truth_score;
% ground_truth_score, L and R are single values
end
FitnessFunction =@(x) parametrized_fitness_fct(x,ground_truth_score);
[x,score] = ga(FitnessFunction,numberOfVariables)%numberOfVariables=2
%x will be a vector containing the searched values "alpha and beta",
%and score is the score optimized to be close to the ground_truth_score

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeGenetic Algorithm についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by