Skip to content

Commit

Permalink
linter loss.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Franck Mamalet committed Oct 9, 2024
1 parent fbedaac commit f4c38c2
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions deel/torchlip/modules/loss.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
# rights reserved. DEEL is a research program operated by IVADO, IRT Saint Exupéry,
# CRIAQ and ANITI - https://www.deel.ai/
# =====================================================================================
from typing import Tuple
import warnings
import torch
from .. import functional as F
Expand Down Expand Up @@ -110,7 +109,8 @@ def __init__(
self.alpha = alpha
else:
warnings.warn(
f"Depreciated alpha should be between 0 and 1 replaced by {alpha/(alpha+1.0)}"
f"Depreciated alpha should be between 0 and 1 replaced by \
{alpha/(alpha+1.0)}"
)
self.alpha = alpha / (alpha + 1.0)
self.min_margin = min_margin
Expand Down Expand Up @@ -171,7 +171,8 @@ def __init__(
self.alpha = alpha
else:
warnings.warn(
f"Depreciated alpha should be between 0 and 1 replaced by {alpha/(alpha+1.0)}"
f"Depreciated alpha should be between 0 and 1 replaced by \
{alpha/(alpha+1.0)}"
)
self.alpha = alpha / (alpha + 1.0)
self.min_margin = min_margin
Expand Down Expand Up @@ -212,7 +213,8 @@ def __init__(
self.alpha = torch.tensor(alpha, dtype=torch.float32)
else:
warnings.warn(
f"Depreciated alpha should be between 0 and 1 replaced by {alpha/(alpha+1.0)}"
f"Depreciated alpha should be between 0 and 1 replaced by \
{alpha/(alpha+1.0)}"
)
self.alpha = torch.tensor(alpha / (alpha + 1.0), dtype=torch.float32)
self.min_margin_v = min_margin
Expand Down

0 comments on commit f4c38c2

Please sign in to comment.