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 language, German: ''wikt:Statistik#German, Statistik'', "description of a State (polity), state, a country") is the discipline that concerns the collection, organization, analysis, interpretation, and presentation of ...
,
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 c ...
. 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 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 The median trick is a generic approach that increases the chances of a probabilistic algorithm to succeed. Apparently first used in 1986 by Jerrum et al. for approximate counting algorithms, the technique was later applied to a broad selection of ...
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 example ...
, 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 vector In linear algebra, a coordinate vector is a representation of a vector as an ordered list of numbers (a tuple) that describes the vector in terms of a particular ordered basis. An ea ...
of two vectors is equivalent to the
convolution In mathematics (in particular, functional analysis), convolution is a operation (mathematics), mathematical operation on two function (mathematics), functions ( and ) that produces a third function (f*g) that expresses how the shape of one is ...
of two component count sketches. The count sketch computes a vector
convolution In mathematics (in particular, functional analysis), convolution is a operation (mathematics), mathematical operation on two function (mathematics), functions ( and ) that produces a third function (f*g) that expresses how the shape of one is ...
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 vector In linear algebra, a coordinate vector is a representation of a vector as an ordered list of numbers (a tuple) that describes the vector in terms of a particular ordered basis. An ea ...
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 th ...
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 * 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