|
a |
|
b/config.py |
|
|
1 |
# -*- coding: utf-8 -*- |
|
|
2 |
''' |
|
|
3 |
@time: 2019/9/8 18:45 |
|
|
4 |
|
|
|
5 |
@ author: javis |
|
|
6 |
''' |
|
|
7 |
import os |
|
|
8 |
|
|
|
9 |
|
|
|
10 |
class Config: |
|
|
11 |
# for data_process.py |
|
|
12 |
#root = r'D:\ECG' |
|
|
13 |
root = r'data' |
|
|
14 |
train_dir = os.path.join(root, 'hf_round1_train/train') |
|
|
15 |
test_dir = os.path.join(root, 'hf_round1_testA/testA') |
|
|
16 |
train_label = os.path.join(root, 'hf_round1_label.txt') |
|
|
17 |
test_label = os.path.join(root, 'hf_round1_subA.txt') |
|
|
18 |
arrythmia = os.path.join(root, 'hf_round1_arrythmia.txt') |
|
|
19 |
train_data = os.path.join(root, 'train.pth') |
|
|
20 |
|
|
|
21 |
# for train |
|
|
22 |
#训练的模型名称 |
|
|
23 |
model_name = 'resnet34' |
|
|
24 |
#在第几个epoch进行到下一个state,调整lr |
|
|
25 |
stage_epoch = [32,64,128] |
|
|
26 |
#训练时的batch大小 |
|
|
27 |
batch_size = 64 |
|
|
28 |
#label的类别数 |
|
|
29 |
num_classes = 55 |
|
|
30 |
#最大训练多少个epoch |
|
|
31 |
max_epoch = 256 |
|
|
32 |
#目标的采样长度 |
|
|
33 |
target_point_num = 2048 |
|
|
34 |
#保存模型的文件夹 |
|
|
35 |
ckpt = 'ckpt' |
|
|
36 |
#保存提交文件的文件夹 |
|
|
37 |
sub_dir = 'submit' |
|
|
38 |
#初始的学习率 |
|
|
39 |
lr = 1e-3 |
|
|
40 |
#保存模型当前epoch的权重 |
|
|
41 |
current_w = 'current_w.pth' |
|
|
42 |
#保存最佳的权重 |
|
|
43 |
best_w = 'best_w.pth' |
|
|
44 |
# 学习率衰减 lr/=lr_decay |
|
|
45 |
lr_decay = 10 |
|
|
46 |
|
|
|
47 |
#for test |
|
|
48 |
temp_dir=os.path.join(root,'temp') |
|
|
49 |
|
|
|
50 |
|
|
|
51 |
config = Config() |