title: Label Smoothing in PyTorch
body: <p>I'm building a <code>ResNet-18</code> classification model for the <strong>Stanford Cars</strong> dataset using transfer learning. I would like to implement <a href="https://arxiv.org/pdf/1701.06548.pdf" rel="noreferrer">label smoothing</a> to penalize overconfident predictions and improve generalization.</p>
  <p><code>TensorFlow</code> has a simple keyword argument in <a href="https://www.tensorflow.org/api_docs/python/tf/losses/softmax_cross_entropy" rel="noreferrer"><code>CrossEntropyLoss</code></a>. Has anyone built a similar function for <code>PyTorch</code> that I could plug-and-play with?</p>