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

Method generator

examples/GAN/ConditionalGAN-mnist.py:47–59  ·  view source on GitHub ↗
(self, z, y)

Source from the content-addressed store, hash-verified

45 tf.TensorSpec((None,), tf.int32, 'label')]
46
47 def generator(self, z, y):
48 l = FullyConnected('fc0', tf.concat([z, y], 1), 1024, activation=BNReLU)
49 l = FullyConnected('fc1', tf.concat([l, y], 1), 64 * 2 * 7 * 7, activation=BNReLU)
50 l = tf.reshape(l, [-1, 7, 7, 64 * 2])
51
52 y = tf.reshape(y, [-1, 1, 1, 10])
53 l = tf.concat([l, tf.tile(y, [1, 7, 7, 1])], 3)
54 l = Conv2DTranspose('deconv1', l, 64 * 2, 5, 2, activation=BNReLU)
55
56 l = tf.concat([l, tf.tile(y, [1, 14, 14, 1])], 3)
57 l = Conv2DTranspose('deconv2', l, 1, 5, 2, activation=tf.identity)
58 l = tf.nn.tanh(l, name='gen')
59 return l
60
61 @auto_reuse_variable_scope
62 def discriminator(self, imgs, y):

Callers 1

build_graphMethod · 0.95

Calls 2

FullyConnectedFunction · 0.85
Conv2DTransposeFunction · 0.85

Tested by

no test coverage detected