Information processing apparatus which obtains submatrices based on an input sparse matrix
A first transforming unit divides a sparse matrix into a first submatrix including a row in which the number of non-zero elements is a predetermined number or more and a second submatrix including a row other than the row, and transforms the first submatrix into a row-major order dense matrix format. A second transforming unit divides the second submatrix into a third submatrix including a column in which the number of non-zero elements is a predetermined number or more and a fourth submatrix including a column other than the column, and transforms the third submatrix into a column-major order dense matrix format. A third transforming unit divides the fourth submatrix into a fifth submatrix and a sixth submatrix, and transforms the fifth submatrix into a row-major order sparse matrix compression format. A fourth transforming unit transforms the sixth submatrix into a column-major order sparse matrix compression format.
1 . An information processing apparatus comprising:
a memory containing program instructions; and
a processor coupled to the memory, wherein the processor is configured to execute the program instructions to:
store a first submatrix for rows having a predetermined number or more of non-zero elements among rows in a sparse matrix in row-major order dense matrix format;
store a second submatrix for columns having a predetermined number or more of non-zero elements among columns of a third submatrix other than the first submatrix in the sparse matrix in column-major order dense matrix format;
store a fourth submatrix for a part of rows in a fifth submatrix other than the second submatrix among the third submatrix in row-major order sparse matrix compression format;
store a sixth submatrix other than the fourth matrix among the fifth submatrix in column-major order sparse matrix compression format;
store a vector that can be multiplied by the sparse matrix to calculate a product;
individually calculate a product of the submatrix stored in the column-major order dense matrix format and the vector, a product of the submatrix stored in the row-major order dense matrix format and the vector, a product of the submatrix in the row-major order sparse matrix compression format and the vector, and a product of the submatrix stored in the column-major order sparse matrix and the vector;
add the calculated products to each other, thereby calculating a product of the sparse matrix and the vector; and
perform statistical machine learning by using the product of the sparse matrix and the vector.
2 . The information processing apparatus according to claim 1 , wherein
the fourth submatrix is for rows having a predetermined number or more of non-zero elements among rows the fifth submatrix, and
the sixth submatrix is for rows other than rows having a predetermined number or more of non-zero elements among rows the fifth submatrix.
3 . The information processing apparatus according to claim 1 , wherein the row-major order sparse matrix compression format is a CRS (Compressed Row Storage) format.
4 . The information processing apparatus according to claim 1 , wherein the column-major order sparse matrix compression format is a JDS (Jagged Diagonal Storage) format.
5 . An information processing apparatus, comprising:
a memory containing program instructions; and
a processor coupled to the memory, wherein the processor is configured to execute the program instructions to:
store a first submatrix for rows having a predetermined number or more of non-zero elements among rows in a sparse matrix in row-major order dense matrix format;
store a second submatrix for columns having a predetermined number or more of non-zero elements among columns of a third submatrix other than the first submatrix in the sparse matrix in column-major order dense matrix format;
store a fourth submatrix for a part of rows in a fifth submatrix other than the second submatrix among the third submatrix in row-major order sparse matrix compression format;
store a sixth submatrix other than the fourth matrix among the fifth submatrix in column-major order sparse matrix compression format;
store a vector that can be multiplied by the sparse matrix to calculate a product;
individually calculate a product of the submatrix stored in the column-major order dense matrix format and the vector, a product of the submatrix stored in the row-major order dense matrix format and the vector, a product of the submatrix in the row-major order sparse matrix compression format and the vector, and a product of the submatrix stored in the column-major order sparse matrix and the vector;
add the calculated products to each other, thereby calculating a product of the sparse matrix and the vector; and
obtain a learned model by performing statistical machine learning according to a parameter vector indicating a set of parameters of a model to be learned, by using the product of the sparse matrix and the vector.