前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Jmetal和PlatEMO中计算IGD时的结果差异

Jmetal和PlatEMO中计算IGD时的结果差异

作者头像
演化计算与人工智能
发布2022-01-24 14:13:42
6870
发布2022-01-24 14:13:42
举报

Jmetal和PlatEMO中计算IGD时的差异

最近的实验过程中,发现即使是同样的种群,在PlatEMO和Jmetal上计算有差异,大概Jmetal比PlatEMO上少一个 数量级

Jmetal Code

代码语言:javascript
复制
public double invertedGenerationalDistance(double [][] front,
                                     double [][] trueParetoFront,
                                     int numberOfObjectives) {

    /**
     * Stores the maximum values of true pareto front.
     */
    double [] maximumValue ;

    /**
     * Stores the minimum values of the true pareto front.
     */
    double [] minimumValue ;

    /**
     * Stores the normalized front.
     */
    double [][] normalizedFront ;

    /**
     * Stores the normalized true Pareto front.
     */
    double [][] normalizedParetoFront ;

    // STEP 1. Obtain the maximum and minimum values of the Pareto front
    maximumValue = utils_.getMaximumValues(trueParetoFront, numberOfObjectives);
    minimumValue = utils_.getMinimumValues(trueParetoFront, numberOfObjectives);

    // STEP 2. Get the normalized front and true Pareto fronts
    normalizedFront       = utils_.getNormalizedFront(front,
                                                maximumValue,
                                                minimumValue);
    normalizedParetoFront = utils_.getNormalizedFront(trueParetoFront,
                                                maximumValue,
                                                minimumValue);

    // STEP 3. Sum the distances between each point of the true Pareto front and
    // the nearest point in the true Pareto front
    double sum = 0.0;
    for (double[] aNormalizedParetoFront : normalizedParetoFront)
      sum += Math.pow(utils_.distanceToClosedPoint(aNormalizedParetoFront,
              normalizedFront),
              pow_);


    // STEP 4. Obtain the sqrt of the sum
    sum = Math.pow(sum,1.0/pow_);

    // STEP 5. Divide the sum by the maximum number of points of the front
    double generationalDistance = sum / normalizedParetoFront.length;

    return generationalDistance;
  } // generationalDistance

PlatEMO Code

代码语言:javascript
复制
function score = IGD(Population,optimum)
% <min>
% Inverted generational distance

%------------------------------- Reference --------------------------------
% C. A. Coello Coello and N. C. Cortes, Solving multiobjective optimization
% problems using an artificial immune system, Genetic Programming and
% Evolvable Machines, 2005, 6(2): 163-190.
%------------------------------- Copyright --------------------------------
% Copyright (c) 2021 BIMK Group. You are free to use the PlatEMO for
% research purposes. All publications which use this platform or any code
% in the platform should acknowledge the use of "PlatEMO" and reference "Ye
% Tian, Ran Cheng, Xingyi Zhang, and Yaochu Jin, PlatEMO: A MATLAB platform
% for evolutionary multi-objective optimization [educational forum], IEEE
% Computational Intelligence Magazine, 2017, 12(4): 73-87".
%--------------------------------------------------------------------------

    PopObj = Population.best.objs;
    if size(PopObj,2) ~= size(optimum,2)
        score = nan;
    else
        score = mean(min(pdist2(optimum,PopObj),[],2));
    end
end

二者区别

  1. Jmetal 在STEP1中对于True PF和Obtain PF都做了归一化操作 而 PlatEMO中对于PF和obtain PF没有进行归一化操作
  2. Jmetal在STEP3和STEP4中,IGD的计算是模仿GD的计算,假设用a表示True上的点对Obtain上获得的点的最近距离,则两者的差异在于
  1. 两者的参考文献不同

Jmetal - Reference: Van Veldhuizen, D.A., Lamont, G.B.: Multiobjective Evolutionary Algorithm Research: A History and Analysis. Technical Report TR-98-03, Dept. Elec. Comput. Eng., Air Force Inst. Technol. (1998)

PlatEMO - C. A. Coello Coello and N. C. Cortes, Solving multiobjective optimization problems using an artificial immune system, Genetic Programming and Evolvable Machines, 2005, 6(2): 163-190.

改进Jmetal

  • 如果你想要Jmetal和PlatEMO中算的一致,可以使用以下经过调整的代码
代码语言:javascript
复制
    public double invertedGenerationalDistance(double[][] front,
                                               double[][] trueParetoFront,
                                               int numberOfObjectives) {

        /**
         * Stores the maximum values of true pareto front.
         */
        double[] maximumValue;

        /**
         * Stores the minimum values of the true pareto front.
         */
        double[] minimumValue;

        /**
         * Stores the normalized front.
         */
        double[][] normalizedFront;

        /**
         * Stores the normalized true Pareto front.
         */
        double[][] normalizedParetoFront;

        normalizedFront = front;
        normalizedParetoFront = trueParetoFront;


//    // STEP 3. Sum the distances between each point of the true Pareto front and
//    // the nearest point in the true Pareto front
//    double sum = 0.0;
//    for (double[] aNormalizedParetoFront : normalizedParetoFront)
//      sum += Math.pow(utils_.distanceToClosedPoint(aNormalizedParetoFront,
//                      normalizedFront),
//              pow_);
//
//
//    // STEP 4. Obtain the sqrt of the sum
//    sum = Math.pow(sum,1.0/pow_);

        double sum = 0.0;
        for (double[] aNormalizedParetoFront : normalizedParetoFront)
            sum += utils_.distanceToClosedPoint(aNormalizedParetoFront,
                    normalizedFront);


        // STEP 5. Divide the sum by the maximum number of points of the front
        double generationalDistance = sum / normalizedParetoFront.length;

        return generationalDistance;
    } // generationalDistance

本文参与 腾讯云自媒体同步曝光计划,分享自微信公众号。
原始发表:2021-10-27,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 DrawSky 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • Jmetal和PlatEMO中计算IGD时的差异
    • Jmetal Code
      • PlatEMO Code
        • 二者区别
          • 改进Jmetal
          领券
          问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档