MMD :maximum mean discrepancy

MMD :maximum mean discrepancy(最大平均差异)

MMD:maximum mean discrepancy。最大平均差异。最先提出的时候用于双样本的检测(two-sample test)问题,用于判断两个分布p和q是否相同。它的基本假设是:如果对于所有以分布生成的样本空间为输入的函数f,如果两个分布生成的足够多的样本在f上的对应的像的均值都相等,那么那么可以认为这两个分布是同一个分布。现在一般用于度量两个分布之间的相似性。在[1]中从任意空间到RKHS上介绍了MMD的计算,这里根据这个顺序来介绍。

1.任意函数空间(arbitary function space)的MMD 
具体而言,基于MMD(maximize mean discrepancy)的统计检验方法是指下面的方式:基于两个分布的样本,通过寻找在样本空间上的连续函数f,求不同分布的样本在f上的函数值的均值,通过把两个均值作差可以得到两个分布对应于f的mean discrepancy。寻找一个f使得这个mean discrepancy有最大值,就得到了MMD。最后取MMD作为检验统计量(test statistic),从而判断两个分布是否相同。如果这个值足够小,就认为两个分布相同,否则就认为它们不相同。同时这个值也用来判断两个分布之间的相似程度。如果用F表示一个在样本空间上的连续函数集,那么MMD可以用下面的式子表示:

假设X和Y分别是从分布p和q通过独立同分布(iid)采样得到的两个数据集,数据集的大小分别为m和n。基于X和Y可以得到MMD的经验估计(empirical estimate)为:

在给定两个分布的观测集X,Y的情况下,这个结果会严重依赖于给定的函数集F。为了能表示MMD的性质:当且仅当p和q是相同分布的时候MMD为0,那么要求F足够rich;另一方面为了使检验具有足够的连续性(be consistent in power),从而使得MMD的经验估计可以随着观测集规模增大迅速收敛到它的期望,F必须足够restrictive。文中证明了当F是universal RKHS上的(unit ball)单位球时,可以满足上面两个性质。 
2.再生核希尔伯特空间的MMD(The MMD In reproducing kernel Hilbert Spaces): 
这部分讲述了在RHKS上单位球(unit ball)作为F的时,通过有限的观测来对MMD进行估计,并且设立一些MMD可以用来区分概率度量的条件。 
在RKHS上,每个f对应一个feature map。在feature map的基础上,首先对于某个分布p定义一个mean embedding of p,它满足如下的性质: 
 

mean embedding存在是有约束条件的[1]。在p和q的mean embedding存在的条件下,MMD的平方可以表示如下:

下面是关于MMD作为一个Borel probability measures时,对F的一个约束及其证明,要求F:be a unit ball in a universal RKHS。比如Gaussian和Laplace RKHSs。进一步在给定了RKHS对应核函数,这个MMD的平方可以表示:

x和x’分别表示两个服从于p的随机变量,y和y‘分别表示服从q的随机变量。对于上面的一个统计估计可以表示为:

对于一个two-sample test, 给定的null hypothesis: p和q是相同,以及the alternative hypothesis: p和q不等。这个通过将test statistic和一个给定的阈值相比较得到,如果MMD大于阈值,那么就reject null hypothesis,也就是两个分布不同。如果MMD小于某个阈值,就接受null hypothesis。由于MMD的计算时使用的是有限的样本数,这里会出现两种类型的错误:第一种错误出现在null hypothesis被错误的拒绝了;也就是本来两个分布相同,但是却被判定为相同。反之,第二种错误出现在null hypothesis被错误的接受了。文章[1]中提供了许多关于hypothesis test的方法,这里不讨论。 
在domain adaptation中,经常用到MMD来在特征学习的时候构造正则项来约束学到的表示,使得两个域上的特征尽可能相同。从上面的定义看,我们在判断两个分布p和q的时候,需要将观测样本首先映射到RKHS空间上,然后再判断。但实际上很多文章直接将观测样本用于计算,省了映射的那个步骤。

reference 
[1] A kernel two sample test 
[2] Optimal kernel choice for large-scale two-sample tests 
[3] Deep domain confusion: maximizing for domain invariance 
[4] Learning transferable feature with deep adaptation nets 
[5] Deep transfer network:Unsupervised domain adaptation 
[6] Adaptive visual category models to new domains 
[7] Geodesic flow kernel for unsupervised domain adaptation 
[8] Transfer sparse coding for robust image representation
---------------------
作者:xiaocong1990
来源:CSDN
原文:https://blog.csdn.net/xiaocong1990/article/details/72051375
版权声明:本文为博主原创文章,转载请附上博文链接!

原文地址:https://www.cnblogs.com/jiangkejie/p/11178108.html

时间: 2024-08-02 12:19:11

MMD :maximum mean discrepancy的相关文章

LeetCode:Maximum Product Subarray

题目:Maximum Product Subarray Find the contiguous subarray within an array (containing at least one number) which has the largest product. For example, given the array [2,3,-2,4], the contiguous subarray [2,3] has the largest product = 6. 这道题属于动态规划的题型,

asp.net 文件上传出错:Maximum request length exceeded 解决方法

<configuration>    <system.web>               <httpRuntime maxRequestLength="102400" useFullyQualifiedRedirectUrl="true" minFreeThreads="8" minLocalRequestFreeThreads="4" appRequestQueueLimit="10

学习笔记:LeetCode104:Maximum Depth of Binary Tree

LeetCode104:Maximum Depth of Binary Tree Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node. 求二叉树的最大深度,树节点包含当前值及分别指向其左右子节点的引用,如下: 1 /** 2 * De

leetcode笔记:Maximum Depth of Binary Tree

一. 题目描述 Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node. 二. 题目分析 这道题和Minimum Depth of Binary Tree一题相似,这个是求最大深度的,就是对二叉树进行递归,然后将子树的最大深度进行返回,最

lintcode 中等题:maximum subarray difference 最大子数组差

题目 最大子数组差 给定一个整数数组,找出两个不重叠的子数组A和B,使两个子数组和的差的绝对值|SUM(A) - SUM(B)|最大. 返回这个最大的差值. 样例 给出数组[1, 2, -3, 1],返回 6 注意 子数组最少包含一个数 挑战 时间复杂度为O(n),空间复杂度为O(n) 解题 刚做了数组中两个子数组和的最大值,这一题是求差,感觉上题的求解思想应该是可以用的 A B 分别是两个子数组的和,则: 所以 当A>B 的时候A越大越好 B越小越好 当A<B 的时候B越大越好 A越小越好

欧拉工程第67题:Maximum path sum II

By starting at the top of the triangle below and moving to adjacent numbers on the row below, the maximum total from top to bottom is 23. 37 42 4 68 5 9 3 That is, 3 + 7 + 4 + 9 = 23. Find the maximum total from top to bottom in triangle.txt (right c

leetcode笔记:Maximum Product of Word Lengths

一. 题目描述 Given a string array words, find the maximum value of length(word[i]) * length(word[j]) where the two words do not share common letters. You may assume that each word will contain only lower case letters. If no such two words exist, return 0.

LeetCode之“动态规划”:Maximum Product Subarray

题目链接 题目要求: Find the contiguous subarray within an array (containing at least one number) which has the largest product. For example, given the array [2,3,-2,4], the contiguous subarray [2,3] has the largest product = 6. 题目分析参考自一博文: 这道题跟Maximum Subarr

LeetCode:Maximum Depth of Binary Tree

要求:求二叉树的深度(二叉树的深度为最远叶子节点到根节点的距离,即根节点到最远叶子节点的距离) Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node. 有两种求解的思路,一种采用DFS的思想,一种采用BFS的思想,如下代码所示: 1 s