talreiss / Mean-Shifted-Anomaly-Detection

Mean-Shifted Contrastive Loss for Anomaly Detection (AAAI 2023)
https://arxiv.org/pdf/2106.03844.pdf
Other
116 stars 23 forks source link

Some question about the angular loss #10

Closed Henry0528 closed 2 years ago

Henry0528 commented 2 years ago

First,thanks for the great work.There seems some difference in the angular center loss between the paper and the code. In the paper, the angular center loss is defined as the product of the output of the model and the centered feature c

image

While in the code, the angular center loss is defined as the L2 distance between the output and centered feature, which seems the same as the original center loss

image
talreiss commented 2 years ago

Hi Please note that optimizing the Euclidean metric when dealing with unit vectors is proportional to optimizing the angular distance multiplied by a constant factor. Therefore, this optimization process is equivalent. Hope this clarifies your question.

Henry0528 commented 2 years ago

Thank for your answer!