Skip to content

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 25 commits into from
Sep 8, 2023
Merged

PyGAD 3.2.0 #230

merged 25 commits into from
Sep 8, 2023

Conversation

ahmedfgad
Copy link
Owner

  1. A new module pygad.utils.nsga2 is created that has the NSGA2 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.
  2. Support of multi-objective optimization using Non-Dominated Sorting Genetic Algorithm II (NSGA-II) using the NSGA2 class in the pygad.utils.nsga2 module. Just return a list, tuple, or numpy.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.
  3. The parent selection methods and adaptive mutation are edited to support multi-objective optimization.
  4. Two new NSGA-II parent selection methods are supported in the pygad.utils.parent_selection module: 1) Tournament selection for NSGA-II 2) NSGA-II selection.
  5. The plot_fitness() method in the pygad.plot module has a new optional parameter named label to accept the label of the plots. This is only used for multi-objective problems. Otherwise, it is ignored. It defaults to None and accepts a list, tuple, or numpy.ndarray. The labels are used in a legend inside the plot.
  6. The default color in the methods of the pygad.plot module is changed to the greenish #64f20c color.
  7. A new instance attribute named pareto_fronts added to the pygad.GA instances that holds the pareto fronts when solving a multi-objective problem.
  8. The gene_type accepts a list, tuple, or numpy.ndarray for integer data types given that the precision is set to None (e.g. gene_type=[float, [int, None]]).
  9. In the cal_pop_fitness() method, the fitness value is re-used if save_best_solutions=True and the solution is found in the best_solutions attribute. These parameters also can help re-using the fitness of a solution instead of calling the fitness function: keep_elitism, keep_parents, and save_solutions.
  10. The value 99999999999 is replaced by float('inf') in the 2 methods wheel_cumulative_probs() and stochastic_universal_selection() inside the pygad.utils.parent_selection.ParentSelection class.
  11. The plot_result() method in the pygad.visualize.plot.Plot class is removed. Instead, please use the plot_fitness() if you did not upgrade yet.

@ahmedfgad ahmedfgad added bug Something isn't working enhancement New feature or request labels Sep 8, 2023
@ahmedfgad ahmedfgad merged commit 759ed4e into master Sep 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant