MCPcopy Create free account
hub / github.com/tensorpack/tensorpack / discriminator

Method discriminator

examples/GAN/DCGAN.py:61–77  ·  view source on GitHub ↗

return a (b, 1) logits

(self, imgs)

Source from the content-addressed store, hash-verified

59
60 @auto_reuse_variable_scope
61 def discriminator(self, imgs):
62 """ return a (b, 1) logits"""
63 nf = 64
64 with argscope(Conv2D, kernel_size=4, strides=2):
65 l = (LinearWrap(imgs)
66 .Conv2D('conv0', nf, activation=tf.nn.leaky_relu)
67 .Conv2D('conv1', nf * 2)
68 .BatchNorm('bn1')
69 .tf.nn.leaky_relu()
70 .Conv2D('conv2', nf * 4)
71 .BatchNorm('bn2')
72 .tf.nn.leaky_relu()
73 .Conv2D('conv3', nf * 8)
74 .BatchNorm('bn3')
75 .tf.nn.leaky_relu()
76 .FullyConnected('fct', 1)())
77 return l
78
79 def build_graph(self, image_pos):
80 image_pos = image_pos / 128.0 - 1

Callers 1

build_graphMethod · 0.95

Calls 2

argscopeFunction · 0.85
LinearWrapClass · 0.85

Tested by

no test coverage detected