C3_W2 Assignment NER model - masked loss and prediction

Hi there, I have passed all unittest on C3_W2 assignment but I got a couple of questions when i am on assignment 2

  1. For masked loss, I passed the unit test, but failed in the grader, the error message in grader return :
    There was an error grading your submission. Details:
    {{function_node _wrapped__SparseSoftmaxCrossEntropyWithLogits_device/job:localhost/replica:0/task:0/device:CPU:0}} Received a label value of -1 which is outside the valid range of [0, 17). Label values: 9 10 15 15 9 9 9 9 9 9 9 9 9 9 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 [Op:SparseSoftmaxCrossEntropyWithLogits] name:

  2. As mentioned I passed both the unit test and grader for exercise 6 testing with your own sentence. However, I notice my output of the prediction is actually wrong

Apparently all prediction labels i got are actually 0 (which led to B-art), anyone got an insight for this?

I have further printed the result of the model to check, apparently, there is something wrong with model output

Figured out what happened, I forgot about the ignore class when we do the masked loss, glad that i figured it out by myself!

4 Likes