Many systems use large-scale machine learning to accomplish challenging problems such as speech recognition, computer vision, image and sound file searching and categorization, etc. Deep learning of multi-layer neural networks is an effective large-scale approach. Kernel methods, e.g., Gaussian and polynomial kernels, have also been used on smaller-scale problems, but scaling kernel methods has proven challenging.
Implementations provide a kernel approximation method that is compact, fast, and accurate for gaussian kernels. The implementations generate unbiased estimators for gaussian kernels according to a new framework called Structured Orthogonal Random Features (SORF). The unbiased estimator KSORF to the kernel involves a linear transformation matrix WSORF computed using products of a set of pairs of matrices, each pair including an orthogonal matrix and respective diagonal matrix whose elements are real numbers following a specified probability distribution. Typically, the orthogonal matrix is a Walsh-Hadamard matrix, the specified probability distribution is a Rademacher distribution, and there are at least two, usually three, pairs of matrices multiplied together to form the linear transformation matrix WSORF.
According to one aspect, a method of generating input for a kernel-based machine learning system that uses a kernel to perform classification operations on data can include generating, by processing circuitry of the kernel-based machine learning system, a set of diagonal matrices, each of the set of diagonal matrices having non-diagonal elements that are zero and diagonal elements that have values distributed according to a specified probability distribution function. The method can also include producing, by the processing circuitry, a set of orthogonal matrices, each of the set of orthogonal matrices having mutually orthogonal rows. The method can further include, for each of the set of diagonal matrices, forming, by the processing circuitry, a set of matrix pairs, each of the set of matrix pairs including (i) that diagonal matrix, and (ii) a respective orthogonal matrix of the set of orthogonal matrices. The method can further include generating, by the processing circuitry, a product of each of the set of matrix pairs to produce a linear transformation matrix, the linear transformation matrix being an unbiased estimator of the kernel used by the kernel-based machine learning system.
The details of one or more implementations are set forth in the accompanying drawings and the description below. Other features will be apparent from the description and drawings, and from the claims.
Like reference symbols in the various drawings indicate like elements.
Kernel methods are used in nonlinear learning. A kernel represents a similarity function between two d-dimensional data vectors. Kernels methods involve expressing a kernel k(x,y) at a first data vector x and a second data vector y approximately as an inner product of a feature vector function of the first data vector ϕ(x) and the feature vector function of the second data vector ϕ(y). The feature vector function is typically a 2D-dimensional vector where 2D>d. According to the Random Fourier Features (RFF) approach to approximating a kernel, when the kernel is positive definite and shift-invariant, the feature vector function takes the form
where each of the vectors wj, jϵ{1,2, . . . , D} is sampled i.i.d. from a probability distribution function p(w) defined as the Fourier transform of the kernel k(x−y), viz.
k(x−y)=p(w)eiw
Define W=[w1, w2, . . . , wD]T. The resources required for the computation of the approximate kernel is dominated by the linear transformation Wx. The Gaussian kernel k(x,y)=e−∥x-y∥
where G is a d×d matrix with entries sampled from a normal distribution. (When D<d, the first D dimensions of the result are used; when D>d, multiple independently generated random features are used and the results are concatenated.) The linear transformation matrix WRFF provides an unbiased estimator KRFF for the gaussian kernel.
Unfortunately, the RFF approach to approximating a kernel has some disadvantages. For example, the computation cost of the linear transformation matrix G in space and time is O(Dd), which is expensive for high-dimensional data. Further, the error in this approximation of the kernel, as expressed as the variance of the unbiased estimator KRFF, is relatively large.
In contrast to the above-described RFF approach, improved techniques involve generating unbiased estimators for gaussian kernels according to a new framework called Structured Orthogonal Random Features (SORF). The unbiased estimator KSORF to the kernel involves a linear transformation matrix WSORF computed using products of a set of pairs of matrices, each pair including an orthogonal matrix and respective diagonal matrix whose elements are real numbers following a specified probability distribution. Typically, the orthogonal matrix is a Walsh-Hadamard matrix, the specified probability distribution is a Rademacher distribution, and there are at least two, usually three, pairs of matrices multiplied together to form the linear transformation matrix WSORF.
Advantageously, the linear transformation matrix WSORF has a computational cost in space that is O(D) and in time that is O(D log D). Further, the variance of KSORF is significantly smaller than that of KRFF.
The large-scale learning system 100 may be a computing device or devices that take the form of a number of different devices, for example a standard server, a group of such servers, or a rack server system, such as kernel-based machine learning server 120. In addition, system 100 may be implemented in a personal computer, for example a laptop computer. The kernel-based machine learning server 120 may be an example of computer device 600, as depicted in
The kernel-based machine learning server 120 includes a network interface 122, one or more processing units 124, and memory 126. The network interface 122 includes, for example, Ethernet adaptors, Token Ring adaptors, and the like, for converting electronic and/or optical signals received from the network 170 to electronic form for use by the kernel-based machine learning server 120. The set of processing units 124 include one or more processing chips and/or assemblies. The memory 126 includes both volatile memory (e.g., RAM) and non-volatile memory, such as one or more ROMs, disk drives, solid state drives, and the like. The set of processing units 124 and the memory 126 together form control circuitry, which is configured and arranged to carry out various methods and functions as described herein.
In some embodiments, one or more of the components of the kernel-based machine learning server 120 can be, or can include processors (e.g., processing units 124) configured to process instructions stored in the memory 126. Examples of such instructions as depicted in
The kernel-based machine learning server 120 may use feature vectors extracted from data items and generate a randomized feature map that produces an approximation of the features, e.g., via a gaussian kernel. A feature vector may be thought of as an array of floating point numbers with a dimensionality of d, or in other words an array with d positions. The data items may be a database, for example of files or search items. For instance, the data items may be any kind of file, such as documents, images, sound files, video files, etc., and the feature vectors may be extracted from the file. The data items may also be database records and the features may be extracted from data related to an item in the database.
The orthogonal matrix manager 130 is configured to generate orthogonal matrix data 132. The orthogonal matrix data 132 includes numbers defining a matrix or matrices having rows that form an orthogonal basis. The size of an orthogonal matrix generated by the orthogonal matrix manager 132 is based on the dimensionality d. For example, in some implementations the orthogonal matrix manager 130 is configured to generate Walsh-Hadamard matrices. Such matrices are generated according to the following rule:
where ⊗ represents the Kronecker product. Accordingly, Walsh-Hadamard matrices are square matrices having a dimension that is a power of two. In response to receiving The orthogonal matrix manager 130 would then generate a Walsh-Hadamard matrix having a dimension that is the smallest power of two greater than d.
The diagonal matrix manager 140 is configured to generate diagonal matrix data 144. The diagonal matrix data 144 includes numbers defining matrices that have zeroes as off-diagonal elements. The values of the diagonal elements are defined via a specified probability distribution function 142. The dimension of the diagonal matrices is the same as the dimension of the orthogonal matrix of the orthogonal matrix data 132. In some implementations, the values of the diagonal elements are either −1 or 1, and the probability distribution 142 is a Rademacher distribution (i.e., coin-flipping distribution).
The kernel-based machine learning server 120 is configured to form linear transformation matrix data 146 from the orthogonal matrix data 132 and the diagonal matrix data 144. Along these lines, when the diagonal matrix data 132 includes numbers defining N diagonal matrices D1, D2, . . . , DN, then the linear transformation matrix WSORF defining the linear transformation matrix data 146 is equal to
where n is the exponent of the least power of two greater than d, and σ is the width of the gaussian kernel. In some implementations, N is at least 2; in a typical implementation, N is equal to 3.
The system 100 may use the machine learning manager 150 to perform image searches, speech recognition, etc., on vector data 152. The system 100 may use conventional methods to extract the vectors from the vector data 152 or may be provided to extracted feature vector data 154. As some examples, the extracted feature vector 154 may be pixels from an image file in the data items or speech waveforms.
In some implementations, the memory 126 can be any type of memory such as a random-access memory, a disk drive memory, flash memory, and/or so forth. In some implementations, the memory 126 can be implemented as more than one memory component (e.g., more than one RAM component or disk drive memory) associated with the components of the kernel-based machine learning server 120. In some implementations, the memory 126 can be a database memory. In some implementations, the memory 126 can be, or can include, a non-local memory. For example, the memory 126 can be, or can include, a memory shared by multiple devices (not shown). In some implementations, the memory 126 can be associated with a server device (not shown) within a network and configured to serve the components of the kernel-based machine learning server 120.
The components (e.g., modules, processing units 124) of the compression computer 120 can be configured to operate based on one or more platforms (e.g., one or more similar or different platforms) that can include one or more types of hardware, software, firmware, operating systems, runtime libraries, and/or so forth. In some implementations, the components of the kernel-based machine learning server 120 can be configured to operate within a cluster of devices (e.g., a server farm). In such an implementation, the functionality and processing of the components of the kernel-based machine learning server 120 can be distributed to several devices of the cluster of devices.
The components of the kernel-based machine learning server 120 can be, or can include, any type of hardware and/or software configured to process attributes. In some implementations, one or more portions of the components shown in the components of the kernel-based machine learning server 120 in
Although not shown, in some implementations, the components of the kernel-based machine learning server 120 (or portions thereof) can be configured to operate within, for example, a data center (e.g., a cloud computing environment), a computer system, one or more server/host devices, and/or so forth. In some implementations, the components of the kernel-based machine learning server 120 (or portions thereof) can be configured to operate within a network. Thus, the components of the kernel-based machine learning server 120 (or portions thereof) can be configured to function within various types of network environments that can include one or more devices and/or one or more server devices. For example, the network can be, or can include, a local area network (LAN), a wide area network (WAN), and/or so forth. The network can be, or can include, a wireless network and/or wireless network implemented using, for example, gateway devices, bridges, switches, and/or so forth. The network can include one or more segments and/or can have portions based on various protocols such as Internet Protocol (IP) and/or a proprietary protocol. The network can include at least a portion of the Internet.
In some embodiments, one or more of the components of the compression computer 120 can be, or can include, processors configured to process instructions stored in a memory. For example, the orthogonal matrix manager 130 (and/or a portion thereof), the diagonal matrix manager 140 (and/or a portion thereof), and the machine learning manager 150 (and/or a portion thereof) can be a combination of a processor and a memory configured to execute instructions related to a process to implement one or more functions.
At 202, the kernel-based machine learning server 120 receives a dimensionality of vector data d to be classified using a gaussian kernel.
At 204, the kernel-based machine learning server 120 generates a Walsh-Hadamard matrix Hn having a dimension 2n that is the smallest power of two greater than d, i.e., n=┌log2 d┐.
At 206, the kernel-based machine learning server 120 generates a set of diagonal matrices D1, D2, . . . , DN, each diagonal matrix having diagonal elements equal to either −1 or 1 and sampled at random according to a Rademacher distribution.
At 208, the kernel-based machine learning server 120 forms the matrix product HnD1HnD2 . . . HnDN.
At 210, the kernel-based machine learning server 120 multiplies the matrix product by the quantity
to form the linear transformation matrix WSORF.
Random Fourier Features (RFF) approximation described above:
where G is a matrix having elements sampled according to a normal distribution that is the Fourier transform of the gaussian kernel;
Orthogonal Random Features (ORF) approximation, which is an approximation of the form
where Q is an orthogonal matrix derived from the randomly sampled gaussian matrix G by a Gram-Schmidt orthonormalization, and S is a diagonal matrix having elements randomly generated according to a chi distribution;
Quasi-Monte Carlo (QMC) approximation, which is similar to ORF except that the samples are chosen according to deterministic, low-displacement rank sequences;
Fastfood is a structured matrix approximation to the kernel of the form
where H is a Hadamard matrix, G is a random gaussian matrix with values distributed according to a normal distribution, II is a permutation matrix, B is a random binary matrix, and S is a scaling matrix that ensures the rows of the linear transformation matrix have norms that follow a prescribed behavior;
Circulant is an approximation to the kernel based on a compact nonlinear map.
In the plots 302, 304, 306, 208, 310, and 312, the dimensionality d increases by a factor of two between plots. Each plot illustrates a behavior of MSE vs. feature vector length D for D>d. It is noted that the SORF approximation has significantly smaller MSE than any other of the above-described approximations, and the reduction in MSE for SORF relative to the other approximations is more apparent with increasing d.
The system may provide the approximated feature vector as input to a classifier (510). The classifier may have access to a large store of data items. The data items may already have corresponding approximated feature vectors or may initiate generation of approximated feature vectors for the data items. In some implementations, the classifier may calculate a dot product between the approximated feature vectors for the input data item and the store of data items. In some implementations, the classifier may use the dot product to determine a label, classification, etc. for the input data item. For example, the classifier may classify an image as an animal, person, building, etc. In some implementations, the classifier may determine items in the data store that are most similar to the input data item. Thus, the system may obtain a classification for the input data item from the classifier (512). Process 500 then ends.
The process of
Computing device 600 includes a processor 602, memory 604, a storage device 606, and expansion ports 610 connected via an interface 608. In some implementations, computing device 600 may include transceiver 646, communication interface 644, and a GPS (Global Positioning System) receiver module 648, among other components, connected via interface 608. Device 600 may communicate wirelessly through communication interface 644, which may include digital signal processing circuitry where necessary. Each of the components 602, 604, 606, 608, 610, 640, 644, 646, and 648 may be mounted on a common motherboard or in other manners as appropriate.
The processor 602 can process instructions for execution within the computing device 600, including instructions stored in the memory 604 or on the storage device 606 to display graphical information for a GUI on an external input/output device, such as display 616. Display 616 may be a monitor or a flat touchscreen display. In some implementations, multiple processors and/or multiple buses may be used, as appropriate, along with multiple memories and types of memory. Also, multiple computing devices 600 may be connected, with each device providing portions of the necessary operations (e.g., as a server bank, a group of blade servers, or a multi-processor system).
The memory 604 stores information within the computing device 600. In one implementation, the memory 604 is a volatile memory unit or units. In another implementation, the memory 604 is a non-volatile memory unit or units. The memory 604 may also be another form of computer-readable medium, such as a magnetic or optical disk. In some implementations, the memory 604 may include expansion memory provided through an expansion interface.
The storage device 606 is capable of providing mass storage for the computing device 600. In one implementation, the storage device 606 may be or include a computer-readable medium, such as a floppy disk device, a hard disk device, an optical disk device, or a tape device, a flash memory or other similar solid state memory device, or an array of devices, including devices in a storage area network or other configurations. A computer program product can be tangibly embodied in such a computer-readable medium. The computer program product may also include instructions that, when executed, perform one or more methods, such as those described above. The computer- or machine-readable medium is a storage device such as the memory 604, the storage device 606, or memory on processor 602.
The interface 608 may be a high speed controller that manages bandwidth-intensive operations for the computing device 600 or a low speed controller that manages lower bandwidth-intensive operations, or a combination of such controllers. An external interface 640 may be provided so as to enable near area communication of device 600 with other devices. In some implementations, controller 608 may be coupled to storage device 606 and expansion port 614. The expansion port, which may include various communication ports (e.g., USB, Bluetooth, Ethernet, wireless Ethernet) may be coupled to one or more input/output devices, such as a keyboard, a pointing device, a scanner, or a networking device such as a switch or router, e.g., through a network adapter.
The computing device 600 may be implemented in a number of different forms, as shown in the figure. For example, it may be implemented as a standard server 630, or multiple times in a group of such servers. It may also be implemented as part of a rack server system. In addition, it may be implemented in a personal computer such as a laptop computer 622, or smart phone 636. An entire system may be made up of multiple computing devices 600 communicating with each other. Other configurations are possible.
Distributed computing system 700 may include any number of computing devices 780. Computing devices 780 may include a server or rack servers, mainframes, etc. communicating over a local or wide-area network, dedicated optical links, modems, bridges, routers, switches, wired or wireless networks, etc.
In some implementations, each computing device may include multiple racks. For example, computing device 780a includes multiple racks 758a-758n. Each rack may include one or more processors, such as processors 752a-752n and 762a-762n. The processors may include data processors, network attached storage devices, and other computer controlled devices. In some implementations, one processor may operate as a master processor and control the scheduling and data distribution tasks. Processors may be interconnected through one or more rack switches 758, and one or more racks may be connected through switch 778. Switch 778 may handle communications between multiple connected computing devices 700.
Each rack may include memory, such as memory 754 and memory 764, and storage, such as 756 and 766. Storage 756 and 766 may provide mass storage and may include volatile or non-volatile storage, such as network-attached disks, floppy disks, hard disks, optical disks, tapes, flash memory or other similar solid state memory devices, or an array of devices, including devices in a storage area network or other configurations. Storage 756 or 766 may be shared between multiple processors, multiple racks, or multiple computing devices and may include a computer-readable medium storing instructions executable by one or more of the processors. Memory 754 and 764 may include, e.g., volatile memory unit or units, a non-volatile memory unit or units, and/or other forms of computer-readable media, such as a magnetic or optical disks, flash memory, cache, Random Access Memory (RAM), Read Only Memory (ROM), and combinations thereof. Memory, such as memory 754 may also be shared between processors 752a-752n. Data structures, such as an index, may be stored, for example, across storage 756 and memory 754. Computing device 700 may include other components not shown, such as controllers, buses, input/output devices, communications modules, etc.
An entire system, such as system 100, may be made up of multiple computing devices 700 communicating with each other. For example, device 780a may communicate with devices 780b, 780c, and 780d, and these may collectively be known as system 100. As another example, system 100 of
Various implementations can include implementation in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.
These computer programs (also known as programs, software, software applications or code) include machine instructions for a programmable processor, and can be implemented in a high-level procedural and/or object-oriented programming language, and/or in assembly/machine language. As used herein, the terms “machine-readable medium” “computer-readable medium” refers to any non-transitory computer program product, apparatus and/or device (e.g., magnetic discs, optical disks, memory (including Read Access Memory), Programmable Logic Devices (PLDs)) used to provide machine instructions and/or data to a programmable processor.
The systems and techniques described here can be implemented in a computing system that includes a back end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front end component (e.g., a client computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back end, middleware, or front end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (“LAN”), a wide area network (“WAN”), and the Internet.
The computing system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.
A number of implementations have been described. Nevertheless, various modifications may be made without departing from the spirit and scope of the invention. In addition, the logic flows depicted in the figures do not require the particular order shown, or sequential order, to achieve desirable results. In addition, other steps may be provided, or steps may be eliminated, from the described flows, and other components may be added to, or removed from, the described systems. Accordingly, other implementations are within the scope of the following claims.
This application claims the benefit of U.S. Provisional Application No. 62/413,011, filed on Oct. 26, 2016, the disclosure of which is incorporated by reference herein in its entirety.
Number | Date | Country | |
---|---|---|---|
62413011 | Oct 2016 | US |