vgg_conv4_3, 3, epsilon=1e-12
)
// Scale.
scale_initializer = tf.ones(
[1, 1, 1, vgg_conv4_3.shape[3]]
) * 20.0 // They initialize to 20.0 in paper
scale = tf.get_variable(
"gamma",
dtype=vgg_conv4_3.dtype.base_dtype,
initializer=scale_initializer
)
vgg_conv4_3_norm = tf.multiply(vgg_conv4_3_norm, scale)
tf.summary.histogram("conv4_3_normalized_hist", vgg_conv4_3)
tf.add_to_collection("FEATURE_MAPS", vgg_conv4_3_norm)
// The original SSD paper uses a modified version of the vgg16
// network, which we"ll modify here
vgg_network_truncation_endpoint = base_net_endpoints[
scope + "/vgg_16/conv5/conv5_3"]
tf.summary.histogram(
"conv5_3_hist",
vgg_network_truncation_endpoint
)
// Extra layers for vgg16 as detailed in paper
with tf.variable_scope("extra_feature_layers"):
self._init_vgg16_extra_layers()
net = tf.nn.max_pool(
vgg_network_truncation_endpoint, [1, 3, 3, 1],
padding="SAME", strides=[1, 1, 1, 1], name="pool5"
)
net = self.conv6(net)
net = self.activation_fn(net)
net = self.conv7(net)
net = self.activation_fn(net)
tf.summary.histogram("conv7_hist", net)
tf.add_to_collection("FEATURE_MAPS", net)
net = self.conv8_1(net)
net = self.activation_fn(net)
net = self.conv8_2(net)
net = self.activation_fn(net)
tf.summary.histogram("conv8_hist", net)
tf.add_to_collection("FEATURE_MAPS", net)
net = self.conv9_1(net)
net = self.activation_fn(net)