Skip to content
Snippets Groups Projects
Commit 9c7cb38c authored by Tiago de Freitas Pereira's avatar Tiago de Freitas Pereira
Browse files

Clipped the Sphereface angle

parent ce8740dc
Branches
Tags
1 merge request!93ArcFace/SphereFace Loss
Pipeline #47386 passed
......@@ -201,6 +201,7 @@ class SphereFaceLayer(tf.keras.layers.Layer):
# cos between X and W
cos_yi = tf.matmul(X, W)
cos_yi = tf.clip_by_value(cos_yi, -1, 1)
# cos(m \theta)
theta = tf.math.acos(cos_yi)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment