The seq2seq model is trained to maximize the probability of the correct target sentence. Because a sentence probability is a product of per-word probabilities, its negative log is a sum of per-word losses.
Implement sequence_nll(probs, targets), which returns the summed negative log-probability of the correct token at each step.
probs has shape (T, V), one distribution per step.Pick the probability of each correct token with fancy indexing, take -log, then sum.
No results yet
Run your code to check it against the examples, or submit to run every test.