-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdatastructure.h
executable file
·110 lines (90 loc) · 1.62 KB
/
datastructure.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
/*
* datastructure.h
*
* Created on: Jan 27, 2012
* Author: dok027
*/
#ifndef DATASTRUCTURE_H_
#define DATASTRUCTURE_H_
#include "common.h"
enum Mode {
EST = 1,
INF = 2
};
typedef struct
{
Mode mode;
double initial_gamma;
double initial_alpha;
double initial_eta;
bool estimate_alpha;
int num_topics;
char corpus_path[MAX_BUF];
char tree_structure_path[MAX_BUF];
char node_to_docids_path[MAX_BUF];
char output_path[MAX_BUF];
int num_threads;
int em_max_iter;
int cat_max_iter;
int kappa_tau_max_iter;
int doc_max_iter;
double em_converged;
double cat_converged;
double kappa_tau_converged;
double doc_converged;
int model_save_freq;
int random_seed;
bool corpus_init;
int num_docs_for_init;
bool warm_start;
char warm_start_path[MAX_BUF];
// Options for evaluation
char model_path[MAX_BUF];
} t_setting;
typedef struct
{
int* words;
int* counts;
int length;
int total;
int parent_index;
} t_document;
typedef struct
{
t_document* docs;
int num_terms;
int num_docs;
int max_length;
} t_corpus;
typedef struct
{
std::vector<int> docids;
std::vector<int> catids;
int parent_index;
} t_cat;
typedef struct
{
double gamma;
double eta;
double* alpha;
int num_topics;
int num_terms;
int num_cats;
} t_tilda_model;
typedef struct
{
int num_topics;
int num_terms;
int num_cats;
int num_docs;
double** kappa;
double* tau;
double** nu;
double*** rho;
double** lambda;
} t_tilda_var_model;
typedef struct
{
double** class_word;
} t_tilda_suffstats;
#endif /* DATASTRUCTURE_H_ */