From 49f139e6c75d93c86f093eaa9314db3edc7d6c28 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Thu, 12 Dec 2019 15:54:58 +0100 Subject: three mixed layers --- inversion/image_inversion_inception.py | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'inversion/image_inversion_inception.py') diff --git a/inversion/image_inversion_inception.py b/inversion/image_inversion_inception.py index 7cadfe6..c4eb5b5 100644 --- a/inversion/image_inversion_inception.py +++ b/inversion/image_inversion_inception.py @@ -223,14 +223,14 @@ if params.features: gen_feat = gen_feat_ex["InceptionV3/Mixed_7a"] target_feat = target_feat_ex["InceptionV3/Mixed_7a"] feat_square_diff = tf.reshape(tf.square(gen_feat - target_feat), [BATCH_SIZE, -1]) - feat_loss = tf.reduce_mean(feat_square_diff) * 0.5 - img_feat_err = tf.reduce_mean(feat_square_diff, axis=1) * 0.5 + feat_loss = tf.reduce_mean(feat_square_diff) * 0.34 + img_feat_err = tf.reduce_mean(feat_square_diff, axis=1) * 0.34 - gen_feat = gen_feat_ex["InceptionV3/Mixed_6a"] - target_feat = target_feat_ex["InceptionV3/Mixed_6a"] - feat_square_diff = tf.reshape(tf.square(gen_feat - target_feat), [BATCH_SIZE, -1]) - feat_loss += tf.reduce_mean(feat_square_diff) * 0.5 - img_feat_err += tf.reduce_mean(feat_square_diff, axis=1) * 0.5 + # gen_feat = gen_feat_ex["InceptionV3/Mixed_6a"] + # target_feat = target_feat_ex["InceptionV3/Mixed_6a"] + # feat_square_diff = tf.reshape(tf.square(gen_feat - target_feat), [BATCH_SIZE, -1]) + # feat_loss += tf.reduce_mean(feat_square_diff) * 0.5 + # img_feat_err += tf.reduce_mean(feat_square_diff, axis=1) * 0.5 # gen_feat = gen_feat_ex["InceptionV3/Mixed_5a"] # target_feat = target_feat_ex["InceptionV3/Mixed_5a"] @@ -238,17 +238,17 @@ if params.features: # feat_loss += tf.reduce_mean(feat_square_diff) # img_feat_err += tf.reduce_mean(feat_square_diff, axis=1) - # gen_feat = gen_feat_ex["InceptionV3/Mixed_7b"] - # target_feat = target_feat_ex["InceptionV3/Mixed_7b"] - # feat_square_diff = tf.reshape(tf.square(gen_feat - target_feat), [BATCH_SIZE, -1]) - # feat_loss += tf.reduce_mean(feat_square_diff) - # img_feat_err += tf.reduce_mean(feat_square_diff, axis=1) + gen_feat = gen_feat_ex["InceptionV3/Mixed_7b"] + target_feat = target_feat_ex["InceptionV3/Mixed_7b"] + feat_square_diff = tf.reshape(tf.square(gen_feat - target_feat), [BATCH_SIZE, -1]) + feat_loss += tf.reduce_mean(feat_square_diff) * 0.33 + img_feat_err += tf.reduce_mean(feat_square_diff, axis=1) - # gen_feat = gen_feat_ex["InceptionV3/Mixed_7c"] - # target_feat = target_feat_ex["InceptionV3/Mixed_7c"] - # feat_square_diff = tf.reshape(tf.square(gen_feat - target_feat), [BATCH_SIZE, -1]) - # feat_loss += tf.reduce_mean(feat_square_diff) - # img_feat_err += tf.reduce_mean(feat_square_diff, axis=1) + gen_feat = gen_feat_ex["InceptionV3/Mixed_7c"] + target_feat = target_feat_ex["InceptionV3/Mixed_7c"] + feat_square_diff = tf.reshape(tf.square(gen_feat - target_feat), [BATCH_SIZE, -1]) + feat_loss += tf.reduce_mean(feat_square_diff) * 0.33 + img_feat_err += tf.reduce_mean(feat_square_diff, axis=1) else: feat_loss = tf.constant(0.0) -- cgit v1.2.3-70-g09d2