paulu / deepfeatinterp

Deep Feature Interpolation (CVPR 2017)
GNU General Public License v3.0
278 stars 50 forks source link

Code/Paper formula mismatch #5

Closed black-puppydog closed 6 years ago

black-puppydog commented 6 years ago

Formula (6) in the paper makes alpha come out to be a vector (assuming an element-wise reciprocal) since pow is specifically applied element-wise. But in the code, you compute this: https://github.com/paulu/deepfeatinterp/blob/76b72e0a3b683a8cdeb13ed35b932680dc159ed1/demo1.py#L118

and later-on this: https://github.com/paulu/deepfeatinterp/blob/76b72e0a3b683a8cdeb13ed35b932680dc159ed1/demo1.py#L127 with delta being the beta from the paper.

I think this would correspond more to this:

alpha = beta / (1/d sum(pow(w, 2))) = beta d / ||w||²

Excuse the ugly formulas, apparently, github markdown doesn't understand proper ones...

paulu commented 6 years ago

The denominator should be the mean squared feature activation, so (6) is missing the sum. The formula you wrote above is correct. Thanks for finding all these bugs!

black-puppydog commented 6 years ago

Thanks for being here to answer all my questions :)