@@ -1290,6 +1290,115 @@ Release Date 20 April 2023
12901290 selection.
12911291 https://github.com/ahmedfgad/GeneticAlgorithmPython/issues/179
12921292
1293+ .. _pygad-310 :
1294+
1295+ PyGAD 3.1.0
1296+ -----------
1297+
1298+ Release Date 20 June 2023
1299+
1300+ 1. Fix a bug when the initial population has duplciate genes if a
1301+ nested gene space is used.
1302+
1303+ 2. The ``gene_space `` parameter can no longer be assigned a tuple.
1304+
1305+ 3. Fix a bug when the ``gene_space `` parameter has a member of type
1306+ ``tuple ``.
1307+
1308+ 4. A new instance attribute called ``gene_space_unpacked `` which has
1309+ the unpacked ``gene_space ``. It is used to solve duplicates. For
1310+ infinite ranges in the ``gene_space ``, they are unpacked to a
1311+ limited number of values (e.g. 100).
1312+
1313+ 5. Bug fixes when creating the initial population using ``gene_space ``
1314+ attribute.
1315+
1316+ 6. When a ``dict `` is used with the ``gene_space `` attribute, the new
1317+ gene value was calculated by summing 2 values: 1) the value sampled
1318+ from the ``dict `` 2) a random value returned from the random
1319+ mutation range defined by the 2 parameters
1320+ ``random_mutation_min_val `` and ``random_mutation_max_val ``. This
1321+ might cause the gene value to exceed the range limit defined in the
1322+ ``gene_space ``. To respect the ``gene_space `` range, this release
1323+ only returns the value from the ``dict `` without summing it to a
1324+ random value.
1325+
1326+ 7. Formatting the strings using f-string instead of the ``format() ``
1327+ method. https://github.com/ahmedfgad/GeneticAlgorithmPython/pull/189
1328+
1329+ 8. In the ``__init__() `` of the ``pygad.GA `` class, the logged error
1330+ messages are handled using a ``try-except `` block instead of
1331+ repeating the ``logger.error() `` command.
1332+ https://github.com/ahmedfgad/GeneticAlgorithmPython/pull/189
1333+
1334+ 9. A new class named ``CustomLogger `` is created in the ``pygad.cnn ``
1335+ module to create a default logger using the ``logging `` module
1336+ assigned to the ``logger `` attribute. This class is extended in all
1337+ other classes in the module. The constructors of these classes have
1338+ a new parameter named ``logger `` which defaults to ``None ``. If no
1339+ logger is passed, then the default logger in the ``CustomLogger ``
1340+ class is used.
1341+
1342+ 10. Except for the ``pygad.nn `` module, the ``print() `` function in all
1343+ other modules are replaced by the ``logging `` module to log
1344+ messages.
1345+
1346+ 11. The callback functions/methods ``on_fitness() ``, ``on_parents() ``,
1347+ ``on_crossover() ``, and ``on_mutation() `` can return values. These
1348+ returned values override the corresponding properties. The output of
1349+ ``on_fitness() `` overrides the population fitness. The
1350+ ``on_parents() `` function/method must return 2 values representing
1351+ the parents and their indices. The output of ``on_crossover() ``
1352+ overrides the crossover offspring. The output of ``on_mutation() ``
1353+ overrides the mutation offspring.
1354+
1355+ 12. Fix a bug when adaptive mutation is used while
1356+ ``fitness_batch_size ``>1.
1357+ https://github.com/ahmedfgad/GeneticAlgorithmPython/issues/195
1358+
1359+ 13. When ``allow_duplicate_genes=False `` and a user-defined
1360+ ``gene_space `` is used, it sometimes happen that there is no room to
1361+ solve the duplicates between the 2 genes by simply replacing the
1362+ value of one gene by another gene. This release tries to solve such
1363+ duplicates by looking for a third gene that will help in solving the
1364+ duplicates. These examples explain how it works. Check `this
1365+ section <https://pygad.readthedocs.io/en/latest/pygad.html#prevent-duplicates-in-gene-values> `__
1366+ for more information.
1367+
1368+ 14. Use probabilities to select parents using the rank parent selection
1369+ method.
1370+ https://github.com/ahmedfgad/GeneticAlgorithmPython/discussions/205
1371+
1372+ 15. The 2 parameters ``random_mutation_min_val `` and
1373+ ``random_mutation_max_val `` can accept iterables
1374+ (list/tuple/numpy.ndarray) with length equal to the number of genes.
1375+ This enables customizing the mutation range for each individual
1376+ gene.
1377+ https://github.com/ahmedfgad/GeneticAlgorithmPython/discussions/198
1378+
1379+ 16. The 2 parameters ``init_range_low `` and ``init_range_high `` can
1380+ accept iterables (list/tuple/numpy.ndarray) with length equal to the
1381+ number of genes. This enables customizing the initial range for each
1382+ individual gene when creating the initial population.
1383+
1384+ 17. The ``data `` parameter in the ``predict() `` function of the
1385+ ``pygad.kerasga `` module can be assigned a data generator.
1386+ https://github.com/ahmedfgad/GeneticAlgorithmPython/issues/115
1387+ https://github.com/ahmedfgad/GeneticAlgorithmPython/issues/207
1388+
1389+ 18. The ``predict() `` function of the ``pygad.kerasga `` module accepts 3
1390+ optional parameters: 1) ``batch_size=None ``, ``verbose=0 ``, and
1391+ ``steps=None ``. Check documentation of the `Keras
1392+ Model.predict() <https://keras.io/api/models/model_training_apis> `__
1393+ method for more information.
1394+ https://github.com/ahmedfgad/GeneticAlgorithmPython/issues/207
1395+
1396+ 19. The documentation is updated to explain how mutation works when
1397+ ``gene_space `` is used with ``int `` or ``float `` data types. Check
1398+ `this
1399+ section <https://pygad.readthedocs.io/en/latest/pygad.html#limit-the-gene-value-range-using-the-gene-space-parameter> `__.
1400+ https://github.com/ahmedfgad/GeneticAlgorithmPython/discussions/198
1401+
12931402PyGAD Projects at GitHub
12941403========================
12951404
0 commit comments