Various-Loss-Function-in-Face-Recognition icon indicating copy to clipboard operation
Various-Loss-Function-in-Face-Recognition copied to clipboard

Unknown loss function:AM-softmax

Open justshot opened this issue 6 years ago • 2 comments

I cloned this project and imported to my own python code. I updated my code as below: siamese_net.compile(loss="AM-softmax",optimizer=optimizer, metrics=['accuracy'])

However, I got below error message: ValueError: Unknown loss function:AM-softmax

justshot avatar Feb 14 '19 08:02 justshot

I changed my code with below update and solved previous problem. However, not a new error message.

Code: AM_softmax_logits = Dense_with_AMsoftmax_loss(2, m=0.2, scale=24)

Error: AttributeError: 'Dense_with_AMsoftmax_loss' object has no attribute 'logits'

justshot avatar Feb 14 '19 08:02 justshot

In the code of class Dense_with_Center_loss(Layer):I think you don't use the softmax activation, however, your code is: crossentropy = K.sparse_categorical_crossentropy(y_true, y_pred, from_logits=True) Why 'from_logits' is True instead of False? Thank you!

Jonathans575 avatar Dec 27 '19 07:12 Jonathans575