diff --git a/training/coqui_stt_training/util/helpers.py b/training/coqui_stt_training/util/helpers.py index 71749a74..c8aa788a 100644 --- a/training/coqui_stt_training/util/helpers.py +++ b/training/coqui_stt_training/util/helpers.py @@ -255,16 +255,14 @@ def tf_pick_value_from_range(value_range, clock=None, double_precision=False): tf.minimum(tf.constant(1.0, dtype=tf.float64), clock), ) value = value_range.start + clock * (value_range.end - value_range.start) - if value_range.r: - # if the option (~, randomization radius) is supplied, - # sample the value from a uniform distribution with "radius" - value = tf.random.stateless_uniform( - [], - minval=value - value_range.r, - maxval=value + value_range.r, - seed=(clock * tf.int32.min, clock * tf.int32.max), - dtype=tf.float64, - ) + # sample the value from a uniform distribution with "radius" + value = tf.random.stateless_uniform( + [], + minval=value - value_range.r, + maxval=value + value_range.r, + seed=(clock * tf.int32.min, clock * tf.int32.max), + dtype=tf.float64, + ) if isinstance(value_range.start, int): return tf.cast(tf.math.round(value), tf.int64 if double_precision else tf.int32) return tf.cast(value, tf.float64 if double_precision else tf.float32)