anguyen8 / face-vit

19 stars 4 forks source link

How do you calculate loss on training of the Hybrid_ViT heatmap #3

Closed mucunwuxian closed 6 months ago

mucunwuxian commented 6 months ago

Thank you for your great work!

I would like to ask. Especially in the case of authentication based on similarity as in test.py.

image

How do you calculate loss on training? The distance calculation in test.py was as follows. Maybe it's not a cosine distance, but is the ArcFace loss function used?

diff = np.subtract(embeddings1, embeddings2)
dist = np.sum(np.square(diff), 1)

Even if it's a rough answer, I appreciate it. Best regards,

anguyen8 commented 6 months ago

@mucunwuxian Thank you for your question!

Yes, the ArcFace loss is used during training. Please see the paper (Eq. 7, Sec. 3.2).

mucunwuxian commented 6 months ago

@anguyen8 Thank you for your reply! I'll try using the information you provided.👍