What happens during validation in keras?

Hello I am training a model for semantic segmentation using dice loss and as a metric.

model.compile(...., loss=diceLoss, metrics=[dice_coef]) 

I noticed that in an epoch, the loss and dice_coef are equal. However, val_loss is never equal val_dice_coef. What is the reason behind that? I feel like something is being done (turned on/off) during validation.

I hope any of this makes sense. Thanks!

Edit: i am using segmentation-models library, using a unet with pretrained weights. I tried looking into the source code; but I couldn’t figure out what’s happening.

submitted by /u/potato-question-mark
[visit reddit] [comments]

Leave a Reply

Your email address will not be published. Required fields are marked *