'Create the encoding layers for supervised finetuning.
:return: output of the final encoding layer.'

def _create_encoding_layers(self):

    next_train = self.input_data
    self.layer_nodes = []
    for (l, layer) in enumerate(self.layers):
        with tf.name_scope('encode-{}'.format(l)):
            y_act = tf.add(tf.matmul(next_train, self.encoding_w_[l]), self.encoding_b_[l])
            if self.finetune_act_func:
                layer_y = self.finetune_act_func(y_act)
            else:
                layer_y = None
            next_train = tf.nn.dropout(layer_y, self.keep_prob)
        self.layer_nodes.append(next_train)
    return next_train
