Clipped the Sphereface angle

parent ce8740dc
Pipeline #47386 passed with stage
in 3 minutes and 36 seconds
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment