vak.common.validators.is_strictly_increasing

vak.common.validators.is_strictly_increasing(boundary_times: FloatTensor, name: str | None = None) bool[source]

Validates that y is a torch.Tensor with 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_increasingTrue if torch.all(y[1:] > y[:-1]) is True.

Return type:

bool

Examples

>>> y = torch.tensor([0.0, 0.1, 0.,2])
>>> vak.metrics.boundary_detection.validators.is_non_negative(y)
True