andreasveit / triplet-network-pytorch

370 stars 95 forks source link

doubt: because they sum the embedded and sum with triplet loss ?? #14

Open Aaronponceuv opened 4 years ago

Aaronponceuv commented 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 ??

AnnaXiong commented 4 years ago

@Aaronponceuv Personally, I think this is to add a regulization term to prevent the gradient from disappearing