(x, scale=1, channel=32, patch=True, name='discriminator', reuse=False)
| 124 | |
| 125 | |
| 126 | def 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 | |
| 149 | def disc_ln(x, channel=32, is_training=True, name='discriminator', patch=True, reuse=False): |
nothing calls this directly
no outgoing calls
no test coverage detected