December 2018
Beginner to intermediate
684 pages
21h 9m
English
The application of an autoencoder to a denoising task only affects the training stage. In this example, we add noise to the Fashion MNIST data from a standard normal distribution while maintaining the pixel values in the range of [0, 1], as follows:
def add_noise(x, noise_factor=.3): return np.clip(x + noise_factor * np.random.normal(size=x.shape), 0, 1)X_train_noisy = add_noise(X_train_scaled)X_test_noisy = add_noise(X_test_scaled)
We then proceed to train the convolutional autoencoder on noisy input with the objective to learn how to generate the uncorrupted originals:
autoencoder_denoise.fit(x=X_train_noisy,y=X_train_scaled,...)
After 60 epochs, the test RMSE is 0.926, unsurprisingly higher than before. The following ...