-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathparameters_en.py
65 lines (45 loc) · 2.05 KB
/
parameters_en.py
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
class flags(object):
def __init__(self):
#set sizes
self.test_set_size = 0.0
self.validation_set_size = 0.2
self.training_set_size = 0.8
#input file paths
self.word_embed_path = "/home/cvrg/darg/glove/glove.twitter.27B.200d.txt" #change word embedding size too
self.training_data_path = "/home/cvrg/darg/pan_data/pan18-author-profiling-training-2018-02-27"
self.test_data_path = "/home/cvrg/darg/pan_data/pan18-author-profiling-test-2018-03-20"
self.char_embed_path = "/home/cvrg/darg/glove/char_embeddings.27B.25d.txt"
#output file paths
self.model_path = "/media/cvrg/HDD/darg/models/en"
self.model_name = "en-model-0.001-0.0001-0.ckpt"
self.log_path = "/home/cvrg/darg/logs/logs_CNN_RNN_en.txt"
#optimization parameters
self.lang = "en"
self.model_save_threshold = 0.79
self.optimize = True #if true below values will be used for hyper parameter optimization, or if testing is run: all the models in model_path will be tested
#if false hyperparameters specified in "model hyperparameters" will be used, and for testing model with model_name and model_path will be used
self.l_rate = [0.01]
self.reg_param = [0.0001, 0.00005, 0.00001, 0.000005, 0.000001, 0.0000005, 0.0000001]
self.rnn_cell_sizes = [150]
self.cnn_filter_counts = [100]
#########################################################################################################################
# Model Hyperparameters
self.l2_reg_lambda = 0.0001
self.learning_rate = 0.001
self.num_classes = 2
#CNN
self.num_filters = 100
self.sequence_length = 190
self.char_embedding_size = 25
self.filter_sizes = "3,6,9"
#RNN
self.word_embedding_size = 200
self.rnn_cell_size = 150
##########################################################################################################################
# Training parameters
self.use_pretrained_model = False
self.tweet_per_user = 100
self.batch_size = 10
self.num_epochs = 25
self.evaluate_every = 5
FLAGS = flags()