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.