Platypus icon indicating copy to clipboard operation
Platypus copied to clipboard

PBI result verification

Open dhadka opened this issue 6 years ago • 2 comments

Hey @eigeneko

I made the necessary modifications so you can use PBI with MOEA/D. From the image below, you can see that with PBI, it's converging to the three corners. Can you please check if this is expected?

Is there a good default for theta?


import functools
import matplotlib.pyplot as plt
from platypus import *
from mpl_toolkits.mplot3d import Axes3D

if __name__ == '__main__':
    problem = DTLZ2(3)
        
    algorithms = [(MOEAD, {}, "MOEAD (Chebyshev)"),
                  (MOEAD, {"scalarizing_function":functools.partial(pbi, theta=0.0)}, "MOEAD (PBI)")]
    
    with ProcessPoolEvaluator() as evaluator:
        results = experiment(algorithms, problem, seeds=1, nfe=10000, evaluator=evaluator)

    # display the results
    fig = plt.figure()
    
    for i, algorithm in enumerate(six.iterkeys(results)):
        result = results[algorithm]["DTLZ2"][0]
        
        ax = fig.add_subplot(1, 2, i+1, projection='3d')
        ax.scatter([s.objectives[0] for s in result],
                   [s.objectives[1] for s in result],
                   [s.objectives[2] for s in result])
        ax.set_title(algorithm)
        ax.set_xlim([0, 1.1])
        ax.set_ylim([0, 1.1])
        ax.set_zlim([0, 1.1])
        ax.view_init(elev=30.0, azim=15.0)
        ax.locator_params(nbins=4)
    
    plt.show()

figure_1

dhadka avatar May 10 '18 18:05 dhadka

Probably there is no good default value for all test problems.

I think people should be aware of what they are doing when they try to use PBI function. The performance of PBI strongly depend on the specification of theta. For convex or concave pareto front, we may have to choose different theta to get good results.

The reason why it converges to three corners is just because theta is the penalty for an offspring which is far away from the weight vector. If theta is small the accept area of PBI would be very large. Which means even when d2(the perpendicular distance from offspring to ith weight vector) is large, the function value may still smaller and the offspring can replace the original solution. you can refer to this paper

Ishibuchi, Hisao. et al. "Use of piecewise linear and nonlinear scalarizing functions in MOEA/D." International Conference on Parallel Problem Solving from Nature. Springer, Cham, 2016.

The first result was theta=0.1, the following one was theta=1 for DTLZ2 with random_weights algorithm = MOEAD(problem, scalarizing_function=pbi) figure_1-1 figure_1-3

eigeneko avatar May 11 '18 11:05 eigeneko

I think the PBI function can work for both maximization and minimization problem. only need a modification mentioned in Li, H. and Zhang, Q. "Multiobjective Optimization problems with Complicated Pareto Sets, MOEA/D and NSGA-II." IEEE Transactions on Evolutionary Computation, 13(2):284-302, 2009

Just because I see your original code in weights.py/chebyshev. There is no absolute value in objs[i]-ideal_point[i] so I think you maybe already assume that all problems is minimization.

btw, could you please tell me

  • How should I specify the max or min for a problem ?
  • When should I use update_utility in MOEAD ?
  • How to specify theta using functools.partial(pbi, theta=0.5) ? this original way doesn't work
problem = DTLZ2()
algorithm = normal_pbi(problem, scalarizing_function=pbi)
algorithm.run(10000)

I hope more people can use Platypus and we could have a well organised document in the future !

eigeneko avatar May 11 '18 11:05 eigeneko

This issue is stale and will be closed soon. If you feel this issue is still relevant, please comment to keep it active. Please also consider working on a fix and submitting a PR.

github-actions[bot] avatar Nov 13 '22 03:11 github-actions[bot]