I have submitted my assignment 9 times
and i have been getting error related to masked_loss function
in the notebook, all testcases are being cleared however in the submission it gives error. I cannot comprehend the problem. Someone please help
Passing unit test does not mean your code is correct. The grader uses different test parameters/values for a more thorough testing. As the error message reported that the valid range of the label is between 0 and 17, however, a label value of -1 is received. So you need to trace where the error might be. Have you used a global variable instead of using the input parameters passed in when calling the Keras loss function? One useful way to check is put a print statement to print out the values of parameters pass to the loss function before making the call.
The error clearly indicates because you are using value of -1, your test is failing as the error mentions it is looking for valid range of [0, 17]
I am also suspecting there is an issue with your assignment copy as the expected output shown in your pic is incorrect for exercise 4 unit test. I am sharing my assignment screenshot for the same exercise
You still need to get a fresh copy as I still suspect the way you got fresh copy might have created some confusion.
You have mixed up codes of Exercise of 4 and exercise 5, as exercise 4 requires you to only write two lines codes, I am sharing a screenshot of the same for you to have better understanding.
The codes and pic shared by you DM still shows incorrect expected output, so you are still using an incorrect or obsolete copy of assignment.
So get a fresh copy, re-read the instructions mentioned in comment before, then re-do from starting. Also kindly don’t DM codes until mentor asks you for codes. Follow community guidelines, refer FAQ section.