You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello.
Firstly, the two variables used as g2 and g5 are the same. So I think the mathematical equations can be represented in 4 variables instead of 5 and so can be used in the code. As per the code here g2 = label + ((-1) ** label) * sigmoid_pred g5 = label + ((-1) ** label) * sigmoid_pred
Also, the only term being used when calling the function robust_pow to calculate the exponent for, is the g2 (or g5) and that value can never be negative. Here there are two cases, either the label is 0 or 1.
In case of 0, g2 becomes sigmoid_pred with range 0 to 1.
In case of 1, g2 becomes 1-sigmoid_pred with the range 1 to 0.
So I don't see the point of having a separate function than using the normal exponent operator of **. In case I'm wrong, please correct me.
The text was updated successfully, but these errors were encountered:
Also robust_pow function is not exactly correct. I am wondering how does it change the calculations because as per this code, (-16)0.25 will be -2. But -24 is 16. And in case this is needed in fact, how about using the answer here ?
Hi, thanks for the comments. After checking the codes, I believe the robust_pow is the legacy of a previous (scrap) version with the wrong math derivation. That results in a (wrong) procedure which will incur (a negative number) ** (a fraction number).
In terms of the implementation of the focal loss, this shouldn't have any effect -- as you said g_{2} can only be [0,1]. I'll fix this in a later version. As for now, the performance of the software should be ok.
Hello.
Firstly, the two variables used as g2 and g5 are the same. So I think the mathematical equations can be represented in 4 variables instead of 5 and so can be used in the code. As per the code here
g2 = label + ((-1) ** label) * sigmoid_pred
g5 = label + ((-1) ** label) * sigmoid_pred
Also, the only term being used when calling the function robust_pow to calculate the exponent for, is the g2 (or g5) and that value can never be negative. Here there are two cases, either the label is 0 or 1.
In case of 0, g2 becomes sigmoid_pred with range 0 to 1.
In case of 1, g2 becomes 1-sigmoid_pred with the range 1 to 0.
So I don't see the point of having a separate function than using the normal exponent operator of **. In case I'm wrong, please correct me.
The text was updated successfully, but these errors were encountered: