生成式对抗网络
Posted kresnikshi
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了生成式对抗网络相关的知识,希望对你有一定的参考价值。
目录
Generative adversarial networks
A generative model G: capture the data distribution(数据分布)
A discriminative model D: estimate the probability that a sample came from the training data rather than G
Adversarial nets
[ min_{G}{max_{D}{V(D, G) = mathbb{E}_{x hicksim p_{data}(x)} [log{D(x)}] + mathbb{E}_{z hicksim p_{z}(z)}[log{(1 - D(G(z)))}] }} ]
generator‘s distribution: $ p_{g} $
a prior on input noise variables: (p_{z}(z))
mapping to data space: (G(z; heta_{g}))
multilayer perceptron with parameters ( heta_{g}): (G)
second multilayer perceptron: (D(x; heta_{d})) (output a single scalar)
the probability that (x) came from the data rather than (p_{g}): (D(x))
value function: $ V(G, D) $
Train G to minimize: $ log{(1 - D(G(z)))} $
Figure
G->D: G is poor, D can reject samples with high confidence
D-->G: log(1-D(G(z))) saturates(充满,饱和)
Note left of G: Training G maximize
log(D(G(z))) rather than
Minimize log(1-D(G(z)))
G->D: G is not poor, whether D can reject samples
D-->G: G becomes perfect
Flowchart
st=>start: Start
e=>end
op1=>operation: update the discriminator
op2=>operation: update the generator
opm=>operation: m--
opk=>operation: k--
pgz=>inputoutput: noise prior
pdatax=>inputoutput: data generating distribution
noisesam=>inputoutput: minibatch of m noise samples
examples=>inputoutput: minibatch of m examples
cond1=>condition: m>0?
cond2=>condition: k>0?
st->cond2
cond1(yes)->op2->opm->e
cond1(no)->e
cond2(yes)->pgz->noisesam->pdatax->examples->op1(right)->opk(right)->cond2
cond2(no)->cond1
Cycle-Consistent Adversarial Networks
Model
X->Y: G
Note left of X: Dx
Note right of Y: Dy
Y->X: F
$ x o G(x) o F(G(x)) approx x $ and $y o F(y) o G(F(y)) approx y $
Formulation
Adversarial Loss
[ mathcal{L}_{GAN}(G, D_{Y}, X, Y) = mathbb{E}_{y hicksim p_{data}(y)} [log D_{Y}(y)] + mathbb{E}_{x hicksim p_{data}(x)}[log(1 - D_{Y}(G(x)))] ]
(G) tries to generate images (G(x)) that look similar to images from domain (Y)
(D_{Y}) aims to distinguish between translated samples (G(x)) and real samples (y)
Cycle Consistency Loss
[ mathcal{L}_{cyc}(G, F) = mathbb{E}_{x hicksim p_{data}(x)} [| F(G(x)) - x |_{1}] + mathbb{E}_{y hicksim p_{data}(y)}[| G(F(y)) - y |_{1}] ]
Full Objective
[ mathcal{L}(G, F, D_{X}, D_{Y}) = mathcal{L}_{GAN}(G, D_{Y}, X, Y) + mathcal{L}_{GAN}(F, D_{X}, Y, X) + lambda mathcal{L}_{cyc}(G, F) ]
Conditional Generative Adversarial Nets
cGANs
[ mathcal{L}_{cGAN}(G, D) = mathbb{E}_{x,y hicksim p_{data}(x, y)} [log D(x, y)] + mathbb{E}_{y hicksim p_{data}(y), z hicksim p_{z}(z)}[log(1 - D(G(y,z),y))] ]
(y) is a kind of auxiliary information
以上是关于生成式对抗网络的主要内容,如果未能解决你的问题,请参考以下文章