Course 5 W1A2 Dino name wrong output

Hello all,

I’m having a ‘AssertionError: Wrong expected output’ error for the # UNQ_C4

Things I have tried:

  • idx
    j = 1535 idx = 1535
    j = 1536 idx = 0
  • format of X and Y (j = 0 idx = 0)
    X = [None, 20, 21, 18, 9, 1, 19, 1, 21, 18, 21, 19]
    Y = [20, 21, 18, 9, 1, 19, 1, 21, 18, 21, 19, 0]
  • Restart kernel/Clear variable etc.

The output gives that:
Iteration: 0, Loss: 23.087336

which means that it has smaller loss at first iteration than the reference answer at iteration 22000:
Iteration: 22000, Loss: 40.504758

What could be the reason causing this problem?
loss function is provided in rnn_forward in this case, and the previous tests are all passed so the input is correct as well…

Thanks for hints/help!

Update: when I submitted my code, I got a 100/100…

I don’t understand your idx values.

  • j should be from the range(num_iterations)
  • idx should be “j % len(examples)”

I had exactly the same ‘j % len(examples)’; didn’t want to post the code is all.
The values I posted for j and idx were the output, showing that it loops over len(example).

In spite of that, could you help explain why the loss is much smaller than the posted solution? Yet I got 100/100 for the grading…

I get exactly the same results you have. I don’t think there is a problem.

Where do you see that? Here’s what the notebook says you should expect:

Strange… Here’s the screen shot where I saw that in my notebook.

You might be using an older copy of the notebook.