W1A2 - Wrong expected output

Hi, I’m facing an issue with the second assignment of week 1. The code runs perfectly and produces the expected output but the last dinasour name is not matching the expected result. I get Ssagonelesirosaurus while the test expects Trodonosaurus. I double and triple-checked the code and I can’t figure out why!
My best guess is it has to do with the seed, but I can’t see anywhere in the code where I may have messed with the seed or changed its value.
The weird thing is my results are consistent, no matter how many times I run the code, they’re just not aligned with the expectation.
Here is my last block of output:

Iteration: 22000, Loss: 14.642888

Omaqosaurus
Omala
Otarailosaurus
Omaldor
Tods
Ogantor
Ssagonelesirosaurus

The weird thing is, my last loss 14.642888, which is significantly less than the expected 22.728886, which indicates my code is working.
Any pointers to what I could have done wrong?

Apologies, I found the issue. It was a problem with the way I was calculating idx which was restricting the range of examples used for training.

4 Likes

That’s great news that you found the error under your own power. Nice work!

3 Likes