count sketch
   HOME

TheInfoList



OR:

Count sketch is a type of
dimensionality reduction Dimensionality reduction, or dimension reduction, is the transformation of data from a high-dimensional space into a low-dimensional space so that the low-dimensional representation retains some meaningful properties of the original data, ideally ...
that is particularly efficient in
statistics Statistics (from German: '' Statistik'', "description of a state, a country") is the discipline that concerns the collection, organization, analysis, interpretation, and presentation of data. In applying statistics to a scientific, indust ...
,
machine learning Machine learning (ML) is a field of inquiry devoted to understanding and building methods that 'learn', that is, methods that leverage data to improve performance on some set of tasks. It is seen as a part of artificial intelligence. Machine ...
and
algorithms In mathematics and computer science, an algorithm () is a finite sequence of rigorous instructions, typically used to solve a class of specific problems or to perform a computation. Algorithms are used as specifications for performing ...
. It was invented by Moses Charikar, Kevin Chen and Martin Farach-Colton in an effort to speed up the AMS Sketch by Alon, Matias and Szegedy for approximating the frequency moments of streams. The sketch is nearly identical to the
Feature hashing In machine learning, feature hashing, also known as the hashing trick (by analogy to the kernel trick), is a fast and space-efficient way of vectorizing features, i.e. turning arbitrary features into indices in a vector or matrix. It works by applyi ...
algorithm by John Moody, but differs in its use of hash functions with low dependence, which makes it more practical. In order to still have a high probability of success, the median trick is used to aggregate multiple count sketches, rather than the mean. These properties allow use for explicit
kernel methods In machine learning, kernel machines are a class of algorithms for pattern analysis, whose best known member is the support-vector machine (SVM). The general task of pattern analysis is to find and study general types of relations (for exampl ...
, bilinear pooling in
neural network A neural network is a network or circuit of biological neurons, or, in a modern sense, an artificial neural network, composed of artificial neurons or nodes. Thus, a neural network is either a biological neural network, made up of biological ...
s and is a cornerstone in many numerical linear algebra algorithms.Woodruff, David P. "Sketching as a Tool for Numerical Linear Algebra." Theoretical Computer Science 10.1-2 (2014): 1–157.


Mathematical definition

1. For constants w and t (to be defined later) independently choose d=2t+1 random hash functions h_1, \dots, h_d and s_1,\dots,s_d such that h_i : \to /math> and s_i : \to \. It is necessary that the hash families from which h_i and s_i are chosen be pairwise independent. 2. For each item q_i in the stream, add s_j(q_i) to the h_j(q_i)th bucket of the jth hash. At the end of this process, one has wd sums (C_) where :C_ = \sum_s_i(k). To estimate the count of qs one computes the following value: :r_q = \text_^d\, s_i(q)\cdot C_. The values s_i(q)\cdot C_ are unbiased estimates of how many times q has appeared in the stream. The estimate r_q has variance O(\mathrm\), where m_1 is the length of the stream and m_2^2 is \sum_q (\sum_i _i=q^2. Furthermore, r_q is guaranteed to never be more than 2m_2/\sqrt off from the true value, with probability 1-e^.


Vector formulation

Alternatively Count-Sketch can be seen as a linear mapping with a non-linear reconstruction function. Let M^\in\^, be a collection of d=2t+1 matrices, defined by :M^_ = s_i(j) for j\in /math> and 0 everywhere else. Then a vector v\in\mathbb^n is sketched by C^ = M^ v \in \mathbb^w. To reconstruct v we take v^*_j = \text_i C^_j s_i(j). This gives the same guarantees as stated above, if we take m_1=\, v\, _1 and m_2=\, v\, _2.


Relation to Tensor sketch

The count sketch projection of the
outer product In linear algebra, the outer product of two coordinate vectors is a matrix. If the two vectors have dimensions ''n'' and ''m'', then their outer product is an ''n'' × ''m'' matrix. More generally, given two tensors (multidimensional arrays of nu ...
of two vectors is equivalent to the
convolution In mathematics (in particular, functional analysis), convolution is a mathematical operation on two functions ( and ) that produces a third function (f*g) that expresses how the shape of one is modified by the other. The term ''convolution'' ...
of two component count sketches. The count sketch computes a vector
convolution In mathematics (in particular, functional analysis), convolution is a mathematical operation on two functions ( and ) that produces a third function (f*g) that expresses how the shape of one is modified by the other. The term ''convolution'' ...
C^x \ast C^x^T, where C^ and C^ are independent count sketch matrices. Pham and Pagh show that this equals C(x \otimes x^T) – a count sketch C of the
outer product In linear algebra, the outer product of two coordinate vectors is a matrix. If the two vectors have dimensions ''n'' and ''m'', then their outer product is an ''n'' × ''m'' matrix. More generally, given two tensors (multidimensional arrays of nu ...
of vectors, where \otimes denotes
Kronecker product In mathematics, the Kronecker product, sometimes denoted by ⊗, is an operation on two matrices of arbitrary size resulting in a block matrix. It is a generalization of the outer product (which is denoted by the same symbol) from vectors to ...
. The
fast Fourier transform A fast Fourier transform (FFT) is an algorithm that computes the discrete Fourier transform (DFT) of a sequence, or its inverse (IDFT). Fourier analysis converts a signal from its original domain (often time or space) to a representation in ...
can be used to do fast convolution of count sketches. By using the face-splitting product such structures can be computed much faster than normal matrices.


See also

*
Count–min sketch In computing, the count–min sketch (CM sketch) is a probabilistic data structure that serves as a frequency table of events in a stream of data. It uses hash functions to map events to frequencies, but unlike a hash table uses only sub-linear ...
* Tensorsketch


References


Further reading

*Faisal M. Algashaam; Kien Nguyen; Mohamed Alkanhal; Vinod Chandran; Wageeh Boles. "Multispectral Periocular Classification WithMultimodal Compact Multi-Linear Pooling

''IEEE Access'', Vol. 5. 2017. *{{Cite web , last1=Ahle , first1=Thomas , last2=Knudsen , first2=Jakob , date=2019-09-03 , title=Almost Optimal Tensor Sketch , url=https://www.researchgate.net/publication/335617805 , access-date=2020-07-11 , website=
ResearchGate ResearchGate is a European commercial social networking site for scientists and researchers to share papers, ask and answer questions, and find collaborators. According to a 2014 study by ''Nature'' and a 2016 article in ''Times Higher Education'' ...
Dimension reduction