mirror of
https://github.com/iperov/DeepFaceLab.git
synced 2025-07-07 21:42:08 -07:00
upd nnlib.py
This commit is contained in:
parent
e9313e29f6
commit
429e7e6aee
2 changed files with 3 additions and 3 deletions
|
@ -317,7 +317,7 @@ class SAEModel(ModelBase):
|
||||||
# x = np.array (self.src_sample_losses)
|
# x = np.array (self.src_sample_losses)
|
||||||
# self.src_sample_losses = []
|
# self.src_sample_losses = []
|
||||||
# b = x[:,1]
|
# b = x[:,1]
|
||||||
# idxs = (x[:,0][ np.argwhere ( b [ b > np.mean(b) ] )[:,0] ]).astype(np.uint)
|
# idxs = (x[:,0][ np.argwhere ( b [ b > (np.mean(b)+np.std(b)) ] )[:,0] ]).astype(np.uint)
|
||||||
# generators_list[0].repeat_sample_idxs(idxs) #ask generator to repeat these sample idxs
|
# generators_list[0].repeat_sample_idxs(idxs) #ask generator to repeat these sample idxs
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
@ -326,7 +326,7 @@ class SAEModel(ModelBase):
|
||||||
# x = np.array (self.dst_sample_losses)
|
# x = np.array (self.dst_sample_losses)
|
||||||
# self.dst_sample_losses = []
|
# self.dst_sample_losses = []
|
||||||
# b = x[:,1]
|
# b = x[:,1]
|
||||||
# idxs = (x[:,0][ np.argwhere ( b [ b > np.mean(b) ] )[:,0] ]).astype(np.uint)
|
# idxs = (x[:,0][ np.argwhere ( b [ b > (np.mean(b)+np.std(b)) ] )[:,0] ]).astype(np.uint)
|
||||||
# generators_list[1].repeat_sample_idxs(idxs) #ask generator to repeat these sample idxs
|
# generators_list[1].repeat_sample_idxs(idxs) #ask generator to repeat these sample idxs
|
||||||
|
|
||||||
if self.options['learn_mask']:
|
if self.options['learn_mask']:
|
||||||
|
|
|
@ -463,7 +463,7 @@ NLayerDiscriminator = nnlib.NLayerDiscriminator
|
||||||
mask = self.mask
|
mask = self.mask
|
||||||
if self.is_mse:
|
if self.is_mse:
|
||||||
blur_mask = tf_gaussian_blur(max(1, mask.get_shape().as_list()[1] // 32))(mask)
|
blur_mask = tf_gaussian_blur(max(1, mask.get_shape().as_list()[1] // 32))(mask)
|
||||||
return K.mean ( 10*K.square( y_true*blur_mask - y_pred*blur_mask ) )
|
return K.mean ( 100*K.square( y_true*blur_mask - y_pred*blur_mask ) )
|
||||||
else:
|
else:
|
||||||
return (1.0 - (tf.image.ssim (y_true*mask, y_pred*mask, 1.0))) / 2.0
|
return (1.0 - (tf.image.ssim (y_true*mask, y_pred*mask, 1.0))) / 2.0
|
||||||
nnlib.DSSIMMSEMaskLoss = DSSIMMSEMaskLoss
|
nnlib.DSSIMMSEMaskLoss = DSSIMMSEMaskLoss
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue