C5W1: Wrong result from Dinosaur Island model

I’m getting the result below for iteration 22000. Any suggestions on what could be wrong? The loss here is actually better than the expected output so I’m assuming it’s something fairly minor. I have checked the learning rate.

Thanks.


Iteration: 22000, Loss: 20.578871

Hutusaurus
Euca
Eustrioppn
Hocamptopanceus
Xuspeodon
Elacropechus
Uspeodon

I get exactly what they show as “expected” for 22000 iterations:

Iteration: 22000, Loss: 22.728886

Onustreofkelus
Llecagosaurus
Mystolojmiaterltasaurus
Ola
Yuskeolongus
Eiacosaurus
Trodonosaurus


All tests passed!

For reference, here are the first few iterations as I see them (I might have some optional prints in there):

j =  0 idx =  0
single_example = turiasaurus
single_example_chars ['t', 'u', 'r', 'i', 'a', 's', 'a', 'u', 'r', 'u', 's']
single_example_ix [20, 21, 18, 9, 1, 19, 1, 21, 18, 21, 19]
 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] 

Iteration: 0, Loss: 23.087336

Nkzxwtdmfqoeyhsqwasjkjvu
Kneb
Kzxwtdmfqoeyhsqwasjkjvu
Neb
Zxwtdmfqoeyhsqwasjkjvu
Eb
Xwtdmfqoeyhsqwasjkjvu


j =  1535 idx =  1535
j =  1536 idx =  0
Iteration: 2000, Loss: 27.884160

Liusskeomnolxeros
Hmdaairus
Hytroligoraurus
Lecalosapaus
Xusicikoraurus
Abalpsamantisaurus
Tpraneronxeros

One thing to note is that it looks like it doesn’t set the seed explicitly in the training cell, but it does earlier in the notebook. That probably means that you can get different results by running the cells in different orders. The best way to get consistent results would be to do “Kernel → Restart and Clear Output” immediately followed by “Cell → Run All”. Then see if your results agree. If not, then it must mean something is different about your code and we can go from there.

Hello,
I have run into the same exact problem and gotten the exact same results. My iterations count appears to match the expected output, at least at index 1535 and 1536 as shown in the screenshot. I restarted the kernel and still got the same results when I re-ran all the cells.
My character generation appears to be correct, but the starting dinosaur appears to be different (I see “aachenosaurus” rather than “turiasaurus” for index 0).

There was another thread like that just earlier today. Have a look and see if the problem there is the same as yours.

Note that aachenosaurus is literally the first entry in the name list, but the logic has you “shuffle” the list before you start. See that other thread for a couple of ways that mistake can happen.

Just re-started the kernel and ran. Fixed the ‘wrong output’ problem. Thank you.