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

Fix Documentation User-Defined Mutation Operator Example: the number ... #156

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
ahmedfgad merged 1 commit into ahmedfgad:master from augustodamasceno:fix_doc_mutation_example
Feb 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix Documentation User-Defined Mutation Operator Example: the number ...
...of genes is the offspring shape dimension index 1.
  • Loading branch information
augustodamasceno committed Jan 22, 2023
commit 06ed09dccf51374f8f6a2d9ee3c5a412c06b8e4d
2 changes: 1 addition & 1 deletion docs/source/README_pygad_ReadTheDocs.rst
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -2261,7 +2261,7 @@ gene's value.
def mutation_func(offspring, ga_instance):

for chromosome_idx in range(offspring.shape[0]):
random_gene_idx = numpy.random.choice(range(offspring.shape[0]))
random_gene_idx = numpy.random.choice(range(offspring.shape[1]))

offspring[chromosome_idx, random_gene_idx] += numpy.random.random()

Expand Down

AltStyle によって変換されたページ (->オリジナル) /