GANs/CycleGAN_Zhu_et_al_2017/model.py
def Rk(self, in_size, out_size):
        """Res block with two 3x3 convs with same number of filters on both."""
        layer = [nn.Conv2d(in_size, out_size,
                           kernel_size=3, stride=1, padding=1,
                           padding_mode='reflect',  bias=False),
                 nn.InstanceNorm2d(num_features=out_size, affine=True),
                 nn.ReLU(inplace=True),
                 nn.Conv2d(out_size, out_size,
                           kernel_size=3, stride=1, padding=1,
                           padding_mode='reflect',  bias=False),
                 nn.InstanceNorm2d(num_features=out_size, affine=True),
                 nn.ReLU(inplace=True)]

        return nn.Sequential(*layer)
Res block with two 3x3 convs with same number of filters on both.
Res block with two 3x3 convs with same number of filters on both.
Res block with two 3x3 convs with same number of filters on both .
def Rk(self, in_size, out_size):
        layer = [nn.Conv2d(in_size, out_size,
                           kernel_size=3, stride=1, padding=1,
                           padding_mode='reflect',  bias=False),
                 nn.InstanceNorm2d(num_features=out_size, affine=True),
                 nn.ReLU(inplace=True),
                 nn.Conv2d(out_size, out_size,
                           kernel_size=3, stride=1, padding=1,
                           padding_mode='reflect',  bias=False),
                 nn.InstanceNorm2d(num_features=out_size, affine=True),
                 nn.ReLU(inplace=True)]
        return nn.Sequential(*layer)
def Rk ( self , in_size , out_size ) : layer = [ nn . Conv2d ( in_size , out_size , kernel_size = 3 , stride = 1 , padding = 1 , padding_mode = 'reflect' , bias = False ) , nn . InstanceNorm2d ( num_features = out_size , affine = True ) , nn . ReLU ( inplace = True ) , nn . Conv2d ( out_size , out_size , kernel_size = 3 , stride = 1 , padding = 1 , padding_mode = 'reflect' , bias = False ) , nn . InstanceNorm2d ( num_features = out_size , affine = True ) , nn . ReLU ( inplace = True ) ] return nn . Sequential ( * layer )
Res block with two 3x3 convs with same number of filters on both.
Res block with two 3x3 convs with same number of filters on both .
"""Res block with two 3x3 convs with same number of filters on both."""
self
in_size
out_size