C5W1 - Assignment 1 - Exercise 2 - RNN forward

I have been staring at it for an hour but I cannot for the life of me figure it out. The grader reports “wrong values for a” for the “rnn_forward” cell.

What am I missing? Below is my code for the “rnn_forward” part. The previous function “rnn_cell_forward” reports “all tests passed”.

# mentor edit: code removed

Please don’t post your code on the forum, unless a mentor asks to see it. Posting your code breaks the course Honor Code.

In your call to rnn_cell_forward(…), a0 is not the correct argument.

I am sorry, I did not know how else to discuss what is wrong when I am not even sure myself where to look at.

Oh, of course. I was thinking about the rnn_forward the wrong way. It is already calculating all the timesteps in one go and not being recursively called with a new a0=a_next every time. I should have paid more attention to the loop.

Thank you for pointing me in the right direction!

I found myself scratching my head with this too. If anyone ends here, notice there’s an a0 given as an input (contrary to the “as zero” initialization mentioned in class).