Open Aaronponceuv opened 4 years ago
https://github.com/andreasveit/triplet-network-pytorch/blob/14e64764ec33d0a6e54508cee24ef7e7fe3a8366/train.py#L150
loss_embedd = embedded_x.norm(2) + embedded_y.norm(2) + embedded_z.norm(2) loss = loss_triplet + 0.001 * loss_embedd
because they sum the embedded and sum with triplet loss ??
@Aaronponceuv Personally, I think this is to add a regulization term to prevent the gradient from disappearing
https://github.com/andreasveit/triplet-network-pytorch/blob/14e64764ec33d0a6e54508cee24ef7e7fe3a8366/train.py#L150
loss_embedd = embedded_x.norm(2) + embedded_y.norm(2) + embedded_z.norm(2) loss = loss_triplet + 0.001 * loss_embedd
because they sum the embedded and sum with triplet loss ??