Generative Models

Find out what the critic rewards

BOTIE

This toy generator multiplies noise by its weight. Pass that fake value through the frozen discriminator's linear score and sigmoid. Build the generator's non-saturating loss by taking the negative log of the discriminator's probability.
Ready to test
0 passed · 0 failed · 1 not run

An empty floor. Start with the information your machine needs.

Received result

Your answer will arrive here.

Examples, experiments and workspace controls
Live values

Connect a tool's inputs to see what it produces. You can try a branch before connecting it to Result.

Try your own inputs

Use a copy of the example to try your own data. Keep the problem's assumptions in mind, and predict the effect of a change before checking the output. You can also add another branch to compare two ways of doing the calculation.

Start at an output arrow, then click or drag to an input. Drag empty space to pan. Delete removes a selection. Ctrl/Cmd+Z undoes a change.
Context for this challenge

This toy generator multiplies noise by its weight. Pass that fake value through the frozen discriminator's linear score and sigmoid. Build the generator's non-saturating loss by taking the negative log of the discriminator's probability.

Botie's scalar generator receives feedback from a frozen discriminator. The workshop isolates the generator's non-saturating objective.

Multiply noise by the generator weight, apply the discriminator's weighted score and bias, then take the negative log of its sigmoid probability.

Examples and results
Generator input
1
Generator weight
0.5
Frozen discriminator weight
2
Discriminator bias
-1
Required result
0.6931
Try a fresh construction

This clears this draft, including its undo history. Earlier successful attempts stay recorded. Build again without opening hints to record an independent attempt.

Stuck? Inspect a worked construction

The tools below form one possible solution. You can assemble it, follow its signals, and undo that change to return to your own construction.

Assumptions and test precision

This scalar construction isolates the generator's objective. A full GAN alternates discriminator and generator training and uses much larger models. Numerical tests allow a difference of 0.001. Lists and structures must also have the right shape.

A generated sample partly convinces the discriminator

This check uses the pieces from “Carry a generated value into its loss”.

BOTIE

Pass Botie's noise value through the scalar generator and the fixed discriminator. Calculate the non-saturating generator loss for this sample, treating the desired discriminator label as real.
Generator input
2
Generator weight
1
Frozen discriminator weight
0.5
Discriminator bias
0

Use a number, text, or an array matching the requested result. For a matrix, put each row in brackets. Saving your prediction runs your current construction on these inputs and checks the earlier examples too.

Build a construction in the workspace above first. This case will test those pieces.

What additional learning loop would be needed to train both sides of a GAN?

Keep the generator objective distinct from alternating updates of generator and discriminator parameters.

This scalar construction isolates the generator's objective. A full GAN alternates discriminator and generator training and uses much larger models.

Work through the Python challenges →
Continue the courseDiffusion Models →
← Variational Autoencoders