-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflags.py
45 lines (29 loc) · 1.32 KB
/
flags.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
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import argparse
import datetime
import pytz
tz = pytz.timezone('Asia/Shanghai')
current_time = datetime.datetime.now(tz)
def parse_args(check=True):
parser = argparse.ArgumentParser()
parser.add_argument('--output_dir', type=str, default='./rnn_log',
help='path to save log and checkpoint.')
parser.add_argument('--text', type=str, default='QuanSongCi.txt',
help='path to QuanSongCi.txt')
parser.add_argument('--num_steps', type=int, default=32,
help='number of time steps of one sample.')
parser.add_argument('--batch_size', type=int, default=3,
help='batch size to use.')
parser.add_argument('--dictionary', type=str, default='dictionary.json',
help='path to dictionary.json.')
parser.add_argument('--reverse_dictionary', type=str, default='reverse_dictionary.json',
help='path to reverse_dictionary.json.')
parser.add_argument('--learning_rate', type=float, default=0.001,
help='learning rate')
FLAGS, unparsed = parser.parse_known_args()
return FLAGS, unparsed
if __name__ == '__main__':
FLAGS, unparsed = parse_args()
for x in dir(FLAGS):
print(getattr(FLAGS, x))