AdvancedPhotonSource / tike

Repository for ptychography software
http://tike.readthedocs.io
Other
29 stars 15 forks source link

NEW: Use wobbly center algorithm to choose random subsets #169

Closed carterbox closed 2 years ago

carterbox commented 3 years ago

Purpose

Choose better random subsets for mini-batches.

Approach

ptychoshelves chooses sparse batches by trying to iteratively minimize the overlap between scanning positions within each subset. This method is similar. It uses the wobbly center algorithm to choose subsets that all try to be as similar to the population as a whole. i.e. both methods try to ensure that the subsets always do better than the worst case random sample.

Pre-Merge Checklists

Submitter

Reviewer

pep8speaks commented 3 years ago

Hello @carterbox! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 68:13: E741 ambiguous variable name 'l'

Comment last updated at 2021-11-02 17:55:49 UTC
carterbox commented 2 years ago

@stevehenke, the test don't pass consistently on the CI because the result is stochastic. I could make them always pass by choosing a random seed that works? What do you think?

stevehenke commented 2 years ago

That could be an initial band-aid approach. Perhaps it would be more robust to introduce a wrapper that runs the test many times to demonstrate that the result holds on average.