@jpeg729 Thank you for reply.

triplet_loss calculates reg_dist_neg but never uses it. Is that intentional?

Yes, It’s intentional. I’ll use value of  reg_dist_neg after addtional modification of triplet_loss.
Now I have another question that:
When I forward() same image Tensor two times, I’ll get two different output. Is this because of the dropout layer?
When I want to use this network as feature extractor, what should I do?