C3W3 Issues with Exercise 4: Classify

Similar to the issues in my previous post (C3W3 Issues with Triplet Loss), I am facing issues in exercise 4


The accuracies are incorrect and I can’t understand why. I implemented the same logic in exercise 5 and that passed all testcases. Can someone help me out please?

hi @N_Adhikari

refer this

see if it helps, if still doesn’t then send the screenshot by personal DM

Hey
So, I actually did refer to this exact post while writing the code, which is why I’m having a hard time figuring out what’s wrong. Especially since the same logic works in exercise 5. I’ll attach the code in a personal message.
Please let me know what I’m missing out on

Sorry for delayed response, I was out.

the code line

take the average of correct predictions to get the accuracy, you are checking average of predictions where it mentions you to take average of correct predictions.

so you mentioning just y_pred would be incorrect.

rather take tf.cast(when y pred is absolute equal to your actual targets, datatype)

here is a similar threads

Oh thank you so much! You’ve been of great help!

1 Like