I have been working on a DCGAN to generate images, based on this tutorial.
I performed transformation on the training dataset.
dataset_mean = [0.05941391, 0.05687975, 0.05648475]
dataset_std = [0.05552825, 0.05573225, 0.05731734]
dataset = dset.ImageFolder(root=dataroot,
transform=transforms.Compose([
transforms.RandomHorizontalFlip(p=0.1),
transforms.Resize(image_size),
transforms.CenterCrop(image_size),
# SCALES DATA TO RANGE [0,1]
transforms.ToTensor(),
# NORMALIZES DATA TO CERTAIN RANGE,
# WITH DATASET-SPECIFIC MEAN AND STD
transforms.Normalize((dataset_mean[0], dataset_mean[1], dataset_mean[2]),
(dataset_std[0], dataset_std[1], dataset_std[2])),
After normalization, the training data should look very weird and noisy.
I am just wondering Q1) if an un-normalization operation a must on the output of DCGAN after training?
I have seen people discussing and even implementing it (This is the method I used to calculate dataset_mean and dataset_std) . But it is at the same time hardly seen on DCGAN/GAN tutorials.
Also, I tried following the tutorial and setting the mean and std all as 0.5. The output already looks pretty well. After using the specific mean and std, the results are not even close to expected. Q2) Why is it so? Although I have not tried un-normalizing it.
Thanks in advance.