utils.pytorch
utils.pytorch copied to clipboard
Possible Bug in LabelSmoothing for Binary Cross Entropy
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)