generative adversarial networks
TRANSCRIPT
GenerativeAdversarialNetworks
MarkChang
OriginalPaper
• Title:– GenerativeAdversarialNets
• Authors:– IanJ.Goodfellow,JeanPouget-Abadie,MehdiMirza,BingXu,DavidWarde-Farley,Sherjil Ozair,AaronCourville,Yoshua Bengio
• Organization:– UniversitedeMontreal
• URL:– https://arxiv.org/abs/1406.2661
Outlines
• Mini-maxTwo-playerGame• GenerativeModelv.s.DiscriminativeModel• GenerativeAdversarialNetworks• ConvergenceProof• Experiment• FurtherResearch
Mini-maxTwo-playerGame
Mini-maxTwo-playerGame
• :thecurrentplayer• :theopponent• :theactiontakenbycurrentplayer• :theactiontakenbyopponent• :thevaluefunctionofcurrentplayer
-1
1
1
vs = max
as
min
as�vs(as, as�)
vs
ss�
asas�
as
as�
ss�
Mini-maxTwo-playerGame
• :thecurrentplayer• :theopponent• :theactiontakenbycurrentplayer• :theactiontakenbyopponent• :thevaluefunctionofcurrentplayer
1
vs = max
as
min
as�vs(as, as�)
vs
ss�
asas�
as
ss�
-1
1
vs = 1
-1
1
1 as�
1
GenerativeModelv.s.DiscriminativeModel
• DiscriminativeModel • GenerativeModel
p(x, y)p(y|x)
y = 0
y = 1
y = 0
y = 1
x
x
DiscriminativeModel:p(y|x)
x
p(y = 0|x) > p(y = 1|x)
p(y = 1|x) > p(y = 0|x)
p(y = 0|x) + p(y = 1|x) = 1
y = 1
y = 0
y = 1
exampleofotherclass
p(y = 0|x) = p(y = 1|x) = 0.5
GenerativeModel:p(x,y)
x
p(x, y = 0)
p(x, y = 1)
generatenewexample
exampleofotherclass
GenerativeAdversarialNetworks
• GeneratenewdatabyNeuralNetwork
p(x, z) = p(z)p(x|z)
GeneratorNetwork
p(z)p(x|z)prior
generateddataz ⇠ p(z)
samplingx
GenerativeAdversarialNetworks
GeneratorNetworkG(z)prior
min
Gmax
DV (D,G)
generateddata
z ⇠ pz(z)
realdatax ⇠ pdata(x)
10
V (D,G) = Ex⇠pdata(x)[logD(x)] + E
z⇠pz(z)[log(1�D(G(z))]
DiscriminatorNetworkD(x)
sigmoidfunction
TrainingDiscriminatorNetworkmax
D
(Ex⇠pdata(x)[logD(x)] + E
z⇠pz(z)[log(1�D(G(z))])
realdata
generateddata
D(x) ⇡ 0 ) logD(x) ⌧ 0
shouldbe1D(x) shouldbe0D(G(z))
DiscriminatorNetwork
10
D(x)
D(G(z)) ⇡ 1 ) log(1�D(G(z))) ⌧ 0
TrainingDiscriminatorNetwork
DiscriminatorNetwork
10
realdata
generateddata
D(x) ⇡ 1 ) logD(x) ⇡ 0
max
D
(Ex⇠pdata(x)[logD(x)] + E
z⇠pz(z)[log(1�D(G(z))])
shouldbe1D(x) shouldbe0D(G(z))
D(x)
D(G(z)) ⇡ 0 ) log(1�D(G(z))) ⇡ 0
TrainingGeneratorNetwork
min
G
(Ex⇠pdata(x)[logD(x)] + E
z⇠pz(z)[log(1�D(G(z))])
) min
G(Ez⇠pz(z)[log(1�D(G(z))])
) max
G(Ez⇠pz(z)[log(D(G(z))])
Thereisnointhisterm.G
shouldnotbe0=>shouldbe1D(G(z)) D(G(z))
priorz ⇠ pz(z)
TrainingGeneratorNetwork
GeneratorNetworkG(z)
max
G(Ez⇠pz(z)[log(D(G(z))])
generateddata
realdata
10
D(G(z)) ⇡ 0 ) logD(G(z)) ⌧ 0
shouldbe1D(G(z))
TrainingGeneratorNetwork
realdata
GeneratorNetwork
priorz ⇠ pz(z)
max
G(Ez⇠pz(z)[log(D(G(z))])
10
generateddata
G(z)
shouldbe1D(G(z))
D(G(z)) ⇡ 1 ) logD(G(z)) ⇡ 0
TrainingGenerativeAdversarialNetworks
minG
V (D,G)
max
DV (D,G)
max
DV (D,G)
min
Gmax
DV (D,G)
minG
V (D,G)
max
DV (D,G)
G(z) G(z) G(z)
G(z)G(z)G(z)
GlobalOptimum
D(G(z)) = 0.5
realdata
generateddataG(z)
ConvergenceProof
• GlobalOptimumExists• ConvergetoGlobalOptimum
GlobalOptimumExists
aftertraining,reachingglobaloptimum
x
pdata(x) = pg(x)
D(x) = 0.5
x
discriminatorD(x)
realdatadistributionpdata(x)
generateddatadistribution
pg(x)
z
priorpz(z)
globaloptimum: pdata = pg
GeneratorG(z)
beforetraining
x
pdata(x) pg(x)D(x)
G(z)
x
pdata(x)pg(x)
D
⇤G(x)
GlobalOptimumExists
• Forfixed,theoptimaldiscriminatoris:
D
⇤G(x) =
pdata(x)
pdata(x) + pg(x)
G D
pdata(x) = 0, pg(x) = 0.5
D
⇤G(x) =
0
0.5 + 0= 0
pdata(x) = 0.5, pg(x) = 0.5
D
⇤G(x) =
0.5
0.5 + 0.5= 0.5
pdata(x) = 0.5, pg(x) = 0
D
⇤G(x) =
0.5
0.5 + 0= 1
GlobalOptimumExists
V (D,G) = Ex⇠pdata(x)[logD(x)] + E
z⇠pz(z)[log(1�D(G(z))]
x = G(z) ) z = G
�1(x) ) dz = (G�1)0(x)dx
) pg(x) = pz(G�1(x))(G�1)0(x)
=
Z
x
p
data
(x)log(D(x))dx+
Z
x
p
z
(G�1(x))log(1�D(x))(G�1)0(x)dx
=
Z
x
p
data
(x)log(D(x))dx+
Z
x
p
g
(x)log(1�D(x))dx
=
Z
x
p
data
(x)log(D(x)) + p
g
(x)log(1�D(x))dx
=
Z
x
p
data
(x)log(D(x))dx+
Z
z
p
z
(z)log(1�D(G(z)))dz
GlobalOptimumExists
max
D
V (D,G) = max
D
Z
x
p
data
(x)log(D(x)) + p
g
(x)log(1�D(x))dx
) pdata(x)
D(x)� pg(x)
1�D(x)= 0
@
@D(x)(pdata(x)log(D(x)) + pg(x)log(1�D(x))) = 0
) D(x) =pdata(x)
pdata(x) + pg(x)
GlobalOptimumExists
• Supposethediscriminatorisoptimal,theoptimalgeneratormakes:
D
⇤G(x)
) D
⇤G(x) =
pdata(x)
pdata(x) + pg(x)=
1
2
pdata(x) = pg(x)
pdata(x) = 0.3, pg(x) = 0.3
D
⇤G(x) =
0.3
0.3 + 0.3= 0.5
pdata(x) = 0.8, pg(x) = 0.8
D
⇤G(x) =
0.8
0.8 + 0.8= 0.5
x
D
⇤G(x)
pdata(x) = pg(x)
GlobalOptimumExists
= max
D
Z
x
p
data
(x)log(D(x)) + p
g
(x)log(1�D(x))dx
C(G) = max
DV (G,D)
=
Z
x
p
data
(x)log(D⇤G
(x)) + p
g
(x)log(1�D
⇤G
(x))dx
=
Z
x
p
data
(x)log(p
data
(x)
p
data
(x) + p
g
(x)) + p
g
(x)log(p
g
(x)
p
data
(x) + p
g
(x))dx
=
Z
x
p
data
(x)log(p
data
(x)pdata(x)+pg(x)
2
) + p
g
(x)log(p
g
(x)pdata(x)+pg(x)
2
)dx� log(4)
= KL[pdata(x)||pdata(x) + pg(x)
2] +KL[pg(x)||
pdata(x) + pg(x)
2]� log(4)
GlobalOptimumExists
C(G) = KL[pdata(x)||pdata(x) + pg(x)
2] +KL[pg(x)||
pdata(x) + pg(x)
2]� log(4)
� 0 � 0
KL[pdata(x)||pdata(x) + pg(x)
2] = 0
) pdata(x) = pg(x)
when pdata(x) =pdata(x) + pg(x)
2
minG
C(G) = 0 + 0� log(4) = �log(4)
D G
ConvergetoGlobalOptimum
V (D,G)
GlobalOptimummax
DV (G,D)
CurrentV (D,G)
ConvergetoGlobalOptimum
V (D,G)
minG
V (G,D)
D G
GlobalOptimumCurrentV (D,G)
Experiment
• QuantitativeAnalyses• QualitativeAnalyses
Experiment
• QuantitativeAnalyses– log-likelihoodestimation– Parzen window: p(x) =
1
N
NX
i=1
G�(x� xi)
Experimentgenerated
dataG(z)
testing data
xix
p(x)
loglikelihood
p(x) =1
N
NX
i=1
G�(x� xi)
Experiment
• QualitativeAnalyses:– Visualizationofsamplesfromthemodel
realdatagenerateddatarealdata
generateddata
Experiment
• QualitativeAnalyses:– linearlyinterpolationinzspace
prior:z ⇠ pz(z)
FurtherResearchUnsupervisedRepresentationLearningwithDeepConvolutionalGenerativeAdversarialNetworks
AlecRadford, LukeMetz,Soumith Chintala
FurtherResearchAdversarialAutoencodersAlireza Makhzani,JonathonShlens,Navdeep
Jaitly,IanGoodfellow, BrendanFrey
FurtherResearchInfoGAN:InterpretableRepresentationLearningbyInformationMaximizingGenerativeAdversarialNets
XiChen,YanDuan,ReinHouthooft, JohnSchulman, Ilya Sutskever, PieterAbbeel
Source Code
• Original paper (theano):– https://github.com/goodfeli/adversarial
• Tensorflow implementation:– https://github.com/ckmarkoh/GAN-tensorflow