# US 2017/0286365 A1 · Approach for more efficient use of computing resources while calculating cross product or its approximation for logistic regression on big data sets

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2017/0286365 A1
- Document ID: US20170286365A1
- Status: Published application
- Kind: A1
- Application number: 15/617,978
- Filed: 2017-06-08
- Published: 2017-10-05
- Earliest claimed: 2014-06-27
- Assignees: Oracle International Corporation
- Applicants: Oracle International Corporation
- Inventors: Dmitry Golovashkin; Uladzislau Sharanhovich; Vaishnavi Sashikanth
- Web page: https://patentgrep.com/patent/US20170286365A1

## CPC

- G06F 17/16: Matrix or vector computation {, e.g. matrix-matrix or matrix-vector multiplication, matrix factorization (matrix transposition G06F7/78)}
- G06F 18/24: Classification techniques
- G06V 10/513: {Sparse representations}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06V: IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING

## Abstract

According to one technique, a modeling computer computes a Hessian matrix by determining whether an input matrix contains more than a threshold number of dense columns. If so, the modeling computer computes a sparsified version of the input matrix and uses the sparsified matrix to compute the Hessian. Otherwise, the modeling computer identifies which columns are dense and which columns are sparse. The modeling computer then partitions the input matrix by column density and uses sparse matrix format to store the sparse columns and dense matrix format to store the dense columns. The modeling computer then computes component parts which combine to form the Hessian, wherein component parts that rely on dense columns are computed using dense matrix multiplication and component parts that rely on sparse columns are computed using sparse matrix multiplication.

## Claims

### Claim 1

A method comprising:
receiving an input matrix containing a plurality of elements, wherein the elements are organized into one or more rows and one or more columns;
partitioning the one or more columns of the input matrix into one or more sparse columns and one or more dense columns;
identifying a plurality of matrix components that form a cross product matrix, wherein each matrix component of the plurality of matrix components is based on one or more of: the one or more sparse columns or the one or more dense columns;
computing the cross product matrix, wherein a first set of components of the plurality of matrix components that are based at least partially on the one or more dense columns are computed using dense matrix multiplication and a second set of components of the plurality of matrix components that are based solely on the one or more sparse columns are computed using sparse matrix multiplication; and
wherein the method is performed by one or more processors.

### Claim 2 (depends on 1)

The method of claim 1, wherein partitioning the one or more columns of the input matrix into the one or more sparse columns and the one or more dense columns is based on a data type associated with each column of the one or more columns.

### Claim 3 (depends on 1)

The method of claim 1, further comprising decomposing the plurality of matrix components into a sparse upper-triangular matrix, a dense upper-triangular matrix, and a general dense matrix.

### Claim 4 (depends on 3)

The method of claim 3, wherein the sparse upper-triangular matrix is computed using a sparse factorization, the general dense matrix is computed using sparse forward substitution, and the dense upper-triangular matrix is computed using dense factorization.

### Claim 5 (depends on 1)

The method of claim 1, further comprising:
dividing the input matrix into one or more blocks, wherein computing the cross product matrix is performed by performing operations on the matrix components in parallel and combining results of the operations into the cross product matrix.

### Claim 6 (depends on 5)

The method of claim 5, wherein performing the operations on the matrix components in parallel is performed by parallelizing over a plurality of processors, a plurality of cores of a CPU, or a plurality of computing devices.

### Claim 7 (depends on 1)

The method of claim 1, wherein partitioning the one or more columns of the input matrix into the one or more sparse columns and the one or more dense columns is based whether each column of the one or more columns contains a threshold number of non-zero elements.

### Claim 8 (depends on 1)

The method of claim 1, further including:
after said partitioning the one or more columns of the input matrix:
determining whether a count of the one or more dense columns exceeds a specified threshold of dense columns;
in response to determining that the count exceeds the specified threshold of dense columns, sparsifying the input matrix by at least:
randomly selecting an element from the input matrix and, if the element is not already placed in a sparse matrix, placing the element in a corresponding position of the sparse matrix, and
in response to a determination that a row of the sparse matrix to which the element belongs exceeds a threshold number of row elements, removing from the row a lowest value element that has a corresponding column of the sparse matrix that exceeds a threshold number of column elements or, if the row does not contain any element that has a corresponding column that exceeds the threshold number of column elements, the lowest value element of the row.

### Claim 9 (depends on 8)

The method of claim 8, further comprising:
repeating said sparsifying the input matrix until each row of the sparse matrix contains the threshold number of the row elements; and
repeating said sparsifying the input matrix until a stopping condition has been met.

### Claim 10 (depends on 9)

The method of claim 9, further comprising tracking one or more row distribution statistics for each row of the sparse matrix and wherein the stopping condition is met when the one or more row distribution statistics for each row of the sparse matrix are within a threshold tolerance of a distribution of a corresponding row of the input matrix.

### Claim 11 (depends on 9)

The method of claim 9, further comprising tracking, for each row of the sparse matrix, a count of different elements that have been randomly selected from the input matrix for insertion into a corresponding row of the sparse matrix and, for each column of the sparse matrix, a count of elements that belong to the column, wherein the stopping condition is met when, for each row, the count of the different elements that have been randomly selected equal or exceed a minimum number of seen elements and, for each column, the count of the elements that belong to the column equal or exceed a minimum number of column elements.

### Claim 12

A non-transitory computer-readable storage medium storing sequences of one or more instructions which, when executed by one or more processors, cause:
receiving an input matrix containing a plurality of elements, wherein the elements are organized into one or more rows and one or more columns;
partitioning the one or more columns of the input matrix into one or more sparse columns and one or more dense columns;
identifying a plurality of matrix components that form a cross product matrix, wherein each matrix component of the plurality of matrix components is based on one or more of: the one or more sparse columns or the one or more dense columns; and
computing the cross product matrix, wherein a first set of components of the plurality of matrix components that are based at least partially on the one or more dense columns are computed using dense matrix multiplication and a second set of components of the plurality of matrix components that are based solely on the one or more sparse columns are computed using sparse matrix multiplication.

### Claim 13 (depends on 12)

The non-transitory computer-readable storage medium of claim 12, wherein partitioning the one or more columns of the input matrix into the one or more sparse columns and the one or more dense columns is based on a data type associated with each column of the one or more columns.

### Claim 14 (depends on 12)

The non-transitory computer-readable storage medium of claim 12, wherein the sequences of one or more instructions include instructions that, when executed by said one or more processors, cause decomposing the plurality of matrix components into a sparse upper-triangular matrix, a dense upper-triangular matrix, and a general dense matrix.

### Claim 15 (depends on 14)

The non-transitory computer-readable storage medium of claim 14, wherein the sequences of one or more instructions include instructions that, when executed by said one or more processors, cause computing the sparse upper-triangular matrix using a sparse factorization, the general dense matrix is computed using sparse forward substitution, and the dense upper-triangular matrix is computed using dense factorization.

### Claim 16 (depends on 12)

The non-transitory computer-readable storage medium of claim 12, wherein the sequences of one or more instructions include instructions that, when executed by said one or more processors, cause:
dividing the input matrix into one or more blocks, wherein computing the cross product matrix is performed by performing operations on the matrix components in parallel and combining results of the operations into the cross product matrix.

### Claim 17 (depends on 16)

The non-transitory computer-readable storage medium of claim 16, wherein the sequences of one or more instructions include instructions that, when executed by said one or more processors, cause performing the operations on the matrix components in parallel by at least parallelizing over a plurality of processors, a plurality of cores of a CPU, or a plurality of computing devices.

### Claim 18 (depends on 12)

The non-transitory computer-readable storage medium of claim 12, wherein partitioning the one or more columns of the input matrix into the one or more sparse columns and the one or more dense columns is based whether each column of the one or more columns contains a threshold number of non-zero elements.

### Claim 19 (depends on 12)

The non-transitory computer-readable storage medium of claim 12, wherein the sequences of one or more instructions include instructions that, when executed by said one or more processors, cause:
after said partitioning the one or more columns of the input matrix:
determining whether a count of the one or more dense columns exceeds a specified threshold of dense columns;
in response to determining that the count exceeds the specified threshold of dense columns, sparsifying the input matrix by at least:
randomly selecting an element from the input matrix and, if the element is not already placed in a sparse matrix, placing the element in a corresponding position of the sparse matrix, and
in response to a determination that a row of the sparse matrix to which the element belongs exceeds a threshold number of row elements, removing from the row a lowest value element that has a corresponding column of the sparse matrix that exceeds a threshold number of column elements or, if the row does not contain any element that has a corresponding column that exceeds the threshold number of column elements, the lowest value element of the row.

### Claim 20 (depends on 19)

The non-transitory computer-readable storage medium of claim 19, wherein the sequences of one or more instructions include instructions that, when executed by said one or more processors, cause:
repeating said sparsifying the input matrix until each row of the sparse matrix contains the threshold number of the row elements; and
repeating said sparsifying the input matrix until a stopping condition has been met.

### Claim 21 (depends on 20)

The non-transitory computer-readable storage medium of claim 20, wherein the sequences of one or more instructions include instructions that, when executed by said one or more processors, cause tracking one or more row distribution statistics for each row of the sparse matrix and wherein the stopping condition is met when the one or more row distribution statistics for each row of the sparse matrix are within a threshold tolerance of a distribution of a corresponding row of the input matrix.

### Claim 22 (depends on 20)

The non-transitory computer-readable storage medium of claim 20, wherein the sequences of one or more instructions include instructions that, when executed by said one or more processors, cause tracking, for each row of the sparse matrix, a count of different elements that have been randomly selected from the input matrix for insertion into a corresponding row of the sparse matrix and, for each column of the sparse matrix, a count of elements that belong to the column, wherein the stopping condition is met when, for each row, the count of the different elements that have been randomly selected equal or exceed a minimum number of seen elements and, for each column, the count of the elements that belong to the column equal or exceed a minimum number of column elements.
