论文标题
快速产生大量的牙龈 - 最大变量
Fast Generating A Large Number of Gumbel-Max Variables
论文作者
论文摘要
众所周知的Gumbel-Max技巧,用于从分类分布(或更一般是非负矢量)及其变体中取样元素的样本,已广泛用于机器学习和信息检索等领域。要采样随机元素$ i $(或gumbel-max变量$ i $)的比例,其正权重$ v_i $,gumbel-max技巧首先计算每个正重量元素$ i $的gumbel随机变量$ g_i $,然后采样元素$ i $,其最大值的$ g_i+g_i+\ ln v_i $。最近,包括相似性估计和图形嵌入在内的应用程序需要从高维矢量产生$ K $独立的Gumbel-Max变量。但是,对于使用传统的Gumbel-Max技巧时,对于$ k $(例如数百甚至数千美元)来说,计算上的昂贵。为了解决这个问题,我们提出了一种新颖的算法,\ emph {fastGM},将时间复杂性从$ o(kn^+)$降低到$ o(k \ ln k+n^+)$,其中$ n^+$是感兴趣的向量中积极元素的数量。与其直接计算$ k $独立的gumbel随机变量,我们发现存在一种以降序生成这些变量的技术。使用此技术,我们的方法FastGM计算变量$ g_i+\ ln v_i $用于所有正元素$ i $ in Discender Order。结果,FASTGM显着减少了计算时间,因为我们可以停止许多元素的胶状随机变量计算过程,尤其是对于那些重量较小的元素。在各种现实世界数据集上的实验表明,FASTGM的数量级比最先进的方法快,而无需牺牲准确性并产生额外的费用。
The well-known Gumbel-Max Trick for sampling elements from a categorical distribution (or more generally a nonnegative vector) and its variants have been widely used in areas such as machine learning and information retrieval. To sample a random element $i$ (or a Gumbel-Max variable $i$) in proportion to its positive weight $v_i$, the Gumbel-Max Trick first computes a Gumbel random variable $g_i$ for each positive weight element $i$, and then samples the element $i$ with the largest value of $g_i+\ln v_i$. Recently, applications including similarity estimation and graph embedding require to generate $k$ independent Gumbel-Max variables from high dimensional vectors. However, it is computationally expensive for a large $k$ (e.g., hundreds or even thousands) when using the traditional Gumbel-Max Trick. To solve this problem, we propose a novel algorithm, \emph{FastGM}, that reduces the time complexity from $O(kn^+)$ to $O(k \ln k + n^+)$, where $n^+$ is the number of positive elements in the vector of interest. Instead of computing $k$ independent Gumbel random variables directly, we find that there exists a technique to generate these variables in descending order. Using this technique, our method FastGM computes variables $g_i+\ln v_i$ for all positive elements $i$ in descending order. As a result, FastGM significantly reduces the computation time because we can stop the procedure of Gumbel random variables computing for many elements especially for those with small weights. Experiments on a variety of real-world datasets show that FastGM is orders of magnitude faster than state-of-the-art methods without sacrificing accuracy and incurring additional expenses.