gamultiobj n by m fitness function evaluation
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
SM
el 14 de Ag. de 2021
Comentada: Walter Roberson
el 16 de Ag. de 2021
Hello
I am trying to optimise 120 parameters using gamultiobj function.
My fitness function output is a matrix with 300 by 88 points, but it seems that the gamultiobj function accepts a single vector as the output of the fitness function since, when I track the error, it tries to assign a matrix of 1 by 26400 to 300 by 88 which through error. 1 by 26400 is calculated inside the gamultiobj function using numel(scorese), which is 300x88=26400.
To clarify: I face the error saying that it is impossible to assign 300 by 88 to 1-26400.
Can anyone help me with how to resolve this?
Thank you in advance
Here is the error:
Unable to perform assignment because the size of the left side is 1-by-26400 and the size of
the right side is 300-by-88.
Error in objAndConVectorizer (line 33)
Fvals(i,:) = feval(objFcn,(pop(i,:)));
Error in gamultiobjMakeState (line 85)
[Score,C,Ceq,isFeas] =
objAndConVectorizer(state.Population(initScoreProvided+1:end,:), ...
Error in gamultiobjsolve (line 20)
state = gamultiobjMakeState(GenomeLength,FitnessFcn,ConstrFcn,output.problemtype,options);
Error in gamultiobj (line 304)
[x,fval,exitFlag,output,population,scores] = gamultiobjsolve(FitnessFcn,nvars, ...
Error in OptimiseParameters_GenAL (line 186)
gamultiobj(f,...
Error in CameraCalibration (line 100)
OptimiseParameters_GenAL(imagePath, nImages, nCameras, boardWidth, boardHeight,
squareSize, calibrationID, thresh, maxIter)
Caused by:
Failure in user-supplied fitness function evaluation. Cannot continue.
0 comentarios
Respuesta aceptada
Walter Roberson
el 14 de Ag. de 2021
reshape() the array into a vector as the last operation.
There is no point in trying to fight gamultiobj() to get it to accept an objective function returning an array: it is not designed for that.
2 comentarios
Walter Roberson
el 16 de Ag. de 2021
No, ga() techniques do not use gradient or hessians, just one position component and one velocity component for every entry. You could use any (consistent) scrambling of the output and ga() and gamultiobj() would not notice or care.
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!