Course 5 Week1 Program 12 - Dinosaur Island Results

Hi,

My final output is incorrect.
The prior functions have passed.

The final function is not getting any syntax errors.

Not sure what is wrong. The output is listed below

Thank you for any help

Neil A

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)
in
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

HI @NeilA

Your single example is wrong, so there is a problem with your code within model(). If you post that section of the code in a DM to me, I will have a look for you.

Hi Kin,

Is it ok to email the code by a response to your email?
(As I don’t want I violate the rules)

Thank you,

Neil

Sent from my iPhone

On Jul 31, 2021, at 1:56 PM, Neil Acampa neilacampa@hotmail.com wrote:

Hi Kin,

Thank you for your response.

The code in the model function is listed below:

[ you code has been removed to adhere to the honour code policy]

Hi @NeilA ,

Two areas need attention in your code:

  1. single_example
    this should be taken from examples, because in examples, all the unwanted
    characters such as spaces, are filtered out.
  2. single_example_ix
    you need to use char_to_index to turn the char in single_example into the digit
    represent the char. Here is how to do it:
    single_example_ix = [char_to_ix[c] for c in single_example_chars]

Hi Kim,

Thank you again for your response and for taking the time.

Yes that worked. Using examples to update single_example instead of data_x solved the issue.

Thank you,

Neil A

Hi,
i have the same problem here, checked you suggestion for @NeilA but its correct for me
Thank you