ddbourgin / numpy-ml

Machine learning, in numpy
https://numpy-ml.readthedocs.io/
GNU General Public License v3.0
15.35k stars 3.72k forks source link

[Question] Gradient of Gradient Penalty in WGAN-GP. #65

Closed hello-fri-end closed 3 years ago

hello-fri-end commented 3 years ago

Hello! I have a question regarding the implementation of gradient function of WGAN-GP (https://github.com/ddbourgin/numpy-ml/blob/master/numpy_ml/neural_nets/losses/losses.py#L497). I'm not sure why epsilon is added toX_interp_norm. I'm getting the same gradient except for the epsilon term. Also, the gradient is computed with respect to GradInterp, shouldn't the gradient be computed with respect to the mixed image x'?

I could be wrong about some of this. Looking forward to hearing from you.