Skip to content

Commit

Permalink
Get rid of subtractive norm.
Browse files Browse the repository at this point in the history
  • Loading branch information
etrulls committed Apr 30, 2018
1 parent 7168ea6 commit 5530e47
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions modules/lift_desc.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ def process(inputs, bypass, name, skip, config, is_training):
image_summary_nhwc(name + "-input", inputs)

# Import the lift_desc_sub_kernel.h5 to get the kernel file
script_dir = os.path.dirname(os.path.realpath(__file__))
sub_kernel = loadh5(script_dir + "/lift_desc_sub_kernel.h5")["kernel"]
# script_dir = os.path.dirname(os.path.realpath(__file__))
# sub_kernel = loadh5(script_dir + "/lift_desc_sub_kernel.h5")["kernel"]

# activation
if config.desc_activ == "tanh":
Expand Down Expand Up @@ -100,17 +100,17 @@ def pool(cur_in, desc_pool, ksize):
cur_in = batch_norm(cur_in, training=is_training)
cur_in = activ(cur_in)
cur_in = pool(cur_in, config.desc_pool, 2)
if config.use_subtractive_norm:
cur_in = norm_spatial_subtractive(cur_in, sub_kernel)
# if config.use_subtractive_norm:
# cur_in = norm_spatial_subtractive(cur_in, sub_kernel)

with tf.variable_scope("conv-act-pool-norm-2"):
cur_in = conv_2d(cur_in, 6, 64, 1, "VALID")
if config.use_batch_norm:
cur_in = batch_norm(cur_in, training=is_training)
cur_in = activ(cur_in)
cur_in = pool(cur_in, config.desc_pool, 3)
if config.use_subtractive_norm:
cur_in = norm_spatial_subtractive(cur_in, sub_kernel)
# if config.use_subtractive_norm:
# cur_in = norm_spatial_subtractive(cur_in, sub_kernel)

with tf.variable_scope("conv-act-pool-3"):
cur_in = conv_2d(cur_in, 5, 128, 1, "VALID")
Expand Down

0 comments on commit 5530e47

Please sign in to comment.