AssertionError Traceback (most recent call last)
in
9 print("\033[92mAll test passed")
10
—> 11 compute_cost_test(compute_cost)
in compute_cost_test(target)
5 print(result)
6 assert(type(result) == EagerTensor), “Use the TensorFlow API”
----> 7 assert (np.abs(result - (0.7752516 + 0.9752516 + 0.7752516) / 3.0) < 1e-7), “Test does not match. Did you get the mean of your cost functions?”
8
9 print("\033[92mAll test passed")
AssertionError: Test does not match. Did you get the mean of your cost functions?
Hi. I’m having the same issue and I can’t figure out what’s wrong. I use the tf.reduce_mean after using the tf.keras.losses.categorical_crossentropy and the notes say that this cost function expected the logits and labels to be of shape (number of examples, num_classes). The shape is (6,num_examples), so I tried using the tf.transpose on the inputs, but it doesn’t seem to solve the issue. Any other hints?
Hey @nramon, I can’t understand your hint. We know, we don’t need to hard code but there is lots of thing going on in computing cost function. Here is a useful thread folks may find helpful.