<p>@Susmit Argawal may give you some solution, you can try it. I will raise my idea to answer why it always generates seven.</p>
<p>You didn't do anything wrong, GANs is the fight between Generator(G) and Discriminator(D). Image it as the philosophical way, when you can fool somebody in some way, you will try to do the same thing next time. That problem appears in GANs too, when the G can &quot;minimize&quot; the loss, it will learn less from data, produce samples with less variation (nearly similar).</p>
<p>Some new GANs model tries to reduce this in multiple ways, for example, &quot;minibatch standard deviation&quot; in <a href="https://arxiv.org/pdf/1710.10196.pdf" rel="nofollow noreferrer">ProGans paper</a>. There are <a href="https://github.com/soumith/ganhacks" rel="nofollow noreferrer">several tips</a> for training the GANs model, follow it will help you reduce a lot of time.</p>
<p>Training GANs and tuning its parameters are painful and need a little luck, so just try it as much as possible.</p>
<p>Good luck!</p>
generator in GAN model generate images of one digit only ( with MNIST Dataset )?
<p>i am learning to code GAN model</p>
<p>the code link <a href="https://github.com/saleh1312/python/blob/master/GAN%20model" rel="nofollow noreferrer">here</a></p>
<p>after 100 epochs when i run generator , it generate one digit only the digit is
: &quot;7&quot;</p>
<p>why it generate one digit only , although i change the random numbers every time before i give it to generator and the result is 7 every time</p>
<p>i use this code to test generator</p>
<pre><code>u=np.random.randn(0,100)
ph=tf.reshape(generator(u)[0],(28,28)).numpy()
plt.imshow(ph,cmap='gray')
</code></pre>
<p>it gives me every time images of the digit 7 :</p>
<p><a href="https://i.stack.imgur.com/SoZcQ.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SoZcQ.jpg" alt="enter image description here" /></a>
<a href="https://i.stack.imgur.com/dS245.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dS245.jpg" alt="enter image description here" /></a></p>
<p>am i make a mistake in code ?? or what ??</p>
<p>the generator and decremenator models <a href="http://www.mediafire.com/file/574007nmqav02tz/models.rar/file" rel="nofollow noreferrer">here</a>to download if you want to try them :)</p>