Parameter optimization with genetic algorithms

2 visualizaciones (últimos 30 días)
Daniel
Daniel el 29 de Jun. de 2013
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 comentarios
Daniel
Daniel el 29 de Jun. de 2013
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 el 30 de Jun. de 2013
Editada: Matt J el 30 de Jun. de 2013
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?

Iniciar sesión para comentar.

Respuestas (1)

Matt J
Matt J el 30 de Jun. de 2013
Editada: Matt J el 30 de Jun. de 2013
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 comentarios
Matt J
Matt J el 2 de Jul. de 2013
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 el 2 de Jul. de 2013
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.

Iniciar sesión para comentar.

Categorías

Más información sobre Genetic Algorithm en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by