diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2019-12-12 15:54:58 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2019-12-12 15:54:58 +0100 |
| commit | 49f139e6c75d93c86f093eaa9314db3edc7d6c28 (patch) | |
| tree | 09e7b28836a3ea8197702a0a3feea5cea74c1b20 | |
| parent | 2eb43a487db9c6f7eee6db1fee0e61075a7c27ac (diff) | |
three mixed layers
| -rw-r--r-- | inversion/image_inversion_inception.py | 34 |
1 files changed, 17 insertions, 17 deletions
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) |
