clip_small_non_zero#
- caf.toolkit.math_utils.clip_small_non_zero(array, min_val)[source]#
Clip all small, non-zero values in an array up to a minimal value.
Any 0 values will be left as is, and only the values less than min_val, and greater than 0 will be changed to min_val.
- Parameters:
array (ndarray) – The array to clip
min_val (float) – The minimum non-zero value to allow in array.
- Returns:
array, with all non-zero values clipped to min_val.
- Return type:
clipped_array