What is mask A and mask B conv in Pixel-CNN?

Viewed 46

Im trying to implement a machine learning project that bases on Pixel-Rnn paper Link, and i'm having some problems to understand how to implement some things.

The model in the paper is

  • 7x7 conv mask A
  • multiple residual blocks conv 3x3 mask B
  • 2 Layers of ReLU followed by 1x1 conv Mask B

I didn't understand the differences between Mask A and Mask B and how to implement them. also, is there any residual block class to use in tensorflow library? if not how can i implement it?

another problem that i have is that i don't know how to implement the image generator of occured images. for exmaple: i've tried to load data(image of size (28,28)) of numbers from MNIST dataset, then all the pixels from row above 13 i reset them to 0.

(x1, _), (y1, _) = keras.datasets.mnist.load_data()

after i load the data i display the 4 images.

f, axarr = plt.subplots(4,1) 
axarr[0].imshow(x1[0])
axarr[1].imshow(x1[1])
axarr[2].imshow(x1[2])
axarr[3].imshow(x1[3])

now i reset some of the pixel to make them occured images.

for i in range(4):
    x1[i, 13:] = 0

and now im stuck. based on the paper i need to generate an image pixel by pixel using this - the probability formula which assign a probability p(x) to each image x formed of nxn pixels.

I'm having hard time to understand how to work with generating problems in machine learning.

In the end i need to built a project that gets occured images and predicts them.

Here is an example

0 Answers
Related