-
-
Notifications
You must be signed in to change notification settings - Fork 481
'mutation_type = None' not allowed #40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thank you. The issue with assigning None values for |
Thanks, @ahmedfgad for the quick response! Please keep up the good work. I will test it after you make it available on your web page. |
Thank you. |
Hi @asishadhikari , This is a normal warning and you can supress all warnings by setting The warning is returned because you use the default of mutating 10% of the genes ( This warning tells you that if you intentionally want to mutate no genes, then it is better to set Please let me know if I should clarify something. |
Changes in PyGAD 2.14.0 1. Issue #40 is solved. Now, the None value works with the crossover_type and mutation_type parameters: #40 2. 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. 3. 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. 4. 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. 5. 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 6. Some changes in the documentation according to issue #32: #32
1. Issue #40 is solved. Now, the None value works with the crossover_type and mutation_type parameters: #40 2. 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. 3. 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. 4. 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. 5. 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 6. Some changes in the documentation according to issue #32: #32
This issue is solved in the new release of PyGAD 2.14.0. |
I did not use mutation, pygad print the following warning:
But when I set mutation_type=None, or mutation_type="None", then pygad crashed:
I looked at the source code, it seems that line 280 does not allow the possibility of mutation_type being None. Yet line 295 does allow such possibility.
The text was updated successfully, but these errors were encountered: