Conditional DCGAN generate the same number for each column

Nicely: <p>hi everyone, I’m new to this beautiful world.<br>
Recently thanks to my university I am discovering the wonders of deep learning.<br>
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).<br>
So I tried to write one, helping me with what I found on the net.<br>
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<br>
<a href="https://i.ibb.co/zQrzkkL/example.png" rel="noopener nofollow ugc">example of my output.png</a><br>
I put the code on pastebin:<br>
<a href="https://pastebin.com/gqwrq5yz" rel="noopener nofollow ugc">simple code of my cDCGAN</a><br>
the goal is to generate a different number for each row, like this:<br>
<img src="https://discuss.pytorch.org/uploads/default/original/3X/4/c/4c933dae00174ef8e1c934e9780e9d5430dd4987.png" alt="generazione github 20" data-base62-sha1="aVpKv1f9OBZ2zWyf0vBODjkf9Kn" width="500" height="500"><br>
Can anyone kindly tell me how to do?<br>
Thanks in advance!</p>

user_123454321: <p>I think you are experiencing what is called mode-collapse. There is an amazing paper by founder of pytorch themselves for mitigating this problem.</p>
<p><a href="https://arxiv.org/pdf/1701.07875.pdf" rel="noopener nofollow ugc">Wasserstein GAN</a></p>

Nicely: <p>Hi, I will read the article as soon as I have some time, thanks for the reply.<br>
However in the end I solved it by changing the architecture.<br>
This is the classic architecture that I find on the net:<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/0/8/08b96cb9541afb8acc828f749c87f340c9122d0f.jpeg" data-download-href="https://discuss.pytorch.org/uploads/default/08b96cb9541afb8acc828f749c87f340c9122d0f" title="Generator_Structure"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/0/8/08b96cb9541afb8acc828f749c87f340c9122d0f_2_690x317.jpeg" alt="Generator_Structure" data-base62-sha1="1fb5BkGpGLUTEcNJwRS9ijsMCiX" width="690" height="317" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/0/8/08b96cb9541afb8acc828f749c87f340c9122d0f_2_690x317.jpeg, https://discuss.pytorch.org/uploads/default/optimized/3X/0/8/08b96cb9541afb8acc828f749c87f340c9122d0f_2_1035x475.jpeg 1.5x, https://discuss.pytorch.org/uploads/default/original/3X/0/8/08b96cb9541afb8acc828f749c87f340c9122d0f.jpeg 2x" data-dominant-color="D8D7D7"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">Generator_Structure</span><span class="informations">1042×479 27.7 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div> <div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/a/8/a88c7a4bdf69a985a114d0eb33a8d36b9315f732.jpeg" data-download-href="https://discuss.pytorch.org/uploads/default/a88c7a4bdf69a985a114d0eb33a8d36b9315f732" title="Discriminator_Structure"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/a/8/a88c7a4bdf69a985a114d0eb33a8d36b9315f732_2_690x443.jpeg" alt="Discriminator_Structure" data-base62-sha1="o33bBsaIERMSihbONlb2LszG2oW" width="690" height="443" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/a/8/a88c7a4bdf69a985a114d0eb33a8d36b9315f732_2_690x443.jpeg, https://discuss.pytorch.org/uploads/default/optimized/3X/a/8/a88c7a4bdf69a985a114d0eb33a8d36b9315f732_2_1035x664.jpeg 1.5x, https://discuss.pytorch.org/uploads/default/original/3X/a/8/a88c7a4bdf69a985a114d0eb33a8d36b9315f732.jpeg 2x" data-dominant-color="DAD9D7"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">Discriminator_Structure</span><span class="informations">1042×669 32.5 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div><br>
By changing it like:<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/6/e/6ec1a5685ba764e3bb313d1d18f2e0357f129d14.png" data-download-href="https://discuss.pytorch.org/uploads/default/6ec1a5685ba764e3bb313d1d18f2e0357f129d14" title="Architettura cDCGAN Cla"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/6/e/6ec1a5685ba764e3bb313d1d18f2e0357f129d14_2_690x222.png" alt="Architettura cDCGAN Cla" data-base62-sha1="fNNpdbtiDJ4ZjoBZH3pOH39lf2k" width="690" height="222" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/6/e/6ec1a5685ba764e3bb313d1d18f2e0357f129d14_2_690x222.png, https://discuss.pytorch.org/uploads/default/optimized/3X/6/e/6ec1a5685ba764e3bb313d1d18f2e0357f129d14_2_1035x333.png 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/6/e/6ec1a5685ba764e3bb313d1d18f2e0357f129d14_2_1380x444.png 2x" data-dominant-color="E6E7E7"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">Architettura cDCGAN Cla</span><span class="informations">1820×586 83.1 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div><br>
this I solved the problem.<br>
I managed to get a FID of 35 on cifar10, after 149 epochs it collapses and becomes unstable. (overfitting?)<br>
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.</p>