FengZhenhua / Wing-Loss

A Matlab Implementation for CNN-based Facial Landmark Localisation using Wing Loss
Apache License 2.0
87 stars 18 forks source link

Wing Loss function of constant C #10

Open Dawson-huang opened 6 years ago

Dawson-huang commented 6 years ago

Hello, thank you for your job! I have a question need your help. When |x| >= w, the |x| will subtract the constant C, but I get the constant C is -7.91759 by the formula C = w − w ln(1 + w/epsilon) with w=10 and epsilon = 2. It means that |x| will be larger when |x| >= w. But it not fit the idea of Wing Loss functions, or I am wrong of the constant C when calculating? Thank you for your help!

FengZhenhua commented 6 years ago

@Dawson-huang Hi, yes, |x| will be larger when |x|>=w due to the shift along the Y-axis with the value of C. But this does not conflict the idea of wing loss. In wing loss, we focus on the gradient of a point, rather than its value. The shift does not change the gradient of a point outside [-w, w]. But the gradient is increased for a point inside [-w, w]. Hope my explanation is helpful for you.

Dawson-huang commented 6 years ago

@FengZhenhua Okay, I understand. I have to try again. Thanks for your reply very much!