Orthogonal Random Features

Felix X. Yu, Ananda Theertha Suresh, Krzysztof Choromanski, Daniel Holtmann-Rice, Sanjiv Kumar

Introduction

Kernel methods are widely used in nonlinear learning , but they are computationally expensive for large datasets. Kernel approximation is a powerful technique to make kernel methods scalable, by mapping input features into a new space where dot products approximate the kernel well . With accurate kernel approximation, efficient linear classifiers can be trained in the transformed space while retaining the expressive power of nonlinear methods .

This means that one can treat p(w)p(\mathbf{w}) as a density function and use Monte-Carlo sampling to derive the following nonlinear map for a real-valued kernel:

where wi\mathbf{w}_{i} is sampled i.i.d. from a probability distribution with density p(w)p(\mathbf{w}). Let \mathbf{W}=\big{[}\mathbf{w}_{1},\cdots,\mathbf{w}_{D}\big{]}^{T}. The linear transformation Wx\mathbf{W}\mathbf{x} is central to the above computation since,

The choice of matrix W\mathbf{W} determines how well the estimated kernel converges to the actual kernel;

The computation of Wx\mathbf{W}\mathbf{x} has space and time costs of O(Dd)\mathcal{O}(Dd). This is expensive for high-dimensional data, especially since DD is often required to be larger than dd to achieve low approximation error.

In this work, we address both of the above issues. We first show an intriguing discovery (Figure 1(c)): by enforcing orthogonality on the rows of W\mathbf{W}, the kernel approximation error can be significantly reduced. We call this method Orthogonal Random Features (ORF). Section 3 describes the method and provides theoretical explanation for the improved performance.

Since both generating a d×dd\times d orthogonal matrix (O(d3)\mathcal{O}(d^{3}) time and O(d2)\mathcal{O}(d^{2}) space) and computing the transformation (O(d2)\mathcal{O}(d^{2}) time and space) are prohibitively expensive for high-dimensional data, we further propose Structured Orthogonal Random Features (SORF) in Section 4. The idea is to replace random orthogonal matrices by a class of special structured matrices consisting of products of binary diagonal matrices and Walsh-Hadamard matrices. SORF has fast computation time, O(Dlogd)\mathcal{O}(D\log d), and almost no extra memory cost (with efficient in-place implementation). We show extensive experiments in Section 5. We also provide theoretical discussions in Section 6 of applying the structured matrices in a broader range of applications where random Gaussian matrix is used.

Related Works

Explicit nonlinear random feature maps have been constructed for many types of kernels, such as intersection kernels , generalized RBF kernels , skewed multiplicative histogram kernels , additive kernels , and polynomial kernels . In this paper, we focus on approximating Gaussian kernels following the seminal Random Fourier Features (RFF) framework , which has been extensively studied both theoretically and empirically .

Key to the RFF technique is Monte-Carlo sampling. It is well known that the convergence of Monte-Carlo can be largely improved by carefully choosing a deterministic sequence instead of random samples . Following this line of reasoning, Yang et al. proposed to use low-displacement rank sequences in RFF. Yu et al. studied optimizing the sequences in a data-dependent fashion to achieve more compact maps. In contrast to the above works, this paper is motivated by an intriguing new discovery that using orthogonal random samples provides much faster convergence. Compared to , the proposed SORF method achieves both lower kernel approximation error and greatly reduced computation and memory costs. Furthermore, unlike , the results in this paper are data independent.

Structured matrices have been used for speeding up dimensionality reduction , binary embedding , deep neural networks and kernel approximation . For the kernel approximation works, in particular, the “structured randomness” leads to a minor loss of accuracy, but allows faster computation since the structured matrices enable the use of FFT-like algorithms. Furthermore, these matrices provide substantial model compression since they require subquadratic (usually only linear) space. In comparison with the above works, our proposed methods SORF and ORF are more effective than RFF. In particular SORF demonstrates both lower approximation error and better efficiency than RFF. Table 1 compares the space and time costs of different techniques.

Orthogonal Random Features

Our goal is to approximate a Gaussian kernel of the form

Recall that the linear transformation matrix of RFF can be written as

The idea of Orthogonal Random Features (ORF) is to impose orthogonality on the matrix on the linear transformation matrix G\mathbf{G}. Note that one cannot achieve unbiased kernel estimation by simply replacing G\mathbf{G} by an orthogonal matrix, since the norms of the rows of G\mathbf{G} follow the χ\chi-distribution, while rows of an orthogonal matrix have the unit norm. The linear transformation matrix of ORF has the following form

Denote the approximate kernel based on the above WORF\mathbf{W}_{\textrm{ORF}} as KORF(x,y)K_{\text{ORF}}(\mathbf{x},\mathbf{y}). The following shows that KORF(x,y)K_{\text{ORF}}(\mathbf{x},\mathbf{y}) is an unbiased estimator of the kernel, and it has lower variance in comparison to RFF.

KORF(x,y)K_{\text{ORF}}(\mathbf{x},\mathbf{y}) is an unbiased estimator of the Gaussian kernel, i.e.,

Let DdD\leq d, and z=xy/σz=||\mathbf{x}-\mathbf{y}||/\sigma. There exists a function ff such that for all zz, the variance of KORF(x,y)K_{\text{ORF}}(\mathbf{x},\mathbf{y}) is bounded by

We now show a proof sketch of the variance. Suppose, ai=cos(wiTz)a_{i}=\cos(\mathbf{w}^{T}_{i}\mathbf{z}).

(Appendix A.3) There is a function ff such that for any zz,

Therefore, for a large dd, and DdD\leq d, the ratio of the variance of ORF and RFF is

Figure 2(a) shows the ratio of the variance of ORF to that of RFF when D=dD=d and dd is large. First notice that this ratio is always smaller than 1, and hence ORF always provides improvement over the conventional RFF. Interestingly, we gain significantly for small values of zz. In fact, when z0z\rightarrow 0 and dd\rightarrow\infty, the ratio is roughly z2z^{2} (note ex1+xe^{x}\approx 1+x when x0x\rightarrow 0), and ORF exhibits infinitely lower error relative to RFF. Figure 2(b) shows empirical simulations of this ratio. We can see that the variance ratio is close to that of d=d=\infty (3), even when d=32d=32, a fairly low-dimensional setting in real-world cases.

Recall that z=xy/σz=||\mathbf{x}-\mathbf{y}||/\sigma. This means that ORF preserves the kernel value especially well for data points that are close, thereby retaining the local structure of the dataset. Furthermore, empirically σ\sigma is typically not set too small in order to prevent overfitting—a common rule of thumb is to set σ\sigma to be the average distance of 50th-nearest neighbors in a dataset. In Figure 2(c), we plot the distribution of zz for several datasets with this choice of σ\sigma. These distributions are all concentrated in the regime where ORF yields substantial variance reduction.

The above analysis is under the assumption that DdD\leq d. Empirically, for RFF, DD needs to be larger than dd in order to achieve low approximation error. In that case, we independently generate and apply the transformation (2) multiple times. The next lemma bounds the variance for this case.

Let D=mdD=m\cdot d, for an integer mm and z=xy/σz=||\mathbf{x}-\mathbf{y}||/\sigma. There exists a function ff such that for all zz, the variance of KORF(x,y)K_{\text{ORF}}(\mathbf{x},\mathbf{y}) is bounded by

Structured Orthogonal Random Features

In the previous section, we presented Orthogonal Random Features (ORF) and provided a theoretical explanation for their effectiveness. Since generating orthogonal matrices in high dimensions can be expensive, here we propose a fast version of ORF by imposing structure on the orthogonal matrices. This method can provide drastic memory and time savings with minimal compromise on kernel approximation quality. Note that the previous works on fast kernel approximation using structured matrices do not use structured orthogonal matrices .

Let us first introduce a simplified version of ORF: replace S\mathbf{S} in (2) by a scalar d\sqrt{d}. Let us call this method ORF´. The transformation matrix thus has the following form:

(Appendix B) Let KORF(x,y)K_{\text{ORF}^{\prime}}(\mathbf{x},\mathbf{y}) be the approximate kernel computed with linear transformation matrix (4). Let DdD\leq d and z=xy/σz=||\mathbf{x}-\mathbf{y}||/\sigma. There exists a function ff such that the bias of KORF(x,y)K_{\text{ORF}^{\prime}}(\mathbf{x},\mathbf{y}) satisfies

The above implies that when dd is large KORF(x,y)K_{\text{ORF}^{\prime}}(\mathbf{x},\mathbf{y}) is a good estimation of the kernel with low variance. Figure 3(a) shows that even for relatively small dd, the estimation is almost unbiased. Figure 3(c) shows that when d32d\geq 32, the variance ratio is very close to that of d=d=\infty. We find empirically that ORF´also provides very similar MSE in comparison with ORF in real-world datasets.

We now introduce Structured Orthogonal Random Features (SORF). It replaces the random orthogonal matrix Q\mathbf{Q} of ORF´in (4) by a special type of structured matrix HD1HD2HD3\mathbf{H}\mathbf{D}_{1}\mathbf{H}\mathbf{D}_{2}\mathbf{H}\mathbf{D}_{3}:

Computing WSORFx\mathbf{W}_{\text{SORF}}\mathbf{x} has the time cost O(dlogd)\mathcal{O}(d\log d), since multiplication with D\mathbf{D} takes O(d)\mathcal{O}(d) time and multiplication with H\mathbf{H} takes O(dlogd)\mathcal{O}(d\log d) time using fast Hadamard transformation. The computation of SORF can also be carried out with almost no extra memory due to the fact that both sign flipping and the Walsh-Hadamard transformation can be efficiently implemented as in-place operations .

Figures 3(b)(d) show the bias and variance of SORF. Note that although the curves for small dd are different from those of ORF, when dd is large (d>32d>32 in practice), the kernel estimation is almost unbiased, and the variance ratio converges to that of ORF. In other words, it is clear that SORF can provide almost identical kernel approximation quality as that of ORF. This is also confirmed by the experiments in Section 5. In Section 6, we provide theoretical discussions to show that the structure of (5) can also be generally applied to many scenarios where random Gaussian matrices are used.

Experiments

Kernel Approximation. We first show kernel approximation performance on six datasets. The input feature dimension dd is set to be power of 2 by padding zeros or subsampling. Figure 4 compares the mean squared error (MSE) of all methods. For fixed DD, the kernel approximation MSE exhibits the following ordering:

By imposing orthogonality on the linear transformation matrix, Orthogonal Random Features (ORF) achieves significantly lower approximation error than Random Fourier Features (RFF). The Structured Orthogonal Random Features (SORF) have almost identical MSE to that of ORF. All other fast kernel approximation methods, such as circulant and FastFood have higher MSE. We also include DigitalNet, the best performing method among Quasi-Monte Carlo techniques . Its MSE is lower than that of RFF, but still higher than that of ORF and SORF. The order of time cost for a fixed DD is

Remarkably, SORF has both better computational efficiency and higher kernel approximation quality compared to other methods.

We also apply ORF and SORF on classification tasks. Table 2 shows classification accuracy for different kernel approximation techniques with a (linear) SVM classifier. SORF is competitive with or better than RFF, and has greatly reduced time and space costs.

Simplifying SORF. The SORF transformation consists of three Hadamard-Diagonal blocks. A natural question is whether using fewer computations and randomness can achieve similar empirical performance. Figure 5(c) shows that reducing the number of blocks to two (HDHD) provides similar performance, while reducing to one block (HD) leads to large error.

Analysis and General Applicability of the Hadamard-Diagonal Structure

We provide theoretical discussions of SORF in this section. We first show that for large dd, SORF is an unbiased estimator of the Gaussian kernel.

(Appendix C) Let KSORF(x,y)K_{\text{SORF}}(\mathbf{x},\mathbf{y}) be the approximate kernel computed with linear transformation matrix dHD1HD2HD3\sqrt{d}\mathbf{H}\mathbf{D}_{1}\mathbf{H}\mathbf{D}_{2}\mathbf{H}\mathbf{D}_{3}. Let z=xy/σz=||\mathbf{x}-\mathbf{y}||/\sigma. Then

Even though SORF is nearly-unbiased, proving tight variance and concentration guarantees similar to ORF remains an open question. The following discussion provides a sketch in that direction. We first show a lemma of RFF.

Let W\mathbf{W} be a random Gaussian matrix as in RFF, for a given z\mathbf{z}, the distribution of Wz\mathbf{W}\mathbf{z} is N(0,z2Id)N(0,||z||_{2}\mathbf{I}_{d}).

Note that Wz\mathbf{W}\mathbf{z} in RFF can be written as Rg\mathbf{R}\mathbf{g}, where R\mathbf{R} is a scaled orthogonal matrix such that each row has norm z2||z||_{2} and g\mathbf{g} is distributed according to N(0,Id)N(0,\mathbf{I}_{d}). Hence the distribution of Rg\mathbf{R}\mathbf{g} is N(0,z2Id)N(0,||z||_{2}\mathbf{I}_{d}), identical to Wz\mathbf{W}\mathbf{z}. The concentration results of RFF use the fact that the projections of a Gaussian vector g\mathbf{g} onto orthogonal directions R\mathbf{R} are independent.

The above result can also be applied to settings not limited to kernel approximation. In the appendix, we show empirically that the same scheme can be successfully applied to angle estimation where the nonlinear map ff is a non-smooth sign()\operatornamewithlimits{sign}(\cdot) function . We note that the HD1HD2HD3\mathbf{H}\mathbf{D}_{1}\mathbf{H}\mathbf{D}_{2}\mathbf{H}\mathbf{D}_{3} structure has also been recently used in fast cross-polytope LSH .

Conclusions

We have demonstrated that imposing orthogonality on the transformation matrix can greatly reduce the kernel approximation MSE of Random Fourier Features when approximating Gaussian kernels. We further proposed a type of structured orthogonal matrices with substantially lower computation and memory cost. We provided theoretical insights indicating that the Hadamard-Diagonal block structure can be generally used to replace random Gaussian matrices in a broader range of applications. Our method can also be generalized to other types of kernels such as general shift-invariant kernels and polynomial kernels based on Schoenberg’s characterization as in .

References

Appendix A Variance Reduction via Orthogonal Random Features

Let z=xyσ\mathbf{z}=\frac{\mathbf{x}-\mathbf{y}}{\sigma}, and z=zz=||\mathbf{z}||. For a vector y\mathbf{y}, let y(i)y(i) denote its ithi^{\text{th}} coordinate. Let n!!n!! be the double factorial of nn, i.e., the product of every number from n to 1 that has the same parity as n.

A.2 Proof of Lemma 1

Let z=(xy)/σ\mathbf{z}=(\mathbf{x}-\mathbf{y})/\sigma. Recall that in RFF, we compute the Kernel approximation as

where each wi\mathbf{w}_{i} is a dd dimensional vector distributed N(0,Id)N(0,I_{d}). Let w\mathbf{w} be a dd dimensional vector distributed N(0,Id)N(0,I_{d}). By Bochner’s theorem,

and hence RFF yields an unbiased estimate.

We now compute the variance of RFF approximation. Observe that

If we take DD such independent random variables w1,w2,wD\mathbf{w}_{1},\mathbf{w}_{2},\ldots\mathbf{w}_{D}, since variance of the sum is sum of variances,

A.3 Proof of Lemma 2

For a set of non-negative values α1,α2,αk\alpha_{1},\alpha_{2},\ldots\alpha_{k} and β1,β2,βk\beta_{1},\beta_{2},\ldots\beta_{k} such that for all ii, βiαi\beta_{i}\leq\alpha_{i},

Combining the above two equations results in the first part of the lemma. For the second part observe that

Combining the above two equations yields the second part of the lemma. ∎

Since the problem is rotation invariant, instead of projecting a vector z\mathbf{z} onto a randomly chosen two orthogonal vectors u1\mathbf{u}_{1} and u2\mathbf{u}_{2}, we can choose a vector y\mathbf{y} that is uniformly distributed on a sphere of radius zz and project it on to the first two dimensions. Thus,

The kthk^{\text{th}} term in the Taylor’s series expansion of sum of above two terms is

A way to compute a uniformly distributed random variable on a sphere with radius zz is to generate dd independent random variables x=(x(1),x(2),,x(d))\mathbf{x}=(x(1),x(2),\ldots,x(d)) each distributed N(0,1)N(0,1) and setting y(i)=zx(i)/xy(i)=zx(i)/||\mathbf{x}||. Hence,

(a)(a) follows from linearity of expectation and the observation above. (b)(b) follows from the independence of s1s_{1}, s2s_{2}, and x\mathbf{x}. (d)(d) follows from substituting the moments of chi and Gaussian distributions. (e)(e) follows from numerical simplification. We now describe the reasoning behind (c)(c). Let z=xyx\mathbf{z}=\frac{\mathbf{x}||\mathbf{y}||}{||\mathbf{x}||}, where y\mathbf{y} and x\mathbf{x} are independent N(0,Id)N(0,I_{d}) random variables. By the properties of the Gaussian random variables z\mathbf{z} is also a N(0,Id)N(0,I_{d}) random variable. Thus,

and hence (c)(c). Substituting the above equation in the cosine expansion, we get that the expectation is

where ck,dk44d2+k2(k1)2d3|c_{k,d}|\leq\frac{k^{4}}{4d^{2}}+\frac{k^{2}(k-1)}{2d^{3}}. Thus,

Appendix B Proof of Theorem 2

The proof of the theorem is similar to that of Lemma 2 and we outline some key steps. We first bound the bias in Lemma 5 and then the variance in Lemma 6.

If w=dy\mathbf{w}=\sqrt{d}\mathbf{y}, where yy is distributed uniformly on a unit sphere, then

Without loss of generality, we can assume z\mathbf{z} is along the first coordinate and hence wTz=dzy(1)\mathbf{w}^{T}\mathbf{z}=\sqrt{d}zy(1). A way to compute a uniformly distributed random variable on a sphere with radius zz is to generate dd independent random variables x=(x(1),x(2),,x(d))\mathbf{x}=(x(1),x(2),\ldots,x(d)) each distributed N(0,1)N(0,1) and setting y(i)=zx(i)/xy(i)=zx(i)/||\mathbf{x}||. hence,

The kthk^{\text{th}} term in the Taylor’s series expansion of cosine in the above equation is

Similar to the proof of Lemma 2, it can be shown that the expectation of this term is

where ck,d(k(k1)d)2|c^{\prime}_{k,d}|\leq\left(\frac{k(k-1)}{d}\right)^{2}. Hence,

Let DdD\leq d. If W=dQ\mathbf{W}=\sqrt{d}\mathbf{Q}, where Q\mathbf{Q} is a uniformly chosen random rotation, then

Let ai=cos(wiTz)a_{i}=\cos(\mathbf{w}^{T}_{i}\mathbf{z}). Expanding the variance we have,

For the first term, rewriting cos2(wTz)=1+cos(2wTz)2\cos^{2}(\mathbf{w}^{T}\mathbf{z})=\frac{1+\cos(2\mathbf{w}^{T}\mathbf{z})}{2}, similar to the proof of Lemma 5 it can be shown that

Second term can be bounded similar to Lemma 2 and here we just sketch an outline. Similar to the proof of Lemma 2, the variance boils down to computing the expectation of cos(w1Tz+w2Tz)\cos(\mathbf{w}^{T}_{1}\mathbf{z}+\mathbf{w}^{T}_{2}\mathbf{z}). Using Lemma 4 and summing Taylor’s series we get

Substituting the above bound and the expectation from Lemma 5, we get

Appendix C Proof of Theorem 3

The proof follows from the following two technical lemmas.

Let zz^{\prime} be distributed according to N(0,x22)N(0,||\mathbf{x}||^{2}_{2}) and y=i=1dx(i)diy^{\prime}=\sum^{d}_{i=1}x(i)d_{i}, where did_{i}s are independent Rademacher random variables. For any function gg such that g1|g^{\prime}|\leq 1 and g1|g|\leq 1,

Let z=z/x2z=z^{\prime}/||\mathbf{x}||_{2}, y=y/x2y=y^{\prime}/||\mathbf{x}||_{2}, and h(x)=g(x2x)h(x)=g(||\mathbf{x}||_{2}x), for all xx. Hence h(z)=g(z)h(z)=g(z^{\prime}) and h(y)=g(y)h(y)=g(y^{\prime}). By a lemma due to Stein ,

We now bound the term on the right hand side by classic Stein-type arguments.

Let yi=yx(i)dix2y_{i}=y-\frac{x(i)d_{i}}{||\mathbf{x}||_{2}}. Observe that

where the first equality follows from the fact that yiy_{i} and did_{i} are independent and did_{i} has zero mean. By Taylor series approximation, the first term is bounded by

Combining the above four equations, we get

Combining the above two equations, we get

Substituting the bound on the second moment of ff yields the result. ∎

Let G\mathbf{G} be a random matrix with i.i.d. N(0,1)N(0,1) entries as before. Using the above lemma we show that dHD1HD2\sqrt{d}\mathbf{H}\mathbf{D}_{1}\mathbf{H}\mathbf{D}_{2} behaves like G\mathbf{G} while computing the bias.

For a given x\mathbf{x}, let z=Gx\mathbf{z}=\mathbf{G}\mathbf{x} and y=dHD1HD2x\mathbf{y}=\sqrt{d}\mathbf{H}\mathbf{D}_{1}\mathbf{H}\mathbf{D}_{2}\mathbf{x}. For any function gg such that g1|g^{\prime}|\leq 1 and g1|g|\leq 1,

Let u=HD2x\mathbf{u}=\mathbf{H}\mathbf{D}_{2}\mathbf{x}. Then for every ii, y(i)=jH(i,j)D2(j)u(j)y(i)=\sum_{j}H(i,j)D_{2}(j)u(j). Hence by Lemma 7, we can relate expectation under yy to the expectation under Gaussian distribution:

where the last equality follows from the fact that HD2\mathbf{H}\mathbf{D}_{2} does not change rotation and (a)(a) follows from the law of total expectation. By Cauchy-Schwartz inequality, for each ii

Summing over all the indices yields the lemma. ∎

Theorem 3 follows from the Bochner’s theorem and the fact that cos()\cos(\cdot) satisfies requirements for the above lemma. We note that Theorem 3 holds for the matrix dHD1HD2\sqrt{d}\mathbf{H}\mathbf{D}_{1}\mathbf{H}\mathbf{D}_{2} itself and the third component HD3\mathbf{H}\mathbf{D}_{3} is not necessary to bound the bias.

Appendix D Proof of Theorem 4

To prove Theorem 4, we use the Hanson-Wright Inequality.

for some universal positive constant c>0c>0.

For a vector u\mathbf{u}, let diag(u)\text{diag}(\mathbf{u}) denote the diagonal matrix whose entries correspond to the entries of u\mathbf{u}. For a diagonal matrix D\mathbf{D}, let vec(D)\text{vec}(\mathbf{D}) denote the vector corresponding to the diagonal entries of D\mathbf{D}. Let v=HD3z\mathbf{v}=\mathbf{H}\mathbf{D}_{3}\mathbf{z} and u=HD2v=Hdiag(v)vec(D2)\mathbf{u}=\mathbf{H}\mathbf{D}_{2}\mathbf{v}=\mathbf{H}\text{diag}(\mathbf{v})\text{vec}(\mathbf{D}_{2}). Observe that

is small. We first show that the expectation of the above quantity is and then use the Hanson-Wright inequality to prove concentration. Let A\mathbf{A} be a diagonal matrix with kthk^{th} entry being dH(i,k)H(j,k)\sqrt{d}H(i,k)H(j,k). The above equation can be rewriten as

Observe that the (l,l)(l,l) entry of the HTAH\mathbf{H}^{T}\mathbf{A}\mathbf{H} is

where the last equality follows from observing that the rows of H\mathbf{H} are orthogonal to each other. Together with the fact that elements of D2\mathbf{D}_{2} are independent of each other, we get

To prove the concentration result, observe that the entries of vec(D2)\text{vec}(\mathbf{D}_{2}) are independent and sub-Gaussian, and hence we can use the Hanson-Wright inequality. To this end, we bound the Frobenius and the spectral norm of the underlying matrix. For the Frobenius norm, observe that

where (a)(a) follows by observing that each diag(v)\text{diag}(\mathbf{v}) changes the Frobenius norm by at most v2||\mathbf{v}||^{2}_{\infty}, (b)(b) follows from the fact that H\mathbf{H} does not change the Frobenius norm, and (c)(c) follows by substituting A\mathbf{A}.

where (a)(a) follows by observing that each diag(v)\text{diag}(\mathbf{v}) changes the spectral norm by at most v||\mathbf{v}||_{\infty}, (b)(b) follows from the fact that rotation does not change the spectral norm, and (c)(c) follows by substituting A\mathbf{A}. Since v=HD3z\mathbf{v}=\mathbf{H}\mathbf{D}_{3}\mathbf{z}, by McDiarmid’s inequality, it can be shown that with probability 12dedϵ2/2\geq 1-2de^{-d\epsilon^{2}/2}, vϵz2||\mathbf{v}||_{\infty}\leq\epsilon||\mathbf{z}||_{2}. Hence, by the Hanson-Wright inequality, we get

where cc is a constant. Choosing ϵ=(t/d)1/3\epsilon=({t/d})^{1/3} results in the theorem. ∎

Appendix E Discrete Hadamard-Diagonal Structure in Binary Embedding

We compare random projection based Locality Sensitive Hashing (LSH) , Circulant Binary Embedding (CBE) and Kronecker Binary Embedding (KBE) . We closely follow the experimental settings of . We choose to compare with because it proposed to use another type of structured random orthogonal matrix (Kronecker product of orthogonal matrices). As shown in Figure 6, our result (HDHDHD) provides higher recall and lower angular MSE in comparison with other methods.