You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 18, 2022. It is now read-only.
Thank you for the prompt reply and pointing me to the code. However I do have doubt regarding the same. For the sake of simplicity, lets say 1) The output from U-net is a 3x3 label image.
dice_score =0
u_net_output = torch.ones(4,3,3) :fill(2) ---[ batches, W, H] say the label associated was 2
targets = torch.ones(4,3,3) :fill(2) --- targets are also 2, ideally dice score should be 1
for i =1 , u_net_output :size(1) do
local output = u_net_output [i]
local target = targets [i]
numerator = torch.cmul(output,target)
dice_score= dice_score + 2*(numerator:sum())/(target:sum()+output:sum())
end
dice_coeff= dice_score/u_net_output:size(1)
print (dice_coeff) yields answer =2 .
Is this because I am calculating the dice score of batch ? Any thoughts?
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi
Could you please point me how you calculate the dice score?
The text was updated successfully, but these errors were encountered: