upd nnlib.py

This commit is contained in:
iperov 2019-02-12 09:30:38 +04:00
parent e9313e29f6
commit 429e7e6aee
2 changed files with 3 additions and 3 deletions

View file

@ -317,7 +317,7 @@ class SAEModel(ModelBase):
# x = np.array (self.src_sample_losses)
# self.src_sample_losses = []
# 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
#
#
@ -326,7 +326,7 @@ class SAEModel(ModelBase):
# x = np.array (self.dst_sample_losses)
# self.dst_sample_losses = []
# 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
if self.options['learn_mask']:

View file

@ -463,7 +463,7 @@ NLayerDiscriminator = nnlib.NLayerDiscriminator
mask = self.mask
if self.is_mse:
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:
return (1.0 - (tf.image.ssim (y_true*mask, y_pred*mask, 1.0))) / 2.0
nnlib.DSSIMMSEMaskLoss = DSSIMMSEMaskLoss