NnmfPack  2.1
Functions
mlsa_mic.c File Reference

File with functions to calcule NNMF using mlsa algorithm with Intel Xeon Phi (MIC) More...

Go to the source code of this file.

Functions

int dmlsa_mic (const int m, const int n, const int k, const double *A, double *W, double *H, const int uType, const int nIter)
 dmlsa_mic performs NNMF using betadivergence when beta=2 using double precision More...
 
int smlsa_mic (const int m, const int n, const int k, const float *A, float *W, float *H, const int uType, const int nIter)
 smlsa_mic performs NNMF using betadivergence when beta=2 using simple precision More...
 

Detailed Description

File with functions to calcule NNMF using mlsa algorithm with Intel Xeon Phi (MIC)

Author
Information Retrieval and Parallel Computing Group (IRPCG)
University of Oviedo, Spain
Interdisciplinary Computation and Communication Group (INCO2)
Universitat Politecnica de Valencia, Spain.
Contact: nnmfp.nosp@m.ack@.nosp@m.gmail.nosp@m..com
Date
12/03/18

Definition in file mlsa_mic.c.

Function Documentation

◆ dmlsa_mic()

int dmlsa_mic ( const int  m,
const int  n,
const int  k,
const double *  A,
double *  W,
double *  H,
const int  uType,
const int  nIter 
)

dmlsa_mic performs NNMF using betadivergence when beta=2 using double precision

The algorithm is
  repit nIter times
    STEP 1
      L=W*H
      B=W'A
      C=W'*L
      H=H(.
)B(./)C

    STEP 2
      L=W*H
      D=A*H'
      E=L*H'
      W=W(.*)D(./)E
    end repit
End algorithm

To save some FLOPs and RAM a modified Lee and Seung version is used, so we have Step 1: L=W'*W, C=L*H and then B=W'*A; Step 2: L=H*H', E=W*L and D=A*H'. W'*W (H*H') and L*H (W*L) can do in parallel with W'*A (A*H'). Because dgemm works fine we don't use threads to do in parallel.

In real live B and C are (k*n) matrices used in STEP 1, and D and E are (m*k) matrices used in STEP 2. B/C and D/E are independent. For this reason only 2 matrices are declared to save space. They are matrices B and C with size max(m,n)*k

Parameters
m(input) Number of rows of matrix A and matrix W
n(input) Number of columns of matrix A and matrix H
k(input) Number of columns of matrix W and rows of H
A(input) Double precision input matrix of (m * n) number of elements stored using 1D column-major
W(inout) Double precision input/output matrix of (m * k) number of elements stored using 1D column-major
H(inout) Double precision input/output matrix of (k * n) number of elements stored using 1D column-major
uType(input) It can be UpdateAll (W and H are updated), UpdateW (only H is updated) or UpdateH (only W is updated)
nIter(input) Number of iterations
Returns
: 0 if all is OK, -1 otherwise

Definition at line 72 of file mlsa_mic.c.

◆ smlsa_mic()

int smlsa_mic ( const int  m,
const int  n,
const int  k,
const float *  A,
float *  W,
float *  H,
const int  uType,
const int  nIter 
)

smlsa_mic performs NNMF using betadivergence when beta=2 using simple precision

Parameters
m(input) Number of rows of matrix A and matrix W
n(input) Number of columns of matrix A and matrix H
k(input) Number of columns of matrix W and rows of H
A(input) Simple precision input matrix of (m * n) number of elements stored using 1D column-major
W(inout) Simple precision input/output matrix of (m * k) number of elements stored using 1D column-major
H(inout) Simple precision input/output matrix of (k * n) number of elements stored using 1D column-major
uType(input) It can be UpdateAll (W and H are updated), UpdateW (only H is updated) or UpdateH (only W is updated)
nIter(input) Number of iterations
Returns
: 0 if all is OK, -1 otherwise

Definition at line 111 of file mlsa_mic.c.