class_docstr: This loss function models all positive and negative interaction predictions as normal distributions and
  returns the probability of overlap between the two distributions. This loss function includes non-interacted items
  as negative interactions.
  Interactions can be any positive or negative values, but this loss function ignores the magnitude of the
  interaction -- interactions are grouped in to {i <= 0} and {i > 0}.
class_docstr_tok: ["This","loss","function","models","all","positive","and","negative","interaction","predictions","as","normal","distributions","and","returns","the","probability","of","overlap","between","the","two","distributions",".","This","loss","function","includes","non-interacted","items","as","negative","interactions",".","Interactions","can","be","any","positive","or","negative","values",",","but","this","loss","function","ignores","the","magnitude","of","the","interaction","--","interactions","are","grouped","in","to","{","i","<","=","0","}","and","{","i",">","0","}","."]
code: def connect_loss_graph(
      self, tf_prediction, tf_interactions, **kwargs
  ):
      interactions_shape = tf.shape(tf_interactions)
      int_serial_shape = tf.cast(
          [interactions_shape[0] * interactions_shape[1]], tf.int32
      )
      tf_interactions_serial = tf.reshape(
          tf.sparse_tensor_to_dense(tf_interactions),
          shape=int_serial_shape,
      )
  
      prediction_shape = tf.shape(tf_prediction)
      pred_serial_shape = tf.cast(
          [prediction_shape[0] * prediction_shape[1]], tf.int32
      )
      tf_prediction_serial = tf.reshape(
          tf_prediction, shape=pred_serial_shape
      )
  
      tf_positive_mask = tf.greater(tf_interactions_serial, 0.0)
      tf_negative_mask = tf.less_equal(tf_interactions_serial, 0.0)
  
      tf_positive_predictions = tf.boolean_mask(
          tf_prediction_serial, tf_positive_mask
      )
      tf_negative_predictions = tf.boolean_mask(
          tf_prediction_serial, tf_negative_mask
      )
  
      tf_pos_mean, tf_pos_var = tf.nn.moments(
          tf_positive_predictions, axes=[0]
      )
      tf_neg_mean, tf_neg_var = tf.nn.moments(
          tf_negative_predictions, axes=[0]
      )
  
      tf_overlap_distribution = tf.contrib.distributions.Normal(
          loc=(tf_neg_mean - tf_pos_mean),
          scale=tf.sqrt(tf_neg_var + tf_pos_var),
      )
  
      loss = 1.0 - tf_overlap_distribution.cdf(0.0)
      return loss
  
imports: import abc
  import tensorflow
label_desc: Use image node_id 1 for calling the SeparationDenseLossGraph obj's underlying member method code with example usage: obj.connect_loss_graph(tf_prediction, tf_interactions) and returns: loss