vak.common.validators.is_strictly_increasing¶
- vak.common.validators.is_strictly_increasing(boundary_times: FloatTensor, name: str | None = None) bool[source]¶
Validates that
yis atorch.Tensorwith strictly increasing values.- Parameters:
y (torch.Tensor) – Array to be validated.
name (str, optional) – Name of array in calling function. Used in any error message if supplied.
- Returns:
is_strictly_increasing –
Trueiftorch.all(y[1:] > y[:-1])isTrue.- Return type:
Examples
>>> y = torch.tensor([0.0, 0.1, 0.,2]) >>> vak.metrics.boundary_detection.validators.is_non_negative(y) True