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

Why concatenating a matrix of ones? #6

Closed
pmorerio opened this issue Jul 1, 2021 · 2 comments
Closed

Why concatenating a matrix of ones? #6

pmorerio opened this issue Jul 1, 2021 · 2 comments

Comments

@pmorerio
Copy link

pmorerio commented Jul 1, 2021

Hi and first of all thanks for the great code!

Can I ask why you stack a matrix of ones in the penultimate channel here?

x = tf.concat([x, ones_x, ones_x*mask], 3)

Wouldn't it make more sense to have x = tf.concat([x, ones_x*(1-mask), ones_x*mask], 3) ?
(i.e. you concat the mask as its one-hot encoding).

Best,
P.

@USTC-JialunPeng
Copy link
Owner

It's a good question.
It originated from the implementation of PixelCNN++, a widely used PixelCNN.
https://github.com/openai/pixel-cnn/blob/bbc15688dd37934a12c2759cf2b34975e15901d9/pixel_cnn_pp/model.py#L36
However, I think it may have little impact on the performance. You can try to remove it and re-train the model.

Best wishes,
Jialun

@pmorerio
Copy link
Author

pmorerio commented Jul 2, 2021

Thanks for your answer!

@pmorerio pmorerio closed this as completed Jul 2, 2021
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