hardikbansal / CycleGAN

Tensorflow implementation of CycleGAN

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

build_gen_discriminator and patch_discriminator

cuimiao187561 opened this issue · comments

hello hardikbansal
I am fuzzy on build_gen_discriminator and patch_discriminator. Can you tell me the difference between build_gen_discriminato and patch_discriminator ?

def build_gen_discriminator(inputdisc, name="discriminator"):

with tf.variable_scope(name):
    f = 4
    o_c1 = general_conv2d(inputdisc, ndf, f, f, 2, 2, 0.02, "SAME", "c1", do_norm=False, relufactor=0.2)
    o_c2 = general_conv2d(o_c1, ndf*2, f, f, 2, 2, 0.02, "SAME", "c2", relufactor=0.2)
    o_c3 = general_conv2d(o_c2, ndf*4, f, f, 2, 2, 0.02, "SAME", "c3", relufactor=0.2)
    o_c4 = general_conv2d(o_c3, ndf*8, f, f, 1, 1, 0.02, "SAME", "c4",relufactor=0.2)
    o_c5 = general_conv2d(o_c4, 1, f, f, 1, 1, 0.02, "SAME", "c5",do_norm=False,do_relu=False)

    return o_c5

def patch_discriminator(inputdisc, name="discriminator"):

with tf.variable_scope(name):
    f= 4

    patch_input = tf.random_crop(inputdisc,[1,70,70,3])
    o_c1 = general_conv2d(patch_input, ndf, f, f, 2, 2, 0.02, "SAME", "c1", do_norm="False", relufactor=0.2)
    o_c2 = general_conv2d(o_c1, ndf*2, f, f, 2, 2, 0.02, "SAME", "c2", relufactor=0.2)
    o_c3 = general_conv2d(o_c2, ndf*4, f, f, 2, 2, 0.02, "SAME", "c3", relufactor=0.2)
    o_c4 = general_conv2d(o_c3, ndf*8, f, f, 2, 2, 0.02, "SAME", "c4", relufactor=0.2)
    o_c5 = general_conv2d(o_c4, 1, f, f, 1, 1, 0.02, "SAME", "c5",do_norm=False,do_relu=False)

    return o_c5

thank you vey much