# Tensorflow assignment Exercise 5 HELP!

Hello, all!

I am doing DLS course 2 last assignment : Introduction to TensorFlow. I am having a huge trouble to implement Exercise 5, forward_propagation.

``````#(approx. 5 lines)                   # Numpy Equivalents:
# Z1 = ...                           # Z1 = np.dot(W1, X) + b1
# A1 = ...                           # A1 = relu(Z1)
# Z2 = ...                           # Z2 = np.dot(W2, A1) + b2
# A2 = ...                           # A2 = relu(Z2)
# Z3 = ...                           # Z3 = np.dot(W3, Z2) + b3
# YOUR CODE STARTS HERE
``````

As the comments show, I thought if just switching numpy functions to tf functions such as tf.math.add, tf.linalg.matmul, tf.keras.activations.relu, then everything might work well. But I got this error:

``````AssertionError: Output does not match
``````

I double checked if I had typo or wrong variable, but I typed right.

When I print my current answer Z3, I got something different from correct value. Here is what I got:

``````tf.Tensor(
[[ 0.31806493]
[ 0.4478007 ]
[ 1.6599247 ]
[-1.261049  ]
[ 0.56874084]
[ 1.3622664 ]], shape=(6, 1), dtype=float32)
``````

I tried to look around more info from tf official docs, but still no luck.

What am I missing? plz help!

Hi, @baekTree.

That is exactly what you have to do. And the comments are correct. [the comments could be wrong in some notebooks, see @paulinpaloaltoâ€™s post below] Feel free to send me a private message with your code so that I can point you in the right direction.

The one thing to point out is that the comment that describes how to compute Z3 is wrong. The input there should be A2, not Z2. This has already been reported and fixed, but the new version is not deployed yet.

1 Like

Thank you, @paulinpaloalto.

It mustâ€™ve been deployed. I checked the formulas in my own notebook and they were correct. I didnâ€™t realize they were different from the ones @baekTree posted

Great! I saw the â€śpullâ€ť request with the fix, but figured if baekTree had seen it the other way that it still must be the previous version. Did you get an â€śautoupdateâ€ť of that notebook or did you do the manual â€śLab Help â†’ Get Latest Versionâ€ť method?

Ok, I just answered my own question: I opened that notebook and it did not â€śautoupdateâ€ť and I still had the old incorrect version. Then I did the â€śrenameâ€ť followed by â€śLab Help â†’ Get Latest Versionâ€ť and I got the fixed version. So it is deployed, but you have to manually ask for the new version.

For anyone who has not been through the â€śGet Latest Versionâ€ť procedure before, thereâ€™s a topic about it on the FAQ Thread. Itâ€™s easy, but the only thing that might trip anyone up is the point that you need to rename your existing notebook or it will not be replaced.

1 Like

It mustâ€™ve been updated automatically before I redid the assignment.

I found myself that I missed the fact that Z3 must have A2 in activation function not Z2 as @paulinpaloalto replied!