Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
sudnya committed Apr 9, 2017
2 parents 538764a + a214201 commit dc0dad3
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions network.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def init_inference(self, config):
stride = layer['stride']
bn = layer.get('enable_batch_norm', None)
ln = layer.get('enable_layer_norm', None)

if bn is not None or ln is not None:
acts = tf.contrib.layers.convolution2d(acts, num_outputs=num_filters,
kernel_size=[filter_size, 1],
Expand All @@ -43,16 +43,16 @@ def init_inference(self, config):

if bn == True:
logger.debug("Adding Batch Norm Layer")
acts = tf.contrib.layers.batch_norm(acts, decay=0.9, center=True,
scale=True, epsilon=1e-8,
activation_fn=tf.nn.relu,
acts = tf.contrib.layers.batch_norm(acts, decay=0.9, center=True,
scale=True, epsilon=1e-8,
activation_fn=tf.nn.relu,
is_training=True)

elif ln == True:
logger.debug("Adding Layer Norm Layer")
acts = tf.contrib.layers.layer_norm(acts, center=True,
scale=True,
activation_fn=tf.nn.relu)
acts = tf.contrib.layers.layer_norm(acts, center=True,
scale=True,
activation_fn=tf.nn.relu)
else:
assert True, "Batch or Layer norm must be specified as True"
else:
Expand Down

0 comments on commit dc0dad3

Please sign in to comment.