李宏毅GAN学习笔记(02)

GAN Lecture 2


Conditional Generation by GAN

李宏毅GAN学习笔记(02)_第1张图片

Algorithm

In each traing iteration:

  • Sample m positive examples { ( c 1 , x 1 ) , ( c 2 , x 2 ) , … , ( c m , x m ) } \{(c^1, x^1), (c^2, x^2), \dots, (c^m, x^m)\} {(c1,x1),(c2,x2),,(cm,xm)} from database
  • Sample m noise samples { z 1 , z 2 , … , z m } \{z^1, z^2, \dots, z^m\} {z1,z2,,zm} from a distribution
  • Obtaining generated data { x ~ 1 , x ~ 2 , … , x ~ m } \{\tilde{x}^1, \tilde{x}^2, \dots, \tilde{x}^m\} {x~1,x~2,,x~m}, x ~ i = G ( c i , z i ) \tilde{x}^i=G(c^i, z^i) x~i=G(ci,zi)
  • Sample m objects { x ^ 1 , x ^ 2 , … , x ^ m } \{\hat{x}^1, \hat{x}^2, \dots, \hat{x}^m\} {x^1,x^2,,x^m} from database
  • Update discriminator parameters θ d \theta_d θd to maximize
    • V ~ = 1 m ∑ i = 1 m l o g D ( c i , x i ) + 1 m ∑ i = 1 m l o g ( 1 − D ( c i , x ~ i ) ) + 1 m i = 1 m l o g ( 1 − D ( c i , x ^ i ) ) \tilde{V}=\frac{1}{m}\sum_{i=1}^mlogD(c^i, x^i)+\frac{1}{m}\sum_{i=1}^mlog(1-D(c^i, \tilde{x}^i))+\frac{1}{m}_{i=1}^mlog(1-D(c^i, \hat{x}^i)) V~=m1i=1mlogD(ci,xi)+m1i=1mlog(1D(ci,x~i))+m1i=1mlog(1D(ci,x^i))
    • θ d ← θ d + η ▽ V ~ ( θ d ) \theta_d \leftarrow \theta_d+\eta\bigtriangledown\tilde{V}(\theta_d) θdθd+ηV~(θd)

Learning D

  • Sample m noise samples { z 1 , z 2 , … , z m } \{z^1,z^2,\dots,z^m\} {z1,z2,,zm} from a distribution
  • Sample m conditions { c 1 , c 2 , … , c m } \{c^1,c^2,\dots,c^m\} {c1,c2,,cm} from a database
  • Update generator parameters θ g \theta_g θg to maximize
    • V ~ = 1 m ∑ i = 1 m l o g ( D ( G ( c i , z i ) ) ) \tilde{V}=\frac{1}{m}\sum_{i=1}^mlog(D(G(c^i, z^i))) V~=m1i=1mlog(D(G(ci,zi))), θ g ← η ▽ V ~ ( θ g ) \theta_g \leftarrow\eta\bigtriangledown\tilde{V}(\theta_g) θgηV~(θg)

Learning G

李宏毅GAN学习笔记(02)_第2张图片

倾向推荐第二种网络架构
参考文献:StackGAN

李宏毅GAN学习笔记(02)_第3张图片

参考文献:Patch GAN

李宏毅GAN学习笔记(02)_第4张图片

李宏毅GAN学习笔记(02)_第5张图片

参考例子:Github

你可能感兴趣的:(GAN,GAN,深度学习)