-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathpmf.h
59 lines (49 loc) · 1.16 KB
/
pmf.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#ifndef _PMF_H_
#define _PMF_H_
#include "util.h"
enum {CCDR1, PCR, PCRPP};
enum {BOLDDRIVER, EXPDECAY};
class parameter {
public:
int solver_type;
int k;
int threads;
int maxiter, maxinneriter;
double lambda;
double rho;
double eps; // for the fundec stop-cond in ccdr1
double eta0, betaup, betadown; // learning rate parameters used in DSGD
int lrate_method, num_blocks;
int do_predict, verbose;
int do_nmf; // non-negative matrix factorization
// liwei
double stepsize;
int ndcg_k;
parameter() {
// liwei
stepsize = 1.0;
ndcg_k = 10;
solver_type = PCRPP;
k = 10;
rho = 1e-3;
maxiter = 10;
maxinneriter = 5;
lambda = 5000;
threads = 4;
eps = 1e-3;
eta0 = 1e-3; // initial eta0
betaup = 1.05;
betadown = 0.5;
num_blocks = 30; // number of blocks used in dsgd
lrate_method = BOLDDRIVER;
do_predict = 1;
verbose = 0;
do_nmf = 0;
}
};
extern "C" {
void ccdr1(smat_t &R, mat_t &W, mat_t &H, testset_t &T, parameter ¶m);
void pcr(smat_t &X, mat_t &U, mat_t &V, testset_t &T, parameter ¶m);
void pcrpp(smat_t &X, mat_t &U, mat_t &V, testset_t &T, parameter ¶m);
}
#endif