Fix issue with precision on pseudo_huber loss
This commit is contained in:
@@ -782,7 +782,7 @@ class SDTrainer(BaseSDTrainProcess):
|
|||||||
target = batch.latents.detach()
|
target = batch.latents.detach()
|
||||||
pred = t0
|
pred = t0
|
||||||
if self.train_config.loss_type == "pseudo_huber":
|
if self.train_config.loss_type == "pseudo_huber":
|
||||||
diff = pred - target
|
diff = pred.float() - target.float()
|
||||||
c=0.0
|
c=0.0
|
||||||
loss =(torch.sqrt(diff.pow(2) + c ** 2) - c)
|
loss =(torch.sqrt(diff.pow(2) + c ** 2) - c)
|
||||||
elif self.train_config.loss_type == "mae":
|
elif self.train_config.loss_type == "mae":
|
||||||
|
|||||||
Reference in New Issue
Block a user