I have trained a GAN to reproduce CIFAR10 like images. Initially I notice all images cross one batch produced by the generator look always the same, like the picture below:

After hours of debugging and comparison to the tutorial which is a great learning source for beginners (https://machinelearningmastery.com/how-to-develop-a-generative-adversarial-network-for-a-cifar-10-small-object-photographs-from-scratch/), I just add only one letter on my original code and the generated images start looking normal (everyone starts looking different from each other cross one batch), like the picture below:

The magical one character change on the code is to make the following change:
Changing from:
def generate_latent_points(self, n_samples):
return np.random.rand(n_samples, self.latent_dim)
to:
def generate_latent_points(self, n_samples):
return np.random.randn(n_samples, self.latent_dim)
Hope this very subtle detail could help those who spend hours scratching off their head for their GAN training process.
np.random.rand gives uniform distribution over [0, 1)
np.random.randn gives a univariate “normal” (Gaussian) distribution of mean 0 and variance 1
So why the difference in the distribution of the latent seeds for generator would behave so differently?