conv2d#
- deepinv.physics.functional.conv2d(x, filter, padding='valid', correlation=False)[source]#
A helper function performing the 2d convolution of images
xandfilter.The adjoint of this operation is
deepinv.physics.functional.conv_transpose2d()- Parameters:
x (torch.Tensor) – Image of size
(B, C, W, H).filter (torch.Tensor) – Filter of size
(b, c, w, h)wherebcan be either1orBandccan be either1orC. Filter center is at(hh, ww)wherehh = h//2if h is odd andhh = h//2 - 1if h is even. Same forww.correlation (bool) – choose True if you want a cross-correlation (default False)
If
b = 1orc = 1, then this function supports broadcasting as the same as numpy. Otherwise, each channel of each image is convolved with the corresponding kernel.- Parameters:
padding (str) – (options =
valid,circular,replicate,reflect,constant) Ifpadding = 'valid'the output is smaller than the image (no padding), otherwise the output has the same size as the image.constantcorresponds to zero padding orsameintorch.nn.functional.conv2d()- Returns:
(
torch.Tensor) : the output- Return type: