megengine.functional.nn.correlation

correlation(data1, data2, kernel_size=1, max_displacement=1, stride1=1, stride2=1, pad_size=0, is_multiply=True)[source]

Applies correlation to inputs.

Parameters
  • data1 (Tensor) – Input data1 to the correlation. format must be nchw

  • data2 (Tensor) – Input data2 to the correlation. format must be nchw

  • kernel_size (int) – int (non-negative), optional, default=1) – kernel size for Correlation must be an odd number

  • max_displacement (int) – int (non-negative), optional, default=1) – Max displacement of Correlation

  • stride1 (int) – int (non-negative), optional, default=1) – stride1 quantize data1 globally

  • stride2 (int) – int (non-negative), optional, default=1) – stride2 quantize data2 within the neighborhood centered around data1

  • pad_size (int) – int (non-negative), optional, default=0) – pad for Correlation

  • is_multiply (bool) – boolean, optional, default=True) – operation type is either multiplication or absolute difference

Return type

Tensor