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_dense_prediction_graph(
      self, tf_user_representation, tf_item_representation
  ):
      # [ n_users, 1 ]
      r_user = tf.reduce_sum(
          tf_user_representation**2, 1, keep_dims=True
      )
  
      # [ n_items, 1 ]
      r_item = tf.reduce_sum(
          tf_item_representation**2, 1, keep_dims=True
      )
  
      # [ n_users, n_items ]
      distance = (
          r_user
          - 2.0
          * tf.matmul(
              tf_user_representation,
              tf_item_representation,
              transpose_b=True,
          )
          + tf.transpose(r_item)
      )
  
      # 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 1 for calling the EuclideanSimilarityPredictionGraph obj's underlying member method code with example usage: obj.connect_dense_prediction_graph(tf_user_representation, tf_item_representation) and returns: unknown