Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Tejan Karmali tejank10

🎯
Focusing
View GitHub Profile
View multiview_color_loss.py
def multiview_color_loss(predicts, targets_a, targets_b):
l1loss = nn.L1Loss()
loss = (l1loss(predicts[0][:, :3], targets_a[:, :3]) + \
l1loss(predicts[1][:, :3], targets_a[:, :3]) + \
l1loss(predicts[2][:, :3], targets_b[:, :3]) + \
l1loss(predicts[3][:, :3], targets_b[:, :3])) / 4
return loss