iaf-vae
iaf-vae copied to clipboard
Is PixelCNN masking reversed in original implementation?
Thanks for sharing this, Lucas!
I saw the implementation of masked convolution in the original openai repo
def get_conv_ar_mask(h, w, n_in, n_out, zerodiagonal=False):
l = (h - 1) / 2
m = (w - 1) / 2
mask = np.ones([h, w, n_in, n_out], dtype=np.float32)
mask[:l, :, :, :] = 0
mask[l, :m, :, :] = 0
mask[l, m, :, :] = get_linear_ar_mask(n_in, n_out, zerodiagonal)
return mask
which was a reversed mask, considering that conv filters run from left to right and from top to bottom. Their theano implementation was the same. Correct one would be something like:
mask[l+1:, :, :, :] = 0
mask[l, m:, :, :] = 0
But I saw your implementation is same as what I expected. so how did you figure this out? or did you have any opinion on this?
Thanks!