hwalsuklee / tensorflow-mnist-VAE

Tensorflow implementation of variational auto-encoder for MNIST
492 stars 182 forks source link

ADD_NOISE #1

Open erlebach opened 7 years ago

erlebach commented 7 years ago

Hi,

In run_main, in the section "if ADD_NOISE:", the code states: if ADD_NOISE: x_PMLR = x_PMLR * np.random.randint(2, size=x_PMLR.shape) x_PMLR += np.random.randint(2, size=x_PMLR.shape)

Line 1 creates pepper noise (since you are multiplying by 1 or 0). The second line adds 1 or 0 to each pixel. What is the rationale? Why not simply add a Gaussian or uniform noise of small amplitude to each pixel? Thanks.

hwalsuklee commented 7 years ago

Hi,

Two lines you mentioned is meant to add "strong" noise to image so that you can hardly recognize digits in input image with noise.

I just wanted to show strong denoising performance of VAE.

You are allowed to add any types of noise like gaussian or uniform. There is no rationale.