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 for fitness curve only ever getting updated at the end #44

Merged
merged 2 commits into from
Nov 3, 2019

Conversation

davideasaf
Copy link
Contributor

Currently, the hill climber only ever responds with 1 item in the curve array because the fitness_curve is only ever getting updated at the end of the while loop.

Copy link
Owner

@gkhayes gkhayes left a comment

Choose a reason for hiding this comment

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

Hi @davideasaf,
I understand what you are trying to do here. However, I think you have implemented the change at the wrong point in the code. With a slight change, this should be able to be merged.
Regards,
Genevieve.

@gkhayes gkhayes closed this Nov 3, 2019
@gkhayes gkhayes reopened this Nov 3, 2019
Copy link
Owner

@gkhayes gkhayes left a comment

Choose a reason for hiding this comment

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

I kind of stuffed up this review because I initially misread your changes to the code (and my original code). Sorry about that. Anyway, I understand what you are doing here, but I think you have implemented it in the wrong location. If you could make a slight change to your code, then I will be happy to merge it with the code base.

@gkhayes gkhayes mentioned this pull request Nov 3, 2019

if curve:
fitness_curve.append(problem.get_fitness())

# If best neighbor is an improvement, move to that state
if next_fitness > problem.get_fitness():
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@gkhayes , When you say "wrong location" are you referring to the fact that it"s happening before this line? If so, that makes sense.

I believe we both agree on that fact that it should be within the while loop, correct?

Copy link
Owner

Choose a reason for hiding this comment

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

Sorry, I should have been clearer. Anyway, what you have done is in agreement with my thinking.

Instead of updating the fitness_curve before we set the state, we set the fitness_curve after we set the state.
@davideasaf davideasaf requested a review from gkhayes November 3, 2019 00:52
@davideasaf
Copy link
Contributor Author

I think I addressed the issue. Let me know if that"s right.

Copy link
Owner

@gkhayes gkhayes left a comment

Choose a reason for hiding this comment

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

Hi @davideasaf,
Thanks for making the requested change. It looks good now, so I"m going to merge your PR with the code base and it will be included in the next mlrose release on PyPi.
Regards,
Genevieve.

@gkhayes gkhayes merged commit 04438d0 into gkhayes:master Nov 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants