Relativistic GAN的部分数学推导,自己重新打一遍字加深记忆。
在论文中定义non-saturating GAN的损失函数如下:
L D S G A N = − E x r ∼ P [ l o g ( s i g m o i d ( C ( x r ) ) ) ] − E x f ∼ Q [ l o g ( s i g m o i d ( C ( x f ) ) ) ] L_D^{SGAN}=-\mathbb{E}_{x_r\sim\mathbb{P}}[log(sigmoid(C(x_r)))]-\mathbb{E}_{x_f\sim\mathbb{Q}}[log(sigmoid(C(x_f)))] LDSGAN=−Exr∼P[log(sigmoid(C(xr)))]−Exf∼Q[log(sigmoid(C(xf)))]
L G S G A N = − E x f ∼ Q [ l o g ( s i g m o i d ( C ( x f ) ) ) ] L_G^{SGAN}=-\mathbb{E}_{x_f\sim\mathbb{Q}}[log(sigmoid(C(x_f)))] LGSGAN=−Exf∼Q[log(sigmoid(C(xf)))]
则Standard GAN的梯度如下:
∇ w L D S G A N = − ∇ w E x r ∼ P [ l o g D ( x r ) ] − ∇ w E x f ∼ Q θ [ l o g ( 1 − D ( x f ) ) ] = − ∇ w E x r ∼ P [ l o g ( e C ( x r ) e C ( x r ) + 1 ) ] − ∇ w E x f ∼ Q θ [ l o g ( 1 − e C ( x f ) e C ( x f ) + 1 ) ] = − ∇ w E x r ∼ P [ C ( x r ) − l o g ( e C ( x r ) + 1 ) ] − ∇ w E x f ∼ Q θ [ l o g ( 1 ) − l o g ( e C ( x f ) + 1 ) ] = − E x r ∼ P [ ∇ w C ( x r ) ] + E x r ∼ P [ e C ( x r ) e C ( x r ) + 1 ∇ w C ( x r ) ] + E x f ∼ Q θ [ e C ( x f ) e C ( x f ) + 1 ∇ w C ( x f ) ] = − E x r ∼ P [ ∇ w C ( x r ) ] + E x r ∼ P [ D ( x r ) ∇
Relativistic GAN的部分数学推导
最新推荐文章于 2024-04-13 09:41:18 发布
本文详细探讨了Relativistic GAN的损失函数及其梯度计算,包括non-saturating GAN、Standard GAN和IPM-based GAN的数学推导,旨在帮助读者深入理解这些GAN变种的工作原理。
摘要由CSDN通过智能技术生成