首页 > 其他分享 >Density estimation using Real NVP

Density estimation using Real NVP

时间:2023-05-25 10:46:20浏览次数:42  
标签:Real layers Density text nabla det using estimation

目录

Dinh L, Sohl-Dickstein J. and Bengio S. Density estimation using real nvp. ICLR, 2017.

一种可逆的 flow, 感觉很 diffusion 已经非常非常像了. 果然, 伟大的成果从来不是一蹴而就的.

Motivation

  • \(x\) 是原始数据, \(z\) 是隐变量, 作者希望找到一个可逆变换 \(f\) 满足:

    1. \(z = f(x)\) 服从一个简单的分布, 比如正态分布;
    2. 逆变换 \(f^{-1}\) 是容易操作的.
  • 如此一来, 我们就可以直接从一个简单的分布 \(p_Z\) 中采样 \(z\), 然后通过

    \[x = f^{-1}(z) \]

    就完成了 generation 的过程.

Real NVP

  • 至于怎么找到这个变换 \(f(\cdot)\) 就是借用 flow 的思想了.

  • 我们知道, 对于 \(z = f(x)\) 有

    \[p_Z(z) = p_X(f^{-1}(z)) |\text{det}(\nabla_x f)|^{-1} \Rightarrow p_X(x) = p_Z(f(x)) |\text{det}(\nabla_x f(x))|. \]

  • 我们假设 \(p_Z(z)\) 服从一个简单的分布 (比如高斯分布), 如此一来只需要极大化对数似然即可:

    \[\max_f \quad \log (p_X(x)) = \log (p_Z(f(x))) + \log (|\text{det}(\nabla_x f(x))|). \]

  • 整体的可行性要求:

    1. \(f(\cdot)\) 具有较强的表达能力, 使得它能够将 \(x\) 映射到一般的简单分布中去;
    2. \(\text{det}(\nabla_x f(x))\) 是容易求解的.

Coupling layers

  • 作者介绍了一种 coupling layers, 符合我们所需的条件.

  • 每一层, 我们将输入 \(x\) 切分为 \([x_1, x_2]\), 然后根据如下变换得到输出:

    \[y_1 = x_1 \\ y_2 = x_2 \odot \exp(s(x_1)) + t(x_1), \]

    其中 \(s, t\) 是可训练的 scale, translation function.

  • 容易证明:

    \[\nabla_x y = \left [ \begin{array}{ll} \mathbb{I}_d & 0 \\ \nabla_{x_1} y_2 & \text{diag}(\exp(s(x_{1:d}))) \end{array} \right ], \]

    为一下三角矩阵, 所以它的行列式就是对角元素的乘积.

  • 如果给定 \(y\), 反向求解 \(x\) 也是容易的:

    \[x_1 = y_1, \\ x_2 = (y_2 - t(y_1)) \odot \exp(-s(y_1)). \]

  • 假设我们用了两层:

    \[z = f(y) = f \circ g (x), \]

    \[\nabla_x z = \nabla_y f \nabla_x g, \]

    \[\text{det}(\nabla_x z) = \text{det}(\nabla_y f) \text{det}(\nabla_x g), \]

    只需一层层算就可以了.

  • 显然, 该思想可以很容易扩展到多层. 另外, 需要注意的是, 每一层, 输入的切分应当是各异的以避免一部分特征始终不变.

标签:Real,layers,Density,text,nabla,det,using,estimation
From: https://www.cnblogs.com/MTandHJ/p/17430451.html

相关文章

  • 使用 TensorFlow 自动微分和神经网络功能估算线性回归的参数(Estimate parameters for
    大多数的深度学习框架至少都会具备以下功能:(1)张量运算(2)自动微分(3)神经网络及各种神经层TensorFlow框架亦是如此。在《深度学习全书公式+推导+代码+TensorFlow全程案例》——洪锦魁主编清华大学出版社ISBN978-7-302-61030-4这本书第3章《TensorFlow架构与主要功能》这一......
  • C#学习笔记 - using语句
    using语句某些类型的非托管对象有数量限制或很耗费系统资源,在代码使用完他们后,尽快释放他们是很重要的using语句有助于简化这一过程,并确保这些资源被适当的处理(0)资源指实现了System.IDisposable接口的类或结构.IDisposalbe接口中有个Dispose的方法,使用这个方法去处置......
  • Paper Reading: forgeNet a graph deep neural network model using tree-based ensem
    目录研究动机文章贡献本文方法图嵌入深度前馈网络forgeNet特征重要性评估具体实现模拟实验合成数据生成实验评估实验结果真实数据应用BRCA数据集microRNA数据Healthyhumanmetabolomics数据集优点和创新点PaperReading是从个人角度进行的一些总结分享,受到个人关注点的侧重......
  • java.sql.SQLException: Access denied for user 'root'@'localhost' (using password
    org.apache.ibatis.exceptions.PersistenceException:###Errorqueryingdatabase.Cause:java.sql.SQLException:Accessdeniedforuser'root'@'localhost'(usingpassword:YES)###Theerrormayexistincom/itheima/mapper/BrandMapper.j......
  • Unzipping Files In iOS Using ZipArchive
    Inthistutorial,IamgoingtodemonstratehowyoucanzipandunzipfilesfromwithinyouriOSapplications.WewillbeusingathirdpartylibrarycalledZipArchivetoachievethis.Whilethereareacouplesolutionsouttheretozipandunzipfiles,......
  • Real-Time Water Waves With Wave Particles - cem yuksel - 2010
    摘要:Thisdissertationdescribesthewaveparticlestechniqueforsimulatingwatersurfacewavesandtwowayfluid-objectinteractionsforreal-timeapplications,suchasvideogames.本文描述了用于模拟水面波的波粒子技术和用于视频游戏等实时应用的双向流体-物体......
  • generate a 3D chart in Python using the CSV data
    Here's an example of how you could use Matplotlib to create a 3D scatter plot from your CSV data:   importpandasaspdimportmatplotlib.pyplotaspltfrommpl_toolkits.mplot3dimportAxes3D#LoadtheCSVdataintoaPand......
  • Unreal Engine 大象无形学习笔记(第二部分:虚幻引擎浅析)
     Q1.虚幻引擎的Main函数在哪?LaunchWindows.cpp中找到WinMain。Q2.虚幻引擎为什么要引入模块机制?编辑器模式、发布模式要单独配置非常麻烦。工具:UnrealBuildTool包含大模块:Runtime、Development、Editor、Plugin每个模块包含:Public、Private文件夹,.build.cs文件作用......
  • Dynamic Process Creation Using API [JBPM 5.1]
    [url]http://atulkotwale.blogspot.com/2012/01/dynamic-process-creation-using-api-jbpm.html[/url]HiFriends,Asyouguysallknowjbpmhascameupwithnewversion.Ithassomebeautifulfeatures.InthispostIwillshowyouhowcanwe......
  • Ubuntu 22.04 停止显示 Daemons using outdated libraries
    这是Ubuntu22.04的新特性,现在是apt-get安装过程的一个步骤,是由needrestart命令触发,默认情况是交互性质的,也就是会中断在这里需要手动要处理提示。解决的方法是修改/etc/needrestart/needrestart.conf文件,将#$nrconf{restart}='i';这行去掉注释,按照需要改成以下两......