Sampling_decode Assignement function

Hi,
I finished the W1 Assignment, but never understood my issue in the “sampling_decode”.
My result was “Ich liebe Sprachen.ich ich.” instead of “Ich liebe Sprachen.”
And the result for greedy_decode_test('‘You are almost done with the assignment!’) would hang as the EOS token is never generated.
Any idea why that could be? Other than that, all unittest pass

If anyone encounter the same results (“Ich liebe Sprachen.ich ich.”) from # UNQ_C7 sampling_decode function, chances are that you are using the wrong index of the prediction output, to get log_probs in the line 38:

    # get log probabilities from the last token output
    log_probs = output[None]

Cheers

1 Like