You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+2-18Lines changed: 2 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,12 +2,12 @@
2
2
3
3
[PyGAD](https://pypi.org/project/pygad) is an open-source easy-to-use Python 3 library for building the genetic algorithm and optimizing machine learning algorithms. It supports Keras and PyTorch. PyGAD supports optimizing both single-objective and multi-objective problems.
4
4
5
-
> Try the [Optimization Gadget](https://optimgadget.com), a free cloud-based tool powered by PyGAD. It makes optimization easier by reducing or removing the need for coding, and it shows helpful visualizations.
5
+
> Try [Vilvik](https://vilvik.com), a free cloud-based tool powered by PyGAD. It makes optimization easier by reducing or removing the need for coding, and it shows helpful visualizations.
6
6
7
7
Read the [PyGAD documentation](https://pygad.readthedocs.io/en/latest).
The PyGAD documentation is available at [Read the Docs](https://pygad.readthedocs.io) at this link: https://pygad.readthedocs.io. It explains the modules supported by PyGAD and all its classes, methods, attributes, and functions. For each module, several examples are given.
@@ -304,7 +291,4 @@ If you used PyGAD, please consider adding a citation to the following paper abou
Copy file name to clipboardExpand all lines: pygad/pygad.py
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,7 @@ class GA(utils.parent_selection.ParentSelection,
9
9
utils.crossover.Crossover,
10
10
utils.mutation.Mutation,
11
11
utils.nsga2.NSGA2,
12
+
utils.nsga3.NSGA3,
12
13
utils.validation.Validation,
13
14
utils.engine.GAEngine,
14
15
helper.unique.Unique,
@@ -37,6 +38,7 @@ def __init__(self,
37
38
keep_parents=-1,
38
39
keep_elitism=1,
39
40
K_tournament=3,
41
+
nsga3_num_divisions=None,
40
42
crossover_type="single_point",
41
43
crossover_probability=None,
42
44
mutation_type="random",
@@ -86,6 +88,7 @@ def __init__(self,
86
88
parent_selection_type: Type of parent selection.
87
89
keep_parents: If 0, this means no parent in the current population will be used in the next population. If -1, this means all parents in the current population will be used in the next population. If set to a value > 0, then the specified value refers to the number of parents in the current population to be used in the next population. Some parent selection operators such as rank selection, favor population diversity and therefore keeping the parents in the next generation can be beneficial. However, some other parent selection operators, such as roulette wheel selection (RWS), have higher selection pressure and keeping more than one parent in the next generation can seriously harm population diversity. This parameter has an effect only when the keep_elitism parameter is 0. Thanks to Prof. Fernando Jiménez (http://webs.um.es/fernan) for editing this sentence.
88
90
K_tournament: When the value of 'parent_selection_type' is 'tournament', the 'K_tournament' parameter specifies the number of solutions from which a parent is selected randomly.
91
+
nsga3_num_divisions: Only used when 'parent_selection_type' is 'nsga3' or 'tournament_nsga3'. It is the number of divisions per objective axis used to build the structured reference points (the 'p' parameter from Deb & Jain 2014). The total number of reference points is C(M + p - 1, p) where M is the number of objectives. Must be a positive integer. Defaults to None.
89
92
90
93
keep_elitism: Added in PyGAD 2.18.0. It can take the value 0 or a positive integer that satisfies (0 <= keep_elitism <= sol_per_pop). It defaults to 1 which means only the best solution in the current generation is kept in the next generation. If assigned 0, this means it has no effect. If assigned a positive integer K, then the best K solutions are kept in the next generation. It cannot be assigned a value greater than the value assigned to the sol_per_pop parameter. If this parameter has a value different from 0, then the keep_parents parameter will have no effect.
raiseTypeError(f"Incorrect parent selection type. The fitness function returned a single numeric fitness value which means the problem is single-objective. But the parent selection type {self.parent_selection_type} is used which only works for multi-objective optimization problems.")
441
441
eliftype(self.last_generation_fitness[0]) in [list, tuple, numpy.ndarray]:
0 commit comments