GeneticAlgorithmPython
GeneticAlgorithmPython copied to clipboard
Source code of PyGAD, a Python 3 library for building the genetic algorithm and training machine learning algorithms (Keras & PyTorch).
fixed a small grammar/typo mistake
Hi, I am refactoring `pygad.py` I wonder why there are lots of duplicate code in function `unique_genes_by_space`, which the function `unique_int_gene_from_range` are mostly use same arguments in the function `unique_genes_by_space`....
I noticed a behaviour where when my desired_output is set to = desired_output: return 1.0 / ((output / desired_output)**2) else: return 1.0 / ((desired_output / output)**2) def crossover_func(): return 0...
The following code is buggy : def mutation_func(offspring, ga_instance): for chromosome_idx in range(offspring.shape[0]): random_gene_idx = numpy.random.choice(range(offspring.shape[0])) offspring[chromosome_idx, random_gene_idx] += numpy.random.random() return offspring The following line : random_gene_idx = numpy.random.choice(range(offspring.shape[0])) should...
## Suggestion: I created a GA with pygad where the fitness function needs a lot of time to calculate (several minutes per fitness calculation). When I am manually stopping it...
Initially I would like to thank you for the excellent work. Moving on to the question at hand, I've identified that there is no version of PyGAD that has already...
Hello, may I know how to add inequality constraint of two different genes. For example, I have a gene space `gene_space=[{'low': 0, 'high': 16}, {'low': 0, 'high': 24}]`. I would...
Hi everyone. I'd like to use pygad's `parallel_processing` feature to enable parallelization with multiprocessing like that: ```parallel_processing=["process", 2]``` Then I have my fitness function which is a closure which has...
I can't check `ga_instance.run_completed == False` during runtime because `ga_instance.run_completed` is initialized to `True` only after a finished run. It was never initialized to `False` inside of `class GA`. This...
When I load a previously saved instance of the genetic algorithm with `ga_instance = pygad.load(filename=filename)` the loaded instance has only the best solution as parent and not the selected number...