-
Chapter 2 of Deep Learning book (by Ian Goodfellow, short path) Link
-
Lecture series on Linear Algebra by three blue one brown (Highly recommended) Link + singular value decomposition (shortpath).
-
And if you have sufficient time, then highly recommended to take “Introduction to Linear Algebra” by Gilbert Strang (on YouTube, long path) Link.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class LabelSmoothing(nn.Module): | |
"Implement label smoothing." | |
def __init__(self, size, padding_idx, smoothing=0.0): | |
super(LabelSmoothing, self).__init__() | |
self.criterion = nn.KLDivLoss(size_average=False) | |
self.padding_idx = padding_idx | |
self.confidence = 1.0 - smoothing | |
self.smoothing = smoothing | |
self.size = size | |
self.true_dist = None |