code: def encode_basket_graph(self, binput, beta, is_sparse=False):
      with tf.name_scope("Graph_Encoder"):
          if is_sparse:
              encoder = tf.sparse_tensor_dense_matmul(
                  binput, self.I_B_Diag, name="XxI_B"
              )
              encoder += self.relu_with_threshold(
                  tf.sparse_tensor_dense_matmul(
                      binput, self.A, name="XxA"
                  ),
                  beta,
              )
          else:
              encoder = tf.matmul(binput, self.I_B_Diag, name="XxI_B")
              encoder += self.relu_with_threshold(
                  tf.matmul(binput, self.A, name="XxA"), beta
              )
      return encoder
  
file_path: cornac/cornac/models/beacon/beacon_tf.py
imports: import numpy
  import warnings
  import tensorflow.compat.v1
label_desc: Use image node_id 5 for calling the BeaconModel obj's underlying member method code with example usage: obj.encode_basket_graph(binput, beta, is_sparse) and returns: encoder