本文主要是介绍李宏毅GAN学习笔记(02),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
GAN Lecture 2
Conditional Generation by GAN
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~=m1∑i=1mlogD(ci,xi)+m1∑i=1mlog(1−D(ci,x~i))+m1i=1mlog(1−D(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~=m1∑i=1mlog(D(G(ci,zi))), θ g ← η ▽ V ~ ( θ g ) \theta_g \leftarrow\eta\bigtriangledown\tilde{V}(\theta_g) θg←η▽V~(θg)
Learning G
倾向推荐第二种网络架构
参考文献:StackGAN
参考文献:Patch GAN
参考例子:Github
这篇关于李宏毅GAN学习笔记(02)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!