def __init__(self, input_nc, ngf=64, n_layers=3, norm_layer=nn.BatchNorm2d, use_dropout=False):
    super(FeatureExtraction, self).__init__()
    downconv = nn.Conv2d(input_nc, ngf, kernel_size=4, stride=2, padding=1)
    model = [downconv, nn.ReLU(True), norm_layer(ngf)]
    for i in range(n_layers):
        in_ngf = (((2 ** i) * ngf) if (((2 ** i) * ngf) < 512) else 512)
        out_ngf = (((2 ** (i + 1)) * ngf) if (((2 ** i) * ngf) < 512) else 512)
        downconv = nn.Conv2d(in_ngf, out_ngf, kernel_size=4, stride=2, padding=1)
        model += [downconv, nn.ReLU(True)]
        model += [norm_layer(out_ngf)]
    model += [nn.Conv2d(512, 512, kernel_size=3, stride=1, padding=1), nn.ReLU(True)]
    model += [norm_layer(512)]
    model += [nn.Conv2d(512, 512, kernel_size=3, stride=1, padding=1), nn.ReLU(True)]
    self.model = nn.Sequential(*model)
    init_weights(self.model, init_type='normal')
def __init__(self, input_nc, ngf=64, n_layers=3, norm_layer=nn.BatchNorm2d, use_dropout=False):
    super(FeatureExtraction, self).__init__()
    downconv = nn.Conv2d(input_nc, ngf, kernel_size=4, stride=2, padding=1)
    model = [downconv, nn.ReLU(True), norm_layer(ngf)]
    for i in range(n_layers):
        in_ngf = (((2 ** i) * ngf) if (((2 ** i) * ngf) < 512) else 512)
        out_ngf = (((2 ** (i + 1)) * ngf) if (((2 ** i) * ngf) < 512) else 512)
        downconv = nn.Conv2d(in_ngf, out_ngf, kernel_size=4, stride=2, padding=1)
        model += [downconv, nn.ReLU(True)]
        model += [norm_layer(out_ngf)]
    model += [nn.Conv2d(512, 512, kernel_size=3, stride=1, padding=1), nn.ReLU(True)]
    model += [norm_layer(512)]
    model += [nn.Conv2d(512, 512, kernel_size=3, stride=1, padding=1), nn.ReLU(True)]
    self.model = nn.Sequential(*model)
    init_weights(self.model, init_type='normal')