Course 2 week 3 programming assignment

Please help as I’m stuck. I believe my error may be from not dividing by the num_examples but I can’t determine the code to use. Below is the output from the run.

Test 1: tf.Tensor(40.436035, shape=(), dtype=float32)

AssertionError Traceback (most recent call last)
in
25 print(“\033[92mAll test passed”)
26
—> 27 compute_total_loss_test(compute_total_loss, new_y_train )

in compute_total_loss_test(target, Y)
13 print("Test 1: ", result)
14 assert(type(result) == EagerTensor), “Use the TensorFlow API”
—> 15 assert (np.abs(result - (0.50722074 + 1.1133534) / 2.0) < 1e-7), “Test 1 does not match. Did you get the reduce sum of your loss functions?”
16
17 ### Test 2

AssertionError: Test 1 does not match. Did you get the reduce sum of your loss functions?

never mind. I found my error.

1 Like

That’s good to hear! For anyone else who sees this thread, here’s the “checklist” for problems on this function. I’m guessing that #4 was the issue here. :grinning:

yep! It was a PEBKAC error…
Problem Exists Between Keyboard And Chair.

Hey!
What was your error, and what was the fix?
It seems that I have the same and got stuck on the lab …

try flipping your X and Y arguments.

1 Like

Did you see my previous post on this thread?