Art of DS

Appearance

Palette
Theme
Unlock $20 one time
Sign in, or create an account

Sign in to Art of DSCreate your Art of DS account

We email you a link and a six-digit code. Either one signs you in; there is no password.Enter your email. We send a link and a six-digit code to confirm it — no password to remember. The account is free.

  • You come back to this page, right where you were.
  • Already have an account? The same email simply signs you in.

By continuing you accept the Terms and the Privacy policy.

Your account

Free accountLifetime access

difficulty 4/5

Generative adversarial network

Definition

Two networks in a game — one invents samples, the other tries to spot them. The generator never sees the data, only gradients that come back through its opponent.

Formula
min⁡Gmax⁡DV(D,G)=Ex∼pdata[log⁡D(x)]+Ez∼pz[log⁡(1−D(G(z)))]\min_G \max_D V(D, G) = \mathbb{E}_{x \sim p_{\text{data}}}[\log D(x)] + \mathbb{E}_{z \sim p_z}[\log(1 - D(G(z)))]

Intuition

Most models on this site are told what the right answer is. A generative model of images has no such thing — there is no target for "a plausible photograph", only a distribution you would like to sample from.

The adversarial idea supplies a target by inventing an opponent. Train a discriminator that "estimates the probability that a sample came from the training data rather than G", and train the generator to fool it: "the training procedure for G is to maximize the probability of D making a mistake" [1, Abstract]. The loss is not written by hand — it is another network, and it improves as the generator does.

What the generator never gets is the data. It is updated "only with gradients flowing through the discriminator", so "components of the input are not copied directly into the generator's parameters" [1, §6]. Everything it knows about photographs arrives second-hand.

Formal definition

How it works

Where it's used

Why & when

Worked example

Pitfalls

Check yourself

3 questions

The questions on this page come with access. They are graded on the server, so the answers stay there until you have given yours.

Unlock all quizzes

Sources

  1. Goodfellow, Pouget-Abadie, Mirza, Xu, Warde-Farley, Ozair, Courville, Bengio. Generative Adversarial Nets (2014)paperhttps://ar5iv.labs.arxiv.org/html/1406.2661
  2. Ho, Jain, Abbeel. Denoising Diffusion Probabilistic Models (2020)paperhttps://ar5iv.labs.arxiv.org/html/2006.11239
  3. Rombach, Blattmann, Lorenz, Esser, Ommer. High-Resolution Image Synthesis with Latent Diffusion Models (2022)paperhttps://arxiv.org/abs/2112.10752

Have a promo code?

A code that takes 100% off unlocks everything at once. A smaller one takes its share off the price in the payment window: enter the same code there.

Write to support

A question, a problem with access, a refund? Write to us and we answer by email.

What is it about?

Your address is used only to answer you.

Message sent

Thank you. We will reply to the address you gave, by email.

Or write to us directly

support@artofds.com

Message sent Thank you. We will reply to the address you gave, by email.

Check the email address: we need it to reply.

That is our own address. Enter yours, so the reply reaches you.

This address cannot receive email. Check it for a typo.

Write a little more: at least 10 characters.

Too many messages in a short time. Try again in a few minutes.

The message could not be sent. Please write to us directly: support@artofds.com