I get two cases passed and two failed. My epsilon is 1 (not hardcoded). Not sure if I am using the axis parameter correctly.
Please help.
Also Keras.sum as mentioned in the lab does not exist. The link to the documentation
https://www.tensorflow.org/api_docs/python/tf/keras/backend/sum
is broken. You may want to note and correct this.
Test Case 1:
Pred:
[[1. 0.]
[0. 1.]]
Label:
[[1. 1.]
[0. 0.]]
Dice coefficient: 0.4
Test Case 2:
Pred:
[[1. 0.]
[0. 1.]]
Label:
[[1. 1.]
[0. 1.]]
Dice coefficient: 0.5
Error: Wrong output for Test Case 1. One possible reason for error: make sure epsilon = 1
Error: Wrong output for Test Case 2. One possible reason for error: make sure epsilon = 1
2 Tests passed
2 Tests failed
@Mubsi . Please ignore. I solved it.
Hello @getjaidev
If you share how you solved this error, it will help fellow learners
Oh… I just forgot to put in a “2 *” in the numerator. My mistake.
In the multiple class section,
I get a wrong output for Test Case 3.
Pred:
class = 0
[[1. 0.]
[0. 1.]]
class = 1
[[1. 0.]
[0. 1.]]
Label:
class = 0
[[1. 1.]
[0. 0.]]
class = 1
[[1. 1.]
[0. 1.]]
Dice coefficient: 0.7
Error: Wrong output for Test Case 3. One possible reason for error: make sure epsilon = 1
6 Tests passed
1 Tests failed
Mubsi
November 28, 2022, 10:00am
8
Hi @getjaidev ,
Your equations are wrong.
You can take a look in your notebook for more details.
Best,
Mubsi
Mubsi
November 28, 2022, 10:56am
10
This and other documentation hyperlinks have been updated.
Thank you @Mubsi . Much appreciated
1 Like