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

Conditional MADE cannot estimate first dimension of input #85

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gmoss13
Copy link

@gmoss13 gmoss13 commented Feb 13, 2025

Hi, thanks for maintaining this package!

While working on a separate PR in the sbi package, we noticed that MADEs cannot correctly estimate the first dimension of the input when context is not None. After a bit of digging, I think the reason is in the way context is used in MADEs. The output corresponding to the first dimension of the input is always independent of all the inputs (including itself), as enforced by the masking with output_layer=True.

With the current implementation, even if context is provided, any input coming from the hidden layers is masked out in the final layer of MADE, and so the output for the first dimension is simply the bias term of the last layer, regardless of context. I think the simplest fix is to introduce a dummy input variable, as done in this PR. This way the masking constraints are still satisfied between all the real dimensions of the input, and we can retain information from context in the output layer.

Happy to discuss further, and thanks again :)

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.

1 participant