August 2018
Intermediate to advanced
272 pages
7h 2m
English
Now, we will present how this kind of model might be implemented in TensorFlow. It is extremely similar to a model for classification, except that we have multiple output layers at the end instead of just one, and each has its own loss function:
def build_graph(self): self.__x_ = tf.placeholder("float", shape=[None, 240, 320, 3], name='X') self.__y_box = tf.placeholder("float", shape=[None, 4], name='Y_box') self.__y_obj = tf.placeholder("float", shape=[None, 1], name='Y_obj') # Training flag for dropout in the fully connected layers self.__is_training = tf.placeholder(tf.bool) with tf.name_scope("model") as scope: conv1 = tf.layers.conv2d(inputs=self.__x_, filters=32, kernel_size=[5, 5], padding="same", activation=tf.nn.relu) ...Read now
Unlock full access