-
Notifications
You must be signed in to change notification settings - Fork 52
Local search sampler refactor #415
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
base: master
Are you sure you want to change the base?
Conversation
saleml
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Solid PR - adds much-needed documentation and comprehensive tests for the local search sampler. Code is production-ready.
- Excellent inline comments explaining the algorithm flow
- Smart reference implementation for regression testing
- Good edge case coverage
Can you please check if Back-step clamping should be terminating_idx - 1 ?
| assert (back_ratio is not None) and (0 < back_ratio <= 1) | ||
| K = torch.ceil(back_ratio * (trajectories.terminating_idx - 1)).long() | ||
| else: | ||
| K = torch.where( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be trajectories.terminating_idx - 1 to ensure n_prevs >= 0
|
|
||
| # Adjust layout and save to home directory. | ||
| if args.plot: | ||
| import seaborn as sns |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is to fix an annoying auxiliary issue.
Description
WIP - trying to refactor the
LocalSearchSamplerlogic to take better advantage of thePolicyMixinframework.For now, consists only of comments and tests (the tests will be useful to ensure any refactoring does not break the method).
Some notes on the plan:
design ideas to simplify LocalSearchSampler using PolicyMixin