Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

PyGAD-3.5.0

Latest

Choose a tag to compare

@ahmedfgadahmedfgad released this 09 Jul 02:24
9ac7527
This commit was created on GitHub.com and signed with GitHub’sverified signature.
GPG key ID:B5690EEEBB952194
Verified
Learn about vigilant mode.
  1. Fix a bug when minus sign (-) is used inside thestop_criteria parameter for multi-objective problems.#314#323
  2. Fix a bug when thestop_criteria parameter is passed as an iterable (e.g. list) for multi-objective problems (e.g.['reach_50_60', 'reach_20, 40']).#314
  3. Call theget_matplotlib() function from theplot_genes() method inside thepygad.visualize.plot.Plot class to import the matplotlib library.#315
  4. Create a new helper method calledselect_unique_value() inside thepygad/helper/unique.py script to select a unique gene from an array of values.
  5. Create a new helper method calledget_random_mutation_range() inside thepygad/utils/mutation.py script that returns the random mutation range (min and max) for a single gene by its index.
  6. Create a new helper method calledchange_random_mutation_value_dtype inside thepygad/utils/mutation.py script that changes the data type of the value used to apply random mutation.
  7. Create a new helper method calledround_random_mutation_value() inside thepygad/utils/mutation.py script that rounds the value used to apply random mutation.
  8. Create thepygad/helper/misc.py script with a class calledHelper that has the following helper methods:
    1. change_population_dtype_and_round(): For each gene in the population, round the gene value and change the data type.
    2. change_gene_dtype_and_round(): Round the change the data type of a single gene.
    3. mutation_change_gene_dtype_and_round(): Decides whether mutation is done by replacement or not. Then it rounds and change the data type of the new gene value.
    4. validate_gene_constraint_callable_output(): Validates the output of the user-defined callable/function that checks whether the gene constraint defined in thegene_constraint parameter is satisfied or not.
    5. get_gene_dtype(): Returns the gene data type from thegene_type instance attribute.
    6. get_random_mutation_range(): Returns the random mutation range using therandom_mutation_min_val andrandom_mutation_min_val instance attributes.
    7. get_initial_population_range(): Returns the initial population values range using theinit_range_low andinit_range_high instance attributes.
    8. generate_gene_value_from_space(): Generates/selects a value for a gene using thegene_space instance attribute.
    9. generate_gene_value_randomly(): Generates a random value for the gene. Only used ifgene_space isNone.
    10. generate_gene_value(): Generates a value for the gene. It checks whethergene_space isNone and calls eithergenerate_gene_value_randomly() orgenerate_gene_value_from_space().
    11. filter_gene_values_by_constraint(): Receives a list of values for a gene. Then it filters such values using the gene constraint.
    12. get_valid_gene_constraint_values(): Selects one valid gene value that satisfy the gene constraint. It simply callsgenerate_gene_value() to generate some gene values then it filters such values usingfilter_gene_values_by_constraint().
  9. Create a new helper method calledmutation_process_random_value() inside thepygad/utils/mutation.py script that generates constrained random values for mutation. It calls eithergenerate_gene_value() orget_valid_gene_constraint_values() based on whether thegene_constraint parameter is used or not.
  10. A new parameter calledgene_constraint is added. It accepts a list of callables (i.e. functions) acting as constraints for the gene values. Before selecting a value for a gene, the callable is called to ensure the candidate value is valid. Check the [Gene Constraint](https://pygad.readthedocs.io/en/latest/pygad_more.html#gene-constraint) section for more information.#119
  11. A new parameter calledsample_size is added. To select a gene value that respects a constraint, this variable defines the size of the sample from which a value is selected randomly. Useful if eitherallow_duplicate_genes orgene_constraint is used. An instance attribute of the same name is created in the instances of thepygad.GA class. Check the [sample_size Parameter](https://pygad.readthedocs.io/en/latest/pygad_more.html#sample-size-parameter) section for more information.
  12. Use thesample_size parameter instead ofnum_trials in the methodssolve_duplicate_genes_randomly() andunique_float_gene_from_range() inside thepygad/helper/unique.py script. It is the maximum number of values to generate as the search space when looking for a unique float value out of a range.
  13. Fixed a bug in population initialization whenallow_duplicate_genes=False. Previously, gene values were checked for duplicates before rounding, which could allow near-duplicates like 7.61 and 7.62 to pass. After rounding (e.g., both becoming 7.6), this resulted in unintended duplicates. The fix ensures gene values are now rounded before duplicate checks, preventing such cases.
  14. More tests are created.
  15. More examples are created.
  16. Edited thesort_solutions_nsga2() method in thepygad/utils/nsga2.py script to accept an optional parameter calledfind_best_solution when calling this method just to find the best solution.
  17. Fixed a bug while applying the non-dominated sorting in theget_non_dominated_set() method inside thepygad/utils/nsga2.py script. It was swapping the non-dominated and dominated sets. In other words, it used the non-dominated set as if it is the dominated set and vice versa. All the calls to this method were edited accordingly.#320.
  18. Fix a bug retrieving in thebest_solution() method when retrieving the best solution for multi-objective problems.#331
Assets4
Loading

[8]ページ先頭

©2009-2025 Movatter.jp