Skip to content
Permalink
Browse files

remove lr_dropout for plaidml backend

  • Loading branch information
iperov committed Jan 8, 2020
1 parent d3e6b43 commit b8182ae42bb0d9db1e20c2e976063f460f7db465
Showing with 9 additions and 5 deletions.
  1. +3 −2 models/Model_Quick96/Model.py
  2. +6 −3 models/Model_SAEHD/Model.py
@@ -141,8 +141,9 @@ def get_model_filename_list(self, exclude_for_pretrain=False):
self.CA_conv_weights_list += [layer.weights[0]] #- is Conv2D kernel_weights

if self.is_training_mode:
self.src_dst_opt = RMSprop(lr=2e-4, lr_dropout=0.3)
self.src_dst_mask_opt = RMSprop(lr=2e-4, lr_dropout=0.3)
lr_dropout = 0.3 if nnlib.device.backend != 'plaidML' else 0.0
self.src_dst_opt = RMSprop(lr=2e-4, lr_dropout=lr_dropout)
self.src_dst_mask_opt = RMSprop(lr=2e-4, lr_dropout=lr_dropout)

target_src_masked = self.model.target_src*self.model.target_srcm
target_dst_masked = self.model.target_dst*self.model.target_dstm
@@ -65,9 +65,12 @@ def onInitializeOptions(self, is_first_run, ask_override):
default_bg_style_power = self.options.get('bg_style_power', 0.0)

if is_first_run or ask_override:
default_lr_dropout = self.options.get('lr_dropout', False)
self.options['lr_dropout'] = io.input_bool ( f"Use learning rate dropout? (y/n, ?:help skip:{yn_str[default_lr_dropout]} ) : ", default_lr_dropout, help_message="When the face is trained enough, you can enable this option to get extra sharpness for less amount of iterations.")

if nnlib.device.backend != 'plaidML':
default_lr_dropout = self.options.get('lr_dropout', False)
self.options['lr_dropout'] = io.input_bool ( f"Use learning rate dropout? (y/n, ?:help skip:{yn_str[default_lr_dropout]} ) : ", default_lr_dropout, help_message="When the face is trained enough, you can enable this option to get extra sharpness for less amount of iterations.")
else:
self.options['lr_dropout'] = False

default_random_warp = self.options.get('random_warp', True)
self.options['random_warp'] = io.input_bool (f"Enable random warp of samples? ( y/n, ?:help skip:{yn_str[default_random_warp]}) : ", default_random_warp, help_message="Random warp is required to generalize facial expressions of both faces. When the face is trained enough, you can disable it to get extra sharpness for less amount of iterations.")

0 comments on commit b8182ae

Please sign in to comment.
You can’t perform that action at this time.