Hi
I am having the following issue:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-20-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!")
<ipython-input-19-37ecc67f3dc9> in model(data_x, ix_to_char, char_to_ix, num_iterations, n_a, dino_names, vocab_size, verbose)
62 # Perform one optimization step: Forward-prop -> Backward-prop -> Clip -> Update parameters
63 # Choose a learning rate of 0.01
---> 64 curr_loss, gradients, a_prev = optimize(X, Y, a_prev, parameters, learning_rate=0.01)
65
66 ### END CODE HERE ###
<ipython-input-9-fca0aba78113> in optimize(X, Y, a_prev, parameters, learning_rate)
32
33 # Forward propagate through time (≈1 line)
---> 34 loss, cache = rnn_forward(X, Y, a_prev, parameters)
35
36 # Backpropagate through time (≈1 line)
~/work/W1A2/utils.py in rnn_forward(X, Y, a0, parameters, vocab_size)
100
101 # Update the loss by substracting the cross-entropy term of this time-step from it.
--> 102 loss -= np.log(y_hat[t][Y[t],0])
103
104 cache = (y_hat, a, x)
TypeError: 'int' object is not subscriptable
Is it possible the implementation of rnn_forward to be incorrect?