Assignment: Introduction to TensorFlow

Hi,
I am following: LINEAR → RELU → LINEAR → RELU → LINEAR
in # GRADED FUNCTION: forward_propagation
def forward_propagation(X, parameters): function after doing this:

YOUR CODE STARTS HERE

Z1 = tf.math.add(tf.linalg.matmul(W1, X), b1)                                  # Z1 = np.dot(W1, X) + b1
A1 = tf.keras.activations.relu(Z1)                                                        # A1 = relu(Z1)
Z2 = tf.math.add(tf.linalg.matmul(W2, A1), b2)                                # Z2 = np.dot(W2, a1) + b2
A2 = tf.keras.activations.relu(Z2)                                                        # A2 = relu(Z2)
Z3 = tf.math.add(tf.linalg.matmul(W3, A2), b3)                                # Z3 = np.dot(W3,Z2) + b3
# YOUR CODE ENDS HERE

Getting following error:
NameError Traceback (most recent call last)
in
18 print("\033[92mAll test passed")
19
—> 20 forward_propagation_test(forward_propagation, new_train)

in forward_propagation_test(target, examples)
2 minibatches = examples.batch(2)
3 for minibatch in minibatches:
----> 4 forward_pass = target(tf.transpose(minibatch), parameters)
5 print(forward_pass)
6 assert type(forward_pass) == EagerTensor, “Your output is not a tensor”

NameError: name ‘parameters’ is not defined

Now working, reset is and then re-ran it :slight_smile:

It’s good to hear that you found the solution. It might be worth reading through the FAQ Thread, as it has a topic on this and other issues that might be helpful.

Also note that you filed this under General Discussion. These forums cover a lot of Specializations besides DLS at this point. Fortunately I recognized the code, but you’ll have better luck if you file the questions under the relevant categories (DLS Course 2 in this case). I moved it for you by using the little “edit pencil” on the title.