code: def build_train(x, y_):
      net = model(x, is_train=True)
      cost = tl.cost.cross_entropy(net.outputs, y_, name="cost_train")
      accurate_prediction = tf.equal(tf.argmax(net.outputs, 1), y_)
      accuracy = tf.reduce_mean(
          tf.cast(accurate_prediction, tf.float32),
          name="accuracy_train",
      )
      log_tensors = {"cost": cost, "accuracy": accuracy}
      return net, cost, log_tensors
  
imports: import numpy
  import tensorflow
  import tensorlayer
label_desc: Use image node_id 3 for calling a global function with example usage: build_train(x, y_) and returns: net,  cost,  log_tensors