From 0be4ae5bed0134056e61ff72bc2664b7b661e753 Mon Sep 17 00:00:00 2001 From: Andreas Schuh <77496589+aschuh-hf@users.noreply.github.com> Date: Fri, 12 Jan 2024 08:47:11 +0000 Subject: [PATCH] [losses] Fix MILoss to allow sample ratio of 1 --- src/deepali/losses/image.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/deepali/losses/image.py b/src/deepali/losses/image.py index e0576c8..85cdb6b 100644 --- a/src/deepali/losses/image.py +++ b/src/deepali/losses/image.py @@ -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__()