-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathtrba_mrn.py
68 lines (59 loc) · 1.66 KB
/
trba_mrn.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
common=dict(
exp_name="TRBA_MRN", # Where to store logs and models
il="mrn", # joint_mix | joint_loader | base | lwf | wa | ewc | der | mrn
memory="random", # None | random
memory_num=2000,
batch_max_length = 25,
imgH = 32,
imgW = 256,
manual_seed=111,
start_task = 0
)
""" Model Architecture """
model=dict(
model_name="TRBA",
Transformation = "TPS", #None TPS
FeatureExtraction = "ResNet", #VGG ResNet
SequenceModeling = "BiLSTM", #None BiLSTM
Prediction = "Attn", #CTC Attn
num_fiducial=20,
input_channel=4,
output_channel=512,
hidden_size=256,
)
""" Optimizer """
optimizer=dict(
schedule="super", #default is super for super convergence, 1 for None, [0.6, 0.8] for the same setting with ASTER
optimizer="adam",
lr=0.0005,
sgd_momentum=0.9,
sgd_weight_decay=0.000001,
milestones=[2000,4000],
lrate_decay=0.1,
rho=0.95,
eps=1e-8,
lr_drop_rate=0.1
)
""" Data processing """
train = dict(
saved_model="", # "path to model to continue training"
Aug="None", # |None|Blur|Crop|Rot|ABINet
workers=4,
lan_list=["Chinese","Latin","Japanese", "Korean", "Arabic", "Bangla"],
valid_datas=[
"../dataset/MLT17_IL/test_2017",
"../dataset/MLT19_IL/test_2019"
],
select_data=[
"../dataset/MLT17_IL/train_2017",
"../dataset/MLT19_IL/train_2019"
],
batch_ratio="0.5-0.5",
total_data_usage_ratio="1.0",
NED=True,
batch_size=256,
num_iter=10000,
val_interval=5000,
log_multiple_test=None,
grad_clip=5,
)