Skip to content

Commit

Permalink
Added relu activation
Browse files Browse the repository at this point in the history
  • Loading branch information
Subodh Malgonde authored and Subodh Malgonde committed Dec 21, 2017
1 parent 651dfb9 commit cc5027d
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,18 +84,22 @@ def layers(vgg_layer3_out, vgg_layer4_out, vgg_layer7_out, is_training, num_clas
vgg_layer4_out = tf.multiply(vgg_layer4_out, 0.01)

new_layer7_1x1_out = tf.layers.conv2d(vgg_layer7_out, filters=num_classes, kernel_size=(1, 1), strides=(1, 1),
name='new_layer7_1x1_out', kernel_initializer=tf.truncated_normal_initializer(stddev=0.01))
name='new_layer7_1x1_out',
kernel_initializer=tf.truncated_normal_initializer(stddev=0.01),
activation='relu')

new_layer7_1x1_upsampled = tf.layers.conv2d_transpose(new_layer7_1x1_out, filters=num_classes, kernel_size=(3, 3),
strides=(2, 2), name='new_layer7_1x1_out_upsampled', padding='same',
kernel_initializer=tf.truncated_normal_initializer(stddev=0.01))
kernel_initializer=tf.truncated_normal_initializer(stddev=0.01),
activation='relu')

new_layer7_1x1_upsampled_bn = tf.layers.batch_normalization(new_layer7_1x1_upsampled,
name="new_layer7_1x1_upsampled_bn",
training=is_training)

new_layer4_1x1_out = tf.layers.conv2d(vgg_layer4_out, filters=num_classes, kernel_size=(1, 1), strides=(1, 1),
name="new_layer4_1x1_out", kernel_initializer=tf.truncated_normal_initializer(stddev=0.01))
name="new_layer4_1x1_out", activation='relu',
kernel_initializer=tf.truncated_normal_initializer(stddev=0.01))

new_layer4_1x1_out_bn = tf.layers.batch_normalization(new_layer4_1x1_out,
name="new_layer4_1x1_out_bn",
Expand All @@ -104,15 +108,17 @@ def layers(vgg_layer3_out, vgg_layer4_out, vgg_layer7_out, is_training, num_clas
new_layer_4_7_combined = tf.add(new_layer7_1x1_upsampled_bn, new_layer4_1x1_out_bn, name="new_layer_4_7_combined")

new_layer47_upsampled = tf.layers.conv2d_transpose(new_layer_4_7_combined, filters=num_classes, kernel_size=(3, 3),
strides=(2, 2), name="new_layer47_upsampled", padding='same',
kernel_initializer=tf.truncated_normal_initializer(stddev=0.01))
strides=(2, 2), name="new_layer47_upsampled", padding='same',
kernel_initializer=tf.truncated_normal_initializer(stddev=0.01),
activation='relu')

new_layer47_upsampled_bn = tf.layers.batch_normalization(new_layer47_upsampled,
name="new_layer47_upsampled_bn",
training = is_training)

new_layer3_1x1_out = tf.layers.conv2d(vgg_layer3_out, filters=num_classes, kernel_size=(1, 1), strides=(1, 1),
name="new_layer3_1x1_out", kernel_initializer=tf.truncated_normal_initializer(stddev=0.01))
name="new_layer3_1x1_out", kernel_initializer=tf.truncated_normal_initializer(stddev=0.01),
activation='relu')

new_layer3_1x1_out_bn = tf.layers.batch_normalization(new_layer3_1x1_out,
name="new_layer3_1x1_upsampled_bn", training = is_training)
Expand All @@ -121,7 +127,8 @@ def layers(vgg_layer3_out, vgg_layer4_out, vgg_layer7_out, is_training, num_clas

new_final_layer_upsampled_4x = tf.layers.conv2d_transpose(out, filters=num_classes, kernel_size=(4, 4),
strides=(4, 4), name="new_final_layer_upsampled_4x",
kernel_initializer=tf.truncated_normal_initializer(stddev=0.01))
kernel_initializer=tf.truncated_normal_initializer(stddev=0.01),
activation='relu')

new_final_layer_upsampled_4x_bn = tf.layers.batch_normalization(new_final_layer_upsampled_4x,
name="new_final_layer_upsampled_4x_bn",
Expand Down

0 comments on commit cc5027d

Please sign in to comment.