for some reason, it seems like that we are backed ๐
setup: assume that we have data xiโ from a distribution pdataโ(x), all we wanna do is to sample from pdataโ(x)
idea: introduce a latent variable z with simple prior p(z), those z can be interpolated,
sample z from p(z), and pass into a Generator x=G(z), then we said that x is a sample from the Generator distribution pGโ,
all we need to do is let pGโ=pdataโ !
and then we include a Discriminator D(x), which takes in x and outputs a probability that x is real (from pdataโ) or fake (from pGโ).
Hopefully, this will converge to a point where D(x) is not able to correctly classify real and fake data.
minmax game:
LGANโโ=GminโDmaxโExโผpdataโโ[logD(x)]+Ezโผp(z)โ[log(1โD(G(z)))]=GminโDmaxโV(G,D)โ
alternating gradient update:
For t in 1, โฆ, T:
- update D, D=D+ฮฑDโโDโVโ
- update G, G=GโฮฑGโโGโVโ
In practice, we wanna the G to minimize โlogD(G(z)), in order to avoid the vanishing gradient problem at the begging.
GminโDmaxโExโผpdataโโ[logD(x)]+Ezโผp(z)โ[log(1โD(G(z)))]=Gminโ(2รJSD(pdataโ,pGโ)โlog4)
Proof: (ready for the math? ๐)
LGANโโ=GminโDmaxโExโผpdataโโ[logD(x)]+Ezโผp(z)โ[log(1โD(G(z)))]=GminโDmaxโExโผpdataโโ[logD(x)]+ExโผpGโโ[log(1โD(x))]=GminโDmaxโโซXโ(pdataโ(x)logD(x)+pGโ(x)log(1โD(x)))dx=GminโโซXโDmaxโ(pdataโ(x)logD(x)+pGโ(x)log(1โD(x)))dxโ
f(y)=alogy+blog(1โy),letfโ(y)=0โy=a+baโโDGโโ(x)=pdataโ(x)+pGโ(x)pdataโ(x)โ
โ=GminโโซXโ(pdataโ(x)logDGโโ(x)+pGโ(x)log(1โDGโโ(x)))dx=GminโโซXโ(pdataโ(x)logpdataโ(x)+pGโ(x)pdataโ(x)โ+pGโ(x)logpdataโ(x)+pGโ(x)pGโ(x)โ)dx=Gminโ(Exโผpdataโโ[logpdataโ(x)+pGโ(x))pdataโ(x)โ]+ExโผpGโโ[logpdataโ(x)+pGโ(x))pGโ(x)โ])=Gminโ(Exโผpdataโโ[logpdataโ(x)+pGโ(x))2รpdataโ(x)โ]+ExโผpGโโ[logpdataโ(x)+pGโ(x))2รpGโ(x)โ]โlog4)=Gminโ(KL(pdataโ,2pdataโ+pGโโ)+KL(pGโ,2pdataโ+pGโโ)โlog4)=Gminโ(2รJSD(pdataโ,pGโ)โlog4)โGminโ(JSD(pdataโ,pGโ))โ

input x and condition y both G, D
Conditional BatchNormalization
some tasks
- GAN of Video
- Text to image synthesis
- Image to image translation
- Image to image super-resolution
- Label Map to Image synthesis / style transfer
even trajectory prediction!