Skip to content

Instantly share code, notes, and snippets.

@nogawanogawa
Created April 28, 2018 12:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nogawanogawa/bd20f1f0340b811c8422bca1470f2d98 to your computer and use it in GitHub Desktop.
Save nogawanogawa/bd20f1f0340b811c8422bca1470f2d98 to your computer and use it in GitHub Desktop.
# Discriminator
def discriminator(inputdisc, name="discriminator", reuse=None):
if reuse:
scope.reuse_variables()
with tf.variable_scope(name):
f = 4
x = conv2d(inputdisc, ndf, f, f, 2, 2, 0.02, "SAME", "c1", do_norm=False, relufactor=0.2)
x = conv2d(x, ndf*2, f, f, 2, 2, 0.02, "SAME", "c2", relufactor=0.2)
x = conv2d(x, ndf*4, f, f, 2, 2, 0.02, "SAME", "c3", relufactor=0.2)
x = conv2d(x, ndf*8, f, f, 1, 1, 0.02, "SAME", "c4",relufactor=0.2)
x = conv2d(x, 1, f, f, 1, 1, 0.02, "SAME", "c5",do_norm=False,do_relu=False)
return x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment