Data preprocessing
As discussed previously, we would be working with the SVHN dataset images of dimensions 32 x 32 x 3.
The dataset images are readily available in matrix data form. The raw pixel of the images are normalized within the range of [-1,1] for faster and stable convergence. Because of this transformation, the final activation of the generator is kept tanh to ensure the generated image has pixel values within [-1,1].
The read_data can be used to process the input data. The dir_flag is used to determine whether we have the raw processed data matrix file or the image directory. For instance, when we work with the SVHN dataset, the dir_flag should be set to False, since we already have a pre-processed data matrix file named train_32x32.mat ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access