MCPcopy Index your code
hub / github.com/tensorpack/tensorpack / discriminator

Method discriminator

examples/GAN/Image2Image.py:107–117  ·  view source on GitHub ↗

return a (b, 1) logits

(self, inputs, outputs)

Source from the content-addressed store, hash-verified

105
106 @auto_reuse_variable_scope
107 def discriminator(self, inputs, outputs):
108 """ return a (b, 1) logits"""
109 l = tf.concat([inputs, outputs], 3)
110 with argscope(Conv2D, kernel_size=4, strides=2, activation=BNLReLU):
111 l = (LinearWrap(l)
112 .Conv2D('conv0', NF, activation=tf.nn.leaky_relu)
113 .Conv2D('conv1', NF * 2)
114 .Conv2D('conv2', NF * 4)
115 .Conv2D('conv3', NF * 8, strides=1, padding='VALID')
116 .Conv2D('convlast', 1, strides=1, padding='VALID', activation=tf.identity)())
117 return l
118
119 def build_graph(self, input, output):
120 input, output = input / 128.0 - 1, output / 128.0 - 1

Callers 1

build_graphMethod · 0.95

Calls 2

argscopeFunction · 0.85
LinearWrapClass · 0.85

Tested by

no test coverage detected