-
-
Notifications
You must be signed in to change notification settings - Fork 481
PyGAD 3.2.0 #230
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
Merged
Merged
PyGAD 3.2.0 #230
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
pygad.utils.nsga2
is created that has theNSGA2
class that includes the functionalities of NSGA-II. The class has these methods: 1)get_non_dominated_set()
2)non_dominated_sorting()
3)crowding_distance()
4)sort_solutions_nsga2()
. Check [this section](https://pygad.readthedocs.io/en/latest/pygad_more.html#multi-objective-optimization) for an example.NSGA2
class in thepygad.utils.nsga2
module. Just return alist
,tuple
, ornumpy.ndarray
from the fitness function and the library will consider the problem as multi-objective optimization. All the objectives are expected to be maximization. Check [this section](https://pygad.readthedocs.io/en/latest/pygad_more.html#multi-objective-optimization) for an example.pygad.utils.parent_selection
module: 1) Tournament selection for NSGA-II 2) NSGA-II selection.plot_fitness()
method in thepygad.plot
module has a new optional parameter namedlabel
to accept the label of the plots. This is only used for multi-objective problems. Otherwise, it is ignored. It defaults toNone
and accepts alist
,tuple
, ornumpy.ndarray
. The labels are used in a legend inside the plot.pygad.plot
module is changed to the greenish#64f20c
color.pareto_fronts
added to thepygad.GA
instances that holds the pareto fronts when solving a multi-objective problem.gene_type
accepts alist
,tuple
, ornumpy.ndarray
for integer data types given that the precision is set toNone
(e.g.gene_type=[float, [int, None]]
).cal_pop_fitness()
method, the fitness value is re-used ifsave_best_solutions=True
and the solution is found in thebest_solutions
attribute. These parameters also can help re-using the fitness of a solution instead of calling the fitness function:keep_elitism
,keep_parents
, andsave_solutions
.99999999999
is replaced byfloat('inf')
in the 2 methodswheel_cumulative_probs()
andstochastic_universal_selection()
inside thepygad.utils.parent_selection.ParentSelection
class.plot_result()
method in thepygad.visualize.plot.Plot
class is removed. Instead, please use theplot_fitness()
if you did not upgrade yet.