import tensorflow as tf

                global_step = tf.get_variable("global_step", [], 
                                              dtype=tf.int32,
                                              initializer=tf.constant_initializer(0), 
                                              trainable=False)
            # Loss value
            reg_item = tf.contrib.layers.l1_l2_regularizer(L1_reg,
                                                           L2_reg)
            reg_term = tf.contrib.layers.apply_regularization(reg_item, self.nnweights)
            loss_fun = self._negative_log_likelihood(y_, y)
            loss = loss_fun + reg_term
            # SGD Optimizer
            if optimizer == 'sgd':
                lr = tf.train.exponential_decay(
                    learning_rate,
