-
Notifications
You must be signed in to change notification settings - Fork 0
/
config_model.py
101 lines (86 loc) · 2.39 KB
/
config_model.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
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
import random
import system_utils
import numpy as np
debug = False
debug = True
# ranodm issues
SEED = 11
np.random.seed(SEED)
random.seed(SEED)
try:
import tensorflow as tf
tf.set_random_seed(SEED)
# from keras.backend import manual_variable_initialization
# manual_variable_initialization(True)
except:
pass
try:
import os
os.environ['PYTHONHASHSEED'] = '0'
except:
pass
# model params
use_item_emb = False
use_class_weight = True
remove_items = True
percent_to_remove = 0.1
min_item_to_remove = int(1 / percent_to_remove)
use_german_tokenizer = True
max_len_item_emb = 10
run_deep_model = True
lr = 0.001
model_batch_size = 256
use_cnn = False
shuffle = True
epochs_model = 20
# file parms
delete_files = True
# use_item_emb = False
# min_len_session = None
# session embedding params
min_len_session = 2
max_len_session = 10
hidden_size_rnn = 150
model_embedding_size = 150
item2vec_embedding_size = 150
dense_layer_size = 20
item2vec_epoch = 1000
wipe_items_not_in_train = False
# val
validation_split = None
# validation_split = 0.1
# dates_for_val = ['2016-08-28','2016-08-29']
# test
dates_for_test = ['2016-08-30', '2016-08-31']
# dates_for_test = ['2016-08-29','2016-08-31']
# file params
dir_input = 'data'
x_train_path = "data_after_encode/x_train.npy"
y_train_path = "data_after_encode/y_train.npy"
x_val_path = "data_after_encode/x_val.npy"
y_val_path = "data_after_encode/y_val.npy"
x_test_path1 = "data_after_encode/x_test1.npy"
y_test_path1 = "data_after_encode/y_test1.npy"
x_test_path2 = "data_after_encode/x_test2.npy"
y_test_path2 = "data_after_encode/y_test2.npy"
model_path = "models/models.h5"
best_model_path = "models/best_model.h5"
if debug:
if delete_files:
system_utils.delete_file_no_exp(x_train_path)
system_utils.delete_file_no_exp(y_train_path)
system_utils.delete_file_no_exp(x_test_path1)
system_utils.delete_file_no_exp(y_test_path1)
system_utils.delete_file_no_exp(x_test_path2)
system_utils.delete_file_no_exp(y_test_path2)
system_utils.delete_file_no_exp(x_val_path)
system_utils.delete_file_no_exp(y_val_path)
system_utils.delete_file_no_exp(model_path)
system_utils.delete_file_no_exp(best_model_path)
hidden_size_rnn = 3
item2vec_epoch = 5
epochs_model = 1
model_embedding_size = 5
item2vec_embedding_size = 5
dense_layer_size = 5
item2vec_epoch = 1