Hypervolume indicator with Yi Cao

13 vues (au cours des 30 derniers jours)
Yeoh Jocelyn
Yeoh Jocelyn le 4 Août 2024
Déplacé(e) : John Kelly le 5 Août 2024
I am working with Multi-objective optimization problem and i come across with this code ( https://www.mathworks.com/matlabcentral/fileexchange/19651-hypervolume-indicator ), however, does anyone know how to get the function 'paretofront' from the exisiting code to obtain the hypervolume value
thanks
  2 commentaires
Yeoh Jocelyn
Yeoh Jocelyn le 4 Août 2024
Modifié(e) : Walter Roberson le 4 Août 2024
@Umar Thanks for the clarification! by any chance, have you come across any other hypervolume computation like the one in platEMO ( https://github.com/BIMK/PlatEMO/blob/1274e2530e1c5afa928f3691c65af7d2f7efe099/PlatEMO/Metrics/HV.m )?
i'd like to clarify how can i use and define the structure array to satisfy thr datatype in HV.m. At first, when i defined my own solution, it showed error ('Dot indexing is not supported for variables of this type.').
I've tried to execute it with the population solutions obtained from my algorithm and the optimum values obtained across several benchmark dataset as follows, however the output for hypervolume value that i've got is extremely low, what could be the problem?
i did modification as such in the main program:
  • inputs:
solutions = [43,176,38;43,177,37;42,188,38;46,168,38;43,184,36;42,178,48;42,169,49;42,179,42];
Population.best = struct('objs', []);
% Fill the structure array with the solutions
for i = 1:size(solutions, 1)
Population.best(i).objs = solutions(i, :);
end
optimum = [40, 162, 38 ; 40, 164, 37 ;40, 167, 36; 40,171,36; 40,165,37; 40,169,36 ; 41, 160, 38 ;41, 163, 37 ;42, 157, 40 ;42, 158, 39 ;42, 165, 36 ; 42,162,42 ; 43, 155, 40 ;44, 154, 40 ;45, 153, 42];
hv = HV(Population, optimum);
disp(['Hypervolume: ', num2str(hv)]);
  • in HV.m:
function score = HV(Population,optimum)
PopObj = vertcat(Population.best.objs);
Umar
Umar le 4 Août 2024
Modifié(e) : Walter Roberson le 4 Août 2024
Hi @ Yeoh Jocelyn,
have you come across any other hypervolume computation like the one in platEMO ( https://github.com/BIMK/PlatEMO/blob/1274e2530e1c5afa928f3691c65af7d2f7efe099/PlatEMO/Metrics/HV.m )?
To be honest, no.
i did modification as such in the main program:
inputs:
solutions =
[43,176,38;43,177,37;42,188,38;46,168,38;43,184,36;42,178,48;42,169,49;42,
179,42];
Population.best = struct('objs', []);
% Fill the structure array with the solutions
for i = 1:size(solutions, 1)
Population.best(i).objs = solutions(i, :);
end
optimum = [40, 162, 38 ; 40, 164, 37 ;40, 167, 36; 40,171,36; 40,165,37;
40,169,36 ; 41, 160, 38 ;41, 163, 37 ;42, 157, 40 ;42, 158, 39 ;42, 165,
36 ; 42,162,42 ; 43, 155, 40 ;44, 154, 40 ;45, 153, 42];
hv = HV(Population, optimum);
disp(['Hypervolume: ', num2str(hv)]);
I just ran the code based on your inputs and it did display the following error message,
Out of memory. The likely cause is an infinite recursion
within the program.
Error in hypervolume (line 34)
hv = hypervolume(Population, optimum);
The error seems to be related to the recursive call to the hypervolume function within the function itself, which causes the memory overflow.

Connectez-vous pour commenter.

Réponses (1)

Umar
Umar le 4 Août 2024
Déplacé(e) : John Kelly le 5 Août 2024

Hi @ Yeoh Jocelyn,

I am afraid you will not like the answer, if you download the file as mentioned in your comments, and uncomment example in his code and execute the function, it will display an error message. In other words, it is missing function “paretofront”. Please see attached results.

Now, in order to define this function, you have to follow the instructions in license as it says verbatim, “ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in
      the documentation and/or other materials provided with the distribution”

Hope, this answers your question.

Catégories

En savoir plus sur Entering Commands dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by