MCPcopy Create free account
hub / github.com/SystemErrorWang/White-box-Cartoonization / disc_ln

Function disc_ln

train_code/network.py:149–167  ·  view source on GitHub ↗
(x, channel=32, is_training=True, name='discriminator', patch=True, reuse=False)

Source from the content-addressed store, hash-verified

147
148
149def disc_ln(x, channel=32, is_training=True, name='discriminator', patch=True, reuse=False):
150 with tf.variable_scope(name, reuse=reuse):
151
152 for idx in range(3):
153 x = slim.convolution2d(x, channel*2**idx, [3, 3], stride=2, activation_fn=None)
154 x = tf.contrib.layers.layer_norm(x)
155 x = tf.nn.leaky_relu(x)
156
157 x = slim.convolution2d(x, channel*2**idx, [3, 3], activation_fn=None)
158 x = tf.contrib.layers.layer_norm(x)
159 x = tf.nn.leaky_relu(x)
160
161 if patch == True:
162 x = slim.convolution2d(x, 1, [1, 1], activation_fn=None)
163 else:
164 x = tf.reduce_mean(x, axis=[1, 2])
165 x = slim.fully_connected(x, 1, activation_fn=None)
166
167 return x
168
169
170

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected