(discriminator, real, fake, scale=1,
channel=32, patch=False, name='discriminator')
| 162 | |
| 163 | |
| 164 | def lsgan_loss(discriminator, real, fake, scale=1, |
| 165 | channel=32, patch=False, name='discriminator'): |
| 166 | |
| 167 | real_logit = discriminator(real, scale, channel, name=name, patch=patch, reuse=False) |
| 168 | fake_logit = discriminator(fake, scale, channel, name=name, patch=patch, reuse=True) |
| 169 | |
| 170 | g_loss = tf.reduce_mean((fake_logit - 1)**2) |
| 171 | d_loss = 0.5*(tf.reduce_mean((real_logit - 1)**2) + tf.reduce_mean(fake_logit**2)) |
| 172 | |
| 173 | return d_loss, g_loss |
| 174 | |
| 175 | |
| 176 |
nothing calls this directly
no outgoing calls
no test coverage detected