def _forward_pass(self):

        """ Perform a forward pass through the layers of the network.
        :return: sampled units at the last layer
        """

        next_train = self.x

        for l in range(self.n_layers-1):

            activation = tf.matmul(next_train, self.W_vars[l]) + self.bh_vars[l]

            if self.act_func == 'sigmoid':
                hprobs = tf.nn.sigmoid(activation)

            elif self.act_func == 'tanh':
                hprobs = tf.nn.tanh(activation)

            elif self.act_func == 'relu':
                hprobs = tf.nn.relu(activation)

            else:
                hprobs = None

            next_train = tf.nn.dropout(hprobs, self.keep_prob)

        return next_train
dataset/ETHPy150Open blackecho/Deep-Learning-TensorFlow/models/rbm_models/dbn.py/DBN._forward_pass/original