tag:github.com,2008:https://github.com/ddfadela/GeneticAlgorithmPython/releasesRelease notes from GeneticAlgorithmPython2021-09-29T01:45:01Ztag:github.com,2008:Repository/449687555/2.16.12021-09-29T01:45:01Z2.16.1<p>PyGAD 2.16.1 Documentation</p>ahmedfgadtag:github.com,2008:Repository/449687555/2.16.02021-06-20T02:17:27ZPyGAD 2.16.0 Documentation<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" rel="nofollow">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" data-error-text="Failed to load title" data-id="3417883" data-permission-text="Title is private" data-url="https://github.com/ahmedfgad/GeneticAlgorithmPython/discussions/50" data-hovercard-type="discussion" data-hovercard-url="/ahmedfgad/GeneticAlgorithmPython/discussions/50/hovercard" href="https://github.com/ahmedfgad/GeneticAlgorithmPython/discussions/50">ahmedfgad#50</a></p>ahmedfgadtag:github.com,2008:Repository/449687555/2.15.12021-06-18T06:16:34ZPyGAD 2.15.1 Documentation<p>Fix a bug when keep_parents is set to a positive integer. <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="924569638" data-permission-text="Title is private" data-url="https://github.com/ahmedfgad/GeneticAlgorithmPython/issues/49" data-hovercard-type="issue" data-hovercard-url="/ahmedfgad/GeneticAlgorithmPython/issues/49/hovercard" href="https://github.com/ahmedfgad/GeneticAlgorithmPython/issues/49">ahmedfgad#49</a></p>ahmedfgadtag:github.com,2008:Repository/449687555/2.15.02021-06-18T03:08:12ZPyGAD 2.15.0 Documentation<p>Changes in PyGAD 2.15.0</p>
<ol>
<li>Control the precision of all genes/individual genes. Thanks to Rainer for asking about this feature: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="3371608" data-permission-text="Title is private" data-url="https://github.com/ahmedfgad/GeneticAlgorithmPython/discussions/43" data-hovercard-type="discussion" data-hovercard-url="/ahmedfgad/GeneticAlgorithmPython/discussions/43/hovercard?comment_id=763452" href="https://github.com/ahmedfgad/GeneticAlgorithmPython/discussions/43#discussioncomment-763452">ahmedfgad#43 (comment)</a></li>
<li>A new attribute named last_generation_parents_indices holds the indices of the selected parents in the last generation.</li>
<li>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.</li>
<li>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.</li>
<li>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" data-error-text="Failed to load title" data-id="3412652" data-permission-text="Title is private" data-url="https://github.com/ahmedfgad/GeneticAlgorithmPython/discussions/48" data-hovercard-type="discussion" data-hovercard-url="/ahmedfgad/GeneticAlgorithmPython/discussions/48/hovercard" href="https://github.com/ahmedfgad/GeneticAlgorithmPython/discussions/48">ahmedfgad#48</a></li>
<li>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.</li>
<li>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 >= 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" data-error-text="Failed to load title" data-id="3374502" data-permission-text="Title is private" data-url="https://github.com/ahmedfgad/GeneticAlgorithmPython/discussions/44" data-hovercard-type="discussion" data-hovercard-url="/ahmedfgad/GeneticAlgorithmPython/discussions/44/hovercard" href="https://github.com/ahmedfgad/GeneticAlgorithmPython/discussions/44">ahmedfgad#44</a></li>
<li>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.</li>
<li>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.</li>
<li>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" data-error-text="Failed to load title" data-id="920771196" data-permission-text="Title is private" data-url="https://github.com/ahmedfgad/GeneticAlgorithmPython/issues/47" data-hovercard-type="pull_request" data-hovercard-url="/ahmedfgad/GeneticAlgorithmPython/pull/47/hovercard" href="https://github.com/ahmedfgad/GeneticAlgorithmPython/pull/47">ahmedfgad#47</a></li>
<li>The default value of the title parameter in the plot_fitness() method is "PyGAD - Generation vs. Fitness" rather than "PyGAD - Iteration vs. Fitness".</li>
<li>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.</li>
<li>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.</li>
<li>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.</li>
</ol>ahmedfgadtag:github.com,2008:Repository/449687555/2.14.32021-06-06T06:21:19ZDocumentation of PyGAD 2.14.3<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>ahmedfgadtag:github.com,2008:Repository/449687555/2.14.22021-05-27T23:51:39Z2.14.2: New bade added<p>Add a new badge: <a href="https://readthedocs.org/projects/pygad/badge" rel="nofollow">https://readthedocs.org/projects/pygad/badge</a></p>ahmedfgadtag:github.com,2008:Repository/449687555/2.14.12021-05-19T07:28:03Z2.14.1: PyGAD 2.14.0 Documentation<ol>
<li>Issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="873830033" data-permission-text="Title is private" data-url="https://github.com/ahmedfgad/GeneticAlgorithmPython/issues/40" data-hovercard-type="issue" data-hovercard-url="/ahmedfgad/GeneticAlgorithmPython/issues/40/hovercard" href="https://github.com/ahmedfgad/GeneticAlgorithmPython/issues/40">ahmedfgad#40</a> is solved. Now, the None value works with the crossover_type and mutation_type parameters: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="873830033" data-permission-text="Title is private" data-url="https://github.com/ahmedfgad/GeneticAlgorithmPython/issues/40" data-hovercard-type="issue" data-hovercard-url="/ahmedfgad/GeneticAlgorithmPython/issues/40/hovercard" href="https://github.com/ahmedfgad/GeneticAlgorithmPython/issues/40">ahmedfgad#40</a></li>
<li>The gene_type parameter supports accepting a list/tuple/numpy.ndarray of numeric data types for the genes. This helps to control the data type of each individual gene. Previously, the gene_type can be assigned only to a single data type that is applied for all genes.</li>
<li>A new bool attribute named gene_type_single is added to the pygad.GA class. It is True when there is a single data type assigned to the gene_type parameter. When the gene_type parameter is assigned a list/tuple/numpy.ndarray, then gene_type_single is set to False.</li>
<li>The mutation_by_replacement flag now has no effect if gene_space exists except for the genes with None values. For example, for gene_space=[None, [5, 6]] the mutation_by_replacement flag affects only the first gene which has None for its value space.</li>
<li>When an element has a value of None in the gene_space parameter (e.g. gene_space=[None, [5, 6]]), then its value will be randomly generated for each solution rather than being generate once for all solutions. Previously, the gene with None value in gene_space is the same across all solutions</li>
<li>Some changes in the documentation according to issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="830933520" data-permission-text="Title is private" data-url="https://github.com/ahmedfgad/GeneticAlgorithmPython/issues/32" data-hovercard-type="issue" data-hovercard-url="/ahmedfgad/GeneticAlgorithmPython/issues/32/hovercard" href="https://github.com/ahmedfgad/GeneticAlgorithmPython/issues/32">ahmedfgad#32</a>: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="830933520" data-permission-text="Title is private" data-url="https://github.com/ahmedfgad/GeneticAlgorithmPython/issues/32" data-hovercard-type="issue" data-hovercard-url="/ahmedfgad/GeneticAlgorithmPython/issues/32/hovercard" href="https://github.com/ahmedfgad/GeneticAlgorithmPython/issues/32">ahmedfgad#32</a></li>
</ol>ahmedfgadtag:github.com,2008:Repository/449687555/2.13.02021-03-13T00:01:13Z2.13.0<p>Add files via upload</p>ahmedfgadtag:github.com,2008:Repository/449687555/2.12.02021-02-20T06:48:14Z2.12.0<p>Add files via upload</p>ahmedfgadtag:github.com,2008:Repository/449687555/2.11.02021-02-16T06:53:36Z2.11.0<p>Add files via upload</p>ahmedfgad