Different loss function for validation set in Keras
问题 I have unbalanced training dataset, thats why I built custom weighted categorical cross entropy loss function. But the problem is my validation set is balanced one and I want to use the regular categorical cross entropy loss. So can I pass different loss function for validation set within Keras? I mean the wighted one for training and regular one for validation set? def weighted_loss(y_pred, y_ture): ' ' ' return loss model.compile(loss= weighted_loss, metric='accuracy') 回答1: You can try the