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 acceptance rate reporting #20

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

ortega2247
Copy link
Contributor

After restarting a pydream calibration, pydream was calculating the acceptance rate as it has just begun instead of taking into account the previous iterations and number of accepted points. This PR saves the acceptance rates per calibration run and the number of accepted points to files and then used them for reference when the pydream calibration is restarted.

Copy link
Contributor

@alubbock alubbock left a comment

Choose a reason for hiding this comment

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

A few small suggestions. Also wondering if there's any kind of unit test that would be appropriate here, like a pause/resume to test the file save/load. What do you think?

pydream/Dream.py Outdated Show resolved Hide resolved
pydream/core.py Outdated Show resolved Hide resolved
pydream/core.py Outdated Show resolved Hide resolved
pydream/core.py Show resolved Hide resolved
pydream/core.py Show resolved Hide resolved
Copy link
Contributor

@alubbock alubbock left a comment

Choose a reason for hiding this comment

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

LGTM

@alubbock
Copy link
Contributor

Should the reporting files be deleted by default when PyDREAM completes? Maybe with a cleanup=True default argument?

@michael-irvin
Copy link

See my pull request here: #22

@ortega2247
Copy link
Contributor Author

Should the reporting files be deleted by default when PyDREAM completes? Maybe with a cleanup=True default argument?

@alubbock @michael-irvin Might be better to have a save_acceptance_rate=False default argument? That way pydream doesn't spend time creating the files to delete them afterward. Also, if pydream is restarted but the acceptance rate files were not saved or were cleaned up, should we print a warning saying that it was restarted but no acceptance rates files were found?

@michael-irvin
Copy link

Also, if pydream is restarted but the acceptance rate files were not saved or were cleaned up, should we print a warning saying that it was restarted but no acceptance rates files were found?

Would this re-create the issue of acceptance rates mysteriously decreasing after the first restart?

@ortega2247
Copy link
Contributor Author

ummm good point. Yes, this would recreate that issue as to get to obtain correctly the acceptance rates the history file is required

@ortega2247
Copy link
Contributor Author

Ok, since the naccepts files are necessary to restart pydream and have the correct acceptance rates, we shouldn't delete them. If you @alubbock @michael-irvin are ok with this I am going to go ahead and merge this PR

@lh64
Copy link

lh64 commented Jul 8, 2020 via email

@lh64
Copy link

lh64 commented Jul 8, 2020 via email

@ortega2247
Copy link
Contributor Author

Yeah @lh64 , I think that there are not standardized best practices for merging pull requests. What most people agree on is to only merge after the reviewers have approved the PR (https://www.quora.com/Is-it-best-practice-to-merge-your-own-pull-request-or-have-someone-else-do-it-on-Github). Since @alubbock and @michael-irvin already approved the PR, and there are no new comments or concerns I thought it was fine to go ahead and merge the PR

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.

4 participants