July 2019
Intermediate to advanced
512 pages
19h 39m
English
Now we will compute the primary capsules, which extract the basic features, and the digit capsules, which recognizes the digits.
Start the TensorFlow Graph:
graph = tf.Graph()with graph.as_default() as g:
Define the placeholders for input and output:
x = tf.placeholder(tf.float32, [batch_size, 784]) y = tf.placeholder(tf.float32, [batch_size,10]) x_image = tf.reshape(x, [-1,28,28,1])
Perform the convolution operation and get the convolutional input:
with tf.name_scope('convolutional_input'): input_data = tf.contrib.layers.conv2d(inputs=x_image, num_outputs=256, kernel_size=9, padding='valid')
Compute the primary capsules that extract the basic features, such as edges. First, compute the capsules using ...
Read now
Unlock full access