注: 本文是作者的自我总结,主要作为个人总结记录, 欢迎大家批评,交流. https://zhouxiaowei1120.github.io/#blogs
Loss Function of GAN
min G max D V ( D , G ) = E x ∼ p d a t a ( x ) [ log D ( x ) ] + E z ∼ p z ( z ) [ log ( 1 − D ( G ( z ) ) ) ] \min \limits_{G} \max \limits_D V(D, G) = \mathbb{E}_{x\sim p_{data}(x)}[\log D(x)] + \mathbb{E}_{z\sim p_{z}(z)}[\log (1 - D(G(z)))] GminDmaxV(D,G)=Ex∼pdata(x)[logD(x)]+Ez∼pz(z)[log(1−D(G(z)))]
My Understanding
D D D try to maximize V ( D , G ) V(D, G) V(D,G), while G G G try to minimize V ( D , G ) V(D, G) V(D,G). Larger the V ( D , G ) V(D, G) V(D,G), larger the D D D, D D D is better to discriminate the input. When we use cross entropy as loss function, because there is a minus between cross entropy and V ( D , G ) V(D, G) V(D,G), we should try to minimize cross entropy, which is equal to maximize V ( D , G ) V(D, G) V(D,G).
When it comes to G G G, smaller the V ( D , G ) V(D, G) V(D,G), larger the D ( G ( z ) ) D(G(z)) D(G(z)). That means D D D try to classify G ( z ) G(z) G(z) as true, which is just the goal of G G G. When we use cross entropy as loss function, because there is a minus between cross entropy and E z ∼ p z ( z ) [ log ( 1 − D ( G ( z ) ) ) ] \mathbb{E}_{z\sim p_{z}(z)}[\log (1 - D(G(z)))] Ez∼pz(z)[log(1−D(G(z)))], we should try to minimize minus cross entropy.