def prediction(self): """ The structure of the network. """ h_conv1 = tf.nn.relu( ne.conv2d(self.data, self.weights['W_conv1']) + self.biases['b_conv1']) h_pool1 = ne.max_pool_2x2(h_conv1) h_conv2 = tf.nn.relu( ne.conv2d(h_pool1, self.weights['W_conv2']) + self.biases['b_conv2']) h_pool2 = ne.max_pool_2x2(h_conv2) h_pool2_flat = tf.reshape(h_pool2, [-1, 7 * 7 * 64]) h_fc1 = tf.nn.relu( tf.matmul(h_pool2_flat, self.weights['W_fc1']) + self.biases['b_fc1']) h_fc1_drop = tf.nn.dropout(h_fc1, self.p_keep) h_fc2 = tf.matmul(h_fc1_drop, self.weights['W_fc2']) + \ self.biases['b_fc2'] y_conv = tf.nn.softmax(h_fc2) return y_conv
def prediction(self): """ The structure of the network. """ h_conv1 = tf.nn.relu( ne.conv2d_valid(self.data, self.weights['W_conv1']) + self.biases['b_conv1']) h_pool1 = ne.max_pool_2x2(h_conv1) h_conv2 = tf.nn.relu( ne.conv2d_valid(h_pool1, self.weights['W_conv2']) + self.biases['b_conv2']) h_pool2 = ne.max_pool_2x2(h_conv2) h_conv3 = tf.nn.relu( ne.conv2d_valid(h_pool2, self.weights['W_conv3']) + self.biases['b_conv3']) h_pool3 = ne.max_pool_2x2(h_conv3) h_pool3_flat = tf.reshape(h_pool3, [-1, 1 * 6 * 64]) h_fc1 = tf.nn.relu( tf.matmul(h_pool3_flat, self.weights['W_fc1']) + self.biases['b_fc1']) h_fc1_drop = tf.nn.dropout(h_fc1, self.p_keep) y_conv = tf.nn.softmax( tf.matmul(h_fc1_drop, self.weights['W_fc2']) + self.biases['b_fc2']) # softmax return y_conv, h_pool3_flat