-
Notifications
You must be signed in to change notification settings - Fork 327
/
dssm_on_books_negative_sample.config
132 lines (125 loc) · 2.51 KB
/
dssm_on_books_negative_sample.config
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
train_input_path: "examples/data/amazon_books_data/amazon_train_data"
eval_input_path: "examples/data/amazon_books_data/amazon_test_data"
model_dir: "examples/ckpt/dssm_book_negative_sample_ckpt"
train_config {
log_step_count_steps: 100
optimizer_config: {
adam_optimizer: {
learning_rate: {
exponential_decay_learning_rate {
initial_learning_rate: 0.001
decay_steps: 1000
decay_factor: 0.5
min_learning_rate: 0.00001
}
}
}
use_moving_average: false
}
save_checkpoints_steps: 2000
num_steps: 20000
}
eval_config {
metrics_set {
recall_at_topk { topk: 1 }
}
metrics_set {
recall_at_topk { topk: 10 }
}
metrics_set {
recall_at_topk { topk: 100 }
}
}
data_config {
input_fields {
input_name:'user_id'
input_type: STRING
}
input_fields {
input_name:'book_id_seq'
input_type: STRING
}
input_fields {
input_name: 'book_id'
input_type: STRING
}
input_fields {
input_name: 'label'
input_type: INT32
}
label_fields: 'label'
batch_size: 4096
num_epochs: 2
prefetch_size: 32
input_type: CSVInput
separator: "\t"
negative_sampler {
input_path: 'examples/data/amazon_books_data/negative_book_data'
num_sample: 1024
num_eval_sample: 1024
attr_fields: 'book_id'
item_id_field: 'book_id'
}
}
feature_config: {
features: {
input_names: 'user_id'
feature_type: IdFeature
embedding_dim: 16
hash_bucket_size: 500000
}
features: {
input_names: 'book_id'
feature_type: IdFeature
embedding_dim: 16
hash_bucket_size: 400000
}
features: {
input_names: 'book_id_seq'
feature_type: SequenceFeature
separator: '|'
hash_bucket_size: 400000
embedding_dim: 16
}
}
model_config:{
model_class: "DSSM"
feature_groups: {
group_name: 'user'
feature_names: 'user_id'
wide_deep:DEEP
sequence_features: {
group_name: "seq_fea"
allow_key_search: true
need_key_feature:true
seq_att_map: {
key: "book_id"
hist_seq: "book_id_seq"
}
}
}
feature_groups: {
group_name: "item"
feature_names: 'book_id'
wide_deep:DEEP
}
dssm {
user_tower {
id: "user_id"
dnn {
hidden_units: [256, 128, 64, 32]
}
}
item_tower {
id: "book_id"
dnn {
hidden_units: [256, 128, 64, 32]
}
}
l2_regularization: 1e-6
}
loss_type: SOFTMAX_CROSS_ENTROPY
embedding_regularization: 5e-6
}
export_config {
}