conv_filter_transpose2d#

deepinv.physics.functional.conv_filter_transpose2d(x, y, filter_size, padding='circular', correlation=False)[source]#

Apply the adjoint of 2D convolution with respect to its filter.

Unlike torch.nn.functional.conv_transpose2d(), which applies the adjoint with respect to the input image, this function applies the adjoint with respect to the filter, treating x as fixed and mapping an adjoint output y back to filter space. Although this result can be obtained with conv_transpose2d followed by cropping, computing only the requested filter support directly is more efficient.

Parameters:
  • x (torch.Tensor) – Input tensor of shape (B, C, H, W).

  • y (torch.Tensor) – Adjoint input. Its spatial shape must match the output of deepinv.physics.functional.conv2d() applied to x.

  • filter_size (tuple[int, int]) – Filter size (H_f, W_f).

  • padding (str) – One of "valid", "circular", "replicate", "reflect", "constant" or "zeros".

  • correlation (bool) – If True, return the filter adjoint of cross-correlation rather than convolution.

Returns:

Per-channel filter adjoint of shape (B, C, H_f, W_f).

Return type:

Tensor