From 28bc61bd7aa9f6bb2de1dccb96a4074b89eef946 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Thu, 12 Dec 2019 17:01:10 +0100 Subject: another experiment --- inversion/image_inversion_inception.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/inversion/image_inversion_inception.py b/inversion/image_inversion_inception.py index 92a472a..1b7b349 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.34 - img_feat_err = tf.reduce_mean(feat_square_diff, axis=1) * 0.34 + 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_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.34 + img_feat_err += tf.reduce_mean(feat_square_diff, axis=1) * 0.25 # 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) * 0.33 - 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) * 0.33 - img_feat_err += tf.reduce_mean(feat_square_diff, axis=1) + feat_loss += tf.reduce_mean(feat_square_diff) * 0.34 + img_feat_err += tf.reduce_mean(feat_square_diff, axis=1) * 0.25 else: feat_loss = tf.constant(0.0) -- cgit v1.2.3-70-g09d2