2
0
mirror of https://github.com/Shawn-Shan/fawkes.git synced 2024-12-22 07:09:33 +05:30

minor fix

This commit is contained in:
Shawn-Shan 2021-05-22 10:14:36 -05:00
parent 386292bafc
commit 600fb82568

View File

@ -191,7 +191,8 @@ class FawkesMaskGeneration:
simg_tanh = self.preprocess_arctanh(source_imgs) simg_tanh = self.preprocess_arctanh(source_imgs)
if target_imgs is not None: if target_imgs is not None:
timg_tanh = self.preprocess_arctanh(target_imgs) timg_tanh = self.preprocess_arctanh(target_imgs)
self.modifier = tf.Variable(np.ones(tuple([len(source_imgs)] + self.single_shape), dtype=np.float32) * 1e-4) self.modifier = tf.Variable(np.random.uniform(-1, 1, tuple([len(source_imgs)] + self.single_shape)) * 1e-4,
dtype=tf.float32)
# make the optimizer # make the optimizer
optimizer = tf.keras.optimizers.Adadelta(float(self.learning_rate)) optimizer = tf.keras.optimizers.Adadelta(float(self.learning_rate))