GPUMLib  0.2.2
GPU Machine Learning Library
NMFkernels.h
1 /*
2  Noel Lopes is an Assistant Professor at the Polytechnic Institute of Guarda, Portugal
3  Copyright (C) 2009, 2010, 2011, 2012 Noel de Jesus Mendonša Lopes
4 
5  This file is part of GPUMLib.
6 
7  GPUMLib is free software: you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation, either version 3 of the License, or
10  (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20 
21 #ifndef GPUMLib_NMFkenels_H
22 #define GPUMLib_NMFkenels_H
23 
24 #include "../common/CudaDefinitions.h"
25 
26 namespace GPUMLib {
27 
30 
32 #define SMALL_VALUE_TO_ADD_DENOMINATOR (CUDA_VALUE(10e-9))
33 
34 
42 void KernelNMFquality(int blockSize, cudafloat * V, cudafloat * WH, int n, cudafloat * quality);
43 
44 
45 // NMFadditiveEuclidian kernels
46 
47 //KERNEL UpdateMatrix_AE(cudafloat * X, cudafloat * deltaX, cudafloat learningRate, int elements);
48 KERNEL UpdateMatrix_AE(cudafloat * X, cudafloat * deltaX1, cudafloat * deltaX2, int elements);
49 
50 // NMF_MultiplicativeEuclidianDistance kernels
51 
58 KERNEL UpdateMatrix_ME(cudafloat * nm, cudafloat * dm, cudafloat * m, int elements);
59 
60 
61 
62 // NMF_MultiplicativeDivergence kernels
63 
64 #define BLOCK_SIZE_NMF (16)
65 #define BLOCK_MULTIPLIER_NMF (2)
66 
74 void KernelSumW(int blockSize, cudafloat * W, int n, int r, cudafloat * sumW);
75 
83 void KernelSumH(int blockSize, cudafloat * H, int r, int m, cudafloat * sumH);
84 
95 KERNEL UpdateH_MD(cudafloat * H, cudafloat * W, cudafloat * V, cudafloat * WH, cudafloat * sumW, int n, int m, int r);
96 
107 KERNEL UpdateW_MD(cudafloat * W, cudafloat * H, cudafloat * V, cudafloat * WH, cudafloat * sumH, int n, int m, int r);
108 
119 KERNEL UpdateW_AD(cudafloat * W, cudafloat * H, cudafloat * V, cudafloat * WH, cudafloat * sumH, int n, int m, int r);
120 
131 KERNEL UpdateH_AD(cudafloat * H, cudafloat * W, cudafloat * V, cudafloat * WH, cudafloat * sumW, int n, int m, int r);
132 
134 
135 }
136 
137 #endif
KERNEL UpdateW_MD(cudafloat *W, cudafloat *H, cudafloat *V, cudafloat *WH, cudafloat *sumH, int n, int m, int r)
Definition: NMFkernels.cu:250
KERNEL UpdateH_MD(cudafloat *H, cudafloat *W, cudafloat *V, cudafloat *WH, cudafloat *sumW, int n, int m, int r)
Definition: NMFkernels.cu:298
void KernelSumW(int blockSize, cudafloat *W, int n, int r, cudafloat *sumW)
Definition: NMFkernels.cu:110
void KernelNMFquality(int blockSize, cudafloat *V, cudafloat *WH, int n, cudafloat *quality)
Definition: NMFquality.cu:72
KERNEL UpdateW_AD(cudafloat *W, cudafloat *H, cudafloat *V, cudafloat *WH, cudafloat *sumH, int n, int m, int r)
void KernelSumH(int blockSize, cudafloat *H, int r, int m, cudafloat *sumH)
Definition: NMFkernels.cu:198
KERNEL UpdateH_AD(cudafloat *H, cudafloat *W, cudafloat *V, cudafloat *WH, cudafloat *sumW, int n, int m, int r)
#define KERNEL
Defines the type of a kernel function.
KERNEL UpdateMatrix_ME(cudafloat *nm, cudafloat *dm, cudafloat *m, int elements)
Definition: NMFkernels.cu:42
float cudafloat