Hi;
First, thank you very much for implementing this in Tensorflow. I just have a confusion, I notice the return for the model have 7 outputs as expected:
model = models.Model(inputs=[x_in], outputs=[d_stage_1, d_stage_2, d_stage_3, d_stage_4, d_stage_5, d_stage_6, bridge])
However, the loss have input for 2, I was expecting also 7:
def ssim_loss(y_true, y_pred):
Because in Basenet implementation in Pytorch:
def muti_bce_loss_fusion(d0, d1, d2, d3, d4, d5, d6, d7, labels_v):
loss0 = bce_ssim_loss(d0,labels_v)
loss1 = bce_ssim_loss(d1,labels_v)
loss2 = bce_ssim_loss(d2,labels_v)
loss3 = bce_ssim_loss(d3,labels_v)
loss4 = bce_ssim_loss(d4,labels_v)
loss5 = bce_ssim_loss(d5,labels_v)
loss6 = bce_ssim_loss(d6,labels_v)
loss7 = bce_ssim_loss(d7,labels_v)
#ssim0 = 1 - ssim_loss(d0,labels_v)
# iou0 = iou_loss(d0,labels_v)
#loss = torch.pow(torch.mean(torch.abs(labels_v-d0)),2)*(5.0*loss0 + loss1 + loss2 + loss3 + loss4 + loss5) #+ 5.0*lossa
loss = loss0 + loss1 + loss2 + loss3 + loss4 + loss5 + loss6 + loss7#+ 5.0*lossa
print("l0: %3f, l1: %3f, l2: %3f, l3: %3f, l4: %3f, l5: %3f, l6: %3f\n"%(loss0.data[0],loss1.data[0],loss2.data[0],loss3.data[0],loss4.data[0],loss5.data[0],loss6.data[0]))
# print("BCE: l1:%3f, l2:%3f, l3:%3f, l4:%3f, l5:%3f, la:%3f, all:%3f\n"%(loss1.data[0],loss2.data[0],loss3.data[0],loss4.data[0],loss5.data[0],lossa.data[0],loss.data[0]))
return loss0, loss
I think I'm missing something here.