(x, y)
return 1 - tf.matmul(x, y, transpose_b=True)
Computes the cosine distance without L2 normalization of x.
Computes the cosine distance without L2 normalization of x.
Computes the cosine distance without L2 normalization of x .
def partial_cosine_distance(x, y):
  """Computes the cosine distance without L2 normalization of x."""
  y = tf.nn.l2_normalize(y, 1, epsilon=1e-3)
  return 1 - tf.matmul(x, y, transpose_b=True)
def partial_cosine_distance ( x , y ) : y = tf . nn . l2_normalize ( y , 1 , epsilon = 1e-3 ) return 1 - tf . matmul ( x , y , transpose_b = True )