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

Function disc_sn

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

Source from the content-addressed store, hash-verified

124
125
126def disc_sn(x, scale=1, channel=32, patch=True, name='discriminator', reuse=False):
127 with tf.variable_scope(name, reuse=reuse):
128
129 for idx in range(3):
130 x = layers.conv_spectral_norm(x, channel*2**idx, [3, 3],
131 stride=2, name='conv{}_1'.format(idx))
132 x = tf.nn.leaky_relu(x)
133
134 x = layers.conv_spectral_norm(x, channel*2**idx, [3, 3],
135 name='conv{}_2'.format(idx))
136 x = tf.nn.leaky_relu(x)
137
138
139 if patch == True:
140 x = layers.conv_spectral_norm(x, 1, [1, 1], name='conv_out'.format(idx))
141
142 else:
143 x = tf.reduce_mean(x, axis=[1, 2])
144 x = slim.fully_connected(x, 1, activation_fn=None)
145
146 return x
147
148
149def disc_ln(x, channel=32, is_training=True, name='discriminator', patch=True, reuse=False):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected