colour.kernel_linear#

colour.kernel_linear(x: ArrayLike) NDArrayFloat[source]#

Evaluate the linear kernel at specified samples.

The linear kernel is a triangular function that returns 1 when \(|x| < 0.5\) and 0 otherwise, providing a simple binary response based on the absolute value of the input.

Parameters:

x (ArrayLike) – Samples at which to evaluate the linear kernel.

Returns:

The linear kernel evaluated at specified samples, with values of 1 for \(|x| < 0.5\) and 0 otherwise.

Return type:

numpy.ndarray

References

[BB09]

Examples

>>> kernel_linear(np.linspace(0, 1, 10))
array([ 1.        ,  0.8888888...,  0.7777777...,  0.6666666...,  0.5555555...,
        0.4444444...,  0.3333333...,  0.2222222...,  0.1111111...,  0.        ])