wreszelewski / nsga2

Implementation NSGA-II algorithm in form of python library
101 stars 50 forks source link

Question regarding test problems #3

Open janmatias opened 6 years ago

janmatias commented 6 years ago

This might not fit under issues, but I hope you can help me anyways. I am exploring the option of using this code for a project at my university. (First of, is this ok?) If I am to use it, I need to implement test problem ZDT6. What I am wondering is how you are able to calculate the perfect pareto front for problems 1, 2 and 3? How would I then do this for ZDT6? I also have a bit of trouble understanding the hypervolume metric. Firstly, why do you choose 11, 11 as a reference point? Is this just random, and unimportant as long as the reference point is the same for all hypercubes? Lastly, how do you calculate the max hypervolume? Is this just the hypervolume for the pareto optimal set?

kamilmielnik commented 6 years ago

This might not fit under issues, but I hope you can help me anyways. I am exploring the option of using this code for a project at my university. (First of, is this ok?)

Sure.

What I am wondering is how you are able to calculate the perfect pareto front for problems 1, 2 and 3? How would I then do this for ZDT6? Firstly, why do you choose 11, 11 as a reference point? Is this just random, and unimportant as long as the reference point is the same for all hypercubes?

These values were taken from a website which happens to provide results for reference point (11, 11): http://people.ee.ethz.ch/~sop/download/supplementary/testproblems/

Lastly, how do you calculate the max hypervolume? Is this just the hypervolume for the pareto optimal set?

I am not sure if I understand your question, but I think you should seek for your answer in nsga2/metrics/hvr.py.

janmatias commented 6 years ago

@kamilmielnik Thanks for the quick reply! The website you link to is immensely helpful to me, thanks! It explains everything that was unclear to me! I regards to the last question, I was wondering how to know the max_hyper_volume variable used in the hvr.py file. This value is hardcoded when used in metrics/problems/zdt.py, but I saw that these values were also taken from website which you link.

janmatias commented 6 years ago

init .txt zdt4_definitions.txt

I have another question, this time regarding test problem ZDT4. This isn't included in the current project, but I wanted to add it myself. The issue is that I am not able to generate a good pareto front for this problem. I get an HVR graph that starts at a value grater than 8, and just fall closer and closer to 0. See attached graph. I also attach the files relevant to the ZDT4 implementation. Any idea why the algorithm isn't working well? I tried altering the mutation from changing 5 features to changing 1, but that had little effect hvr-nsga2-zdt4

kamilmielnik commented 6 years ago

h = 1 - math.sqrt(individual.features[0]/g) should it not be h = 1 - math.pow(individual.features[0]/g, 2)?

I don't have python set up now, so I don't know if it helps - does it? If not, could you create a PR with your changes?

janmatias commented 6 years ago

@kamilmielnik You are right when it comes to the h function. Unfortunately though, this does not help the results. I have created a pull request ( #4 ) with my code. Thanks for trying to help me!

kamilmielnik commented 6 years ago

@janmatias

Your code appears correct. I tried to disable mutations or exclude the first feature (the one in [-1, 1] range) from crossover operation but it did not help.

My guess is this: ZDT problems were designed to find different kinds of flaws in optimizing algorithms. It might just be the case that this particular implementation is not able to overcome the problems which ZDT4 causes. But I don't know.

ZDT4 is a problem which helps determining how well does an algorithm handle multi-modal multi-objective optimization problems.

Wish you good luck!