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).
pygad version: `2.16.3` (testing in a jupyter notebook), python version: `3.10.3` The function call `ga_instance.plot_fitness()` as well as other plot functions like `ga_instance.plot_new_solution_rate()` throw an error: ``` matplotlib.pyplot.title(title, fontsize=font_size) ->...
The current version doesn't accept objects methods because of the way of counting arguments. Using `inspect` can solve it.
Hi! I am trying to solve TSP with GA and it seems like allow_duplicate_genes is not working. **Reproduction:** TSP with 32 citites, each city is represented by number [0, ...,...
How do I do it for multiple values of xi and yi? For example, I have: ``` X= [[1.875, 1.875, 1.875, 2.5 ], [0.625, 3.125, 1.25 , 3.125], [3.125, 1.25...
The values I'm trying to optimize are percentages, such that the sum of all genes should be exactly 1. Is there a way to enfoce this in PyGAD? I can...
Hi, I am using PyGAD.GA inside of another class. The various functions PyGAD will accept as parameters have strict parameter count checks. However, when you assign a class method to...
I'm trying to use PyGAD to solve a minimization problem which is part of a bigger algorithm I'm trying to implement, but I have no idea on the appropiate way...
The parent_indices returned by pygad.GA.tournament_selection are actually the best indices selected from the K rand_indices. Within this method parents_indices are updated as followed: `parents_indices.append(selected_parent_idx)` where I believe it should be...
Replaced all `numpy.max` with `numpy.nanmax` to handle the calculation if `nan` values somehow get through. The specific line where I encountered this issue is line 3124, however, I also fixed...
Line: pointers_distance = 1.0 / self.num_parents_mating # Distance between different pointers. Should be: pointers_distance = 1.0 / num_parents # Distance between different pointers.