-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtrain.csh
More file actions
105 lines (81 loc) · 2.34 KB
/
train.csh
File metadata and controls
105 lines (81 loc) · 2.34 KB
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#!/bin/csh
#################################################################
# train.csh #
#################################################################
# Copyright (c) 2017 Yuki Saito #
# This software is released under the MIT License. #
# http://opensource.org/licenses/mit-license.php #
#################################################################
# output directory
set out_gen="out"
# names of source/target speaker
set src="hoge"
set tgt="fuga"
# if negative, use cpu
set gpu=0
# order of mel-cepstral coefficients
set omc=59
# frame shift [ms]
set shiftl=5
# sampling rate [Hz]
set fs=16000
# F0 range (src)
set minf0_s=45
set maxf0_s=200
# F0 range (tgt)
set minf0_t=180
set maxf0_t=420
# batchsize
set batch=200
# number of iterations
set epoch=25
# number of hidden unit
set nhid=512
# learning late
set lr=0.01
# if 1, use input-to-output highway networks
set hw=1
# VUF for whisper filtering
set VUF=1
# ---------------------------------------
# tools
set EXT_FEATURES="python scripts/extract_features.py"
# -> extract features from wav files
set MAKE_DATA="python scripts/make_paradata.py"
# -> make train and test data
set TRAIN_GEN="python scripts/train_gen.py"
# -> train generator model
set SYNTHESIS="python scripts/synthesis.py"
# -> synthesis waveform
# ---------------------------------------
# flags
set COMPL=1
set EXTFT=1
set MKDAT=1
set TRGEN=1
set SYNTH=1
# ---------------------------------------
# COMPILE .pyx FILES
if (${COMPL} == 1) then
cd scripts/; python setup.py build_ext --inplace; cd ../
endif
# EXTRACT FEATURES
set opt=" --omc ${omc} --shiftl ${shiftl} --fs ${fs} "
if (${EXTFT} == 1) then
${EXT_FEATURES} ${opt} ${src} ${minf0_s} ${maxf0_s} ${tgt} ${minf0_t} ${maxf0_t}
endif
# MAKE DATA
set opt=" --omc ${omc} "
if (${MKDAT} == 1) then
${MAKE_DATA} ${opt} ${src} ${tgt}
endif
# TRAIN GENERATOR
set opt=" --batch ${batch} --epoch ${epoch} --gpu ${gpu} --lr ${lr} --nhid ${nhid} --hw ${hw} --omc ${omc} "
if (${TRGEN} == 1) then
${TRAIN_GEN} ${opt} ${out_gen} ${src} ${tgt}
endif
# SYNTHESIS WAVEFORM
set opt=" --gpu ${gpu} --nhid ${nhid} --hw ${hw} --omc ${omc} --shiftl ${shiftl} --fs ${fs} --VUF ${VUF} "
if (${SYNTH} == 1) then
${SYNTHESIS} ${opt} ${out_gen} $1 ${minf0_s} ${maxf0_s} $2
endif