Skip to content

Commit

Permalink
[losses] Fix MILoss to allow sample ratio of 1
Browse files Browse the repository at this point in the history
  • Loading branch information
aschuh-hf committed Jan 12, 2024
1 parent 53b90ea commit 0be4ae5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/deepali/losses/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,9 +272,9 @@ def __init__(
raise ValueError(
f"{type(self).__name__}() 'num_samples' must be positive integral value"
)
if sample_ratio is not None and (sample_ratio <= 0 or sample_ratio >= 1):
if sample_ratio is not None and (sample_ratio <= 0 or sample_ratio > 1):
raise ValueError(
f"{type(self).__name__}() 'sample_ratio' must be in closed interval [0, 1]"
f"{type(self).__name__}() 'sample_ratio' must be in open-closed interval (0, 1]"
)

super().__init__()
Expand Down

0 comments on commit 0be4ae5

Please sign in to comment.