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
Hi, im new to deep learning and python, i have a question: in a multi-class semantic segmentation with 4 classes ( im using keras ) my model has a softmax activation and the input for the model.fit has shape : mask_train[batch, h, w, 4 ].
I can't understand if i have to uncomment these lines or not
def DiceLoss(y_true, y_pred, smooth=1e-6):
# if you are using this loss for multi-class segmentation then uncomment
# following lines
# if y_pred.shape[-1] <= 1:
# # activate logits
# y_pred = tf.keras.activations.sigmoid(y_pred)
# elif y_pred.shape[-1] >= 2:
# # activate logits
# y_pred = tf.keras.activations.softmax(y_pred, axis=-1)
# # convert the tensor to one-hot for multi-class segmentation
# y_true = K.squeeze(y_true, 3)
# y_true = tf.cast(y_true, "int32")
# y_true = tf.one_hot(y_true, num_class, axis=-1)
The text was updated successfully, but these errors were encountered:
Hi, im new to deep learning and python, i have a question: in a multi-class semantic segmentation with 4 classes ( im using keras ) my model has a softmax activation and the input for the model.fit has shape : mask_train[batch, h, w, 4 ].
I can't understand if i have to uncomment these lines or not
def DiceLoss(y_true, y_pred, smooth=1e-6):
The text was updated successfully, but these errors were encountered: