Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Commit

Permalink
Fix training rates
Browse files Browse the repository at this point in the history
  • Loading branch information
MarvinTeichmann committed Jun 6, 2016
1 parent d1b0bba commit c535a75
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
9 changes: 7 additions & 2 deletions fcn16_vgg.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ def build(self, rgb, train=False, num_classes=20, random_init_fc8=False,

self.conv5_1 = self._conv_layer(self.pool4, "conv5_1")
self.conv5_2 = self._conv_layer(self.conv5_1, "conv5_2")

self.conv5_3 = self._conv_layer(self.conv5_2, "conv5_3")
self.pool5 = self._max_pool(self.conv5_3, 'pool5', debug)

Expand Down Expand Up @@ -182,8 +183,11 @@ def _score_layer(self, bottom, name, num_classes):
in_features = bottom.get_shape()[3].value
shape = [1, 1, in_features, num_classes]
# He initialization Sheme
num_input = in_features
stddev = (2 / num_input)**0.5
if name == "score_fr":
num_input = in_features
stddev = (2 / num_input)**0.5
elif name == "score_pool4":
stddev = 0.001
# Apply convolution
w_decay = self.wd
weights = self._variable_with_weight_decay(shape, stddev, w_decay)
Expand Down Expand Up @@ -225,6 +229,7 @@ def _upscore_layer(self, bottom, shape,
deconv = tf.nn.conv2d_transpose(bottom, weights, output_shape,
strides=strides, padding='SAME')

deconv.set_shape([None, None, None, 2])
if debug:
deconv = tf.Print(deconv, [tf.shape(deconv)],
message='Shape of %s' % name,
Expand Down
9 changes: 7 additions & 2 deletions fcn8_vgg.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,13 @@ def _score_layer(self, bottom, name, num_classes):
in_features = bottom.get_shape()[3].value
shape = [1, 1, in_features, num_classes]
# He initialization Sheme
num_input = in_features
stddev = (2 / num_input)**0.5
if name == "score_fr":
num_input = in_features
stddev = (2 / num_input)**0.5
elif name == "score_pool4":
stddev = 0.001
elif name == "score_pool3":
stddev = 0.0001
# Apply convolution
w_decay = self.wd
weights = self._variable_with_weight_decay(shape, stddev, w_decay)
Expand Down

0 comments on commit c535a75

Please sign in to comment.