baopng / nsga-ii Goto Github PK
View Code? Open in Web Editor NEWImplementation of NSGA-II algorithm in form of a python library.
Implementation of NSGA-II algorithm in form of a python library.
Hello!
Please can I know how to obtain the value of the variables where the minima is found in your implementation.
Thanks
Is it possible to create another version of the repository in PyPI with the addition of the new progress bar? This will be useful to use the package in a project I am currently working on.
hey guys,i meet a problem as follows:
when i run kur.py,i set objectives=[f1, f2] and expand = False,it can runs.
however, if i set objectives=(f1, f2) and now i think expand should be True,right? Now it cant run.If i change [f(*individual.features)] to [f([*individual.features]) in problem.py,it finally gets well.So i just want to know if my modification is right.Looking forward to reply as soon as possible
Hi!
I'm trying to use your code as my experiment in Test Case Prioritization (TCP). I studied several methods of Genetic Algorithm (GA) and found that your code doesn't implement a certain crossover and mutation rate, or does it? I also did some changes to your code in my local to simulate the crossover rate, which roughly looks like this:
x = random.random()
if x < crossover_rate:
child1, child2 = self.crossover(parent1, parent2)
else:
child1, child2 = parent1, parent2
When doing so, it seems the sorting algorithm seems broken. The total front size decreases and is not the same as the length of the population that passed to the fast_nondominated_sort method. This happens in the second generation (after merging with children) and the following next generation. Here is an example:
INITIAL PORPULATION PREP
pop size 100 # length of the population that passed to fast_nondominated sorting method (OK)
front size after sort 100 # total number of individuals from all fronts. This one is OK, since total = len(population)
GENERATION NUMBER: 2
pop size 200 # length of the population that passed after merging with children (OK)
front size after sort 19 # shouldn't it be the same as the len(population), which is 200?
The decreasing front size lead the program to raise the index out of range issue when executing this line of code, since there is no element on a certain front_num and the total length of it never reach the same value as self.num_of_individuals
:
front_num = 0
while len(new_population) + len(self.population.fronts[front_num]) <= self.num_of_individuals:
self.utils.calculate_crowding_distance(
self.population.fronts[front_num])
new_population.extend(self.population.fronts[front_num])
front_num += 1
I looked at the original paper (Deb, 2003) and found nothing wrong with the algorithm itself and it's precisely the same as mentioned in the paper. Can you tell me what part of this program affects this? Or is it okay for me to use 1 as the crossover and the mutation probability (which means we do crossover and mutate every time we synthesize children)? If so, can I have the reference that mentions it?
Thanks in advance.
Hi, thanks for your wonderful work! During the use, I want to know the input values of the problems in the last generation, the x in the example. How can I get these individuals? Thanks!
Hi,
Hope all is well with you. Would you please explain to me what is the purpose of the code block from line 33 to 37 in the evolution.py file? I see you are returning "returned_population.fronts[0]" at the end of the generations. So, if the algorithm is going through its final generation then the lines 33 to 37 seem to be useless because, I guess it is creating the population for the next generation and has nothing to do with the final output at the last generation, right?
Thanks,
It looks like that -1 is missing from the exponent when u>=0.5 in __get_delta method
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.