Closed xiaomaxiao closed 5 years ago
You don't really have to choose which loss function to use, you rather choose which type of prediction you need. If you have a classification problem (one label per pixel), then you should have PredictionType = CLASSIFICATION
, this is by default. If you have a multilabel classification problem (multiple labels per pixel) then set PredictionType = MULTILABEL
. I'd recommend using one of these two.
thx , I use PredictionType = ClassFICATION , I don't know how to adjust the parameters of focal loss ,do you have any advice?
By default no focal loss is used. If you want to try it, I'd recommend having a look at the original paper to set the parameters.
I found some errors .
Remove the negative sign
tf.multiply(training_params.focal_loss_alpha*(1. - prediction_probs), onehot_labels)),
Unfortunately, I didn't get good results with focal loss , I am looking for the reason
I also try to use class weight
Good catch, I corrected it in https://github.com/dhlab-epfl/dhSegment/commit/0cddcfabcec6943d13cbff6c8afaa307d6f0cfc6
And yeah class weight is basically the $\alpha_t$ in the focal loss paper
What are the differences between these loss functions? How do I choose? especially REGRESSION
tf.squared_difference loss fuction