C1_W3_Assignment_Exercise 5 - soft_dice loss

i keep getting stuck here, no matter what i do, test case 2,4,5 keep failing. I need help please.
Screenshot removed by moderator as posting grade function codes on public post is against community guidelines. if a mentor wants to see your codes they will ask you to DM the codes


hi hi @kae009

see if this response helps you understand your mistake

remember your code implementation for grade function unqc5 is almost similar to unqc4 (if you have done it correctly)

Your code for dice denominator is missing the equation value which mentions ground truth values and soft prediction are squared.

Also remember in the dice losss is a float number, so when you are calculating dice numerator, use 2. instead of 2 as epsilon value is also a float value which will help you in the correct code implementation and calculation of dice loss.

Next after calculating dice numerator and dice denominator. While calculating dice loss your code implementation requires you to do 1-K.mean of numerator and denominator but when you calculated by 1-numerator/denominator And then implemented K.mean to the above code implementation your test calculations failed because equation mentions you to K.mean of numerator/denominator to which is subtracted by 1.

I hope now you understood your mistake.

Keep Learning!!

Regards
DP

wow, it worked. Thank you very much

1 Like