on-policy icon indicating copy to clipboard operation
on-policy copied to clipboard

Being confused about The huber_loss

Open Atan03 opened this issue 2 years ago • 0 comments

the function huber_loss in utils is like:

def huber_loss(e, d):
    a = (abs(e) <= d).float()
    b = (e > d).float()
    return a*e**2/2 + b*d*(abs(e)-d/2)

It may come with a zero loss when error is greater than huber_delta.

If I'm not mistaken,it should be b = (abs(e) > d).float()

Looking forward to hearing from you.

Atan03 avatar Jun 22 '22 12:06 Atan03