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

Avoid inconsequential warning when using multi-dimensional x #351

Closed
alvorithm opened this issue Sep 30, 2020 · 1 comment · Fixed by #361
Closed

Avoid inconsequential warning when using multi-dimensional x #351

alvorithm opened this issue Sep 30, 2020 · 1 comment · Fixed by #361

Comments

@alvorithm
Copy link
Contributor

Problem

The user is free to supply an embedding net whose output does not reduce x to one dimension (shape (D,)). It is difficult for us to prevent this mismatch, because it requires poking into an already built Sequential architecture, which could turn out to be hacky (but this has to be assessed? see https://github.com/mackelab/sbi/blob/292396b87f9f27806445cb74307f9b58f125e787/sbi/neural_nets/classifier.py#L95 @janfb @michaeldeistler ).

At the moment any sort of multidimensional x will trigger a warning, but the warning will sometimes be idle, i.e. things will just work. We want to prevent idle warnings.

Solution

Do not issue an inconditional warning, but if a dimension mismatch happens at the input of the density estimator proper, catch the exception and include a potential debug hypothesis in the error message ('This could have failed because x has more than one dimension').

Note this has to be handled differently depending on the inference method.

@janfb
Copy link
Contributor

janfb commented Oct 1, 2020

Looks good, thanks for summarising this @Meteore . I will tackle it next week!

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 a pull request may close this issue.

2 participants