baybe.parameters.utils.is_inactive¶
- baybe.parameters.utils.is_inactive(x: _Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str], /, lower_threshold: _Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str], upper_threshold: _Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str])[source]¶
Check if the given values are inactive (i.e. can be treated as zero).
A value is considered inactive when at least one of the following is true: * The value lies in the open interval specified by the given thresholds. * The value is zero.
- Parameters:
x¶ (
Union[_Buffer,_SupportsArray[dtype[Any]],_NestedSequence[_SupportsArray[dtype[Any]]],complex,bytes,str,_NestedSequence[complex|bytes|str]]) – An array-like object containing numeric values.lower_threshold¶ (
Union[_Buffer,_SupportsArray[dtype[Any]],_NestedSequence[_SupportsArray[dtype[Any]]],complex,bytes,str,_NestedSequence[complex|bytes|str]]) – The (broadcastable) lower thresholds of the inactive regions.upper_threshold¶ (
Union[_Buffer,_SupportsArray[dtype[Any]],_NestedSequence[_SupportsArray[dtype[Any]]],complex,bytes,str,_NestedSequence[complex|bytes|str]]) – The (broadcastable) upper thresholds of the inactive regions.
- Return type:
- Returns:
A Boolean-valued numpy array indicating which elements are inactive.