tag:github.com,2008:https://github.com/benman1/GeneticAlgorithmPython/releases Tags from GeneticAlgorithmPython 2022-09-19T19:06:36Z tag:github.com,2008:Repository/589037097/2.18.1 2022-09-19T19:06:36Z 2.18.1 ahmedfgad tag:github.com,2008:Repository/589037097/2.18.0 2022-09-09T05:38:58Z PyGAD 2.18.0 Documentation <p>PyGAD 2.18.0 Documentation</p> <p>1. Raise an exception if the sum of fitness values is zero while either roulette wheel or stochastic universal parent selection is used. <a class="issue-link js-issue-link" href="https://github.com/ahmedfgad/GeneticAlgorithmPython/issues/129">ahmedfgad#129</a> <br />2. Initialize the value of the `run_completed` property to `False`. <a class="issue-link js-issue-link" href="https://github.com/ahmedfgad/GeneticAlgorithmPython/issues/122">ahmedfgad#122</a> <br />3. The values of these properties are no longer reset with each call to the `run()` method `self.best_solutions, self.best_solutions_fitness, self.solutions, self.solutions_fitness`: <a class="issue-link js-issue-link" href="https://github.com/ahmedfgad/GeneticAlgorithmPython/issues/123">ahmedfgad#123</a>. Now, the user can have the flexibility of calling the `run()` method more than once while extending the data collected after each generation. Another advantage happens when the instance is loaded and the `run()` method is called, as the old fitness value are shown on the graph alongside with the new fitness values. Read more in this section: [Continue without Loosing Progress](<a href="https://pygad.readthedocs.io/en/latest/README_pygad_ReadTheDocs.html#continue-without-loosing-progress">https://pygad.readthedocs.io/en/latest/README_pygad_ReadTheDocs.html#continue-without-loosing-progress</a>) <br />4. Thanks [Prof. Fernando Jiménez Barrionuevo](<a href="http://webs.um.es/fernan">http://webs.um.es/fernan</a>) (Dept. of Information and Communications Engineering, University of Murcia, Murcia, Spain) for editing this [comment](<a href="https://github.com/ahmedfgad/GeneticAlgorithmPython/blob/5315bbec02777df96ce1ec665c94dece81c440f4/pygad.py#L73">https://github.com/ahmedfgad/GeneticAlgorithmPython/blob/5315bbec02777df96ce1ec665c94dece81c440f4/pygad.py#L73</a>) in the code. <a class="commit-link" href="https://github.com/ahmedfgad/GeneticAlgorithmPython/commit/5315bbec02777df96ce1ec665c94dece81c440f4">ahmedfgad@<tt>5315bbe</tt></a> <br />5. A bug fixed when `crossover_type=None`. <br />6. Support of elitism selection through a new parameter named `keep_elitism`. It defaults to 1 which means for each generation keep only the best solution in the next generation. If assigned 0, then it has no effect. Read more in this section: [Elitism Selection](<a href="https://pygad.readthedocs.io/en/latest/README_pygad_ReadTheDocs.html#elitism-selection">https://pygad.readthedocs.io/en/latest/README_pygad_ReadTheDocs.html#elitism-selection</a>). <a class="issue-link js-issue-link" href="https://github.com/ahmedfgad/GeneticAlgorithmPython/issues/74">ahmedfgad#74</a> <br />7. A new instance attribute named `last_generation_elitism` added to hold the elitism in the last generation. <br />8. A new parameter called `random_seed` added to accept a seed for the random function generators. Credit to this issue <a class="issue-link js-issue-link" href="https://github.com/ahmedfgad/GeneticAlgorithmPython/issues/70">ahmedfgad#70</a> and [Prof. Fernando Jiménez Barrionuevo](<a href="http://webs.um.es/fernan">http://webs.um.es/fernan</a>). Read more in this section: [Random Seed](<a href="https://pygad.readthedocs.io/en/latest/README_pygad_ReadTheDocs.html#random-seed">https://pygad.readthedocs.io/en/latest/README_pygad_ReadTheDocs.html#random-seed</a>). <br />9. Editing the `pygad.TorchGA` module to make sure the tensor data is moved from GPU to CPU. Thanks to Rasmus Johansson for opening this pull request: <a class="issue-link js-issue-link" href="https://github.com/ahmedfgad/TorchGA/pull/2">ahmedfgad/TorchGA#2</a></p> ahmedfgad tag:github.com,2008:Repository/589037097/2.17.0 2022-07-08T03:55:54Z 2.17.0 ahmedfgad tag:github.com,2008:Repository/589037097/2.16.3 2022-02-03T01:34:29Z 2.16.3 ahmedfgad tag:github.com,2008:Repository/589037097/2.16.1 2021-09-29T01:45:01Z 2.16.1 ahmedfgad tag:github.com,2008:Repository/589037097/2.16.0 2021-06-20T02:17:27Z PyGAD 2.16.0 Documentation <p>PyGAD 2.16.0 Documentation</p> <p>A user-defined function can be passed to the mutation_type, crossover_type, and parent_selection_type parameters in the pygad.GA class to create a custom mutation, crossover, and parent selection operators. Check the User-Defined Crossover, Mutation, and Parent Selection Operators section in the documentation: <a href="https://pygad.readthedocs.io/en/latest/README_pygad_ReadTheDocs.html#user-defined-crossover-mutation-and-parent-selection-operators">https://pygad.readthedocs.io/en/latest/README_pygad_ReadTheDocs.html#user-defined-crossover-mutation-and-parent-selection-operators</a></p> <p>The example_custom_operators.py script gives an example of building and using custom functions for the 3 operators.</p> <p><a class="issue-link js-issue-link" href="https://github.com/ahmedfgad/GeneticAlgorithmPython/discussions/50">ahmedfgad#50</a></p> ahmedfgad tag:github.com,2008:Repository/589037097/2.15.1 2021-06-18T06:16:34Z PyGAD 2.15.1 Documentation <p>PyGAD 2.15.1 Documentation</p> <p>Fix a bug when keep_parents is set to a positive integer. <a class="issue-link js-issue-link" href="https://github.com/ahmedfgad/GeneticAlgorithmPython/issues/49">ahmedfgad#49</a></p> ahmedfgad tag:github.com,2008:Repository/589037097/2.15.0 2021-06-18T03:08:12Z PyGAD 2.15.0 Documentation <p>PyGAD 2.15.0 Documentation</p> <p>Changes in PyGAD 2.15.0 <br />1. Control the precision of all genes/individual genes. Thanks to Rainer for asking about this feature: <a class="issue-link js-issue-link" href="https://github.com/ahmedfgad/GeneticAlgorithmPython/discussions/43#discussioncomment-763452">ahmedfgad#43 (comment)</a> <br />2. A new attribute named last_generation_parents_indices holds the indices of the selected parents in the last generation. <br />3. In adaptive mutation, no need to recalculate the fitness values of the parents selected in the last generation as these values can be returned based on the last_generation_fitness and last_generation_parents_indices attributes. This speeds-up the adaptive mutation. <br />4. When a sublist has a value of None in the gene_space parameter (e.g. gene_space=[[1, 2, 3], [5, 6, None]]), then its value will be randomly generated for each solution rather than being generated once for all solutions. Previously, a value of None in a sublist of the gene_space parameter was identical across all solutions. <br />5. The dictionary assigned to the gene_space parameter itself or one of its elements has a new key called "step" to specify the step of moving from the start to the end of the range specified by the 2 existing keys "low" and "high". An example is {"low": 0, "high": 30, "step": 2} to have only even values for the gene(s) starting from 0 to 30. For more information, check the More about the gene_space Parameter section. <a class="issue-link js-issue-link" href="https://github.com/ahmedfgad/GeneticAlgorithmPython/discussions/48">ahmedfgad#48</a> <br />6. A new function called predict() is added in both the pygad.kerasga and pygad.torchga modules to make predictions. This makes it easier than using custom code each time a prediction is to be made. <br />7. A new parameter called stop_criteria allows the user to specify one or more stop criteria to stop the evolution based on some conditions. Each criterion is passed as str which has a stop word. The current 2 supported words are reach and saturate. reach stops the run() method if the fitness value is equal to or greater than a given fitness value. An example for reach is "reach_40" which stops the evolution if the fitness is &gt;= 40. saturate means stop the evolution if the fitness saturates for a given number of consecutive generations. An example for saturate is "saturate_7" which means stop the run() method if the fitness does not change for 7 consecutive generations. Thanks to Rainer for asking about this feature: <a class="issue-link js-issue-link" href="https://github.com/ahmedfgad/GeneticAlgorithmPython/discussions/44">ahmedfgad#44</a> <br />8. A new bool parameter, defaults to False, named save_solutions is added to the constructor of the pygad.GA class. If True, then all solutions in each generation are appended into an attribute called solutions which is NumPy array. <br />9. The plot_result() method is renamed to plot_fitness(). The users should migrate to the new name as the old name will be removed in the future. <br />10. Four new optional parameters are added to the plot_fitness() function in the pygad.GA class which are font_size=14, save_dir=None, color="#3870FF", and plot_type="plot". Use font_size to change the font of the plot title and labels. save_dir accepts the directory to which the figure is saved. It defaults to None which means do not save the figure. color changes the color of the plot. plot_type changes the plot type which can be either "plot" (default), "scatter", or "bar". <a class="issue-link js-issue-link" href="https://github.com/ahmedfgad/GeneticAlgorithmPython/pull/47">ahmedfgad#47</a> <br />11. The default value of the title parameter in the plot_fitness() method is "PyGAD - Generation vs. Fitness" rather than "PyGAD - Iteration vs. Fitness". <br />12. A new method named plot_new_solution_rate() creates, shows, and returns a figure showing the rate of new/unique solutions explored in each generation. It accepts the same parameters as in the plot_fitness() method. This method only works when save_solutions=True in the pygad.GA class's constructor. <br />13. A new method named plot_genes() creates, shows, and returns a figure to show how each gene changes per each generation. It accepts similar parameters like the plot_fitness() method in addition to the graph_type, fill_color, and solutions parameters. The graph_type parameter can be either "plot" (default), "boxplot", or "histogram". fill_color accepts the fill color which works when graph_type is either "boxplot" or "histogram". solutions can be either "all" or "best" to decide whether all solutions or only best solutions are used. <br />14. The gene_type parameter now supports controlling the precision of float data types. For a gene, rather than assigning just the data type like float, assign a list/tuple/numpy.ndarray with 2 elements where the first one is the type and the second one is the precision. For example, [float, 2] forces a gene with a value like 0.1234 to be 0.12. For more information, check the More about the gene_type Parameter section.</p> ahmedfgad tag:github.com,2008:Repository/589037097/2.14.3 2021-06-06T06:21:19Z Documentation of PyGAD 2.14.3 <p>Documentation of PyGAD 2.14.3</p> <p>The new release has some bug fixes when setting the save_best_solutions parameter to True. Previously, the best solution for generation i was added into the best_solutions attribute at generation i+1. Now, the best_solutions attribute is updated by each solution at its exact generation.</p> ahmedfgad tag:github.com,2008:Repository/589037097/2.14.2 2021-05-27T23:51:39Z 2.14.2: New bade added <p>New bade added</p> <p>Add a new badge: <a href="https://readthedocs.org/projects/pygad/badge">https://readthedocs.org/projects/pygad/badge</a></p> ahmedfgad