Question: Applies input filter ( s ) to the input image. Args: image: Tensor of shape ( 1 , d 1 , h 1 , w
Applies input filters to the input image.
Args:
image: Tensor of shape d h w
kernel: Tensor of shape N dgroups k k to be applied to the image
Returns:
filteredimage: Tensor of shape d h w where
d N
hh k padding stride
ww k padding stride
HINTS:
You should use the d convolution operator from torch.nnfunctional.
In PyTorch, d is inchannels and d is outchannels
Make sure to pad the image appropriately its a parameter to the
convolution function you should use here!
You can assume the number of groups is equal to the number of input channels.
You can assume only square filters for this function.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
