GANs入门系列二

该博客是根据台大李宏毅老师的关于GAN的视频教程所整理的笔记,建议大家可以直接看这个老师的视频(因在youtube,故需翻墙)

Generative Adversarial Network

回顾

Auto-encoder (AE)

简单,但生成的图像的质量很no realistic,视觉上看会很模糊,更像是图像的求均运算

Variational Auto encoder (VAE)

NN Encoder会产生两个向量 m , σ ∈ R 3 m, \sigma \in R^3 m,σR3, 然后再从一个正态分布中采样一个噪声 e ∈ R 3 e \in R^3 eR3,做 c = exp ⁡ ( σ ) ⊙ e + m ∈ R 3 c=\exp{(\sigma)} \odot e + m \in R^3 c=exp(σ)e+mR3 ,最后将 c c c 输入到NN Decoder中生成图像。优化的目标是使得 output 与 input 要尽可能地接近,同时为了引入正则项的目的是为了让 σ , m \sigma, m σ,m 尽可能地接近于 0,这样在测试时就可以去掉NN Encoder而直接使用 e e e 作为NN Decoder的输入了。

AE/VAE存在的问题:

即NN Decoder并不会产生真正realisctic的数据。例如图中的两张“7”,二者仅差了一个像素点,人会偏爱左边的,但对该模型来说,二者与真实的“7”均差了一个像素点,故无优劣之分

GAN

Maximum Likelihood Estimation

  • Given a data distribution P d a t a ( x ) P_{data}(x) Pdata(x)
  • We have a distribution P G ( x ; θ ) P_G(x; \theta) PG(x;θ) parameterized by θ \theta θ
    • E . g .   P G ( x ; θ ) \it{E.g.}\ P_G(x; \theta) E.g. PG(x;θ) is a Gaussian Mixture Model, then θ \theta θ are means and variances of the mixture Gaussian.
    • goal: find θ \theta θ that P G ( x ; θ ) P_G(x; \theta) PG(x;θ) close to P d a t a ( x ) P_{data}(x) Pdata(x)
    • note: the  x  here donates the data sampling from (output of) distribution  P d a t a ( P G ) , not the input . \color{#F00}{\text{the }x\text{ here donates the data sampling from (output of) distribution }P_{data} (P_G)\text{, not the input}}. the x here donates the data sampling from (output of) distribution Pdata(PG), not the input.

Sampling { x 1 , x 2 , … , x m } \{x^1,x^2,\dots,x^m\} { x1,x2,,xm} from P d a t a ( x ) P_{data}(x) Pdata(x), we can compute P G ( x i ; θ ) , i = 1 , 2 , … , m P_G(x^i;\theta), i=1,2,\dots,m PG(xi;θ),i=1,2,,m. Then Likelihood of generating the samples is: L = ∏ i = 1 m P G ( x i ; θ ) L=\prod_{i=1}^mP_G(x^i;\theta) L=i=1mPG(xi;θ). Our goal is to find θ ∗ \theta^* θ maximizing the likelihood:
θ ∗ = arg ⁡ max ⁡ θ ∏ i = 1 m P G ( x i ; θ ) = arg ⁡ max ⁡ θ log ⁡ ∏ i = 1 m P G ( x i ; θ ) = arg ⁡ max ⁡ θ ∑ i = 1 m log ⁡ P G ( x i ; θ )   ( ∵ { x i , … , x m }  from  P d a t a ) ≈ arg ⁡ max ⁡ θ E x ∼ P d a t a log ⁡ P G ( x ; θ )   ( when  m = + ∞ ) = arg ⁡ max ⁡ θ ∫ x P d a t a ( x ) log ⁡ P G ( x ; θ ) d x − ∫ x P d a t a ( x ) log ⁡ P d a t a ( x ) d x ⎵ 与 θ 无 关 , 为 一 个 常 数 项 , 不 会 影 响 θ ∗ 的 求 值 = arg ⁡ max ⁡ θ ∫ x − P d a t a ( x ) log ⁡ P d a t a ( x ) P G ( x ; θ ) d x = arg ⁡ min ⁡ θ KL ( P d a t a ( x ) ∥ P G ( x ;

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值