arcface-pytorch icon indicating copy to clipboard operation
arcface-pytorch copied to clipboard

The loss function seems to be error

Open Woolseyyy opened this issue 5 years ago • 5 comments

The focal loss function seems to be differernt from the theory. The theory describes the loss as: -alpha * (1-y')^gamma * log(y') - (1-alpha) * y'^gamma * log(1-y') Besides, the arc metric also confuses me...ArcFace is modified based on softmax but there is nothing similiar to softmax in the metric code. Maybe I misunderstand the theory. I will be grateful if you point my errors out.

Woolseyyy avatar May 22 '19 03:05 Woolseyyy

About the seconde question, I have found the answer. Torch.nn.CrossEntropyLoss() combines nn.LogSoftmax() and nn.NLLLoss() in one single class.

Woolseyyy avatar May 23 '19 07:05 Woolseyyy

About the seconde question, I have found the answer. Torch.nn.CrossEntropyLoss() combines nn.LogSoftmax() and nn.NLLLoss() in one single class.

have you try sphereloss in metric.py?i can`t make loss decrease

CodeMonkZy avatar Jun 28 '19 11:06 CodeMonkZy

About the seconde question, I have found the answer. Torch.nn.CrossEntropyLoss() combines nn.LogSoftmax() and nn.NLLLoss() in one single class.

have you try sphereloss in metric.py?i can`t make loss decrease

my training loss is not decline too, how do you resolve this problem???

ReverseSystem001 avatar Dec 28 '19 09:12 ReverseSystem001

I think the focal loss here is wrong.

LucasWangZH avatar Oct 03 '20 11:10 LucasWangZH

About the seconde question, I have found the answer. Torch.nn.CrossEntropyLoss() combines nn.LogSoftmax() and nn.NLLLoss() in one single class.

So is the implementation here of ArcFace loss right?

wenzhengzeng avatar Jul 22 '21 09:07 wenzhengzeng