-
Notifications
You must be signed in to change notification settings - Fork 65
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
bring back sample_dim in log_joint #44
base: master
Are you sure you want to change the base?
Conversation
@@ -80,7 +80,7 @@ def elbo(q, p, sample_dim=None, batch_dim=None, alpha=0.1, beta=(1.0, 1.0, 1.0, | |||
|
|||
|
|||
def kl(q, p, sample_dim=None, batch_dim=None, log_weights=None, beta=(1.0, 1.0, 1.0, 1.0, 1.0), | |||
size_average=True, reduce=True, bias=None): | |||
size_average=True, reduce=True, bias=None): |
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 appears to just be a whitespace edit. I'm fine with it going in if JW is.
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.
only review-worthy change is the sample_dim
thing, rest is pep8 etc.- don't waste your time on those...
probtorch/stochastic.py
Outdated
batch_dim(int): The dimension that enumerates batch items. | ||
""" | ||
if (sample_dim is not None): | ||
if sample_dims is None: | ||
sample_dims = sample_dim |
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.
Shouldn't this contain a single-element tuple as the default when assigning sample_dim to sample_dims?
because backwards compatibility is a thing. But seriously, having only
sample_dims
for one method andsample_dim
creates confusion in namespace. I agree thatsample_dims
is semantically correct where it's used and we should permit multiple sample dims (and usesample_dims
) everywhere. In the meantime, let's allow forsample_dim
(with a deprecation warning).