import tensorflow as tf

                                              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,
                    global_step,
                    1,
                    learning_rate_decay
                )
                train_step = tf.train.GradientDescentOptimizer(lr).minimize(loss, global_step=global_step)
            elif optimizer == 'adam':
                train_step = tf.train.GradientDescentOptimizer(learning_rate).\
                                                               minimize(loss, global_step=global_step)     
            else:
                raise NotImplementedError('activation not recognized')   
            # init op
            init_op = tf.global_variables_initializer()
        
        # Save into class members
        self.X = X
        self.y_ = y_
        self.y = y
        self.global_step = global_step
        self.loss = loss
