Skip to main content

Let's say I want to add a few hand-crafted features to a convolutional neural network (CNN)CNN in TensorFlow.

The CNN can be a simple one as described in: https://www.tensorflow.org/get_started/mnist/proshere.

Naturally I'd like to add these features right after the second pooling and right before the first fully-connected layer (FC1 in the example).

Is that easy to express my method in code? I'd have to append my features to the h_pool2_flat vector/tensor:

h_pool2_flat = tf.reshape(h_pool2, [-1, 7*7*64])
h_fc1 = tf.nn.relu(tf.matmul(h_pool2_flat, W_fc1) + b_fc1)

Let's say I want to add a few hand-crafted features to a convolutional neural network (CNN) in TensorFlow.

The CNN can be a simple one as described in: https://www.tensorflow.org/get_started/mnist/pros

Naturally I'd like to add these features right after the second pooling and right before the first fully-connected layer (FC1 in the example).

Is that easy to express my method in code? I'd have to append my features to the h_pool2_flat vector/tensor:

h_pool2_flat = tf.reshape(h_pool2, [-1, 7*7*64])
h_fc1 = tf.nn.relu(tf.matmul(h_pool2_flat, W_fc1) + b_fc1)

Let's say I want to add a few hand-crafted features to a convolutional neural network CNN in TensorFlow.

The CNN can be a simple one as described here.

Naturally I'd like to add these features right after the second pooling and right before the first fully-connected layer (FC1 in the example).

Is that easy to express my method in code? I'd have to append my features to the h_pool2_flat vector/tensor:

h_pool2_flat = tf.reshape(h_pool2, [-1, 7*7*64])
h_fc1 = tf.nn.relu(tf.matmul(h_pool2_flat, W_fc1) + b_fc1)
Source Link
wsw
  • 151
  • 5

Adding hand-crafted features to a convolutional neural network (CNN) in TensorFlow

Let's say I want to add a few hand-crafted features to a convolutional neural network (CNN) in TensorFlow.

The CNN can be a simple one as described in: https://www.tensorflow.org/get_started/mnist/pros

Naturally I'd like to add these features right after the second pooling and right before the first fully-connected layer (FC1 in the example).

Is that easy to express my method in code? I'd have to append my features to the h_pool2_flat vector/tensor:

h_pool2_flat = tf.reshape(h_pool2, [-1, 7*7*64])
h_fc1 = tf.nn.relu(tf.matmul(h_pool2_flat, W_fc1) + b_fc1)