jax.scipy.signal.correlate2d

Contents

jax.scipy.signal.correlate2d#

jax.scipy.signal.correlate2d(in1, in2, mode='full', boundary='fill', fillvalue=0, precision=None)[source]#

Cross-correlation of two 2-dimensional arrays.

JAX implementation of jax.scipy.signal.correlate2d().

Parameters:
  • in1 (Array) – left-hand input to the cross-correlation. Must have in1.ndim == 2.

  • in2 (Array) – right-hand input to the cross-correlation. Must have in2.ndim == 2.

  • mode (str) –

    controls the size of the output. Available operations are:

    • "full": (default) output the full cross-correlation of the inputs.

    • "same": return a centered portion of the "full" output which is the same size as in1.

    • "valid": return the portion of the "full" output which do not depend on padding at the array edges.

  • boundary (str) – only "fill" is supported.

  • fillvalue (float) – only 0 is supported.

  • method –

    controls the computation method. Options are

    • "auto": (default) always uses the "direct" method.

    • "direct": lower to jax.lax.conv_general_dilated().

    • "fft": compute the result via a fast Fourier transform.

  • precision (str | Precision | tuple[str, str] | tuple[Precision, Precision] | None) – Specify the precision of the computation. Refer to jax.lax.Precision for a description of available values.

Returns:

Array containing the cross-correlation result.

Return type:

Array

See also