C3W1 Assignment - perplexity

I am having trouble in C3W1 Assignment - perplexity calculation. I passed unit test first 8 examples, but fail 9-th example. I see the preds dimension is 4 while tartget is 3:

preds.shape (2, 1, 7, 3)
target.shape (2, 7)

I tried tf.squeeze(preds)
preds shape after squeeze: (2, 7, 3)

Still get the error:

AssertionError: Fail in Example 9. Batch of 2. Expected -0.31333333427707355 but got -0.27916666759798925

Does this helps ?:backhand_index_pointing_down:t2::backhand_index_pointing_down:t2::backhand_index_pointing_down:t2:

No. That’s for example 1. I have passed 8 examples. The 9th preds dimension is different.

I read #C3W1 Assignment - perplexity score ,

did you resolve issue?

Yes. I nailed it. I guess TensorFlow version is changed in the lab, I’d say this is a bug in the lab. I worked around it, and all tests passed.

Took me two days!!!

1 Like