Skip to content
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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

alicanb
Copy link
Collaborator

@alicanb alicanb commented Nov 5, 2019

because backwards compatibility is a thing. But seriously, having only sample_dims for one method and sample_dim creates confusion in namespace. I agree that sample_dims is semantically correct where it's used and we should permit multiple sample dims (and use sample_dims) everywhere. In the meantime, let's allow for sample_dim (with a deprecation warning).

@@ -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):
Copy link
Contributor

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.

Copy link
Collaborator Author

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...

batch_dim(int): The dimension that enumerates batch items.
"""
if (sample_dim is not None):
if sample_dims is None:
sample_dims = sample_dim
Copy link
Contributor

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants