LCorleone / Various-Loss-Function-in-Face-Recognition

Keras implementation of various loss functions in face recognition and visualization on Mnist
27 stars 5 forks source link

Unknown loss function:AM-softmax #1

Open justshot opened 5 years ago

justshot commented 5 years ago

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 commented 5 years ago

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'

Jonathans575 commented 4 years ago

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!