Skip to content
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

Fix parameters being reininitialized in Genome.mutate() #213

Conversation

jakobj
Copy link
Member

@jakobj jakobj commented Jul 29, 2020

As mutate uses dna.setter it also triggers the function to initialize numerical values for (unknown) parameters. Before initializing any parameter it is now checked that this does have a value assigned yet. If it does, this parameter is not (re)initialized.

(ouch! 😬 )

@jakobj jakobj added bug Something isn't working high priority Let's fix this quickly! labels Jul 29, 2020
@jakobj jakobj added this to the 0.2.0 milestone Jul 29, 2020
@jakobj jakobj requested a review from mschmidt87 July 29, 2020 14:54
Copy link
Member

@mschmidt87 mschmidt87 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but why does the differential_evo_regression work with this bug?

@jakobj
Copy link
Member Author

jakobj commented Jul 30, 2020

my guess would be that the parent is maintained long enough to evolve such useful parameters that new offspring with reset parameters can not compete. as the parent is not mutated, local search will fit it's parameters correctly.

As the mutate function uses the dna.setter it also triggers the
function to initialize parameters. Before initializing any parameter
it is now checked that it does have a value assigned yet. If it does,
this parameter is not (re)initialized.
@jakobj jakobj force-pushed the fix/mutate-should-not-reinitialize-parameters branch from 99beba3 to ce40c36 Compare July 30, 2020 12:17
@jakobj
Copy link
Member Author

jakobj commented Jul 30, 2020

rebased, waiting for travis

@jakobj jakobj merged commit 9c34a9d into Happy-Algorithms-League:master Jul 30, 2020
@jakobj jakobj deleted the fix/mutate-should-not-reinitialize-parameters branch July 30, 2020 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working high priority Let's fix this quickly!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants