docstr: For each input in batch, compute the sum of its affinity to negative samples.
  
  Returns:
      Tensor of shape [batch_size x num_neg_samples]. For each node, a list of affinities to
          negative samples is computed.
docstr_tok: ["For","each","input","in","batch",",","compute","the","sum","of","its","affinity","to","negative","samples",".","Returns",":","Tensor","of","shape","[","batch_size","x","num_neg_samples","]",".","For","each","node",",","a","list","of","affinities","to","negative","samples","is","computed","."]
code: def neg_cost(self, inputs1, neg_samples, hard_neg_samples=None):
      """For each input in batch, compute the sum of its affinity to negative samples.
  
      Returns:
          Tensor of shape [batch_size x num_neg_samples]. For each node, a list of affinities to
              negative samples is computed.
      """
      if self.bilinear_weights:
          inputs1 = tf.matmul(inputs1, self.vars["weights"])
      neg_aff = tf.matmul(inputs1, tf.transpose(neg_samples))
      return neg_aff
  
file_path: GraphSAGE/graphsage/prediction.py
imports: from __future__ import division
  from __future__ import print_function
  from graphsage.inits import zeros
  from graphsage.layers import Layer
  import tensorflow
label_desc: Use image node_id 3 for calling the BipartiteEdgePredLayer obj's underlying member method code with example usage: obj.neg_cost(inputs1, neg_samples, hard_neg_samples) and returns: neg_aff