diff --git a/models/Model_SAE/Model.py b/models/Model_SAE/Model.py index 752bb33..14fba1a 100644 --- a/models/Model_SAE/Model.py +++ b/models/Model_SAE/Model.py @@ -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']: diff --git a/nnlib/nnlib.py b/nnlib/nnlib.py index 76ec058..9920434 100644 --- a/nnlib/nnlib.py +++ b/nnlib/nnlib.py @@ -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