utils.pytorch icon indicating copy to clipboard operation
utils.pytorch copied to clipboard

Possible Bug in LabelSmoothing for Binary Cross Entropy

Open manujosephv opened this issue 4 years ago • 0 comments

Possible bug in LabelSmoothing for Binary Cross Entropy.

Current Code:

smooth_eps = smooth_eps or 0
    if smooth_eps > 0:
        target = target.float()
        target.add_(smooth_eps).div_(2.)

Shouldn't it be:

smooth_eps = smooth_eps or 0
    if smooth_eps > 0:
        target = target.float()* (1- smooth_eps)
        target = target + (smooth_eps/2)

manujosephv avatar Mar 12 '20 12:03 manujosephv