Parameter optimization with genetic algorithms

조회 수: 8 (최근 30일)
Daniel
Daniel 2013년 6월 29일
Hey there,
I have a question concerning GA. I want to optimize several parameter at once by using a function handle. One example is the optimization for a set-up of 2 variables. Each vector consists of 10 possible values so an exhaustive search would comprise 100 trials. Instead of the exhaustive search I want to use GA which for example only needs 20 trials to find the optimal set-up. The optimization function has to be a classification function whose error value should be minimized. How can I implement the 2 variables into the function?
Thanks a lot in advance
Danyo
  댓글 수: 5
Daniel
Daniel 2013년 6월 29일
I just want to implement the GA to optimize the fitness function (classification task) which needs to optimize two variables, C and Sigma for the RBF-SVM.
Matt J
Matt J 2013년 6월 30일
편집: Matt J 2013년 6월 30일
Your question isn't specific enough for us to know what to advise you other than "do what the GA documentation says". Have you done
>> doc ga
What are you looking for beyond what's written there?

댓글을 달려면 로그인하십시오.

답변 (1개)

Matt J
Matt J 2013년 6월 30일
편집: Matt J 2013년 6월 30일
This page gives an example of ga optimization over integer variables
The example with Rastrigin's Function is a 2 variable problem and shows you how to make one of the variables integer-variable, though of course you could make them both integers if you wished.
  댓글 수: 20
Matt J
Matt J 2013년 7월 2일
Daniel Commented:
I figured it out. And I have changed the set-up to: options=gaoptimset('Vectorized', 'off') ; [x fval] = ga(@fitness, 2,[],[],[],[],lb,ub,[],options);
Bur Matt, this take forever, and the range for C and Sigma is not even large yet. Is there a way to speed it up? like discrete values as input for C and Sigma so that GA does only have to combine to find the best solution for the SVM?
Many thanks, I know it must sound really stupid, but I am really new to GA especially in MATLAB
Matt J
Matt J 2013년 7월 2일
If your fitness function is expensive, then the process will inevitably be slow....
You could try an exhaustive search on a coarse grid sigma=C=1:5:20. From the results of that, you could then do a finer grid optimization with tighter bounds. Or you could do a continuous domain optimization with GA within the tighter bounds.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Genetic Algorithm에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by