Course 5 Week 1 Assignment 2 Exercise 4 - model()

Hello course mentors,

I’m currently working on the model() function in the Dinosaurus Island Character Level Language Model assignment, and I get “Wrong expected output”. All the previous function implementations passed without errors.

The output of the first iteration is:

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] 

The final output name is “Saurur” and I get a loss of 0.294620, as opposed to the expected loss of 22.728886.

Any help or insights for me would be greatly appreciated.
Thanks for your advice and support!

Seems like other learners have stumbled across the same error. If this doesn’t help, please click my name and message your notebook as an attachment.

Here’s a help page to use search.

2 Likes

Hi, thanks for the reply.

I read through one of the threads you sent me and found out that the problem was that, I was using the wrong variables for calculating the variable idx.

Anyway, thank you so much for your help. Couldn’t have done it without you! :smile:

2 Likes