Exemplo n.º 1
0
 def __init__(self,
              in_channels,
              out_channels,
              kernel_size,
              stride,
              upsample=None):
     super(UpsampleConvLayer, self).__init__()
     self.upsample = upsample
     if upsample:
         self.upsample_layer = nn.Upsample(mode='nearest',
                                           scale_factor=upsample)
     reflection_padding = kernel_size // 2
     self.reflection_pad = nn.ReflectionPad2d(reflection_padding)
     self.conv2d = nn.Conv2d(in_channels, out_channels, kernel_size,
                             stride)
Exemplo n.º 2
0
 def __init__(self):
     super().__init__()
     self.m = nn.ReflectionPad2d((2, 3, 0, 1))
Exemplo n.º 3
0
 def __init__(self, in_channels, out_channels, kernel_size, stride):
     super(ConvLayer, self).__init__()
     reflection_padding = kernel_size // 2
     self.reflection_pad = nn.ReflectionPad2d(reflection_padding)
     self.conv2d = nn.Conv2d(in_channels, out_channels, kernel_size,
                             stride)