code: def get_train(self):
      NodeA = tf.placeholder(
          tf.float32, [None, self.node_size], name="node_a"
      )
      BmaskA = tf.placeholder(
          tf.float32, [None, self.node_size], name="beta_mask_a"
      )
      NodeB = tf.placeholder(
          tf.float32, [None, self.node_size], name="node_b"
      )
      BmaskB = tf.placeholder(
          tf.float32, [None, self.node_size], name="beta_mask_b"
      )
      Weights = tf.placeholder(
          tf.float32, [None, 1], name="adj_weights"
      )
  
      layer_collector = []
      nodes = tf.concat([NodeA, NodeB], axis=0)
      bmasks = tf.concat([BmaskA, BmaskB], axis=0)
      emb, recons = self.model(nodes, layer_collector, "reconstructor")
      embs = tf.split(emb, num_or_size_splits=2, axis=0)
  
      L_1st = tf.reduce_sum(
          Weights
          * (tf.reduce_sum(tf.square(embs[0] - embs[1]), axis=1))
      )
  
      L_2nd = tf.reduce_sum(tf.square((nodes - recons) * bmasks))
  
      L = L_2nd + self.alpha * L_1st
  
      for param in layer_collector:
          L += self.nu1 * tf.reduce_sum(
              tf.abs(param[0])
          ) + self.nu2 * tf.reduce_sum(tf.square(param[0]))
  
      # lr = tf.train.exponential_decay(1e-6, self.max_iter, decay_steps=1, decay_rate=0.9999)
      # optimizer = tf.train.MomentumOptimizer(lr, 0.99, use_nesterov=True)
  
      optimizer = tf.train.AdamOptimizer(self.lr)
      train_op = optimizer.minimize(L)
  
      init = tf.global_variables_initializer()
      self.sess.run(init)
  
      generator = self.generate_batch()
  
      for step in range(self.max_iter + 1):
          (
              nodes_a,
              nodes_b,
              beta_mask_a,
              beta_mask_b,
              weights,
          ) = generator.__next__()
  
          feed_dict = {
              NodeA: nodes_a,
              NodeB: nodes_b,
              BmaskA: beta_mask_a,
              BmaskB: beta_mask_b,
              Weights: weights,
          }
  
          self.sess.run(train_op, feed_dict=feed_dict)
          if step % 50 == 0:
              print(
                  "step %i: %s"
                  % (
                      step,
                      self.sess.run(
                          [L, L_1st, L_2nd], feed_dict=feed_dict
                      ),
                  )
              )
  
      return self.sess.run(
          emb,
          feed_dict={
              NodeA: self.adj_mat[0:1, :],
              NodeB: self.adj_mat[1:, :],
          },
      )
  
file_path: OpenNE/src/openne/sdne.py
imports: import tensorflow
  import numpy
label_desc: Use image node_id 5 for calling the SDNE2 obj's underlying member method code with example usage: obj.get_train() and returns: self