@@ -833,6 +833,64 @@ Release Date: 19 June 2021
833833 section for more details.
834834 https://github.com/ahmedfgad/GeneticAlgorithmPython/discussions/50
835835
836+ .. _pygad-2161 :
837+
838+ PyGAD 2.16.1
839+ ------------
840+
841+ Release Date: 28 September 2021
842+
843+ 1. Reuse the fitness of previously explored solutions rather than
844+ recalculating them. This feature only works if
845+ ``save_solutions=True ``.
846+
847+ 2. The user can use the ``tqdm `` library to show a progress bar.
848+ https://github.com/ahmedfgad/GeneticAlgorithmPython/discussions/50
849+
850+ .. code :: python
851+
852+ import pygad
853+ import numpy
854+ import tqdm
855+
856+ equation_inputs = [4 ,- 2 ,3.5 ]
857+ desired_output = 44
858+
859+ def fitness_func (solution , solution_idx ):
860+ output = numpy.sum(solution * equation_inputs)
861+ fitness = 1.0 / (numpy.abs(output - desired_output) + 0.000001 )
862+ return fitness
863+
864+ num_generations = 10000
865+ with tqdm.tqdm(total = num_generations) as pbar:
866+ ga_instance = pygad.GA(num_generations = num_generations,
867+ sol_per_pop = 5 ,
868+ num_parents_mating = 2 ,
869+ num_genes = len (equation_inputs),
870+ fitness_func = fitness_func,
871+ on_generation = lambda _ : pbar.update(1 ))
872+
873+ ga_instance.run()
874+
875+ ga_instance.plot_result()
876+
877+ 1. Solved the issue of unequal length between the ``solutions `` and
878+ ``solutions_fitness `` when the ``save_solutions `` parameter is set to
879+ ``True ``. Now, the fitness of the last population is appended to the
880+ ``solutions_fitness `` array.
881+ https://github.com/ahmedfgad/GeneticAlgorithmPython/issues/64
882+
883+ 2. There was an issue of getting the length of these 4 variables
884+ (``solutions ``, ``solutions_fitness ``, ``best_solutions ``, and
885+ ``best_solutions_fitness ``) doubled after each call of the ``run() ``
886+ method. This is solved by resetting these variables at the beginning
887+ of the ``run() `` method.
888+ https://github.com/ahmedfgad/GeneticAlgorithmPython/issues/62
889+
890+ 3. Bug fixes when adaptive mutation is used
891+ (``mutation_type="adaptive" ``).
892+ https://github.com/ahmedfgad/GeneticAlgorithmPython/issues/65
893+
836894PyGAD Projects at GitHub
837895========================
838896
0 commit comments