luisguiserrano / gans

GANs in slanted land
242 stars 151 forks source link

discriminator error from noise #2

Open LondaniZuma opened 2 years ago

LondaniZuma commented 2 years ago

Hi @luisguiserrano , thanks a lot about this friendly intro to GAN, it is really helpful. But I have a question about the code in the notebook where you calculate the error for discriminator. Use calculate the error using <errors_discriminator.append(sum(D.error_from_image(face) + D.error_from_noise(z)))>. When you calculate the error from noise you pass which is the random number, shouldn't you pass the noise generated by the generator i.e <G.forward(z)>. So the error for discriminator is <errors_discriminator.append(D.error_from_image(face) + D.error_from_noise(G.forward(z)))>??

josedavid220 commented 1 year ago

Hi @LondaniZuma, you are correct. The error should be computed with G.forward(z), i.e. a generated image, and not from the z value itself. Maybe it's because the complexity is low that things work nonetheless. I changed this locally and the results are the same.