-
Hi, I am using NSGA2 for my multi-objective problem and I am confused at some level on the terminology used in PyGMO. Below, you will find 3 cases which for me does the same job. But I would like to use the most efficient. First, here is the intial structure of my code: prob = pg.problem(multiObjProblem) # Create UDP
pop = pg.population(prob, size=200) # Create population
algo = pg.algorithm(pg.nsga2(gen=nGen)) # Set algorithm
archi = pg.archipelago() # Initialize empty archipelago
islands = [pg.island(algo=algo, pop=pop) for i in range(nIsl)]
for i in islands:
archi.push_back(i)
archi.set_topology(pg.fully_connected(len(archi))) # Set topology of archipelago Now, i list the three cases:
nGen = 20
nEvol = 10
for i in range(nEvol):
archi.evolve(1)
nGen = 20
nEvol = 10
archi.evolve(nEvol)
nGen = 1
nEvol = 10 * 20 = 200
archi.evolve(nEvol) Other questions are:
Thank you. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Thanks for the question, it is always a bit confusing indeed, let me try to answer as clearly as I can: All UDAs shipped with pagmo are guaranteed to make: for i in range(10):
pop = algorithm(uda(gen=1)).evolve(pop) equivalent to pop = algorithm(uda(gen=10)).evolve(pop) The exception are those algorithms with a Now, with this in mind lets go to your case where you have an So we are now ready to answer your questions. You have 3 code snippets labelled with (1,2,3), they all do slightly different things and hence will have slightly different results. 1,2 do very similar things, As no 3 Does a very different thing instead. Since As per your other questions: Hope this answer your question, let us know .... |
Beta Was this translation helpful? Give feedback.
-
Dear @darioizzo I have read the chapter you recommanded (thank you for sharing it), it helped me to understand deeper but I am still confused on two aspects:
|
Beta Was this translation helpful? Give feedback.
Thanks for the question, it is always a bit confusing indeed, let me try to answer as clearly as I can:
All UDAs shipped with pagmo are guaranteed to make:
equivalent to
The exception are those algorithms with a
memory
argument, for example CMAES. When that argument is not set to true, the above equivalence is broken as the algorithm resets its internal state at each call to the methodevolve
and the following call will have no memory of the previous. In those cases settingmemory
to true recovers the above equivalence.Now, with this in mind lets go to your case where you have an
arch…