April 2020
Intermediate to advanced
438 pages
12h 2m
English
We will be using the labeled faces in the wild (lfw) face dataset from scikit-learn (it contains face images of seven very famous politicians). We will add some random noise to these face images, use them as inputs to the autoencoder, and train it to learn to remove the noise. We will use PyTorch library functions for deep learning. As usual, let's start by importing the required libraries:
import osimport numpy as npimport matplotlib.pylab as pltimport torchfrom torch import nnfrom torch.autograd import Variablefrom torch.utils.data import DataLoaderfrom torchvision import transformsfrom torchvision.utils import save_imagefrom sklearn.datasets import fetch_lfw_people
Read now
Unlock full access