Conditional DCGAN generate the same number for each column

hi everyone, I’m new to this beautiful world.
Recently thanks to my university I am discovering the wonders of deep learning.
I recently tried to write a gan architecture, and it seems to work very well, but I need to compare my GAN’s FID with a cDCGAN (conditional DCGAN).
So I tried to write one, helping me with what I found on the net.
The problem with my cDCGAN (MNIST dataset) is that it always generates the same number for each row, even giving a different noise, it always generates the same 0, the same 1 … etc
example of my output.png
I put the code on pastebin:
simple code of my cDCGAN
the goal is to generate a different number for each row, like this:
generazione github 20
Can anyone kindly tell me how to do?
Thanks in advance!

I think you are experiencing what is called mode-collapse. There is an amazing paper by founder of pytorch themselves for mitigating this problem.

Wasserstein GAN

Hi, I will read the article as soon as I have some time, thanks for the reply.
However in the end I solved it by changing the architecture.
This is the classic architecture that I find on the net:


By changing it like:

this I solved the problem.
I managed to get a FID of 35 on cifar10, after 149 epochs it collapses and becomes unstable. (overfitting?)
I would like to have an implementation of the classic architecture that works, unfortunately you don’t find much with pytorch, and the ones I found all have the problem I described.