January 2019
Intermediate to advanced
342 pages
9h 17m
English
The loss function for the neural translation machine is the average cross-entropy loss for prediction of each target word in the model sequence. The actual target word and the predicted target word can be any of the 16,297 words in the French corpus that we have taken. The target label at time step t would be a one-hot encoded vector yt ∈ {0,1}16297, while the predicted output would be in the form of probability for each of the 16,297 words in the French vocabulary. If we represent the predicted output probability vector as pt ∈ (0,1)16297, then the average categorical loss in each time step of a particular sentence s is given by the following:
We get the loss for the entire sentence by summing ...
Read now
Unlock full access