-
Notifications
You must be signed in to change notification settings - Fork 125
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
post: bugfix: chains should be detempered/reweighted at once (or bad weights) #322
Changes from all commits
79cb768
88063aa
3957c79
8e036a8
2a90ba9
4081a63
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,7 +58,6 @@ def current_logp(self) -> float: | |
:return: log likelihood from the current state as a scalar | ||
""" | ||
value = self.current_state["logp"] | ||
# Unfortunately, numpy arrays are not derived from Sequence, so the test is ugly | ||
if hasattr(value, "__len__"): | ||
value = value[0] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sized does not imply indexable? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note the Sized form is also nearly ten times slower than hasattr, which I think may be why we were using that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sized simply implies that it has length (as opposed to Sequence, which is not compatible with numpy arrays). Reverting where applicable. I though you preferred stronger type checks and less duck-typing, but fine to me. |
||
return value | ||
|
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.
is_batch is not used?
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.
Oops!