Yes, as Kic says, there must be something fundamentally wrong with your logic. Look at your single_example_chars
variable contents. It should be (‘t’, ‘u’, ‘r’, …}, right? So how did that happen?
For reference here’s my output for that iteration and notice how that looks below:
initial loss 23.070858062030304
len(X) 12, len(Y) 12
a_prev.shape (50, 1)
(50, 27)
(50, 1)
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
len(X) 15, len(Y) 15
a_prev.shape (50, 1)
(50, 27)
(50, 1)
len(X) 11, len(Y) 11
a_prev.shape (50, 1)
(50, 27)
(50, 1)
len(X) 14, len(Y) 14
a_prev.shape (50, 1)
(50, 27)
(50, 1)