-
Notifications
You must be signed in to change notification settings - Fork 86
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: no pool preds for random heuristic #277
Conversation
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.
Thank you for your PR!
Small comment and could we add some test to be sure that it doesn't call self.get_probabilities
?
baal/active/active_loop.py
Outdated
@@ -79,7 +79,10 @@ def step(self, pool=None) -> bool: | |||
indices = None | |||
|
|||
if len(pool) > 0: | |||
probs = self.get_probabilities(pool, **self.kwargs) | |||
if self.heuristic.__class__.__name__ == "Random": |
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.
I think we can use isinstance(self.heuristic, Random)
here.
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.
Thanks for the comment! I added a unit test that checks whether self.get_probabilities
is called with unittest.mock.patch
.
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.
Looks great thank you!
LGTM
Summary:
Issue #274
Features:
/
Checklist:
tests/documentation_test.py
).