NSGA-II/SPEA2 Convergence and Diversity

453 views
Skip to first unread message

Jannie

unread,
Feb 14, 2018, 12:42:47 PM2/14/18
to deap-users
Hi I'm a new user of DEAP and MOEA problems and find DEAP is very useful to implement multi-objective optimizations. Thanks all the developers!
After successfully tested out NSGA-II and SEPA2 for a simple three-objective Knapsack problem, I would like to use some performance measures including Convergence rate and Diversity of the solutions to compare the performance of the two algorithms. 

I've found deap.benchmarks.tools.convergence(first_front, optimal_front) and deap.benchmarks.tools.diversity(first_front, first, last) on the benchmark page but not sure if these are the correct tools to address my problem and how to use them. For example, what should I put as "first_front"? What are the extreme points "first, last" I should use? As my problem is to selecting an optimal set of projects from a list of projects, I don't really know the true optimal pareto front of the problem.

It would be great if anyone can give me some ideas or an example to learn. Thanks!

Best,
Jannie

François-Michel De Rainville

unread,
Feb 14, 2018, 1:07:01 PM2/14/18
to deap-users
The first front is the pareto front found the optimization. You cannot test for convergence if you don't know the optimal front. As for the first and last they are the extrema of the optimal pareto front. You could always estimate those. 

As for benchmarking for you problem without knowing the optimal pareto front, I would track the hypervolume of the pareto front. You can use the (undocumented) hypervolume function from the tool._hypervolume module with a arbitrary reference in d^N. Front is your the first pareto front given by sortNonDominated.

try:
# try importing the C version
from deap.tools._hypervolume import hv
except ImportError:
# fallback on python version
from deap.tools._hypervolume import pyhv as hv

# Must use wvalues * -1 since hypervolume use implicit minimization
# And minimization in deap use max on -obj
wobj = numpy.array([ind.fitness.wvalues for ind in front]) * -1
ref = EXTREMA_POINTS_OUTSIDE_YOUR_DOMAIN

hypervolume = hv.hypervolume(wobj, ref)


Cheers,



--
You received this message because you are subscribed to the Google Groups "deap-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to deap-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jannie

unread,
Feb 15, 2018, 2:38:26 PM2/15/18
to deap-users
Hi François-Michel,

Thank you for the quick response. Based on your suggestions, I'm able to track the hypervolume and diversity during each generation. Many thanks!

To unsubscribe from this group and stop receiving emails from it, send an email to deap-users+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages