Potential problem with the notebook template for the C4W1 assignment in the NLP Specialization

While troubleshooting possible issues with the grader for the C4W1 assignment in the NLP Specialization, I noticed some potential typos in the code block for Exercise 1 (Encoder), which describes the ‘Encoder’ class:

  • In the Bidirectional layer, there is a reference to a ‘None’ layer instead of an LSTM layer (appears to be a typo)
  • The reference to ‘merge_mode=“sum”’ appears to be in the wrong place (it should be listed just prior to the closing quote for the Bidirectional layer, in-line with indentation for “layer”, as I understand it).

Am I wrong?

Also, I would like to know: Is this is one of those assignments in which the grader will not grant you any credit for any exercise until EVERY exercise is completed correctly? I am asking because I have refreshed my workspace a couple of times now, and although I have entered code in the block for Exercise 1 that passes the unit test in the notebook, the grader refuses to grant any credit at all. Exercise 1 is pretty simple (once you have fixed the typos referenced above), and the grader should be granting credit. (In my case, I am working from a totally fresh (new) notebook, and I have only modified the editable text in Exercise 1.

Could the mentors please check the notebook for C4W1 (NLP Specialization) as well as the grading system for this assignment?


I’m not a mentor for this course and don’t have access to the grader for this assignment.

However in general, I can say that if your notebook is incomplete and still contains any “None” statements, these cause a runtime error and will make the grader crash. This prevents your code from getting any score.

Thank you for your response, and the additional insights. That helps!

I’ve been reading the instructions more carefully, and now I realize the “None” value in the bidirectional layer was put there intentionally so people could choose which layer type it should be (specified as LSTM in the instructions).

I also checked whether ‘merge_mode=“sum”’ works when left in the existing location, and it does–but I still can’t get any credit from the grader.

Perhaps my code for this block is not yet correct according to the grader, even though it appears to pass the unit tests in the notebook.

I’ll keep working…

… Update: The comments from ‘TMosh’ helped a lot. After completing the remaining code–eliminating the remaining ‘None’ values in the exercise blocks, the grader indeed granted points successfully for nearly all code blocks. One exercise block (not the first one discussed above) still requires work to achieve credit, but all the other blocks (including the one above) received credit. In Exercise 1, I did relocate the line of code for ‘merge_mode=“sum”’, and it did receive credit. I have not yet tried leaving this particular snippet in the location specified by the template code, but perhaps that version would receive credit as well.