2021-07-13

今天看了非常基础的GAN的介绍,我自己是想看更多的理论的,所以general的内容就很快过一遍了。
大致记了一些笔记如下:

一、随机变量的产生

随机变量的产生方法有很多,rejection sampling等。我们关注于:inverse transfrom method。
随机生成 0-1 之间的数 u
就是计算机智能产生(0,1)之间的均匀分布。其他分布必须基于这个分布去产生。
具体怎么"基于这个分布去产生",则用cdf的逆变换的方法去产生。

逆变换采样法
我自己的理解其实也是对0-1上的均匀分布进行逆变换,
知乎上有这样一个例子,但是感觉自己不太懂。
pdf(x) = x/ 2 有 cdf(x) = 1/4 x^2:

y = 1/4 x^2 → x = sqrt(4y) → 反函数 : y = sqrt(4x) → e = sqrt(4*drand48())

那么e就是符合 pdf = x/2 分布的变量。

二、generative models

nn的狗的照片可以转化为N维向量:N=nn。
这个N维向量形成一个复杂的“狗的概率分布”。
进一步:
用神经网络的方法,把N维简单的随机变量转化成
复杂的“狗的概率分布”。(网络的输出should follow the target distribution).

二、generative matching networks

直接产生概率分布的办法:(直接training方法)
comparing the true and the generated probability distributions and backpropagating the difference (the error) through the network

Maximum Mean Discrepancy (MMD) approach.
定义了两个概率分布的间距

之后通过后向传播来计算

三、间接training方法

The brilliant idea that rules GANs consists in replacing this direct comparison by an indirect one that takes the form of a downstream task over these two distributions

in a GAN architecture, we have a discriminator, that takes samples of true and generated data and that try to classify them as well as possible, and a generator that is trained to fool the discriminator as much as possible.

直接方法和间接方法在理论上都能得到最优的生成器(下一节有进一步证明)

四、理想情况:完美的生成器与分类器

perfect的定义: they are not constrained by any kind of (parametrised) model.


这个图还是该记在脑子里的。

indirect比direct强的地方:

For the first point, the difficulty of directly comparing two probability distributions based on samples counterbalances the apparent higher complexity of indirect method. 比较起来简单

For the second point, it is obvious that the discriminator is not known. However, it can be learned!

五、近似情况:对抗神经网络

generator的输入:随机变量
generator的输出:满足目标分布的随机变量

discriminator的输入:generator的输出
discriminator的输出:是否是true

从game theory的角度理解:min-max two-player game

平衡态(## equilibrium state):

the generator produces data from the exact targeted distribution and where the discriminator predicts “true” or “generated” with probability 1/2 for any point it receives.

六、数学细节:对抗神经网络

原Paper用的是cross-entropy error,这里用的是absolute error.

GAN的损失函数

这个式子其实很好理解的
第一行:x是真实图,p_z为generator的概率分布,G(z)为生成器的输出。
D(x)要和1相减,D(G(z))要和0相减。
第二行:p_g是生成器的输出图的概率分布。

loss function2

这里相当于把期望拆开来写了


loss function
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • 现在网上介绍 GAN 的文章很多,理解角度也是多种多样。最近在 towardsdatascience 网站闲逛的时...
    OurNote阅读 8,422评论 0 2
  • 9. 循环神经网络 场景描述 循环神经网络(Recurrent Neural Network)是一种主流的深度学习...
    _龙雀阅读 7,946评论 0 3
  • GAN-QP 写到一半发现关于 WGAN 以及它相关约束部分之前没有完全读懂,需要重读,那顺手也把笔记给谢了吧 W...
    Duffy_x阅读 5,721评论 0 0
  • 1. InfoGAN简介: 普通的GAN存在无约束、不可控、噪声信号z很难解释等问题,2016年发表在NIP...
    baiyang白杨阅读 14,408评论 2 5
  • 2018/11/07 机器学习-Gan算法 Alpha go:运用蒙特卡洛搜索树,深度学习,机器学习三种方法 1...
    坚持的皮蛋阅读 11,495评论 1 3

友情链接更多精彩内容