I am doing a multiclass image segmentation using keras and TensorFlow. My trained network is giving me good predictions but fails to separate the touching objects, that's why I want to use softmax_cross_entropy
loss function which has a "weights"
parameter.
How can I calculate those weights knowing that my y_true
shape is (batch-size,128,128,3)
?
tf.losses.softmax_cross_entropy(y_true,y_pred,weights=my_weights)