znxlwm / pytorch-generative-model-collections

Collection of generative models in Pytorch version.
2.59k stars 546 forks source link

gradient penalty in WGAN_GP #3

Closed CuthbertCai closed 6 years ago

CuthbertCai commented 6 years ago

Thanks for your great work! I have a question about the gradient penalty part in WGAN_GP model. From line 189 to line 194, I know that these codes compute the gradients of the pred_hat with respect to x_hat, but I don't know why you add [0] in the end. Would you please do some explanations to that? Thank you very much!