cos4\theta
sycophant-stone opened this issue · 0 comments
sycophant-stone commented
since
cos(4\theta )=8cos^4\theta-8cos^2\theta+2
why do i care the sign of cos\theta?
thanks
cos_theta = tf.div(selected_logits, embeddings_norm)
cos_theta_power = tf.square(cos_theta)
cos_theta_biq = tf.pow(cos_theta, 4)
sign0 = tf.sign(cos_theta)
sign3 = tf.multiply(tf.sign(2*cos_theta_power-1), sign0)
sign4 = 2*sign0 + sign3 -3
result=sign3*(8*cos_theta_biq-8*cos_theta_power+1) + sign4