Course 5 week 1 assignment 2 - Incorrect Output

EDIT: I shutdown the notebook and restarted the kernel. This fixed the error.

I’m trying to debug the issue causing my output to diverge from the expected grader outcome.

O/P of iteration0 seems fine, and the subsequent o/p differs. Where could i be going wrong?

Here’s the output:

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: 4.207065

Saurus
Rtsa
Rus
Sasaurus
Wtus
H
Usasaurus

Iteration: 4000, Loss: 0.579789

Saurus
Rtsa
Sasaurus
Sasaurus
Wtus
H
Usasaurus

Iteration: 6000, Loss: 0.084244

Saurus
Rtsc
Sasaurus
Sasaurus
Wtus
Iasaurus
Usasaurus

Iteration: 8000, Loss: 0.015348

Saurus
Sasaurus
Sasaurus
Sasaurus
Wtus
Iasaurus
Usasaurus

Iteration: 10000, Loss: 0.005048

Saurus
Sasaurus
Sasaurus
Sasaurus
Wtus
Iasaurus
Usasaurus

Iteration: 12000, Loss: 0.003056

Saurus
Sasaurus
Sasaurus
Sasaurus
Wtus
Iasaurus
Usasaurus

Iteration: 14000, Loss: 0.002383

Saurus
Sasaurus
Sasaurus
Sasaurus
Wtus
Iasaurus
Usasaurus

Iteration: 16000, Loss: 0.002004

Saurus
Sasaurus
Sasaurus
Sasaurus
Wtus
Iasaurus
Usasaurus

Iteration: 18000, Loss: 0.001737

Saurus
Sasaurus
Sasaurus
Sasaurus
Wtus
Iasaurus
Usasaurus

Iteration: 20000, Loss: 0.001532

Sataurus
Sasaurus
Sasaurus
Sasaurus
Wtus
Iasaurus
Usasaurus

Iteration: 22000, Loss: 0.001371

Sataurus
Sasaurus
Sasaurus
Sasaurus
Wtus
Iasaurus
Usasaurus


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

EDIT: I shutdown the notebook and restarted the kernel. This fixed the error.

I shutdown the notebook and restarted the kernel. This fixed the error.