# GAN doesn't train

**URL:** <https://discuss.pytorch.org/t/gan-doesnt-train/121939>\
**Category:** Uncategorized\
**Created:** [May 21, 2021, 10:02am UTC](https://discuss.pytorch.org/t/gan-doesnt-train/121939 "2021-05-21T10:02:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![paozaf](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/paozaf/32/37637_2.png) [@paozaf](https://discuss.pytorch.org/u/paozaf)\
**Post date:** [May 21, 2021, 10:02am UTC](https://discuss.pytorch.org/t/gan-doesnt-train/121939/1 "2021-05-21T10:02:44Z")

</div>

Hi all,  
I wrote this GAN (in the example it uses fake input):

> <https://gist.github.com/pzaffino/7c3714ffe8eb867eb45b721ac4d2d808>

Basically, the generative accuracy is quantified in terms of image difference.

The generator net and the discriminator net get trained (individually), but it looks like they don’t “communicate”. I mean, the discriminator judgment doesn’t affect the generative training…the training goes parallel, without affecting each other.

Any idea? Am I missing something?  
I multiply the discriminator score by a float factor in order to make it comparable to the image difference.

Thank you in advance.

Best,  
Paolo

---

<div class="post-metadata">

**Author:** ![paozaf](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/paozaf/32/37637_2.png) [@paozaf](https://discuss.pytorch.org/u/paozaf)\
**Post date:** [May 24, 2021, 9:22am UTC](https://discuss.pytorch.org/t/gan-doesnt-train/121939/2 "2021-05-24T09:22:26Z")

</div>

No idea?  
Thanks in advance
