-
Notifications
You must be signed in to change notification settings - Fork 1
/
config.py
30 lines (22 loc) · 932 Bytes
/
config.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
# fixed size of images for the loader
fixed_size = (64, 256)
# overall epochs and restart epochs according to a cosine annealing with restarts shceduler
restart_epochs = 40
max_epochs = 4 * restart_epochs
# batch size of word images
batch_size = 100
# initial learning rate
nlr = 1e-3
# number of iterations between progress display
display = 100
# DNN architecture configurations
cnn_cfg = [(2, 64), 'M', (4, 128), 'M', (4, 256)] #, (2, 512)]
cnn_top = 256 # hidden size for CTC top
rnn_cfg = (256, 2) # (hidden , num_layers)
# possible stopwords required for keyword spotting evaluation
stopwords = []
#classes = '_!"#&\'()*+,-./0123456789:;?ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz '
# reduced character set typically used in KWS settings (only lowercase alphanumeric characters)
def reduced(istr):
rstr = ''.join([c if (c.isalnum() or c=='_' or c==' ') else '*' for c in istr.lower()])
return rstr