import tensorflow as tf

      with tf.variable_scope(self.model_scope):
        # loss & extra evaluation metrics
        logits = self.forward_train(images)
        self.maskable_var_names = [var.name for var in self.maskable_vars]
        loss, metrics = self.calc_loss(labels, logits, self.trainable_vars)
        if FLAGS.enbl_dst:
          loss += self.helper_dst.calc_loss(logits, logits_dst)
        tf.summary.scalar('loss', loss)
        for key, value in metrics.items():
          tf.summary.scalar(key, value)

        # learning rate schedule
        self.global_step = tf.train.get_or_create_global_step()
        lrn_rate, self.nb_iters_train = self.setup_lrn_rate(self.global_step)
