class_docstr: This prediction function calculates the prediction as the negative euclidean distance between the user and
  item representations.
  Prediction = -1 * sqrt(sum((user_repr - item_repr)^2))
class_docstr_tok: ["This","prediction","function","calculates","the","prediction","as","the","negative","euclidean","distance","between","the","user","and","item","representations",".","Prediction","=","-1","*","sqrt","(","sum","(","(","user_repr","-","item_repr",")","^2",")",")"]
code: def connect_serial_prediction_graph(
      self,
      tf_user_representation,
      tf_item_representation,
      tf_x_user,
      tf_x_item,
  ):
      # [ n_interactions, n_components ]
      gathered_user_reprs = tf.gather(tf_user_representation, tf_x_user)
      gathered_item_reprs = tf.gather(tf_item_representation, tf_x_item)
  
      # [ n_interactions, n_components ]
      delta = tf.pow(gathered_user_reprs - gathered_item_reprs, 2)
  
      # [ n_interactions, 1 ]
      distance = tf.reduce_sum(delta, axis=1)
  
      # For numeric stability
      distance = tf.maximum(distance, self.epsilon)
  
      return -1.0 * tf.sqrt(distance)
  
file_path: tensorrec/tensorrec/prediction_graphs.py
imports: import abc
  import tensorflow
  from .recommendation_graphs import relative_cosine
label_desc: Use image node_id 2 for calling the EuclideanSimilarityPredictionGraph obj's underlying member method code with example usage: obj.connect_serial_prediction_graph(tf_user_representation, tf_item_representation, tf_x_user, tf_x_item) and returns: unknown