You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe there is a problem with counting the mutations in Genome.mutate()
The counter successful_mutations increases only for mutations in the output region (see genome.py L400, L395: https://github.com/Happy-Algorithms-League/hal-cgp/blob/master/cgp/genome.py#L400). This causes the mutation_factor to be multiplied by a factor ≃ n_hidden_genes / n_output_genes (a bit lower in practice, since some hidden genes might be mutated several times)
Suggestion 1: add successful_mutations += 1 on line 400. But this causes the new issue, that also mutations that result in the same gene value are counted as successful mutations.
Suggestion 2: add a second output to _mutate_hidden_region that indicates whether there was a real change in the value of the gene (success?) and count only if a real mutation happened.
(PS. point 2 might also be necessary in _mutate_output_region as additional control for a "real" mutation)
The text was updated successfully, but these errors were encountered:
I think your first suggestion should be definitely implemented, regardless of the remaining issues. We should count a mutation if one was applied ;)
Regarding the second point, this requires a design decision, I don't think there's the perfect solution. I would suggest to only return from the function after a gene different from the previous one was picked, sort of while gene was not changed: mutate solution. Otherwise nothing in the dna has changed, and I would hardly count that a mutation. In general I think it would be nice if the return values of _mutate_hidden_region and _mutate_output_region to be logically similar, do you think that's possible?
I'm not sure I understand why the factor is n_hidden_genes / n_output_genes. Have you checked this numerically? Could be easily done by fixing the second point first and counting the actual number of mutations over a number of trials.
I believe there is a problem with counting the mutations in
Genome.mutate()
The counter
successful_mutations
increases only for mutations in the output region (see genome.py L400, L395: https://github.com/Happy-Algorithms-League/hal-cgp/blob/master/cgp/genome.py#L400). This causes the mutation_factor to be multiplied by a factor ≃ n_hidden_genes / n_output_genes (a bit lower in practice, since some hidden genes might be mutated several times)Suggestion 1: add
successful_mutations += 1
on line 400. But this causes the new issue, that also mutations that result in the same gene value are counted as successful mutations.Suggestion 2: add a second output to
_mutate_hidden_region
that indicates whether there was a real change in the value of the gene (success?) and count only if a real mutation happened.(PS. point 2 might also be necessary in
_mutate_output_region
as additional control for a "real" mutation)The text was updated successfully, but these errors were encountered: