from torch import nn


def get_fc_discriminator(num_classes, ndf=64):
    return nn.Sequential(
        nn.Conv2d(num_classes, ndf, kernel_size=4, stride=2, padding=1),
        nn.LeakyReLU(negative_slope=0.2, inplace=True),
        nn.Conv2d(ndf, ndf * 2, kernel_size=4, stride=2, padding=1),
        nn.LeakyReLU(negative_slope=0.2, inplace=True),
        nn.Conv2d(ndf * 2, ndf * 4, kernel_size=4, stride=2, padding=1),
        nn.LeakyReLU(negative_slope=0.2, inplace=True),
        nn.Conv2d(ndf * 4, ndf * 8, kernel_size=4, stride=2, padding=1),
        nn.LeakyReLU(negative_slope=0.2, inplace=True),
        nn.Conv2d(ndf * 8, 1, kernel_size=4, stride=2, padding=1),
    )


# def get_fe_discriminator(num_classes, ndf=64): # 256-128-64-32-16
#     return nn.Sequential(
#         nn.Conv2d(num_classes, ndf * 4, kernel_size=4, stride=2, padding=1),
#         nn.LeakyReLU(negative_slope=0.2, inplace=True),
#         nn.Conv2d(ndf * 4, ndf * 2, kernel_size=4, stride=2, padding=1),
#         nn.LeakyReLU(negative_slope=0.2, inplace=True),
#         nn.Conv2d(ndf * 2, ndf, kernel_size=2, stride=2, padding=0),
#         nn.LeakyReLU(negative_slope=0.2, inplace=True),
#         # nn.Conv2d(ndf * 4, ndf * 8, kernel_size=4, stride=2, padding=1),
#         # nn.LeakyReLU(negative_slope=0.2, inplace=True),
#         nn.Conv2d(ndf, 1, kernel_size=2, stride=2, padding=0),
#     )

# def get_fe_discriminator(num_classes, ndf=64):
#     return nn.Sequential(
#         nn.Conv2d(num_classes, ndf, kernel_size=4, stride=2, padding=1),
#         nn.LeakyReLU(negative_slope=0.2, inplace=True),
#         nn.Conv2d(ndf, ndf * 2, kernel_size=4, stride=2, padding=1),
#         nn.LeakyReLU(negative_slope=0.2, inplace=True),
#         nn.Conv2d(ndf * 2, ndf * 4, kernel_size=4, stride=2, padding=1),
#         nn.LeakyReLU(negative_slope=0.2, inplace=True),
#         # nn.Conv2d(ndf * 4, ndf * 8, kernel_size=4, stride=2, padding=1),
#         # nn.LeakyReLU(negative_slope=0.2, inplace=True),
#         nn.Conv2d(ndf * 4, 1, kernel_size=1, stride=1, padding=0),
#     )

def get_fe_discriminator(num_classes, ndf=64):  # H/8,H/8,(1024 -> 256 -> 128 -> 64  -> 1)
    return nn.Sequential(
        nn.Conv2d(num_classes, ndf * 4, kernel_size=1, stride=1, padding=0),
        # x=self.dropout(x)
        nn.LeakyReLU(negative_slope=0.2, inplace=True),
        nn.Conv2d(ndf * 4, ndf * 2, kernel_size=1, stride=1, padding=0),
        # x=self.dropout(x)
        nn.LeakyReLU(negative_slope=0.2, inplace=True),
        nn.Conv2d(ndf * 2, ndf, kernel_size=1, stride=1, padding=0),
        # x=self.dropout(x)
        nn.LeakyReLU(negative_slope=0.2, inplace=True),
        # nn.Conv2d(ndf * 4, ndf * 8, kernel_size=4, stride=2, padding=1),
        # nn.LeakyReLU(negative_slope=0.2, inplace=True),
        nn.Conv2d(ndf, 1, kernel_size=1, stride=1, padding=0),
    )
[((6, 8, 6, 71), 'torch.nn.Conv2d', 'nn.Conv2d', (), '', False, 'from torch import nn\n'), ((7, 8, 7, 54), 'torch.nn.LeakyReLU', 'nn.LeakyReLU', (), '', False, 'from torch import nn\n'), ((8, 8, 8, 67), 'torch.nn.Conv2d', 'nn.Conv2d', (), '', False, 'from torch import nn\n'), ((9, 8, 9, 54), 'torch.nn.LeakyReLU', 'nn.LeakyReLU', (), '', False, 'from torch import nn\n'), ((10, 8, 10, 71), 'torch.nn.Conv2d', 'nn.Conv2d', (), '', False, 'from torch import nn\n'), ((11, 8, 11, 54), 'torch.nn.LeakyReLU', 'nn.LeakyReLU', (), '', False, 'from torch import nn\n'), ((12, 8, 12, 71), 'torch.nn.Conv2d', 'nn.Conv2d', (), '', False, 'from torch import nn\n'), ((13, 8, 13, 54), 'torch.nn.LeakyReLU', 'nn.LeakyReLU', (), '', False, 'from torch import nn\n'), ((14, 8, 14, 65), 'torch.nn.Conv2d', 'nn.Conv2d', (), '', False, 'from torch import nn\n'), ((46, 8, 46, 75), 'torch.nn.Conv2d', 'nn.Conv2d', (), '', False, 'from torch import nn\n'), ((48, 8, 48, 54), 'torch.nn.LeakyReLU', 'nn.LeakyReLU', (), '', False, 'from torch import nn\n'), ((49, 8, 49, 71), 'torch.nn.Conv2d', 'nn.Conv2d', (), '', False, 'from torch import nn\n'), ((51, 8, 51, 54), 'torch.nn.LeakyReLU', 'nn.LeakyReLU', (), '', False, 'from torch import nn\n'), ((52, 8, 52, 67), 'torch.nn.Conv2d', 'nn.Conv2d', (), '', False, 'from torch import nn\n'), ((54, 8, 54, 54), 'torch.nn.LeakyReLU', 'nn.LeakyReLU', (), '', False, 'from torch import nn\n'), ((57, 8, 57, 61), 'torch.nn.Conv2d', 'nn.Conv2d', (), '', False, 'from torch import nn\n')]