Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.



Re: Generation Information from Genetic Algorithm
Posted:
May 13, 2013 8:32 AM


On 5/13/2013 12:10 AM, Maninder wrote: > Hi Alan, > I have some similar doubts and would appreciate if you could give some > suggestions > > I am using Genetic Algorithm for optimization of a computationally > expensive fitness function which also has constraints . I am right now > imposing constraints in the form of penalty in to the objective > function since constraint violation can only be calculated at the end > of the function evaluation. I wanted to use nonlcon rather to satisfy > the constraints. > > But my problem is that the fitness function evaluation is expensive > and I cant afford to do it again for checking of constraint violation. > I have seen some nested function formulations where using output > function I can accumulate all the individual variable values for every > generation. > > As per what I was thinking, would it be possible to have sort of a > matrix in which I can store all the individual values at the beginning > of a generation update that matrix while my fitness evaluations and > when I call nonlcon for constraint evaluation, then to look up that > updated matrix for constraint violation. While I am trying to > implement this, I have some doubts. > > 1) I remember reading in some forum that outputfcn for Genetic algo > can be called either at the beginning of a generation or at the end. > By default, it is at the end. I wont be able to execute my method if > it calls at the end. Sadly I am not able to find how to call the > outputfcn at the beginning rather than the end of a generation. > > 2) Since my fitness function is computationally expensive, I am using > Parallel evaluations. So Would it be possible to implement the above > mentioned idea while using parallel option in matlab or it would > create some difficulties??
Perhaps what you are looking for is explained in some recent documentation: http://www.mathworks.com/help/optim/ug/writingconstraints.html#btfdwb7
As for your particular tentative approaches, you have to be careful calling parfor with data files, you might have to use spmd commands or some other parallel construct. Sorry, I am not an expert on parallel computation in MATLAB.
Good luck,
Alan Weiss MATLAB mathematical toolbox documentation



