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

Squeeze implementations differs to that reported in article. #88

Open
AlexanderMath opened this issue Aug 7, 2019 · 1 comment
Open

Comments

@AlexanderMath
Copy link

AlexanderMath commented Aug 7, 2019

The article briefly describe the architecture, and refer to Real NVP for more details.

image

This lead me to believe Glow implemented the Squeeze operation as done by Real NVP. It turns out this is not the case, please see the images below.

GLOW:
image

RealNVP:
image

This can be fixed by changing a single line in squeeze2d(..) which can be found in tfops.py.

#x = tf.transpose(x, [0, 1, 3, 5, 2, 4]) # differs to RealNVP
x = tf.transpose(x, [0, 1, 3, 2, 4, 5]) # the same as RealNVP

Please not similar changes needs to be done for unsqueeze2d(..).

Does anyone know if this was intentional? It might be that mixing up channels this way slightly improves performance?

@naturomics
Copy link

naturomics commented Aug 15, 2019

It doesn't matter. Squeeze2d is followed by 1x1 conv layer. After squeezing, both implementations have the same data within each channel group but a different order, they look same for 1x1 conv.

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

No branches or pull requests

2 participants