mirror of
https://github.com/iperov/DeepFaceLab.git
synced 2025-08-19 21:13:20 -07:00
fix avatar multigpu mode
This commit is contained in:
parent
adc1e701de
commit
58d9b4ae09
2 changed files with 37 additions and 29 deletions
|
@ -43,6 +43,19 @@ def DSSIMMaskLossClass(tf):
|
|||
return total_loss
|
||||
|
||||
return DSSIMMaskLoss
|
||||
|
||||
def DSSIMLossClass(tf):
|
||||
class DSSIMLoss(object):
|
||||
def __init__(self, is_tanh=False):
|
||||
self.is_tanh = is_tanh
|
||||
|
||||
def __call__(self,y_true, y_pred):
|
||||
if not self.is_tanh:
|
||||
return (1.0 - tf.image.ssim (y_true, y_pred, 1.0)) / 2.0
|
||||
else:
|
||||
return (1.0 - tf.image.ssim ((y_true/2+0.5), (y_pred/2+0.5), 1.0)) / 2.0
|
||||
|
||||
return DSSIMLoss
|
||||
|
||||
def MSEMaskLossClass(keras):
|
||||
class MSEMaskLoss(object):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue