Week 1 Assignment 1 back-propagation formulas correction


In the first assignment of first week, when doing the back-propagation of the RNN, some notations didn’t feel right to me.

First, I don’t get why there is a variable dtanh. In my opinion, this notation is not consistent with the notations of the course because tanh is not a variable. Why not naming it dz, it would be more consistent both with the course and the graph right above the equations.

In addition, and this is less important, I think that it might be better to change
dtan(x)/dx = 1-tanh²(x) to dtan(x)/dx = 1-tanh(x)² because, depending on the context, tanh²(x) could be tanh(tanh(x)) or tanh(x)² while the latter is not ambiguous.

Please let me know what you think, I hope that my feedback can help to make this amazing assignment even better!


Thanks, I’ll suggest this to the course staff.

1 Like

Thanks, your question/comment helped me better understand tanh²(x) After some trial and error as well as simplifying the variables using the hints in the problem, I finally got a working solution with np.square(tanh(x))


I had exactly the same problem. The notation dtanh is confusing in my opinion. As Pierre mentions it should be dz to be consistent with backprop as presented in DLS Course 1.

Thx for the post!