Training GAN on MNIST gives very strange results


Results of training are quite strange, because Discriminator loss and Generator loss are very small:

Loss in epoch 10
Discriminator: 0.00015746265571486972
Generator: 1.1572355696669042e-08

Loss in epoch 20
Discriminator: 0.000207384460320012
Generator: 3.4869694783008414e-10

Loss in epoch 30
Discriminator: 4.014897100638508e-05
Generator: 0.0

Loss in epoch 40
Discriminator: 0.00012505375613592535
Generator: 0.0

Loss in epoch 50
Discriminator: 0.00015698512803940945
Generator: 0.0

but data generated by Generator is some random nonsense.
Generated data sample, almost everything looks like this:

I’ve checked loss functions, tried a lot of different values of hyperparameters, but nothing works.

If someone could help i’ll appreciate :slight_smile:

Training loop code:

Model implementation: