Ok so I create a class and within the init I define some conv blocks (which are also classes). For example:
class WienerFilter(nn.Module):
def __init__(self):
super(WienerFilter, self).__init__()
self.relu = nn.ReLU()
self.relu2 = nn.LeakyReLU()
self.bn = nn.BatchNorm2d(1)
self.coringa = ConvBlock(2, 1, kernel_size=1, padding=0, with_bn=False)
def forward(self, I, noise_std, block_size):
example = self.coring(I)
return example
If in another class I do:
class test(nn.module):
def __init__(self):
self.wiener_filter = WienerFilter()
def forward(self, input_image, std):
WINDOW_SIZE = 16
filteringa = self.wiener_filter(t_map, std, WINDOW_SIZE)
WINDOW_SIZE = 16
filteringb = self.wiener_filter(t_map, std, WINDOW_SIZE)
# WINDOW_SIZE = 32
# filteringc = self.wiener_filter(t_map, std, WINDOW_SIZE)
My question is, will ‘coringa’ be considered a new filter/convolution or will the same filter be used in each of the 3 calls of the function.