I want to apply gaussian filter on output of the network for smoothing purpose.
Is there a function for that?
1 Like
You could use the functional API with your custom weights:
# Create gaussian kernels
kernel = Variable(torch.FloatTensor([[[0.006, 0.061, 0.242, 0.383, 0.242, 0.061, 0.006]]]))
# Create input
x = Variable(torch.randn(1, 1, 100))
# Apply smoothing
x_smooth = F.conv1d(x, kernel)
9 Likes