Six Pairs Before the Judge

Adversarial GenerationMedium+20 XP+20

Six Pairs Before the Judge

A conditional GAN generates handwritten digits on demand. Its discriminator never sees an example on its own — it always receives a pair: the example together with the label it is supposed to go with. It outputs DDD, its estimate that the pair is a genuine one, meaning a real photograph shown with its own correct label.

The training targets follow from that. A pair gets target 111 only if the image is real and the label matches it. Everything else gets target 000 — a generated image, and also a real photograph shown with the wrong label.

The discriminator is a plain binary classifier, so each pair costs

ℓ=−ln⁡Dwhen the target is 1,ℓ=−ln⁡(1−D)when the target is 0\ell = -\ln D \quad \text{when the target is } 1, \qquad \ell = -\ln(1 - D) \quad \text{when the target is } 0ℓ=−lnDwhen the target is 1,ℓ=−ln(1−D)when the target is 0

and the batch loss is the average of ℓ\ellℓ over the pairs in the batch.

#examplelabel shown to the discriminatorDDD
1real photo of a 330.860.860.86
2real photo of a 770.620.620.62
3real photo of a 520.700.700.70
4generated, asked for a 440.350.350.35
5generated, asked for a 990.580.580.58
6real photo of a 180.200.200.20

What is the discriminator's average loss over this batch of 6 pairs?

Use natural logarithms and round the answer to 2 decimal places.

Hints

Solve it to unlock the solution

Once you get it right, the reasoning behind the answer shows up here.