Low-rank matrix approximations

From testwiki
Revision as of 18:06, 20 January 2025 by imported>Ira Leviton (Fixed another reference. Please see Category:CS1 errors: missing periodical.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Template:Use dmy dates

Low-rank matrix approximations are essential tools in the application of kernel methods to large-scale learning problems.[1]

Kernel methods (for instance, support vector machines or Gaussian processes[2]) project data points into a high-dimensional or infinite-dimensional feature space and find the optimal splitting hyperplane. In the kernel method the data is represented in a kernel matrix (or, Gram matrix). Many algorithms can solve machine learning problems using the kernel matrix. The main problem of kernel method is its high computational cost associated with kernel matrices. The cost is at least quadratic in the number of training data points, but most kernel methods include computation of matrix inversion or eigenvalue decomposition and the cost becomes cubic in the number of training data. Large training sets cause large storage and computational costs. While low rank decomposition methods (Cholesky decomposition) reduce this cost, they still require computing the kernel matrix. One of the approaches to deal with this problem is low-rank matrix approximations. The most popular examples of them are the Nyström approximation and randomized feature maps approximation methods. Both of them have been successfully applied to efficient kernel learning.

Nyström approximation

Kernel methods become computationally unfeasible when the number of points D is so large such that the kernel matrix K cannot be stored in memory.

If n is the number of training examples, the storage and computational cost required to find the solution of the problem using general kernel method is O(D2) and O(D3) respectively. The Nyström approximation can allow a significant speed-up of the computations.[2][3] This speed-up is achieved by using, instead of the kernel matrix, its approximation K~ of rank d. An advantage of the method is that it is not necessary to compute or store the whole kernel matrix, but only a submatrix of size d×D.

It reduces the storage and complexity requirements to O(Dd) and O(Dd2) respectively.

The method is named "Nyström approximation" because it can be interpreted as a case of the Nyström method from integral equation theory.[3]

Kernel approximation

[1][4]Template:Pg[5]

Consider a positive-definite kernel function k:X×X. Given some data points x1,x2,,xD, we can form the kernel matrix KD×D such that Kij:=k(xi,xj).

Now, let d1:D be an integer, then we can divide the kernel matrix as K=[K11K12K21K22]D×D, where K11d×d is the top-left corner of it. Also, set C=[K11K21] to be its first d columns.

The Nyström approximation of K in this case isK~=CK11+CT=[K11K21]K11+[K11K12] where K11+ is the Moore–Penrose pseudoinverse of K11, which must exist since K11 is positive semidefinite.

Properties

By Mercer's theorem, we can decompose the kernel matrix as a Gram matrix: K=XTX, where XN×D. Let X be the left d columns of X.

Template:Math theorem

Template:Hidden begin Template:Math proof Template:Hidden end

Regularized least squares

In a vector and kernel notation, the problem of regularized least squares can be rewritten as: mincn1nYKcn2+λc,Kcn. Computing the gradient and setting in to 0, the minimum can be obtained: 1nK(YKc)+λKc=0K(K+λnI)c=KYc=(K+λnI)1Y, where cn The inverse matrix (K+λnI)1 can be computed using Woodbury matrix identity: (K+λnI)1=1λn(1λnK+I)1=1λn(I+Kn,q(λnKq)1Kn,qT)1=1λn(IKn,q(λnKq+Kn,qTKn,q)1Kn,qT)It has the desired storage and complexity requirements.

Randomized feature maps approximation

Template:Main

Let 𝐱,𝐱d – samples of data, z:dD – a randomized feature map (maps a single vector to a vector of higher dimensionality) so that the inner product between a pair of transformed points approximates their kernel evaluation:

K(𝐱,𝐱)=Φ(𝐱),Φ(𝐱)z(𝐱)Tz(𝐱), where Φ is the mapping embedded in the RBF kernel.

Since z is low-dimensional, the input can be easily transformed with z, after that different linear learning methods to approximate the answer of the corresponding nonlinear kernel can be applied. There are different randomized feature maps to compute the approximations to the RBF kernels. For instance, random Fourier features and random binning features.

Random Fourier features

The random Fourier features map produces a Monte Carlo approximation to the feature map. The Monte Carlo method is considered to be randomized. These random features consists of sinusoids cos(wT𝐱+b) randomly drawn from Fourier transform of the kernel to be approximated, where wd and b are random variables. The line is randomly chosen, then the data points are projected on it by the mappings. The resulting scalar is passed through a sinusoid. The product of the transformed points will approximate a shift-invariant kernel. Since the map is smooth, random Fourier features work well on interpolation tasks.

Random binning features

A random binning features map partitions the input space using randomly shifted grids at randomly chosen resolutions and assigns to an input point a binary bit string that corresponds to the bins in which it falls. The grids are constructed so that the probability that two points 𝐱,𝐱d are assigned to the same bin is proportional to K(𝐱,𝐱). The inner product between a pair of transformed points is proportional to the number of times the two points are binned together, and is therefore an unbiased estimate of K(𝐱,𝐱). Since this mapping is not smooth and uses the proximity between input points, Random binning features works well for approximating kernels that depend only on the L1 distance between datapoints.

Comparison of approximation methods

The approaches for large-scale kernel learning (Nyström method and random features) differs in the fact that the Nyström method uses data dependent basis functions while in random features approach the basis functions are sampled from a distribution independent from the training data. This difference leads to an improved analysis for kernel learning approaches based on the Nyström method. When there is a large gap in the eigen-spectrum of the kernel matrix, approaches based on the Nyström method can achieve better results than the random features based approach.[6]

See also

References

Template:Reflist

  1. 1.0 1.1 Template:Cite conference
  2. 2.0 2.1 Template:Cite journal
  3. 3.0 3.1 Template:Citation
  4. Template:Cite book
  5. Template:Citation
  6. Tianbao Yang, Yu-Feng Li, Mehrdad Mahdavi, Rong Jin and Zhi-Hua Zhou (2012). "Nyström Method vs Random Fourier Features: A Theoretical and Empirical Comparison". Advances in Neural Information Processing Systems 25 (NIPS).