C3W1 log_perplexity grading

Im getting this assertion error with just a single value, so my grade for this excersie is a bit lower. I followed the same steps as in the non graded notebook, but using the tf modules instead. Anything that i’m missing? Its weird because in the cells below, the perplexity on the complete sets is the same as the Expected Output.
If someone could check my code and give me a lead id really appreciate ti.

1 Like

Hi @Santiago_Elewaut

Please check this post(it’s an old post when Course was based on trax, but the ideas are the same) or this(which is a bit involved, but you can see how the test case gets -0.31333), it might help you to find your mistake.
It looks like your value is twice as large while the batch is 2, so maybe your mistake is related to that aspect.



Thanks for the quick reply. I’ll look into it, try to fix it and come back. Have a great day :smile:

1 Like

Was summing probabilities not along the last axis but the middle one, the example was using axis=1 but did not had an additional dimension like the one in the test. Now its working, thanks for sharing the older posts, really useful!