-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathexample.py
More file actions
34 lines (26 loc) · 792 Bytes
/
example.py
File metadata and controls
34 lines (26 loc) · 792 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
33
34
import argparse
from train_words import evaluate_setting
parser = argparse.ArgumentParser()
parser.add_argument('--gpu_id', '-gpu', action='store', type=int, default='0',
help='The ID of the GPU to use. If not specified, training is run in CPU mode.')
args = parser.parse_args()
gpu_id = args.gpu_id
# name of the dataset and path to the dataset files
dataset = ('IAM', '../IAM')
# max epochs
N = 120
# experimental setting
setting = {
'lowercase': True,
'path_ctc': True,
'path_s2s': True,
'path_autoencoder': True,
'train_external_lm': True,
'start_external_lm': 0,
'binarize': False,
'start_binarize': 0,
'feat_size': 512
}
# report name
rname = './tmp'
evaluate_setting(setting, dataset, gpu_id, report_name=rname, epochs=N)