forked from cedias/word2vec
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtrainingThread.h
60 lines (52 loc) · 1.26 KB
/
trainingThread.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
#ifndef TRAIN_THREADS
#define TRAIN_THREADS
#define MAX_SENTENCE_LENGTH 100
#define MAX_CODE_LENGTH 40
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <math.h>
#include <pthread.h>
#include "vocab.h"
typedef float real;
typedef struct threadParameters_struct {
vocabulary *voc;
real *syn0 , *syn1, *syn1neg, *expTable, *alpha,starting_alpha;
real sample;
int threadNumber,num_threads,hs,negative,file_size,max_string,exp_table_size,ngram,max_exp,window, layer1_size,table_size,position, overlap, hashbang;
int *table;
long long int *word_count_actual;
char* train_file;
} threadParameters;
threadParameters * CreateParametersStruct(vocabulary* voc,
real *syn0,
real *syn1,
real *syn1neg,
real *expTable,
real *alpha,
real starting_alpha,
real sample,
long long int *word_count_actual,
int *table,
int threadNumber,
int num_threads,
int file_size,
int max_string,
int exp_table_size,
int ngram,
int layer1_size,
int window,
int max_exp,
int hs,
int negative,
int table_size,
int position,
int overlap,
int hashbang,
char* train_file
);
void *TrainCBOWModelThread(void *arg);
void *TrainCBOWModelThreadGram(void *arg);
void *TrainSKIPModelThread(void *arg);
void *TrainSKIPModelThreadGram(void *arg);
#endif