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

Function disc_bn

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

Source from the content-addressed store, hash-verified

99
100
101def disc_bn(x, scale=1, channel=32, is_training=True,
102 name='discriminator', patch=True, reuse=False):
103
104 with tf.variable_scope(name, reuse=reuse):
105
106 for idx in range(3):
107 x = slim.convolution2d(x, channel*2**idx, [3, 3], stride=2, activation_fn=None)
108 x = slim.batch_norm(x, is_training=is_training, center=True, scale=True)
109 x = tf.nn.leaky_relu(x)
110
111 x = slim.convolution2d(x, channel*2**idx, [3, 3], activation_fn=None)
112 x = slim.batch_norm(x, is_training=is_training, center=True, scale=True)
113 x = tf.nn.leaky_relu(x)
114
115 if patch == True:
116 x = slim.convolution2d(x, 1, [1, 1], activation_fn=None)
117 else:
118 x = tf.reduce_mean(x, axis=[1, 2])
119 x = slim.fully_connected(x, 1, activation_fn=None)
120
121 return x
122
123
124

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected