[W1A2E4] dinosaur model unexpected loss output

Hello. After passing all previous tests, I end up with a loss that is close, but not exactly the same as expected:

Expected output

Iteration: 22000, Loss: 22.728886

Onustreofkelus
Llecagosaurus
Mystolojmiaterltasaurus
Ola
Yuskeolongus
Eiacosaurus
Trodonosaurus

Actual output

j =  0 idx =  0
single_example = aachenosaurus
single_example_chars ['a', 'a', 'c', 'h', 'e', 'n', 'o', 's', 'a', 'u', 'r', 'u', 's']
single_example_ix [1, 1, 3, 8, 5, 14, 15, 19, 1, 21, 18, 21, 19]
 X =  [None, 1, 1, 3, 8, 5, 14, 15, 19, 1, 21, 18, 21, 19] 
 Y =        [1, 1, 3, 8, 5, 14, 15, 19, 1, 21, 18, 21, 19, 0] 

Iteration: 0, Loss: 23.093932

Nkzxwtdmeqoeyhsqwasjjjvu
Kneb
Kzxwtdmeqoeyhsqwasjjjvu
Neb
Zxwtdmeqoeyhsqwasjjjvu
Eb
Xwtdmeqoeyhsqwasjjjvu


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

Iiytronheoravhoss
Eola
Eytosaurus
Idaahosalaus
Xuskeonoraveros
Cdalosan
Tosaurus


Iteration: 4000, Loss: 24.336871

Mevtosaurus
Lnecacosaurus
Lustonacor
Mecacoteeaosaurus
Vusmenatontosaurus
Gaacosaurus
Tosaurus


Iteration: 6000, Loss: 23.075217

Titotomanosaurus
Sidachssalchunthenus
Sutotcmenonus
Tha
Utoterchomunmtocongitochusus
Laaiton
Totaresaurus


Iteration: 8000, Loss: 22.248987

Liusus
Huecaepsamaruosaurus
Hususaurus
Leaaerur
Xusocheopeurus
Caaeroleanus
Usicheopeurus


Iteration: 10000, Loss: 21.874312

Lixusmengshesaurus
Lidbansselasslrggnysausphisantronghboson
Lytrongeselusaurus
Lebalrsaurus
Xusphikosaurus
Haahosaurus
Tosaurus


Iteration: 12000, Loss: 21.609906

Sivrosaurus
Piha
Pusosaurus
Sefaisngcaptitiigus
Wusicillidylosaurus
Jeaesmaiaisaurus
Sirciinidumisiariilos


Iteration: 14000, Loss: 21.170115

Lixtrocheramtis
Hocaaaurus
Hustranbhecs
Mabacrodador
Yustaraptos
Abacrodador
Wusaurus


Iteration: 16000, Loss: 21.020460

Huysisaurus
Huicansihadrus
Hyrusaurus
Hicaisig
Yuspengosaurus
He
Susenhopeus


Iteration: 18000, Loss: 20.964361

Prutroconlicuosaurus
Oracajroia
Ourotangopburotoatepitoanogyilaiceualobon
Plaaerogabosaurus
Xrrocofondsaururapnotoaproxanaocerapoconaeratolong
Ia
Trocohasaurus


Iteration: 20000, Loss: 21.056823

Rixtstapnosaurus
Miceadsomabosaurus
Owutoosaurus
Rabaessaacitatornythaycerogavsaurus
Zuromibosaurus
Haadropcarus
Yuocheroptosaurus


Iteration: 22000, Loss: 20.578871

Hutusaurus
Euca
Eustrioppn
Hocamptopanceus
Xuspeodon
Elacropechus
Uspeodon


---------------------------------------------------------------------------
AssertionError                            Traceback (most recent call last)
<ipython-input-98-725c093d6b91> in <module>
      1 parameters, last_name = model(data.split("\n"), ix_to_char, char_to_ix, 22001, verbose = True)
      2 
----> 3 assert last_name == 'Trodonosaurus\n', "Wrong expected output"
      4 print("\033[92mAll tests passed!")

AssertionError: Wrong expected output


1 Like

The problem is most likely in the model() function, where you are updating the X and Y variables.

1 Like

(edited)

Or if you get answers that otherwise look reasonable, but just different than the “expected”, check that you used the “shuffled” order of the inputs that they generated for you instead of just using them “straight”.

2 Likes

Update for those who find this thread later:

It’s important that you use the correct variable for the list of dinosaur names in your code inside the iteration for-loop.

This is exactly what happened. Everything including the loss graph seemed correct but I forgot to use the shuffled inputs. Thank you!