Generative Adversarial Networks/paper/zh
| Research Paper | |
|---|---|
| Authors | Ian J. Goodfellow; Jean Pouget-Abadie; Mehdi Mirza; Bing Xu; David Warde-Farley; Sherjil Ozair; Aaron Courville; Yoshua Bengio |
| Year | 2014 |
| Topic area | Machine Learning |
| Difficulty | Research |
| arXiv | 1406.2661 |
| Download PDF | |
生成对抗网络
Ian J. Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley,
Sherjil Ozair, Aaron Courville, Yoshua Bengio
Département d’informatique et de recherche opérationnelle
Université de Montréal
Montréal, QC H3C 3J7
Jean Pouget-Abadie 从 Ecole Polytechnique 访问 Université de Montréal。Sherjil Ozair 从 Indian Institute of Technology Delhi 访问 Université de Montréal。Yoshua Bengio 是 CIFAR 高级研究员。
摘要
我们提出了一个通过对抗过程估计生成模型的新框架,其中同时训练两个模型:一个捕捉数据分布的生成模型 $ {\textstyle G} $,以及一个估计样本来自训练数据而非来自 $ {\textstyle G} $ 的概率的判别模型 $ {\textstyle D} $。$ {\textstyle G} $ 的训练过程是最大化 $ {\textstyle D} $ 出错的概率。该框架对应于一个二人极小极大博弈。在任意函数 $ {\textstyle G} $ 和 $ {\textstyle D} $ 的空间中,存在唯一解,其中 $ {\textstyle G} $ 恢复训练数据分布,$ {\textstyle D} $ 处处等于 $ {\textstyle \frac{1}{2}} $。在 $ {\textstyle G} $ 和 $ {\textstyle D} $ 由多层感知机定义的情形下,整个系统可以通过反向传播进行训练。在训练或样本生成过程中,不需要任何马尔可夫链或展开的近似推理网络。实验通过对生成样本的定性与定量评估展示了该框架的潜力。
1 引言
深度学习的前景在于发现丰富的、层次化的模型 [2],这些模型能够表示在人工智能应用中遇到的各类数据(如自然图像、包含语音的音频波形以及自然语言语料中的符号)上的概率分布。迄今为止,深度学习最显著的成功大多涉及判别模型,通常是将高维、丰富的感官输入映射到类别标签的模型 [14, 22]。这些显著的成功主要基于反向传播和dropout算法,使用具有特别良好梯度行为的分段线性单元 [19, 9, 10]。深度生成模型的影响相对较小,原因是难以逼近最大似然估计及相关策略中出现的许多难处理的概率计算,以及在生成场景中难以利用分段线性单元的优势。我们提出了一种新的生成模型估计过程,回避了这些困难。111所有代码和超参数见 http://www.github.com/goodfeli/adversarial
在所提出的对抗网络框架中,生成模型与一个对手对抗:判别模型学习判断样本来自模型分布还是数据分布。生成模型可以类比为一个伪造团伙,试图制造假币并在不被察觉的情况下使用;而判别模型则类似于警察,试图识别这些伪造品。这场博弈中的竞争促使双方不断改进各自的方法,直到伪造品与真品难以区分。
该框架可以为许多类型的模型和优化算法产出具体的训练算法。在本文中,我们探讨一个特殊情形:生成模型通过将随机噪声传入一个多层感知机来生成样本,判别模型也是一个多层感知机。我们将这一特殊情形称为对抗网络。在此情形下,我们可以仅使用非常成功的反向传播和dropout算法 [17] 来训练两个模型,并仅使用前向传播从生成模型中采样。不需要近似推理或马尔可夫链。
2 相关工作
与含潜变量的有向图模型相对的一个替代方案是含潜变量的无向图模型,例如受限玻尔兹曼机(RBM)[27, 16]、深度玻尔兹曼机(DBM)[26] 及其众多变体。这类模型中的相互作用表示为未归一化势函数的乘积,并通过对所有随机变量状态的全局求和/积分进行归一化。该量(配分函数)及其梯度除最平凡的情形外都是难以处理的,但可以通过马尔可夫链蒙特卡洛(MCMC)方法估计。混合性给依赖于 MCMC 的学习算法带来了显著的问题 [3, 5]。
深度信念网络(DBN)[16] 是包含一个无向层和若干有向层的混合模型。尽管存在快速的近似逐层训练准则,DBN 仍然承担了无向和有向模型双方的计算困难。
也有一些不近似或不限定对数似然的替代准则,例如分数匹配(score matching)[18] 和噪声对比估计(NCE)[13]。两者都要求学习到的概率密度可以解析地指定到一个归一化常数为止。需要注意的是,在许多带有若干层潜变量的有趣生成模型(如 DBN 和 DBM)中,甚至无法导出一个易处理的未归一化概率密度。诸如去噪自编码器 [30] 与收缩自编码器之类的模型,其学习规则与应用于 RBM 的分数匹配非常相似。在 NCE 中,正如本工作一样,使用判别式训练准则来拟合一个生成模型。然而,并不是另外拟合一个独立的判别模型,而是用生成模型本身来区分生成的数据和来自固定噪声分布的样本。由于 NCE 使用固定的噪声分布,一旦模型已经在观察变量的一个小子集上学到了大致正确的分布之后,学习速度便急剧下降。
最后,一些技术并不显式地定义概率分布,而是训练一个生成机器以从目标分布中抽取样本。这种方法的优势是,这类机器可以设计为通过反向传播进行训练。该方向上近期的代表性工作包括生成随机网络(GSN)框架 [5],它扩展了广义去噪自编码器 [4]:二者均可视为定义了一个参数化的马尔可夫链,即学习一个执行生成式马尔可夫链一步的机器的参数。与 GSN 相比,对抗网络框架在采样时不需要马尔可夫链。由于对抗网络在生成过程中不需要反馈回路,因此能够更好地利用分段线性单元 [19, 9, 10],这类单元提高了反向传播的性能,但在反馈回路中使用时由于无界激活而存在问题。通过反向传播训练生成机器的更近期的例子包括变分自编码(auto-encoding variational Bayes)[20] 和随机反向传播 [24]。
3 对抗网络
当两个模型都是多层感知机时,对抗建模框架最容易应用。为了学习生成器在数据 $ {\textstyle \mathbf{x}} $ 上的分布 $ {\textstyle p_{g}} $,我们在输入噪声变量上定义先验 $ {\textstyle p_{\mathbf{z}}\hspace{0pt}{({\mathbf{z}})}} $,然后将到数据空间的映射表示为 $ {\textstyle G\hspace{0pt}{({\mathbf{z}};\theta_{g})}} $,其中 $ {\textstyle G} $ 是由参数为 $ {\textstyle \theta_{g}} $ 的多层感知机表示的可微函数。我们还定义第二个多层感知机 $ {\textstyle D\hspace{0pt}{({\mathbf{x}};\theta_{d})}} $,输出单个标量。$ {\textstyle D\hspace{0pt}{({\mathbf{x}})}} $ 表示 $ {\textstyle \mathbf{x}} $ 来自数据而非 $ {\textstyle p_{g}} $ 的概率。我们训练 $ {\textstyle D} $ 以最大化为训练样本和来自 $ {\textstyle G} $ 的样本分配正确标签的概率。同时,我们训练 $ {\textstyle G} $ 以最小化 $ {\textstyle \log{({1 - {D\hspace{0pt}{({G\hspace{0pt}{({\mathbf{z}})}})}}})}} $:
换言之,$ {\textstyle D} $ 与 $ {\textstyle G} $ 进行如下二人极小极大博弈,价值函数为 $ {\textstyle V\hspace{0pt}{(G,D)}} $:
| $ {\displaystyle {{{\min\limits_{G}{\max\limits_{D}V}}\hspace{0pt}{(D,G)}} = {{{\mathbb{E}}_{{\mathbf{x}} \sim {p_{\text{data}}\hspace{0pt}{({\mathbf{x}})}}}\hspace{0pt}{\lbrack{{\log D}\hspace{0pt}{({\mathbf{x}})}}\rbrack}} + {{\mathbb{E}}_{{\mathbf{z}} \sim {p_{\mathbf{z}}\hspace{0pt}{({\mathbf{z}})}}}\hspace{0pt}{\lbrack{\log{({1 - {D\hspace{0pt}{({G\hspace{0pt}{({\mathbf{z}})}})}}})}}\rbrack}}}}.} $ | (1) |
在下一节中,我们对对抗网络进行理论分析,本质上证明只要 $ {\textstyle G} $ 和 $ {\textstyle D} $ 具有足够的容量(即在非参数极限下),训练准则就能让我们恢复数据生成分布。关于该方法更非形式化、更具教学意义的解释,参见图 1。在实践中,我们必须用迭代的数值方法来实现该博弈。在训练的内层循环中将 $ {\textstyle D} $ 优化到完成在计算上是不可行的,而且在有限数据集上会导致过拟合。因此,我们交替进行 $ {\textstyle k} $ 步对 $ {\textstyle D} $ 的优化和一步对 $ {\textstyle G} $ 的优化。只要 $ {\textstyle G} $ 变化得足够慢,$ {\textstyle D} $ 就能保持在其最优解附近。该策略类似于 SML/PCD 训练 [31, 29] 在学习步骤之间保留来自马尔可夫链的样本,以避免将马尔可夫链的预热作为学习内层循环的一部分。该过程在算法 1 中正式给出。
在实践中,方程 1 可能无法为 $ {\textstyle G} $ 提供足够的梯度以良好学习。在学习初期,当 $ {\textstyle G} $ 表现较差时,$ {\textstyle D} $ 可以以高置信度拒绝这些样本,因为它们与训练数据明显不同。此时,$ {\textstyle \log{({1 - {D\hspace{0pt}{({G\hspace{0pt}{({\mathbf{z}})}})}}})}} $ 会饱和。与其训练 $ {\textstyle G} $ 最小化 $ {\textstyle \log{({1 - {D\hspace{0pt}{({G\hspace{0pt}{({\mathbf{z}})}})}}})}} $,我们可以训练 $ {\textstyle G} $ 最大化 $ {\textstyle {\log D}\hspace{0pt}{({G\hspace{0pt}{({\mathbf{z}})}})}} $。这一目标函数得到 $ {\textstyle G} $ 与 $ {\textstyle D} $ 动力学的同一个不动点,但在学习初期提供了强得多的梯度。
| … | ||||
| (a) | (b) | (c) | (d) |
对于训练迭代次数,执行 对 $ {\textstyle k} $ 步,执行 $ {\textstyle \bullet} $ 从噪声先验 $ {\textstyle p_{g}\hspace{0pt}{({\mathbf{z}})}} $ 中采样 $ {\textstyle m} $ 个噪声样本的小批量 $ {\textstyle \{{\mathbf{z}}^{(1)},\ldots,{\mathbf{z}}^{(m)}\}} $。 $ {\textstyle \bullet} $ 从数据生成分布 $ {\textstyle p_{\text{data}}\hspace{0pt}{({\mathbf{x}})}} $ 中采样 $ {\textstyle m} $ 个样本的小批量 $ {\textstyle \{{\mathbf{x}}^{(1)},\ldots,{\mathbf{x}}^{(m)}\}} $。 $ {\textstyle \bullet} $ 通过沿其随机梯度上升来更新判别器:
| $ {\displaystyle {{\nabla_{\theta_{d}}\frac{1}{m}}\hspace{0pt}{\sum\limits_{i = 1}^{m}\left\lbrack {{{\log D}\hspace{0pt}\left( {\mathbf{x}}^{(i)} \right)} + {\log\left( {1 - {D\hspace{0pt}\left( {G\hspace{0pt}\left( {\mathbf{z}}^{(i)} \right)} \right)}} \right)}} \right\rbrack}}.} $ |
结束 for $ {\textstyle \bullet} $ 从噪声先验 $ {\textstyle p_{g}\hspace{0pt}{({\mathbf{z}})}} $ 中采样 $ {\textstyle m} $ 个噪声样本的小批量 $ {\textstyle \{{\mathbf{z}}^{(1)},\ldots,{\mathbf{z}}^{(m)}\}} $。 $ {\textstyle \bullet} $ 通过沿其随机梯度下降来更新生成器:
| $ {\displaystyle {{\nabla_{\theta_{g}}\frac{1}{m}}\hspace{0pt}{\sum\limits_{i = 1}^{m}{\log\left( {1 - {D\hspace{0pt}\left( {G\hspace{0pt}\left( {\mathbf{z}}^{(i)} \right)} \right)}} \right)}}}.} $ |
结束 for基于梯度的更新可使用任何标准的基于梯度的学习规则。我们在实验中使用了动量。
4 理论结果
生成器 $ {\textstyle G} $ 隐式定义了一个概率分布 $ {\textstyle p_{g}} $,即当 $ {\textstyle {\mathbf{z}} \sim p_{\mathbf{z}}} $ 时所得样本 $ {\textstyle G\hspace{0pt}{({\mathbf{z}})}} $ 的分布。因此,我们希望算法 1 在容量与训练时间足够时收敛到 $ {\textstyle p_{\text{data}}} $ 的一个良好估计。本节的结果是在非参数设定下完成的,即我们通过研究概率密度函数空间中的收敛性来表示一个具有无限容量的模型。
我们将在第 4.1 节证明这一极小极大博弈在 $ {\textstyle p_{g} = p_{\text{data}}} $ 处具有全局最优。随后在第 4.2 节证明算法 1 优化方程 1,从而获得所期望的结果。
4.1 p_{g} = p_{\text{data}} 的全局最优性
我们首先考虑对任意给定生成器 $ {\textstyle G} $ 的最优判别器 $ {\textstyle D} $。
命题 1.
对于固定的 $ {\textstyle G} $,最优判别器 $ {\textstyle D} $ 为
| $ {\displaystyle {D_{G}^{\ast}\hspace{0pt}{({\mathbf{x}})}} = \frac{p_{\text{data}}\hspace{0pt}{({\mathbf{x}})}}{{p_{\text{data}}\hspace{0pt}{({\mathbf{x}})}} + {p_{g}\hspace{0pt}{({\mathbf{x}})}}}} $ | (2) |
证明。
对于给定的任意生成器 $ {\textstyle G} $,判别器 D 的训练准则是最大化数量 $ {\textstyle V\hspace{0pt}{(G,D)}} $
| $ {\textstyle {V\hspace{0pt}{(G,D)}} =} $ | $ {\textstyle {\int_{\mathbf{x}}{p_{\text{data}}\hspace{0pt}{({\mathbf{x}})}\hspace{0pt}{\log{({D\hspace{0pt}{({\mathbf{x}})}})}}\hspace{0pt}{dx}}} + {\int_{z}{p_{\mathbf{z}}\hspace{0pt}{({\mathbf{z}})}\hspace{0pt}{\log{({1 - {D\hspace{0pt}{({g\hspace{0pt}{({\mathbf{z}})}})}}})}}\hspace{0pt}{dz}}}} $ | |||
| $ {\textstyle =} $ | $ {\textstyle {\int_{\mathbf{x}}{p_{\text{data}}\hspace{0pt}{({\mathbf{x}})}\hspace{0pt}{\log{({D\hspace{0pt}{({\mathbf{x}})}})}}}} + {p_{g}\hspace{0pt}{({\mathbf{x}})}\hspace{0pt}{\log{({1 - {D\hspace{0pt}{({\mathbf{x}})}}})}}\hspace{0pt}d\hspace{0pt}x}} $ | (3) |
对于任意 $ {\textstyle {(a,b)} \in {{\mathbb{R}}^{2} \smallsetminus {\{ 0,0\}}}} $,函数 $ {\textstyle y\rightarrow{{a\hspace{0pt}{\log{(y)}}} + {b\hspace{0pt}{\log{({1 - y})}}}}} $ 在 $ {\textstyle \lbrack 0,1\rbrack} $ 上的最大值在 $ {\textstyle \frac{a}{a + b}} $ 处取得。判别器无需在 $ {\textstyle {S\hspace{0pt}u\hspace{0pt}p\hspace{0pt}p\hspace{0pt}{(p_{\text{data}})}} \cup {S\hspace{0pt}u\hspace{0pt}p\hspace{0pt}p\hspace{0pt}{(p_{g})}}} $ 之外定义,证明结束。∎
注意,$ {\textstyle D} $ 的训练目标可以解释为最大化估计条件概率 $ {\textstyle P\hspace{0pt}{({Y = \left. y \middle| {\mathbf{x}} \right.})}} $ 的对数似然,其中 $ {\textstyle Y} $ 表示 $ {\textstyle \mathbf{x}} $ 来自 $ {\textstyle p_{\text{data}}} $($ {\textstyle y = 1} $)还是来自 $ {\textstyle p_{g}} $($ {\textstyle y = 0} $)。方程 1 中的极小极大博弈现在可以重新表述为:
| $ {\textstyle {C\hspace{0pt}{(G)}} =} $ | $ {\textstyle {\max\limits_{D}V}\hspace{0pt}{(G,D)}} $ | |||
| $ {\textstyle =} $ | $ {\textstyle {{\mathbb{E}}_{{\mathbf{x}} \sim p_{\text{data}}}\hspace{0pt}{\lbrack{{\log D_{G}^{\ast}}\hspace{0pt}{({\mathbf{x}})}}\rbrack}} + {{\mathbb{E}}_{{\mathbf{z}} \sim p_{\mathbf{z}}}\hspace{0pt}{\lbrack{\log{({1 - {D_{G}^{\ast}\hspace{0pt}{({G\hspace{0pt}{({\mathbf{z}})}})}}})}}\rbrack}}} $ | (4) | ||
| $ {\textstyle =} $ | $ {\textstyle {{\mathbb{E}}_{{\mathbf{x}} \sim p_{\text{data}}}\hspace{0pt}{\lbrack{{\log D_{G}^{\ast}}\hspace{0pt}{({\mathbf{x}})}}\rbrack}} + {{\mathbb{E}}_{{\mathbf{x}} \sim p_{g}}\hspace{0pt}{\lbrack{\log{({1 - {D_{G}^{\ast}\hspace{0pt}{({\mathbf{x}})}}})}}\rbrack}}} $ | |||
| $ {\textstyle =} $ | $ {\textstyle {{\mathbb{E}}_{{\mathbf{x}} \sim p_{\text{data}}}\hspace{0pt}\left\lbrack {\log\frac{p_{\text{data}}\hspace{0pt}{({\mathbf{x}})}}{{P_{\text{data}}\hspace{0pt}{({\mathbf{x}})}} + {p_{g}\hspace{0pt}{({\mathbf{x}})}}}} \right\rbrack} + {{\mathbb{E}}_{{\mathbf{x}} \sim p_{g}}\hspace{0pt}\left\lbrack {\log\frac{p_{g}\hspace{0pt}{({\mathbf{x}})}}{{p_{\text{data}}\hspace{0pt}{({\mathbf{x}})}} + {p_{g}\hspace{0pt}{({\mathbf{x}})}}}} \right\rbrack}} $ |
定理 1.
虚拟训练准则 $ {\textstyle C\hspace{0pt}{(G)}} $ 的全局极小当且仅当 $ {\textstyle p_{g} = p_{\text{data}}} $ 时达到。在该点,$ {\textstyle C\hspace{0pt}{(G)}} $ 取值 $ {\textstyle - {\log 4}} $。
证明。
对于 $ {\textstyle p_{g} = p_{\text{data}}} $,$ {\textstyle {D_{G}^{\ast}\hspace{0pt}{({\mathbf{x}})}} = \frac{1}{2}} $(参考方程 2)。因此,在 $ {\textstyle {D_{G}^{\ast}\hspace{0pt}{({\mathbf{x}})}} = \frac{1}{2}} $ 处考察方程 4.1,我们得到 $ {\textstyle {C\hspace{0pt}{(G)}} = {{\log\frac{1}{2}} + {\log\frac{1}{2}}} = {- {\log 4}}} $。为说明这是 $ {\textstyle C\hspace{0pt}{(G)}} $ 可能的最优值,且仅在 $ {\textstyle p_{g} = p_{\text{data}}} $ 时达到,注意到
| $ {\displaystyle {{{\mathbb{E}}_{{\mathbf{x}} \sim p_{\text{data}}}\hspace{0pt}\left\lbrack {- {\log 2}} \right\rbrack} + {{\mathbb{E}}_{{\mathbf{x}} \sim p_{g}}\hspace{0pt}\left\lbrack {- {\log 2}} \right\rbrack}} = {- {\log 4}}} $ |
并且,将此表达式从 $ {\textstyle {C\hspace{0pt}{(G)}} = {V\hspace{0pt}{(D_{G}^{\ast},G)}}} $ 中减去,我们得到:
| $ {\displaystyle {C\hspace{0pt}{(G)}} = {{- {\log{(4)}}} + {K\hspace{0pt}L\hspace{0pt}\left( p_{\text{data}}\parallel\frac{p_{\text{data}} + p_{g}}{2} \right)} + {K\hspace{0pt}L\hspace{0pt}\left( p_{g}\parallel\frac{p_{\text{data}} + p_{g}}{2} \right)}}} $ | (5) |
其中 KL 为 Kullback–Leibler 散度。我们在上述表达式中识别出模型分布与数据生成过程之间的 Jensen–Shannon 散度:
| $ {\displaystyle {C\hspace{0pt}{(G)}} = {{- {\log{(4)}}} + {{2 \cdot J}\hspace{0pt}S\hspace{0pt}D\hspace{0pt}\left( p_{\text{data}}\parallel p_{g} \right)}}} $ | (6) |
由于两个分布之间的 Jensen–Shannon 散度始终非负,且仅在相等时为零,我们已证明 $ {\textstyle C^{\ast} = {- {\log{(4)}}}} $ 是 $ {\textstyle C\hspace{0pt}{(G)}} $ 的全局极小,且唯一解为 $ {\textstyle p_{g} = p_{\text{data}}} $,即生成模型完美复现数据生成过程。∎
<span id="convergence-of-algorithm-1">
4.2 算法 1 的收敛性
命题 2.
如果 $ {\textstyle G} $ 与 $ {\textstyle D} $ 具有足够的容量,并且在算法 1 的每一步中都允许判别器在给定 $ {\textstyle G} $ 的情况下达到其最优,且 $ {\textstyle p_{g}} $ 被更新以改进准则
| $ {\displaystyle {{\mathbb{E}}_{{\mathbf{x}} \sim p_{\text{data}}}\hspace{0pt}{\lbrack{{\log D_{G}^{\ast}}\hspace{0pt}{({\mathbf{x}})}}\rbrack}} + {{\mathbb{E}}_{{\mathbf{x}} \sim p_{g}}\hspace{0pt}{\lbrack{\log{({1 - {D_{G}^{\ast}\hspace{0pt}{({\mathbf{x}})}}})}}\rbrack}}} $ |
那么 $ {\textstyle p_{g}} $ 收敛到 $ {\textstyle p_{\text{data}}} $
证明。
考虑 $ {\textstyle {V\hspace{0pt}{(G,D)}} = {U\hspace{0pt}{(p_{g},D)}}} $ 作为 $ {\textstyle p_{g}} $ 的函数,如上述准则所做。注意 $ {\textstyle U\hspace{0pt}{(p_{g},D)}} $ 在 $ {\textstyle p_{g}} $ 中是凸的。凸函数上确界的次导数包含在最大值取得点处该函数的导数。换言之,若 $ {\textstyle {f\hspace{0pt}{(x)}} = {\sup_{\alpha \in \mathcal{A}}{f_{\alpha}\hspace{0pt}{(x)}}}} $ 且对每个 $ {\textstyle \alpha} $,$ {\textstyle f_{\alpha}\hspace{0pt}{(x)}} $ 在 $ {\textstyle x} $ 中是凸的,则当 $ {\textstyle \beta = {\arg\hspace{0pt}{\sup_{\alpha \in \mathcal{A}}{f_{\alpha}\hspace{0pt}{(x)}}}}} $ 时 $ {\textstyle {\partial{f_{\beta}\hspace{0pt}{(x)}}} \in {\partial f}} $。这相当于在给定 $ {\textstyle G} $ 所对应的最优 $ {\textstyle D} $ 处对 $ {\textstyle p_{g}} $ 进行一次梯度下降更新。$ {\textstyle \sup_{D}{U\hspace{0pt}{(p_{g},D)}}} $ 在 $ {\textstyle p_{g}} $ 中是凸的,并具有唯一全局最优(如定理 1 所证),因此对 $ {\textstyle p_{g}} $ 进行足够小的更新时,$ {\textstyle p_{g}} $ 收敛到 $ {\textstyle p_{x}} $,证明结束。∎
在实践中,对抗网络通过函数 $ {\textstyle G\hspace{0pt}{({\mathbf{z}};\theta_{g})}} $ 表示有限的 $ {\textstyle p_{g}} $ 分布族,我们优化的是 $ {\textstyle \theta_{g}} $ 而非 $ {\textstyle p_{g}} $ 本身。用多层感知机定义 $ {\textstyle G} $ 会在参数空间中引入多个临界点。然而,多层感知机在实践中的优秀表现表明,尽管缺乏理论保证,它仍然是一个合理可用的模型。
5 实验
我们在多个数据集上训练对抗网络,包括 MNIST [23]、Toronto Face Database(TFD)[28] 与 CIFAR-10 [21]。生成器网络混合使用整流线性激活 [19, 9] 与 sigmoid 激活,而判别器网络使用 maxout [10] 激活。在训练判别器网络时使用了 dropout [17]。尽管我们的理论框架允许在生成器的中间层使用 dropout 和其他噪声,但我们仅将噪声用作生成器网络最底层的输入。
我们通过对 $ {\textstyle G} $ 生成的样本拟合高斯 Parzen 窗,并报告该分布下的对数似然,来估计测试集数据在 $ {\textstyle p_{g}} $ 下的概率。高斯的 $ {\textstyle \sigma} $ 参数通过在验证集上交叉验证获得。该流程由 Breuleux 等人 [8] 提出,并被应用于多种无法直接计算精确似然的生成模型 [25, 3, 5]。结果见表 1。这种似然估计方法方差较大,在高维空间中表现不佳,但据我们所知是目前可用的最佳方法。能够采样但无法直接估计似然的生成模型的进展,激励了关于如何评估此类模型的进一步研究。
| 模型 | MNIST | TFD |
|---|---|---|
| DBN [3] | $ {\textstyle 138 \pm 2} $ | $ {\textstyle 1909 \pm 66} $ |
| Stacked CAE [3] | $ {\textstyle 121 \pm 1.6} $ | $ {\textstyle \mathbf{2}\mathbf{1}\mathbf{1}\mathbf{0} \pm \mathbf{5}\mathbf{0}} $ |
| Deep GSN [6] | $ {\textstyle 214 \pm 1.1} $ | $ {\textstyle 1890 \pm 29} $ |
| 对抗网络 | $ {\textstyle \mathbf{2}\mathbf{2}\mathbf{5} \pm \mathbf{2}} $ | $ {\textstyle \mathbf{2}\mathbf{0}\mathbf{5}\mathbf{7} \pm \mathbf{2}\mathbf{6}} $ |
在图 2 和图 3 中,我们展示了训练后从生成器网络中抽取的样本。虽然我们不声称这些样本优于已有方法生成的样本,但我们相信它们至少与文献中较好的生成模型具有竞争力,并凸显了对抗框架的潜力。
|
|
| a) | b) |
|
|
| c) | d) |
| 深度有向图模型 | 深度无向图模型 | 生成式自编码器 | 对抗模型 | |
| 训练 | 训练时需要推理。 | 训练时需要推理。需要 MCMC 以近似配分函数梯度。 | 在混合性与重构/生成能力之间存在强制取舍 | 需保持判别器与生成器同步。Helvetica。 |
| 推理 | 学习到的近似推理 | 变分推理 | 基于 MCMC 的推理 | 学习到的近似推理 |
| 采样 | 无困难 | 需要马尔可夫链 | 需要马尔可夫链 | 无困难 |
| 评估 $ {\textstyle p\hspace{0pt}{(x)}} $ | 难以处理,可用 AIS 近似 | 难以处理,可用 AIS 近似 | 不显式表示,可用 Parzen 密度估计近似 | 不显式表示,可用 Parzen 密度估计近似 |
| 模型设计 | 几乎所有模型都面临极大困难 | 需要精心设计以确保多种性质 | 任何可微函数在理论上都是允许的 | 任何可微函数在理论上都是允许的 |
6 优势与劣势
这个新框架相对于以往的建模框架既有优势也有劣势。劣势主要是 $ {\textstyle p_{g}\hspace{0pt}{({\mathbf{x}})}} $ 没有显式表示,以及 $ {\textstyle D} $ 在训练时必须与 $ {\textstyle G} $ 良好同步(具体而言,$ {\textstyle G} $ 在不更新 $ {\textstyle D} $ 的情况下不能训练过多,以避免“Helvetica 情景”——即 $ {\textstyle G} $ 将过多的 $ {\textstyle \mathbf{z}} $ 值塌缩到相同的 $ {\textstyle \mathbf{x}} $ 值,导致没有足够的多样性来建模 $ {\textstyle p_{\text{data}}} $),就像玻尔兹曼机的负链必须在学习步骤之间保持同步那样。优势在于从不需要马尔可夫链,仅使用反向传播(backprop)来获得梯度,学习期间不需要推理,并且模型中可以纳入种类繁多的函数。表 2 总结了生成对抗网络与其他生成建模方法的比较。
上述优势主要是计算上的。对抗模型还可能获得某些统计上的优势,因为生成器网络并不直接用数据样本更新,而是仅用流经判别器的梯度更新。这意味着输入的成分不会直接被复制到生成器的参数中。对抗网络的另一个优势是可以表示非常尖锐甚至退化的分布,而基于马尔可夫链的方法则要求分布略显模糊,以便链能够在不同模式之间混合。
7 结论与未来工作
该框架允许许多直接的扩展:
1.
通过将 $ {\textstyle \mathbf{c}} $ 作为输入同时加入 $ {\textstyle G} $ 与 $ {\textstyle D} $,可以得到条件生成模型 $ {\textstyle p\hspace{0pt}{({{\mathbf{x}} \mid {\mathbf{c}}})}} $。
2.
可以通过训练一个辅助网络在给定 $ {\textstyle \mathbf{x}} $ 的情况下预测 $ {\textstyle \mathbf{z}} $ 来进行学习到的近似推理。这与 wake-sleep 算法 [15] 训练的推理网络类似,但其优势在于:可以在生成器网络训练完成之后,针对一个固定的生成器网络训练推理网络。
3.
可以通过训练一组共享参数的条件模型来近似建模所有条件 $ {\textstyle p\hspace{0pt}{({{\mathbf{x}}_{S} \mid {\mathbf{x}}_{\mathit{S\not{}}}})}} $,其中 $ {\textstyle S} $ 是 $ {\textstyle \mathbf{x}} $ 索引的子集。本质上,可以使用对抗网络实现确定性 MP-DBM [11] 的随机扩展。
4.
半监督学习:当可用的标注数据有限时,来自判别器或推理网络的特征可以提升分类器的性能。
5.
效率提升:通过设计更好的方法来协调 $ {\textstyle G} $ 与 $ {\textstyle D} $,或在训练期间确定更好的 $ {\textstyle \mathbf{z}} $ 采样分布,可以大幅加快训练速度。
本文论证了对抗建模框架的可行性,表明这些研究方向可能富有成效。
致谢
我们要感谢 Patrice Marcotte、Olivier Delalleau、Kyunghyun Cho、Guillaume Alain 和 Jason Yosinski 进行的有益讨论。Yann Dauphin 与我们分享了他的 Parzen 窗评估代码。我们要感谢 Pylearn2 [12] 与 Theano [7, 1] 的开发者,尤其是 Frédéric Bastien,他专门为本项目加急加入了一个 Theano 特性。Arnaud Bergeron 在 LaTeX 排版方面提供了非常必要的支持。我们还要感谢 CIFAR 和 Canada Research Chairs 的资助,以及 Compute Canada 和 Calcul Québec 提供的计算资源。Ian Goodfellow 获得 2013 年 Google 深度学习奖学金的支持。最后,我们要感谢 Les Trois Brasseurs 激发了我们的创造力。
参考文献
- Bastien et al. [2012] Bastien, F., Lamblin, P., Pascanu, R., Bergstra, J., Goodfellow, I. J., Bergeron, A., Bouchard, N., 与 Bengio, Y. (2012). Theano: new features and speed improvements. Deep Learning and Unsupervised Feature Learning NIPS 2012 Workshop.
- Bengio [2009] Bengio, Y. (2009). Learning deep architectures for AI. Now Publishers.
- Bengio et al. [2013a] Bengio, Y., Mesnil, G., Dauphin, Y., 与 Rifai, S. (2013a). Better mixing via deep representations. 见 ICML’13。
- Bengio et al. [2013b] Bengio, Y., Yao, L., Alain, G., 与 Vincent, P. (2013b). Generalized denoising auto-encoders as generative models. 见 NIPS26。Nips Foundation。
- Bengio et al. [2014a] Bengio, Y., Thibodeau-Laufer, E., 与 Yosinski, J. (2014a). Deep generative stochastic networks trainable by backprop. 见 ICML’14。
- Bengio et al. [2014b] Bengio, Y., Thibodeau-Laufer, E., Alain, G., 与 Yosinski, J. (2014b). Deep generative stochastic networks trainable by backprop. 见 Proceedings of the 30th International Conference on Machine Learning (ICML’14)。
- Bergstra et al. [2010] Bergstra, J., Breuleux, O., Bastien, F., Lamblin, P., Pascanu, R., Desjardins, G., Turian, J., Warde-Farley, D., 与 Bengio, Y. (2010). Theano: a CPU and GPU math expression compiler. 见 Proceedings of the Python for Scientific Computing Conference (SciPy)。口头报告。
- Breuleux et al. [2011] Breuleux, O., Bengio, Y., 与 Vincent, P. (2011). Quickly generating representative samples from an RBM-derived process. Neural Computation, 23(8), 2053–2073.
- Glorot et al. [2011] Glorot, X., Bordes, A., 与 Bengio, Y. (2011). Deep sparse rectifier neural networks. 见 AISTATS’2011。
- Goodfellow et al. [2013a] Goodfellow, I. J., Warde-Farley, D., Mirza, M., Courville, A., 与 Bengio, Y. (2013a). Maxout networks. 见 ICML’2013。
- Goodfellow et al. [2013b] Goodfellow, I. J., Mirza, M., Courville, A., 与 Bengio, Y. (2013b). Multi-prediction deep Boltzmann machines. 见 NIPS’2013。
- Goodfellow et al. [2013c] Goodfellow, I. J., Warde-Farley, D., Lamblin, P., Dumoulin, V., Mirza, M., Pascanu, R., Bergstra, J., Bastien, F., 与 Bengio, Y. (2013c). Pylearn2: a machine learning research library. arXiv preprint arXiv:1308.4214.
- Gutmann 与 Hyvarinen [2010] Gutmann, M. 与 Hyvarinen, A. (2010). Noise-contrastive estimation: A new estimation principle for unnormalized statistical models. 见 AISTATS’2010。
- Hinton et al. [2012a] Hinton, G., Deng, L., Dahl, G. E., Mohamed, A., Jaitly, N., Senior, A., Vanhoucke, V., Nguyen, P., Sainath, T., 与 Kingsbury, B. (2012a). Deep neural networks for acoustic modeling in speech recognition. IEEE Signal Processing Magazine, 29(6), 82–97.
- Hinton et al. [1995] Hinton, G. E., Dayan, P., Frey, B. J., 与 Neal, R. M. (1995). The wake-sleep algorithm for unsupervised neural networks. Science, 268, 1558–1161.
- Hinton et al. [2006] Hinton, G. E., Osindero, S., 与 Teh, Y. (2006). A fast learning algorithm for deep belief nets. Neural Computation, 18, 1527–1554.
- Hinton et al. [2012b] Hinton, G. E., Srivastava, N., Krizhevsky, A., Sutskever, I., 与 Salakhutdinov, R. (2012b). Improving neural networks by preventing co-adaptation of feature detectors. 技术报告,arXiv:1207.0580。
- Hyvärinen [2005] Hyvärinen, A. (2005). Estimation of non-normalized statistical models using score matching. J. Machine Learning Res., 6.
- Jarrett et al. [2009] Jarrett, K., Kavukcuoglu, K., Ranzato, M., 与 LeCun, Y. (2009). What is the best multi-stage architecture for object recognition? 见 Proc. International Conference on Computer Vision (ICCV’09),第 2146–2153 页。IEEE。
- Kingma 与 Welling [2014] Kingma, D. P. 与 Welling, M. (2014). Auto-encoding variational bayes. 见 Proceedings of the International Conference on Learning Representations (ICLR)。
- Krizhevsky 与 Hinton [2009] Krizhevsky, A. 与 Hinton, G. (2009). Learning multiple layers of features from tiny images. 技术报告,University of Toronto。
- Krizhevsky et al. [2012] Krizhevsky, A., Sutskever, I., 与 Hinton, G. (2012). ImageNet classification with deep convolutional neural networks. 见 NIPS’2012。
- LeCun et al. [1998] LeCun, Y., Bottou, L., Bengio, Y., 与 Haffner, P. (1998). Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11), 2278–2324.
- Rezende et al. [2014] Rezende, D. J., Mohamed, S., 与 Wierstra, D. (2014). Stochastic backpropagation and approximate inference in deep generative models. 技术报告,arXiv:1401.4082。
- Rifai et al. [2012] Rifai, S., Bengio, Y., Dauphin, Y., 与 Vincent, P. (2012). A generative process for sampling contractive auto-encoders. 见 ICML’12。
- Salakhutdinov 与 Hinton [2009] Salakhutdinov, R. 与 Hinton, G. E. (2009). Deep Boltzmann machines. 见 AISTATS’2009,第 448–455 页。
- Smolensky [1986] Smolensky, P. (1986). Information processing in dynamical systems: Foundations of harmony theory. 见 D. E. Rumelhart 与 J. L. McClelland 编,Parallel Distributed Processing,卷 1,第 6 章,第 194–281 页。MIT Press,Cambridge。
- Susskind et al. [2010] Susskind, J., Anderson, A., 与 Hinton, G. E. (2010). The Toronto face dataset. Technical Report UTML TR 2010-001, U. Toronto。
- Tieleman [2008] Tieleman, T. (2008). Training restricted Boltzmann machines using approximations to the likelihood gradient. 见 W. W. Cohen, A. McCallum, 与 S. T. Roweis 编,ICML 2008,第 1064–1071 页。ACM。
- Vincent et al. [2008] Vincent, P., Larochelle, H., Bengio, Y., 与 Manzagol, P.-A. (2008). Extracting and composing robust features with denoising autoencoders. 见 ICML 2008。
- Younes [1999] Younes, L. (1999). On the convergence of Markovian stochastic algorithms with rapidly decreasing ergodicity rates. Stochastics and Stochastic Reports, 65(3), 177–228.


