The convolve function#

Aliases#

halerium.core.convolve
halerium.core.math.convolve
convolve(left, right, mode='same')#

Convolution along the last axis of the left operator. The right operator is the convolution kernel. The shapes of the left and right operator have to be compatible in the following way left.shape = (…, s_left) right.shape = (s_right,)

Parameters:
  • left – The array to be convolved. Can be of any dimensionality greater or equal to 1.

  • right – The convolution kernel. Has to be one-dimensional.

  • mode ("same" or "valid") – The padding method. Can be either “same” or “valid”. For “same” the last result axis will be of length s_res = max(s_left, s_right). For “valid” the last result axis will be of length s_res = max(s_left, s_right) - min(s_left, s_right) +1.

Returns:

operator – The convolution result. Will be of shape (…, s_res).

Return type:

halerium.core.operator.Conv1D