samsudinng / label-smoothing-pytorch

label smoothing PyTorch implementation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

label smoothing PyTorch implementation

Requirements

pytorch > 1.0

Install

git clone https://github.com/wangleiofficial/label-smoothing-pytorch.git

Usage

import LabelSmoothingCrossEntropy
criterion = LabelSmoothingCrossEntropy(reduction='sum')
loss = criterion(preds, labels)

License

MIT

Citation

Müller, Rafael, Simon Kornblith, and Geoffrey E. Hinton. "When does label smoothing help?." Advances in Neural Information Processing Systems. 2019.

About

label smoothing PyTorch implementation

License:MIT License


Languages

Language:Python 100.0%