tf_unet icon indicating copy to clipboard operation
tf_unet copied to clipboard

why I got the negative loss ?

Open zzdang opened this issue 7 years ago • 4 comments

I got the nagetive loss use the unet ,I don't know what's the wrong in my code. I use the gt (maks) of 2 class,background and foregroud,with the mask pixels are 255 .The mask png is 1 channel. I use image_util.ImageDataProvider to provide data,unet.Unet is the network. Thank you for helping me

zzdang avatar Jan 23 '18 05:01 zzdang

Do you use "class_weights" in the model definition?

PhySci avatar Jan 23 '18 14:01 PhySci

Depending on the loss you are using this actually valid

jakeret avatar Jan 23 '18 15:01 jakeret

I see that cross-entropy loss function gives negative value for my model. But according to the definition, it should be strictly positive. Any ideas? I'm trying to sort out the problem and realize what's going on.

PhySci avatar Jan 23 '18 16:01 PhySci

I see, that's every odd. Haven't seen that before

jakeret avatar Jan 25 '18 15:01 jakeret