Comments (5)
Thank you. The issue with assigning None values for crossover_type
and mutation_type
is solved. The updated pygad.py
module is available at GitHub and a new release will be published to PyPI later. Please try the updated module if there a chance.
from geneticalgorithmpython.
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.
from geneticalgorithmpython.
Thank you.
from geneticalgorithmpython.
Hi @ahmedfgad thanks a lot for this wonderful tool. I tried to run the example code from
/home/sikari/Desktop/temp_proj_pygad/PYGAD/pygad.py:374:
UserWarning: The percentage of genes to mutate (mutation_percent_genes=10) resutled in selecting (0) genes. The number of genes to mutate is set to 1 (mutation_num_genes=1).
If you do not want to mutate any gene, please set mutation_type=None.
if not self.suppress_warnings: warnings.warn("The percentage of genes to mutate (mutation_percent_genes={mutation_percent}) resutled in selecting ({mutation_num}) genes. The number of genes to mutate is set to 1 (mutation_num_genes=1).\nIf you do not want to mutate any gene, please set mutation_type=None.".format(mutation_percent=mutation_percent_genes, mutation_num=mutation_num_genes))solution, solution_fitness, solution_idx = ga_instance.best_solution()
print("Parameters of the best solution : {solution}".format(solution=solution))
Parameters of the best solution : [ 4.46054413 -0.56253708 -0.58246418 1.96274254 -2.26517722 1.62457641]
print("Fitness value of the best solution = {solution_fitness}".format(solution_fitness=solution_fitness))
Fitness value of the best solution = 42.05377974846767`
Hi @asishadhikari ,
This is a normal warning and you can supress all warnings by setting suppress_warnings=True
.
The warning is returned because you use the default of mutating 10% of the genes (mutation_percent_genes=10
). When you have few genes like only 2, then 10% means 0.2 genes which is rounded to 0. This means you are mutating 0 genes. With that situation, the number of genes is raised to 1 automatically.
This warning tells you that if you intentionally want to mutate no genes, then it is better to set mutation_type=None
. Otherwise, there will be 1 gene mutated.
Please let me know if I should clarify something.
from geneticalgorithmpython.
This issue is solved in the new release of PyGAD 2.14.0.
Thank you.
from geneticalgorithmpython.
Related Issues (20)
- Variable population size HOT 6
- KerasGA Parellel Processing HOT 1
- Wor HOT 1
- Additive random mutation with `gene_space` `low` and `high` HOT 2
- AttributeError HOT 1
- Adding interactive examples HOT 1
- Multi-Objective Optimization and parallel_processing
- Exceptions when running multi-objective problems HOT 1
- Save the instance of a GA during fitness evaluation HOT 1
- Error when run parallel_processing "process" HOT 3
- multi objective optimization - metric of quality HOT 1
- Force recalculation of fitness values for each new generation ? HOT 7
- Fitness value of a solution computed multiple times per generation? HOT 5
- The on_generation callback is not called at the end of generation 0 HOT 2
- GA
- Convergence issue: good solution appears to be forgotten, resulting best solution is not even valid HOT 1
- Error when running 3.2.0 vs. 3.1.0 for ga_instance.best_solutions
- ga_instance.save will not work with tqdm example HOT 1
- fitness function is being saved? HOT 2
- Cannot modify the attributes of the ga_instance when running multiple processes in parallel HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from geneticalgorithmpython.