-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathargs.py
More file actions
32 lines (23 loc) · 785 Bytes
/
args.py
File metadata and controls
32 lines (23 loc) · 785 Bytes
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
import os
import tensorflow as tf
tf.logging.set_verbosity(tf.logging.INFO)
file_path = os.path.dirname(__file__)
model_dir = os.path.join(file_path, 'ModelParams/chinese_L-12_H-768_A-12/')
config_name = os.path.join(model_dir, 'bert_config.json')
ckpt_name = os.path.join(model_dir, 'bert_model.ckpt')
output_dir = os.path.join(file_path, 'Output/SIM/result/')
vocab_file = os.path.join(model_dir, 'vocab.txt')
data_dir = os.path.join(file_path, 'Data/Sim_Data/')
num_train_epochs = 2
batch_size = 128
learning_rate = 0.00005
# gpu使用率
gpu_memory_fraction = 0.8
# 默认取倒数第二层的输出值作为句向量
layer_indexes = [-2]
# 序列的最大程度,单文本建议把该值调小
max_seq_len = 32
# 预训练模型
train = True
# 测试模型
test = False