deepsafe commited on
Commit
8886d5d
·
verified ·
1 Parent(s): c146f3c

chore: remove non-weight files (batch 5)

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/template_single_spk/voc1/local/data_prep.sh +0 -87
  2. audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/template_single_spk/voc1/path.sh +0 -33
  3. audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/template_single_spk/voc1/run.sh +0 -188
  4. audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/vctk/hubert_voc1/cmd.sh +0 -91
  5. audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/vctk/hubert_voc1/conf/hifigan_hubert.v1.yaml +0 -176
  6. audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/vctk/hubert_voc1/conf/hifigan_hubert_24k.v1.yaml +0 -176
  7. audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/vctk/hubert_voc1/conf/slurm.conf +0 -12
  8. audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/vctk/hubert_voc1/conf/style_melgan_hubert.v1.yaml +0 -145
  9. audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/vctk/hubert_voc1/path.sh +0 -33
  10. audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/vctk/hubert_voc1/run.sh +0 -151
  11. audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/vctk/voc1/cmd.sh +0 -91
  12. audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/vctk/voc1/conf/hifigan.v1.yaml +0 -180
  13. audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/vctk/voc1/conf/multi_band_melgan.v2.yaml +0 -154
  14. audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/vctk/voc1/conf/parallel_wavegan.v1.long.yaml +0 -122
  15. audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/vctk/voc1/conf/parallel_wavegan.v1.yaml +0 -122
  16. audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/vctk/voc1/conf/slurm.conf +0 -12
  17. audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/vctk/voc1/conf/style_melgan.v1.yaml +0 -147
  18. audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/vctk/voc1/local/data_download.sh +0 -37
  19. audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/vctk/voc1/local/data_prep.sh +0 -118
  20. audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/vctk/voc1/local/decode_from_text.py +0 -174
  21. audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/vctk/voc1/local/preprocess_hubert.py +0 -249
  22. audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/vctk/voc1/path.sh +0 -33
  23. audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/vctk/voc1/run.sh +0 -188
  24. audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/vctk/vq1/cmd.sh +0 -91
  25. audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/vctk/vq1/conf/conditioned_melgan_vae.v3.yaml +0 -130
  26. audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/vctk/vq1/conf/local_conditioned_melgan_vae.v3.yaml +0 -134
  27. audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/vctk/vq1/conf/slurm.conf +0 -12
  28. audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/vctk/vq1/local/data_download.sh +0 -37
  29. audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/vctk/vq1/local/data_prep.sh +0 -121
  30. audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/vctk/vq1/local/data_prep_2mix.sh +0 -54
  31. audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/vctk/vq1/local/decode_from_text.py +0 -174
  32. audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/vctk/vq1/local/setup_for_vc.py +0 -222
  33. audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/vctk/vq1/path.sh +0 -33
  34. audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/vctk/vq1/run.sh +0 -295
  35. audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/yesno/voc1/cmd.sh +0 -91
  36. audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/yesno/voc1/conf/hifigan.v1.debug.yaml +0 -152
  37. audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/yesno/voc1/conf/melgan.v1.debug.yaml +0 -112
  38. audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/yesno/voc1/conf/melgan.v3.debug.yaml +0 -121
  39. audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/yesno/voc1/conf/multi_band_melgan.v1.debug.yaml +0 -126
  40. audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/yesno/voc1/conf/parallel_wavegan.v1.debug.diff_fs.yaml +0 -121
  41. audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/yesno/voc1/conf/parallel_wavegan.v1.debug.npy.yaml +0 -121
  42. audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/yesno/voc1/conf/parallel_wavegan.v1.debug.yaml +0 -120
  43. audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/yesno/voc1/conf/slurm.conf +0 -12
  44. audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/yesno/voc1/conf/style_melgan.v1.debug.yaml +0 -135
  45. audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/yesno/voc1/conf/uhifigan.v1.debug.yaml +0 -155
  46. audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/yesno/voc1/local/data_download.sh +0 -28
  47. audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/yesno/voc1/local/data_prep.sh +0 -88
  48. audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/yesno/voc1/path.sh +0 -33
  49. audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/yesno/voc1/run.sh +0 -178
  50. audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/yesno/vq1/cmd.sh +0 -91
audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/template_single_spk/voc1/local/data_prep.sh DELETED
@@ -1,87 +0,0 @@
1
- #!/bin/bash
2
-
3
- # Copyright 2020 Tomoki Hayashi
4
- # MIT License (https://opensource.org/licenses/MIT)
5
-
6
- # shellcheck disable=SC1091
7
- . ./path.sh || exit 1;
8
-
9
- fs=22050
10
- num_dev=100
11
- num_eval=100
12
- train_set="train_nodev"
13
- dev_set="dev"
14
- eval_set="eval"
15
- shuffle=false
16
-
17
- # shellcheck disable=SC1091
18
- . utils/parse_options.sh || exit 1;
19
-
20
- db_root=$1
21
- data_dir=$2
22
-
23
- # check arguments
24
- if [ $# != 2 ]; then
25
- echo "Usage: $0 [Options] <db_root> <data_dir>"
26
- echo ""
27
- echo "Options:"
28
- echo " --num_dev: number of development uttreances (default=250)."
29
- echo " --num_eval: number of evaluation uttreances (default=250)."
30
- echo " --train_set: name of train set (default=train_nodev)."
31
- echo " --dev_set: name of dev set (default=dev)."
32
- echo " --eval_set: name of eval set (default=eval)."
33
- echo " --shuffle: whether to perform shuffle in making dev / eval set (default=false)."
34
- exit 1
35
- fi
36
-
37
- set -euo pipefail
38
-
39
- [ ! -e "${data_dir}/all" ] && mkdir -p "${data_dir}/all"
40
-
41
- # set filenames
42
- scp="${data_dir}/all/wav.scp"
43
-
44
- # check file existence
45
- [ -e "${scp}" ] && rm "${scp}"
46
-
47
- # make all scp
48
- find "${db_root}" -follow -name "*.wav" | sort | while read -r filename; do
49
- id=$(basename "${filename}" | sed -e "s/\.[^\.]*$//g")
50
- echo "${id} cat ${filename} | sox -t wav - -c 1 -b 16 -t wav - rate ${fs} |" >> "${scp}"
51
- done
52
-
53
- # split
54
- num_all=$(wc -l < "${scp}")
55
- num_deveval=$((num_dev + num_eval))
56
- num_train=$((num_all - num_deveval))
57
- if [ ${num_eval} -ne 0 ]; then
58
- utils/split_data.sh \
59
- --num_first "${num_train}" \
60
- --num_second "${num_deveval}" \
61
- --shuffle "${shuffle}" \
62
- "${data_dir}/all" \
63
- "${data_dir}/${train_set}" \
64
- "${data_dir}/deveval"
65
- utils/split_data.sh \
66
- --num_first "${num_dev}" \
67
- --num_second "${num_eval}" \
68
- --shuffle "${shuffle}" \
69
- "${data_dir}/deveval" \
70
- "${data_dir}/${dev_set}" \
71
- "${data_dir}/${eval_set}"
72
- else
73
- utils/split_data.sh \
74
- --num_first "${num_train}" \
75
- --num_second "${num_deveval}" \
76
- --shuffle "${shuffle}" \
77
- "${data_dir}/all" \
78
- "${data_dir}/${train_set}" \
79
- "${data_dir}/${dev_set}"
80
- cp -r "${data_dir}/${dev_set}" "${data_dir}/${eval_set}"
81
- fi
82
-
83
- # remove tmp directories
84
- rm -rf "${data_dir}/all"
85
- rm -rf "${data_dir}/deveval"
86
-
87
- echo "Successfully prepared data."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/template_single_spk/voc1/path.sh DELETED
@@ -1,33 +0,0 @@
1
- # cuda related
2
- export CUDA_HOME=/usr/local/cuda-11.3
3
- export LD_LIBRARY_PATH="${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}"
4
-
5
- # path related
6
- export PRJ_ROOT="${PWD}/../../.."
7
- if [ -e "${PRJ_ROOT}/tools/venv/bin/activate" ]; then
8
- # shellcheck disable=SC1090
9
- . "${PRJ_ROOT}/tools/venv/bin/activate"
10
- fi
11
-
12
- # python related
13
- export OMP_NUM_THREADS=1
14
- export PYTHONIOENCODING=UTF-8
15
- export MPL_BACKEND=Agg
16
-
17
- # check installation
18
- if ! command -v parallel-wavegan-train > /dev/null; then
19
- echo "Error: It seems setup is not finished." >&2
20
- echo "Error: Please setup your environment by following README.md" >&2
21
- return 1
22
- fi
23
- if ! command -v jq > /dev/null; then
24
- echo "Error: It seems jq is not installed." >&2
25
- echo "Error: Please install via \`sudo apt-get install jq\`." >&2
26
- echo "Error: If you do not have sudo, please download from https://stedolan.github.io/jq/download/." >&2
27
- return 1
28
- fi
29
- if ! command -v yq > /dev/null; then
30
- echo "Error: It seems yq is not installed." >&2
31
- echo "Error: Please install via \`pip install yq\`." >&2
32
- return 1
33
- fi
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/template_single_spk/voc1/run.sh DELETED
@@ -1,188 +0,0 @@
1
- #!/bin/bash
2
-
3
- # Copyright 2020 Tomoki Hayashi
4
- # MIT License (https://opensource.org/licenses/MIT)
5
-
6
- . ./cmd.sh || exit 1;
7
- . ./path.sh || exit 1;
8
-
9
- # basic settings
10
- stage=0 # stage to start
11
- stop_stage=100 # stage to stop
12
- verbose=1 # verbosity level (lower is less info)
13
- n_gpus=1 # number of gpus in training
14
- n_jobs=4 # number of parallel jobs in feature extraction
15
-
16
- # NOTE(kan-bayashi): renamed to conf to avoid conflict in parse_options.sh
17
- conf=conf/parallel_wavegan.v1.yaml
18
-
19
- # directory path setting
20
- db_root=/path/to/database # direcotry including wavfiles (MODIFY BY YOURSELF)
21
- # each wav filename in the directory should be unique
22
- # e.g.
23
- # /path/to/database
24
- # ├── utt_1.wav
25
- # ├── utt_2.wav
26
- # │ ...
27
- # └── utt_N.wav
28
- dumpdir=dump # directory to dump features
29
-
30
- # subset setting
31
- shuffle=false # whether to shuffle the data to create subset
32
- num_dev=100 # the number of development data
33
- num_eval=100 # the number of evaluation data
34
- # (if set to 0, the same dev set is used as eval set)
35
-
36
- # training related setting
37
- tag="" # tag for directory to save model
38
- resume="" # checkpoint path to resume training
39
- # (e.g. <path>/<to>/checkpoint-10000steps.pkl)
40
- pretrain="" # checkpoint path to load pretrained parameters
41
- # (e.g. ../../jsut/<path>/<to>/checkpoint-400000steps.pkl)
42
-
43
- # decoding related setting
44
- checkpoint="" # checkpoint path to be used for decoding
45
- # if not provided, the latest one will be used
46
- # (e.g. <path>/<to>/checkpoint-400000steps.pkl)
47
-
48
- # shellcheck disable=SC1091
49
- . utils/parse_options.sh || exit 1;
50
-
51
- train_set="train_nodev" # name of training data directory
52
- dev_set="dev" # name of development data direcotry
53
- eval_set="eval" # name of evaluation data direcotry
54
-
55
- set -euo pipefail
56
-
57
- if [ "${stage}" -le 0 ] && [ "${stop_stage}" -ge 0 ]; then
58
- echo "Stage 0: Data preparation"
59
- local/data_prep.sh \
60
- --fs "$(yq ".sampling_rate" "${conf}")" \
61
- --num_dev "${num_dev}" \
62
- --num_eval "${num_eval}" \
63
- --train_set "${train_set}" \
64
- --dev_set "${dev_set}" \
65
- --eval_set "${eval_set}" \
66
- --shuffle "${shuffle}" \
67
- "${db_root}" data
68
- fi
69
-
70
- stats_ext=$(grep -q "hdf5" <(yq ".format" "${conf}") && echo "h5" || echo "npy")
71
- if [ "${stage}" -le 1 ] && [ "${stop_stage}" -ge 1 ]; then
72
- echo "Stage 1: Feature extraction"
73
- # extract raw features
74
- pids=()
75
- for name in "${train_set}" "${dev_set}" "${eval_set}"; do
76
- (
77
- [ ! -e "${dumpdir}/${name}/raw" ] && mkdir -p "${dumpdir}/${name}/raw"
78
- echo "Feature extraction start. See the progress via ${dumpdir}/${name}/raw/preprocessing.*.log."
79
- utils/make_subset_data.sh "data/${name}" "${n_jobs}" "${dumpdir}/${name}/raw"
80
- ${train_cmd} JOB=1:${n_jobs} "${dumpdir}/${name}/raw/preprocessing.JOB.log" \
81
- parallel-wavegan-preprocess \
82
- --config "${conf}" \
83
- --scp "${dumpdir}/${name}/raw/wav.JOB.scp" \
84
- --dumpdir "${dumpdir}/${name}/raw/dump.JOB" \
85
- --verbose "${verbose}"
86
- echo "Successfully finished feature extraction of ${name} set."
87
- ) &
88
- pids+=($!)
89
- done
90
- i=0; for pid in "${pids[@]}"; do wait "${pid}" || ((++i)); done
91
- [ "${i}" -gt 0 ] && echo "$0: ${i} background jobs are failed." && exit 1;
92
- echo "Successfully finished feature extraction."
93
-
94
- # calculate statistics for normalization
95
- if [ -z "${pretrain}" ]; then
96
- # calculate statistics for normalization
97
- echo "Statistics computation start. See the progress via ${dumpdir}/${train_set}/compute_statistics.log."
98
- ${train_cmd} "${dumpdir}/${train_set}/compute_statistics.log" \
99
- parallel-wavegan-compute-statistics \
100
- --config "${conf}" \
101
- --rootdir "${dumpdir}/${train_set}/raw" \
102
- --dumpdir "${dumpdir}/${train_set}" \
103
- --verbose "${verbose}"
104
- echo "Successfully finished calculation of statistics."
105
- else
106
- echo "Use statistics of pretrained model. Skip statistics computation."
107
- cp "$(dirname "${pretrain}")/stats.${stats_ext}" "${dumpdir}/${train_set}"
108
- fi
109
-
110
- # normalize and dump them
111
- pids=()
112
- for name in "${train_set}" "${dev_set}" "${eval_set}"; do
113
- (
114
- [ ! -e "${dumpdir}/${name}/norm" ] && mkdir -p "${dumpdir}/${name}/norm"
115
- echo "Nomalization start. See the progress via ${dumpdir}/${name}/norm/normalize.*.log."
116
- ${train_cmd} JOB=1:${n_jobs} "${dumpdir}/${name}/norm/normalize.JOB.log" \
117
- parallel-wavegan-normalize \
118
- --config "${conf}" \
119
- --stats "${dumpdir}/${train_set}/stats.${stats_ext}" \
120
- --rootdir "${dumpdir}/${name}/raw/dump.JOB" \
121
- --dumpdir "${dumpdir}/${name}/norm/dump.JOB" \
122
- --verbose "${verbose}"
123
- echo "Successfully finished normalization of ${name} set."
124
- ) &
125
- pids+=($!)
126
- done
127
- i=0; for pid in "${pids[@]}"; do wait "${pid}" || ((++i)); done
128
- [ "${i}" -gt 0 ] && echo "$0: ${i} background jobs are failed." && exit 1;
129
- echo "Successfully finished normalization."
130
- fi
131
-
132
- if [ -z "${tag}" ]; then
133
- expdir="exp/${train_set}_$(basename "${conf}" .yaml)"
134
- if [ -n "${pretrain}" ]; then
135
- pretrain_tag=$(basename "$(dirname "${pretrain}")")
136
- expdir+="_${pretrain_tag}"
137
- fi
138
- else
139
- expdir="exp/${train_set}_${tag}"
140
- fi
141
- if [ "${stage}" -le 2 ] && [ "${stop_stage}" -ge 2 ]; then
142
- echo "Stage 2: Network training"
143
- [ ! -e "${expdir}" ] && mkdir -p "${expdir}"
144
- cp "${dumpdir}/${train_set}/stats.${stats_ext}" "${expdir}"
145
- if [ "${n_gpus}" -gt 1 ]; then
146
- train="python -m parallel_wavegan.distributed.launch --nproc_per_node ${n_gpus} -c parallel-wavegan-train"
147
- else
148
- train="parallel-wavegan-train"
149
- fi
150
- echo "Training start. See the progress via ${expdir}/train.log."
151
- ${cuda_cmd} --gpu "${n_gpus}" "${expdir}/train.log" \
152
- ${train} \
153
- --config "${conf}" \
154
- --train-dumpdir "${dumpdir}/${train_set}/norm" \
155
- --dev-dumpdir "${dumpdir}/${dev_set}/norm" \
156
- --outdir "${expdir}" \
157
- --resume "${resume}" \
158
- --pretrain "${pretrain}" \
159
- --verbose "${verbose}"
160
- echo "Successfully finished training."
161
- fi
162
-
163
- if [ "${stage}" -le 3 ] && [ "${stop_stage}" -ge 3 ]; then
164
- echo "Stage 3: Network decoding"
165
- # shellcheck disable=SC2012
166
- [ -z "${checkpoint}" ] && checkpoint="$(ls -dt "${expdir}"/*.pkl | head -1 || true)"
167
- outdir="${expdir}/wav/$(basename "${checkpoint}" .pkl)"
168
- pids=()
169
- for name in "${dev_set}" "${eval_set}"; do
170
- (
171
- [ ! -e "${outdir}/${name}" ] && mkdir -p "${outdir}/${name}"
172
- [ "${n_gpus}" -gt 1 ] && n_gpus=1
173
- echo "Decoding start. See the progress via ${outdir}/${name}/decode.log."
174
- ${cuda_cmd} --gpu "${n_gpus}" "${outdir}/${name}/decode.log" \
175
- parallel-wavegan-decode \
176
- --dumpdir "${dumpdir}/${name}/norm" \
177
- --checkpoint "${checkpoint}" \
178
- --outdir "${outdir}/${name}" \
179
- --verbose "${verbose}"
180
- echo "Successfully finished decoding of ${name} set."
181
- ) &
182
- pids+=($!)
183
- done
184
- i=0; for pid in "${pids[@]}"; do wait "${pid}" || ((++i)); done
185
- [ "${i}" -gt 0 ] && echo "$0: ${i} background jobs are failed." && exit 1;
186
- echo "Successfully finished decoding."
187
- fi
188
- echo "Finished."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/vctk/hubert_voc1/cmd.sh DELETED
@@ -1,91 +0,0 @@
1
- # ====== About run.pl, queue.pl, slurm.pl, and ssh.pl ======
2
- # Usage: <cmd>.pl [options] JOB=1:<nj> <log> <command...>
3
- # e.g.
4
- # run.pl --mem 4G JOB=1:10 echo.JOB.log echo JOB
5
- #
6
- # Options:
7
- # --time <time>: Limit the maximum time to execute.
8
- # --mem <mem>: Limit the maximum memory usage.
9
- # -–max-jobs-run <njob>: Limit the number parallel jobs. This is ignored for non-array jobs.
10
- # --num-threads <ngpu>: Specify the number of CPU core.
11
- # --gpu <ngpu>: Specify the number of GPU devices.
12
- # --config: Change the configuration file from default.
13
- #
14
- # "JOB=1:10" is used for "array jobs" and it can control the number of parallel jobs.
15
- # The left string of "=", i.e. "JOB", is replaced by <N>(Nth job) in the command and the log file name,
16
- # e.g. "echo JOB" is changed to "echo 3" for the 3rd job and "echo 8" for 8th job respectively.
17
- # Note that the number must start with a positive number, so you can't use "JOB=0:10" for example.
18
- #
19
- # run.pl, queue.pl, slurm.pl, and ssh.pl have unified interface, not depending on its backend.
20
- # These options are mapping to specific options for each backend and
21
- # it is configured by "conf/queue.conf" and "conf/slurm.conf" by default.
22
- # If jobs failed, your configuration might be wrong for your environment.
23
- #
24
- #
25
- # The official documentaion for run.pl, queue.pl, slurm.pl, and ssh.pl:
26
- # "Parallelization in Kaldi": http://kaldi-asr.org/doc/queue.html
27
- # =========================================================~
28
-
29
-
30
- # Select the backend used by run.sh from "local", "stdout", "sge", "slurm", or "ssh"
31
- cmd_backend="local"
32
-
33
- # Local machine, without any Job scheduling system
34
- if [ "${cmd_backend}" = local ]; then
35
-
36
- # The other usage
37
- export train_cmd="utils/run.pl"
38
- # Used for "*_train.py": "--gpu" is appended optionally by run.sh
39
- export cuda_cmd="utils/run.pl"
40
- # Used for "*_recog.py"
41
- export decode_cmd="utils/run.pl"
42
-
43
- # Local machine, without any Job scheduling system
44
- elif [ "${cmd_backend}" = stdout ]; then
45
-
46
- # The other usage
47
- export train_cmd="utils/stdout.pl"
48
- # Used for "*_train.py": "--gpu" is appended optionally by run.sh
49
- export cuda_cmd="utils/stdout.pl"
50
- # Used for "*_recog.py"
51
- export decode_cmd="utils/stdout.pl"
52
-
53
- # "qsub" (SGE, Torque, PBS, etc.)
54
- elif [ "${cmd_backend}" = sge ]; then
55
- # The default setting is written in conf/queue.conf.
56
- # You must change "-q g.q" for the "queue" for your environment.
57
- # To know the "queue" names, type "qhost -q"
58
- # Note that to use "--gpu *", you have to setup "complex_value" for the system scheduler.
59
-
60
- export train_cmd="utils/queue.pl"
61
- export cuda_cmd="utils/queue.pl"
62
- export decode_cmd="utils/queue.pl"
63
-
64
- # "sbatch" (Slurm)
65
- elif [ "${cmd_backend}" = slurm ]; then
66
- # The default setting is written in conf/slurm.conf.
67
- # You must change "-p cpu" and "-p gpu" for the "partion" for your environment.
68
- # To know the "partion" names, type "sinfo".
69
- # You can use "--gpu * " by defualt for slurm and it is interpreted as "--gres gpu:*"
70
- # The devices are allocated exclusively using "${CUDA_VISIBLE_DEVICES}".
71
-
72
- export train_cmd="utils/slurm.pl"
73
- export cuda_cmd="utils/slurm.pl"
74
- export decode_cmd="utils/slurm.pl"
75
-
76
- elif [ "${cmd_backend}" = ssh ]; then
77
- # You have to create ".queue/machines" to specify the host to execute jobs.
78
- # e.g. .queue/machines
79
- # host1
80
- # host2
81
- # host3
82
- # Assuming you can login them without any password, i.e. You have to set ssh keys.
83
-
84
- export train_cmd="utils/ssh.pl"
85
- export cuda_cmd="utils/ssh.pl"
86
- export decode_cmd="utils/ssh.pl"
87
-
88
- else
89
- echo "$0: Error: Unknown cmd_backend=${cmd_backend}" 1>&2
90
- return 1
91
- fi
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/vctk/hubert_voc1/conf/hifigan_hubert.v1.yaml DELETED
@@ -1,176 +0,0 @@
1
- # This configuration is based on HiFiGAN V1, derived
2
- # from official repository (https://github.com/jik876/hifi-gan).
3
-
4
- ###########################################################
5
- # FEATURE EXTRACTION SETTING #
6
- ###########################################################
7
- sampling_rate: 16000 # Sampling rate.
8
- fft_size: null # FFT size.
9
- hop_size: 320 # Hop size.
10
- win_length: null # Window length.
11
- # If set to null, it will be the same as fft_size.
12
- window: null # Window function.
13
- num_mels: 2 # Number of mel basis.
14
- fmin: null # Minimum freq in mel basis calculation.
15
- fmax: null # Maximum frequency in mel basis calculation.
16
- global_gain_scale: 1.0 # Will be multiplied to all of waveform.
17
- trim_silence: false # Whether to trim the start and end of silence.
18
- trim_threshold_in_db: 20 # Need to tune carefully if the recording is not good.
19
- trim_frame_size: 1024 # Frame size in trimming.
20
- trim_hop_size: 256 # Hop size in trimming.
21
- format: "hdf5" # Feature file format. "npy" or "hdf5" is supported.
22
-
23
- ###########################################################
24
- # GENERATOR NETWORK ARCHITECTURE SETTING #
25
- ###########################################################
26
- generator_type: DiscreteSymbolHiFiGANGenerator
27
- generator_params:
28
- in_channels: 512 # Number of input channels.
29
- out_channels: 1 # Number of output channels.
30
- channels: 512 # Number of initial channels.
31
- num_embs: 100
32
- num_spk_embs: 128
33
- spk_emb_dim: 512
34
- concat_spk_emb: false
35
- kernel_size: 7 # Kernel size of initial and final conv layers.
36
- upsample_scales: [10, 8, 2, 2] # Upsampling scales.
37
- upsample_kernel_sizes: [20, 16, 4, 4] # Kernel size for upsampling layers.
38
- resblock_kernel_sizes: [3, 7, 11] # Kernel size for residual blocks.
39
- resblock_dilations: # Dilations for residual blocks.
40
- - [1, 3, 5]
41
- - [1, 3, 5]
42
- - [1, 3, 5]
43
- use_additional_convs: true # Whether to use additional conv layer in residual blocks.
44
- bias: true # Whether to use bias parameter in conv.
45
- nonlinear_activation: "LeakyReLU" # Nonlinear activation type.
46
- nonlinear_activation_params: # Nonlinear activation paramters.
47
- negative_slope: 0.1
48
- use_weight_norm: true # Whether to apply weight normalization.
49
-
50
- ###########################################################
51
- # DISCRIMINATOR NETWORK ARCHITECTURE SETTING #
52
- ###########################################################
53
- discriminator_type: HiFiGANMultiScaleMultiPeriodDiscriminator
54
- discriminator_params:
55
- scales: 3 # Number of multi-scale discriminator.
56
- scale_downsample_pooling: "AvgPool1d" # Pooling operation for scale discriminator.
57
- scale_downsample_pooling_params:
58
- kernel_size: 4 # Pooling kernel size.
59
- stride: 2 # Pooling stride.
60
- padding: 2 # Padding size.
61
- scale_discriminator_params:
62
- in_channels: 1 # Number of input channels.
63
- out_channels: 1 # Number of output channels.
64
- kernel_sizes: [15, 41, 5, 3] # List of kernel sizes.
65
- channels: 128 # Initial number of channels.
66
- max_downsample_channels: 1024 # Maximum number of channels in downsampling conv layers.
67
- max_groups: 16 # Maximum number of groups in downsampling conv layers.
68
- bias: true
69
- downsample_scales: [4, 4, 4, 4, 1] # Downsampling scales.
70
- nonlinear_activation: "LeakyReLU" # Nonlinear activation.
71
- nonlinear_activation_params:
72
- negative_slope: 0.1
73
- follow_official_norm: true # Whether to follow the official norm setting.
74
- periods: [2, 3, 5, 7, 11] # List of period for multi-period discriminator.
75
- period_discriminator_params:
76
- in_channels: 1 # Number of input channels.
77
- out_channels: 1 # Number of output channels.
78
- kernel_sizes: [5, 3] # List of kernel sizes.
79
- channels: 32 # Initial number of channels.
80
- downsample_scales: [3, 3, 3, 3, 1] # Downsampling scales.
81
- max_downsample_channels: 1024 # Maximum number of channels in downsampling conv layers.
82
- bias: true # Whether to use bias parameter in conv layer."
83
- nonlinear_activation: "LeakyReLU" # Nonlinear activation.
84
- nonlinear_activation_params: # Nonlinear activation paramters.
85
- negative_slope: 0.1
86
- use_weight_norm: true # Whether to apply weight normalization.
87
- use_spectral_norm: false # Whether to apply spectral normalization.
88
-
89
- ###########################################################
90
- # STFT LOSS SETTING #
91
- ###########################################################
92
- use_stft_loss: false # Whether to use multi-resolution STFT loss.
93
- use_mel_loss: true # Whether to use Mel-spectrogram loss.
94
- mel_loss_params: # Mel-spectrogram loss parameters.
95
- fs: 16000
96
- fft_size: 1024
97
- hop_size: 256
98
- win_length: null
99
- window: "hann"
100
- num_mels: 80
101
- fmin: 0
102
- fmax: 8000
103
- log_base: null # Log base. If set to null, use natural logarithm.
104
- generator_adv_loss_params:
105
- average_by_discriminators: false # Whether to average loss by #discriminators.
106
- discriminator_adv_loss_params:
107
- average_by_discriminators: false # Whether to average loss by #discriminators.
108
- use_feat_match_loss: true
109
- feat_match_loss_params:
110
- average_by_discriminators: false # Whether to average loss by #discriminators.
111
- average_by_layers: false # Whether to average loss by #layers in each discriminator.
112
- include_final_outputs: true # Whether to include final outputs in feat match loss calculation.
113
-
114
- ###########################################################
115
- # ADVERSARIAL LOSS SETTING #
116
- ###########################################################
117
- lambda_aux: 45.0 # Loss balancing coefficient for STFT loss.
118
- lambda_adv: 1.0 # Loss balancing coefficient for adversarial loss.
119
- lambda_feat_match: 2.0 # Loss balancing coefficient for feat match loss..
120
-
121
- ###########################################################
122
- # DATA LOADER SETTING #
123
- ###########################################################
124
- batch_size: 16 # Batch size.
125
- batch_max_steps: 10240 # Length of each audio in batch. Make sure dividable by hop_size.
126
- pin_memory: true # Whether to pin memory in Pytorch DataLoader.
127
- num_workers: 2 # Number of workers in Pytorch DataLoader.
128
- remove_short_samples: false # Whether to remove samples the length of which are less than batch_max_steps.
129
- allow_cache: true # Whether to allow cache in dataset. If true, it requires cpu memory.
130
-
131
- ###########################################################
132
- # OPTIMIZER & SCHEDULER SETTING #
133
- ###########################################################
134
- generator_optimizer_type: Adam
135
- generator_optimizer_params:
136
- lr: 2.0e-4
137
- betas: [0.5, 0.9]
138
- weight_decay: 0.0
139
- generator_scheduler_type: MultiStepLR
140
- generator_scheduler_params:
141
- gamma: 0.5
142
- milestones:
143
- - 200000
144
- - 400000
145
- - 600000
146
- - 800000
147
- generator_grad_norm: -1
148
- discriminator_optimizer_type: Adam
149
- discriminator_optimizer_params:
150
- lr: 2.0e-4
151
- betas: [0.5, 0.9]
152
- weight_decay: 0.0
153
- discriminator_scheduler_type: MultiStepLR
154
- discriminator_scheduler_params:
155
- gamma: 0.5
156
- milestones:
157
- - 200000
158
- - 400000
159
- - 600000
160
- - 800000
161
- discriminator_grad_norm: -1
162
-
163
- ###########################################################
164
- # INTERVAL SETTING #
165
- ###########################################################
166
- generator_train_start_steps: 1 # Number of steps to start to train discriminator.
167
- discriminator_train_start_steps: 0 # Number of steps to start to train discriminator.
168
- train_max_steps: 2500000 # Number of training steps.
169
- save_interval_steps: 50000 # Interval steps to save checkpoint.
170
- eval_interval_steps: 1000 # Interval steps to evaluate the network.
171
- log_interval_steps: 100 # Interval steps to record the training log.
172
-
173
- ###########################################################
174
- # OTHER SETTING #
175
- ###########################################################
176
- num_save_intermediate_results: 4 # Number of results to be saved as intermediate results.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/vctk/hubert_voc1/conf/hifigan_hubert_24k.v1.yaml DELETED
@@ -1,176 +0,0 @@
1
- # This configuration is based on HiFiGAN V1, derived
2
- # from official repository (https://github.com/jik876/hifi-gan).
3
-
4
- ###########################################################
5
- # FEATURE EXTRACTION SETTING #
6
- ###########################################################
7
- sampling_rate: 24000 # Sampling rate.
8
- fft_size: null # FFT size.
9
- hop_size: 480 # Hop size.
10
- win_length: null # Window length.
11
- # If set to null, it will be the same as fft_size.
12
- window: null # Window function.
13
- num_mels: 2 # Number of mel basis.
14
- fmin: null # Minimum freq in mel basis calculation.
15
- fmax: null # Maximum frequency in mel basis calculation.
16
- global_gain_scale: 1.0 # Will be multiplied to all of waveform.
17
- trim_silence: false # Whether to trim the start and end of silence.
18
- trim_threshold_in_db: 20 # Need to tune carefully if the recording is not good.
19
- trim_frame_size: 1024 # Frame size in trimming.
20
- trim_hop_size: 256 # Hop size in trimming.
21
- format: "hdf5" # Feature file format. "npy" or "hdf5" is supported.
22
-
23
- ###########################################################
24
- # GENERATOR NETWORK ARCHITECTURE SETTING #
25
- ###########################################################
26
- generator_type: DiscreteSymbolHiFiGANGenerator
27
- generator_params:
28
- in_channels: 512 # Number of input channels.
29
- out_channels: 1 # Number of output channels.
30
- channels: 512 # Number of initial channels.
31
- num_embs: 100
32
- num_spk_embs: 128
33
- spk_emb_dim: 512
34
- concat_spk_emb: false
35
- kernel_size: 7 # Kernel size of initial and final conv layers.
36
- upsample_scales: [12, 10, 2, 2] # Upsampling scales.
37
- upsample_kernel_sizes: [24, 20, 4, 4] # Kernel size for upsampling layers.
38
- resblock_kernel_sizes: [3, 7, 11] # Kernel size for residual blocks.
39
- resblock_dilations: # Dilations for residual blocks.
40
- - [1, 3, 5]
41
- - [1, 3, 5]
42
- - [1, 3, 5]
43
- use_additional_convs: true # Whether to use additional conv layer in residual blocks.
44
- bias: true # Whether to use bias parameter in conv.
45
- nonlinear_activation: "LeakyReLU" # Nonlinear activation type.
46
- nonlinear_activation_params: # Nonlinear activation paramters.
47
- negative_slope: 0.1
48
- use_weight_norm: true # Whether to apply weight normalization.
49
-
50
- ###########################################################
51
- # DISCRIMINATOR NETWORK ARCHITECTURE SETTING #
52
- ###########################################################
53
- discriminator_type: HiFiGANMultiScaleMultiPeriodDiscriminator
54
- discriminator_params:
55
- scales: 3 # Number of multi-scale discriminator.
56
- scale_downsample_pooling: "AvgPool1d" # Pooling operation for scale discriminator.
57
- scale_downsample_pooling_params:
58
- kernel_size: 4 # Pooling kernel size.
59
- stride: 2 # Pooling stride.
60
- padding: 2 # Padding size.
61
- scale_discriminator_params:
62
- in_channels: 1 # Number of input channels.
63
- out_channels: 1 # Number of output channels.
64
- kernel_sizes: [15, 41, 5, 3] # List of kernel sizes.
65
- channels: 128 # Initial number of channels.
66
- max_downsample_channels: 1024 # Maximum number of channels in downsampling conv layers.
67
- max_groups: 16 # Maximum number of groups in downsampling conv layers.
68
- bias: true
69
- downsample_scales: [4, 4, 4, 4, 1] # Downsampling scales.
70
- nonlinear_activation: "LeakyReLU" # Nonlinear activation.
71
- nonlinear_activation_params:
72
- negative_slope: 0.1
73
- follow_official_norm: true # Whether to follow the official norm setting.
74
- periods: [2, 3, 5, 7, 11] # List of period for multi-period discriminator.
75
- period_discriminator_params:
76
- in_channels: 1 # Number of input channels.
77
- out_channels: 1 # Number of output channels.
78
- kernel_sizes: [5, 3] # List of kernel sizes.
79
- channels: 32 # Initial number of channels.
80
- downsample_scales: [3, 3, 3, 3, 1] # Downsampling scales.
81
- max_downsample_channels: 1024 # Maximum number of channels in downsampling conv layers.
82
- bias: true # Whether to use bias parameter in conv layer."
83
- nonlinear_activation: "LeakyReLU" # Nonlinear activation.
84
- nonlinear_activation_params: # Nonlinear activation paramters.
85
- negative_slope: 0.1
86
- use_weight_norm: true # Whether to apply weight normalization.
87
- use_spectral_norm: false # Whether to apply spectral normalization.
88
-
89
- ###########################################################
90
- # STFT LOSS SETTING #
91
- ###########################################################
92
- use_stft_loss: false # Whether to use multi-resolution STFT loss.
93
- use_mel_loss: true # Whether to use Mel-spectrogram loss.
94
- mel_loss_params: # Mel-spectrogram loss parameters.
95
- fs: 24000
96
- fft_size: 2048
97
- hop_size: 300
98
- win_length: 1200
99
- window: "hann"
100
- num_mels: 80
101
- fmin: 80
102
- fmax: 7600
103
- log_base: null # Log base. If set to null, use natural logarithm.
104
- generator_adv_loss_params:
105
- average_by_discriminators: false # Whether to average loss by #discriminators.
106
- discriminator_adv_loss_params:
107
- average_by_discriminators: false # Whether to average loss by #discriminators.
108
- use_feat_match_loss: true
109
- feat_match_loss_params:
110
- average_by_discriminators: false # Whether to average loss by #discriminators.
111
- average_by_layers: false # Whether to average loss by #layers in each discriminator.
112
- include_final_outputs: true # Whether to include final outputs in feat match loss calculation.
113
-
114
- ###########################################################
115
- # ADVERSARIAL LOSS SETTING #
116
- ###########################################################
117
- lambda_aux: 45.0 # Loss balancing coefficient for STFT loss.
118
- lambda_adv: 1.0 # Loss balancing coefficient for adversarial loss.
119
- lambda_feat_match: 2.0 # Loss balancing coefficient for feat match loss..
120
-
121
- ###########################################################
122
- # DATA LOADER SETTING #
123
- ###########################################################
124
- batch_size: 16 # Batch size.
125
- batch_max_steps: 12000 # Length of each audio in batch. Make sure dividable by hop_size.
126
- pin_memory: true # Whether to pin memory in Pytorch DataLoader.
127
- num_workers: 2 # Number of workers in Pytorch DataLoader.
128
- remove_short_samples: false # Whether to remove samples the length of which are less than batch_max_steps.
129
- allow_cache: true # Whether to allow cache in dataset. If true, it requires cpu memory.
130
-
131
- ###########################################################
132
- # OPTIMIZER & SCHEDULER SETTING #
133
- ###########################################################
134
- generator_optimizer_type: Adam
135
- generator_optimizer_params:
136
- lr: 2.0e-4
137
- betas: [0.5, 0.9]
138
- weight_decay: 0.0
139
- generator_scheduler_type: MultiStepLR
140
- generator_scheduler_params:
141
- gamma: 0.5
142
- milestones:
143
- - 200000
144
- - 400000
145
- - 600000
146
- - 800000
147
- generator_grad_norm: -1
148
- discriminator_optimizer_type: Adam
149
- discriminator_optimizer_params:
150
- lr: 2.0e-4
151
- betas: [0.5, 0.9]
152
- weight_decay: 0.0
153
- discriminator_scheduler_type: MultiStepLR
154
- discriminator_scheduler_params:
155
- gamma: 0.5
156
- milestones:
157
- - 200000
158
- - 400000
159
- - 600000
160
- - 800000
161
- discriminator_grad_norm: -1
162
-
163
- ###########################################################
164
- # INTERVAL SETTING #
165
- ###########################################################
166
- generator_train_start_steps: 1 # Number of steps to start to train discriminator.
167
- discriminator_train_start_steps: 0 # Number of steps to start to train discriminator.
168
- train_max_steps: 2500000 # Number of training steps.
169
- save_interval_steps: 20000 # Interval steps to save checkpoint.
170
- eval_interval_steps: 1000 # Interval steps to evaluate the network.
171
- log_interval_steps: 100 # Interval steps to record the training log.
172
-
173
- ###########################################################
174
- # OTHER SETTING #
175
- ###########################################################
176
- num_save_intermediate_results: 4 # Number of results to be saved as intermediate results.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/vctk/hubert_voc1/conf/slurm.conf DELETED
@@ -1,12 +0,0 @@
1
- # Default configuration
2
- command sbatch --export=PATH --ntasks-per-node=1
3
- option time=* --time $0
4
- option mem=* --mem-per-cpu $0
5
- option mem=0 # Do not add anything to qsub_opts
6
- option num_threads=* --cpus-per-task $0 --ntasks-per-node=1
7
- option num_threads=1 --cpus-per-task 1 --ntasks-per-node=1 # Do not add anything to qsub_opts
8
- default gpu=0
9
- option gpu=0 -p cpu
10
- option gpu=* -p gpu --gres=gpu:$0
11
- # note: the --max-jobs-run option is supported as a special case
12
- # by slurm.pl and you don't have to handle it in the config file.
 
 
 
 
 
 
 
 
 
 
 
 
 
audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/vctk/hubert_voc1/conf/style_melgan_hubert.v1.yaml DELETED
@@ -1,145 +0,0 @@
1
- # This configuration is based on StyleMelGAN paper.
2
-
3
- ###########################################################
4
- # FEATURE EXTRACTION SETTING #
5
- ###########################################################
6
- sampling_rate: 16000 # Sampling rate.
7
- fft_size: null # FFT size.
8
- hop_size: 320 # Hop size.
9
- win_length: null # Window length.
10
- # If set to null, it will be the same as fft_size.
11
- window: null # Window function.
12
- num_mels: 1 # Number of mel basis.
13
- fmin: null # Minimum freq in mel basis calculation.
14
- fmax: null # Maximum frequency in mel basis calculation.
15
- global_gain_scale: 1.0 # Will be multiplied to all of waveform.
16
- trim_silence: false # Whether to trim the start and end of silence.
17
- trim_threshold_in_db: 60 # Need to tune carefully if the recording is not good.
18
- trim_frame_size: 1024 # Frame size in trimming.
19
- trim_hop_size: 256 # Hop size in trimming.
20
- format: "hdf5" # Feature file format. " npy " or " hdf5 " is supported.
21
-
22
- ###########################################################
23
- # GENERATOR NETWORK ARCHITECTURE SETTING #
24
- ###########################################################
25
- generator_type: "DiscreteSymbolStyleMelGANGenerator" # Generator type.
26
- generator_params:
27
- in_channels: 128
28
- aux_channels: 128
29
- channels: 64
30
- out_channels: 1
31
- num_embs: 100
32
- num_spk_embs: 128
33
- spk_emb_dim: 128
34
- concat_spk_emb: false
35
- kernel_size: 9
36
- dilation: 2
37
- bias: True
38
- noise_upsample_scales: [7, 2, 2, 2]
39
- noise_upsample_activation: "LeakyReLU"
40
- noise_upsample_activation_params:
41
- negative_slope: 0.2
42
- upsample_scales: [5, 2, 2, 2, 2, 2, 2, 1, 1]
43
- upsample_mode: "nearest"
44
- gated_function: "softmax"
45
- use_weight_norm: True
46
-
47
- ###########################################################
48
- # DISCRIMINATOR NETWORK ARCHITECTURE SETTING #
49
- ###########################################################
50
- discriminator_type: "StyleMelGANDiscriminator" # Discriminator type.
51
- discriminator_params:
52
- repeats: 4
53
- window_sizes: [512, 1024, 2048, 4096]
54
- pqmf_params:
55
- - [1, None, None, None]
56
- - [2, 62, 0.26700, 9.0]
57
- - [4, 62, 0.14200, 9.0]
58
- - [8, 62, 0.07949, 9.0]
59
- discriminator_params:
60
- out_channels: 1
61
- kernel_sizes: [5, 3]
62
- channels: 16
63
- max_downsample_channels: 512
64
- bias: True
65
- downsample_scales: [4, 4, 4, 1]
66
- nonlinear_activation: "LeakyReLU"
67
- nonlinear_activation_params:
68
- negative_slope: 0.2
69
- use_weight_norm: True
70
-
71
- ###########################################################
72
- # STFT LOSS SETTING #
73
- ###########################################################
74
- stft_loss_params:
75
- fft_sizes: [1024, 2048, 512] # List of FFT size for STFT-based loss.
76
- hop_sizes: [120, 240, 50] # List of hop size for STFT-based loss
77
- win_lengths: [600, 1200, 240] # List of window length for STFT-based loss.
78
- window: "hann_window" # Window function for STFT-based loss
79
- lambda_aux: 1.0 # Loss balancing coefficient for aux loss.
80
-
81
- ###########################################################
82
- # ADVERSARIAL LOSS SETTING #
83
- ###########################################################
84
- lambda_adv: 1.0 # Loss balancing coefficient for adv loss.
85
- generator_adv_loss_params:
86
- average_by_discriminators: false # Whether to average loss by #discriminators.
87
- discriminator_adv_loss_params:
88
- average_by_discriminators: false # Whether to average loss by #discriminators.
89
-
90
- ###########################################################
91
- # DATA LOADER SETTING #
92
- ###########################################################
93
- batch_size: 16 # Batch size.
94
- batch_max_steps: 17920 # Length of each audio in batch. Make sure dividable by hop_size.
95
- pin_memory: true # Whether to pin memory in Pytorch DataLoader.
96
- num_workers: 2 # Number of workers in Pytorch DataLoader.
97
- remove_short_samples: false # Whether to remove samples the length of which are less than batch_max_steps.
98
- allow_cache: true # Whether to allow cache in dataset. If true, it requires cpu memory.
99
-
100
- ###########################################################
101
- # OPTIMIZER & SCHEDULER SETTING #
102
- ###########################################################
103
- generator_optimizer_type: Adam
104
- generator_optimizer_params:
105
- lr: 1.0e-4
106
- betas: [0.5, 0.9]
107
- weight_decay: 0.0
108
- generator_scheduler_type: MultiStepLR
109
- generator_scheduler_params:
110
- gamma: 0.5
111
- milestones:
112
- - 100000
113
- - 300000
114
- - 500000
115
- - 700000
116
- - 900000
117
- generator_grad_norm: -1
118
- discriminator_optimizer_type: Adam
119
- discriminator_optimizer_params:
120
- lr: 2.0e-4
121
- betas: [0.5, 0.9]
122
- weight_decay: 0.0
123
- discriminator_scheduler_type: MultiStepLR
124
- discriminator_scheduler_params:
125
- gamma: 0.5
126
- milestones:
127
- - 200000
128
- - 400000
129
- - 600000
130
- - 800000
131
- discriminator_grad_norm: -1 # Discriminator's gradient norm.
132
-
133
- ###########################################################
134
- # INTERVAL SETTING #
135
- ###########################################################
136
- discriminator_train_start_steps: 100000 # Number of steps to start to train discriminator.
137
- train_max_steps: 1500000 # Number of training steps.
138
- save_interval_steps: 50000 # Interval steps to save checkpoint.
139
- eval_interval_steps: 1000 # Interval steps to evaluate the network.
140
- log_interval_steps: 100 # Interval steps to record the training log.
141
-
142
- ###########################################################
143
- # OTHER SETTING #
144
- ###########################################################
145
- num_save_intermediate_results: 4 # Number of results to be saved as intermediate results.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/vctk/hubert_voc1/path.sh DELETED
@@ -1,33 +0,0 @@
1
- # cuda related
2
- export CUDA_HOME=/usr/local/cuda-11.3
3
- export LD_LIBRARY_PATH="${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}"
4
-
5
- # path related
6
- export PRJ_ROOT="${PWD}/../../.."
7
- if [ -e "${PRJ_ROOT}/tools/venv/bin/activate" ]; then
8
- # shellcheck disable=SC1090
9
- . "${PRJ_ROOT}/tools/venv/bin/activate"
10
- fi
11
-
12
- # python related
13
- export OMP_NUM_THREADS=1
14
- export PYTHONIOENCODING=UTF-8
15
- export MPL_BACKEND=Agg
16
-
17
- # check installation
18
- if ! command -v parallel-wavegan-train > /dev/null; then
19
- echo "Error: It seems setup is not finished." >&2
20
- echo "Error: Please setup your environment by following README.md" >&2
21
- return 1
22
- fi
23
- if ! command -v jq > /dev/null; then
24
- echo "Error: It seems jq is not installed." >&2
25
- echo "Error: Please install via \`sudo apt-get install jq\`." >&2
26
- echo "Error: If you do not have sudo, please download from https://stedolan.github.io/jq/download/." >&2
27
- return 1
28
- fi
29
- if ! command -v yq > /dev/null; then
30
- echo "Error: It seems yq is not installed." >&2
31
- echo "Error: Please install via \`pip install yq\`." >&2
32
- return 1
33
- fi
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/vctk/hubert_voc1/run.sh DELETED
@@ -1,151 +0,0 @@
1
- #!/bin/bash
2
-
3
- # Copyright 2020 Tomoki Hayashi
4
- # MIT License (https://opensource.org/licenses/MIT)
5
-
6
- . ./cmd.sh || exit 1;
7
- . ./path.sh || exit 1;
8
-
9
- # basic settings
10
- stage=-1 # stage to start
11
- stop_stage=100 # stage to stop
12
- verbose=1 # verbosity level (lower is less info)
13
- n_gpus=1 # number of gpus in training
14
- n_jobs=16 # number of parallel jobs in feature extraction
15
-
16
- # NOTE(kan-bayashi): renamed to conf to avoid conflict in parse_options.sh
17
- conf=conf/parallel_wavegan_hubert.v1.yaml
18
-
19
- # directory path setting
20
- dumpdir=dump # directory to dump features
21
-
22
- # training related setting
23
- tag="" # tag for directory to save model
24
- resume="" # checkpoint path to resume training
25
- # (e.g. <path>/<to>/checkpoint-10000steps.pkl)
26
-
27
- # decoding related setting
28
- checkpoint="" # checkpoint path to be used for decoding
29
- # if not provided, the latest one will be used
30
- # (e.g. <path>/<to>/checkpoint-400000steps.pkl)
31
-
32
- train_set=tr_2mix_trim
33
- dev_set=cv_2mix
34
- eval_set=tt_2mix
35
-
36
- hubert_text=downloads/dump_feature_hubert9/label_km100_vctk_16k_tr_2mix_trim/all.txt
37
-
38
- # shellcheck disable=SC1091
39
- . utils/parse_options.sh || exit 1;
40
-
41
- set -euo pipefail
42
-
43
- if [ "${stage}" -le 0 ] && [ "${stop_stage}" -ge 0 ]; then
44
- echo "Stage 0: Data preparation"
45
- echo "Data preparation is not prepared."
46
- echo "Please manually locate kaldi-style directories as follows:"
47
- cat << EOF
48
- $ ls data/${train_set}
49
- wav.scp utt2spk
50
- $ ls data/${dev_set}
51
- wav.scp utt2spk
52
- $ ls data/${eval_set}
53
- wav.scp utt2spk
54
- EOF
55
- # shellcheck disable=SC2016
56
- echo 'Please make sure "${hubert_text}" is correctly set.'
57
- echo "Then, please run from stage 1 via --stage 1."
58
- exit 1;
59
- fi
60
-
61
- if [ "${stage}" -le 1 ] && [ "${stop_stage}" -ge 1 ]; then
62
- echo "Stage 1: Feature extraction"
63
- if [ ! -e "${hubert_text}" ]; then
64
- echo "Valid --hubert_text is not provided. Please prepare it by yourself."
65
- echo "hubert_text should be like kaldi-style text as follows:"
66
- cat << EOF
67
- utt_id_1 0 0 0 0 1 1 1 1 2 2 2 2
68
- utt_id_2 0 0 0 0 0 0 3 3 3 3 3 3 5 5 5 5
69
- ...
70
- EOF
71
- exit 1
72
- fi
73
- # extract raw features
74
- pids=()
75
- for name in "${train_set}" "${dev_set}" "${eval_set}"; do
76
- (
77
- [ ! -e "${dumpdir}/${name}/raw" ] && mkdir -p "${dumpdir}/${name}/raw"
78
- echo "Feature extraction start. See the progress via ${dumpdir}/${name}/raw/preprocessing.*.log."
79
- utils/make_subset_data.sh "data/${name}" "${n_jobs}" "${dumpdir}/${name}/raw"
80
- ${train_cmd} JOB=1:${n_jobs} "${dumpdir}/${name}/raw/preprocessing.JOB.log" \
81
- local/preprocess_hubert.py \
82
- --config "${conf}" \
83
- --scp "${dumpdir}/${name}/raw/wav.JOB.scp" \
84
- --dumpdir "${dumpdir}/${name}/raw/dump.JOB" \
85
- --utt2spk "data/${name}/utt2spk" \
86
- --spk2idx "data/${train_set}/spk2idx" \
87
- --text "${hubert_text}" \
88
- --verbose "${verbose}"
89
- echo "Successfully finished feature extraction of ${name} set."
90
- ) &
91
- pids+=($!)
92
- done
93
- i=0; for pid in "${pids[@]}"; do wait "${pid}" || ((++i)); done
94
- [ "${i}" -gt 0 ] && echo "$0: ${i} background jobs are failed." && exit 1;
95
- echo "Successfully finished feature extraction."
96
-
97
- fi
98
-
99
- if [ -z "${tag}" ]; then
100
- expdir="exp/${train_set}_vctk_$(basename "${conf}" .yaml)"
101
- else
102
- expdir="exp/${train_set}_vctk_${tag}"
103
- fi
104
- if [ "${stage}" -le 2 ] && [ "${stop_stage}" -ge 2 ]; then
105
- echo "Stage 2: Network training"
106
- [ ! -e "${expdir}" ] && mkdir -p "${expdir}"
107
- if [ "${n_gpus}" -gt 1 ]; then
108
- train="python -m parallel_wavegan.distributed.launch --nproc_per_node ${n_gpus} -c parallel-wavegan-train"
109
- else
110
- train="parallel-wavegan-train"
111
- fi
112
- # shellcheck disable=SC2012
113
- resume="$(ls -dt "${expdir}"/*.pkl | head -1 || true)"
114
- echo "Training start. See the progress via ${expdir}/train.log."
115
- ${cuda_cmd} --gpu "${n_gpus}" "${expdir}/train.log" \
116
- ${train} \
117
- --config "${conf}" \
118
- --train-dumpdir "${dumpdir}/${train_set}/raw" \
119
- --dev-dumpdir "${dumpdir}/${dev_set}/raw" \
120
- --outdir "${expdir}" \
121
- --resume "${resume}" \
122
- --verbose "${verbose}"
123
- echo "Successfully finished training."
124
- fi
125
-
126
- if [ "${stage}" -le 3 ] && [ "${stop_stage}" -ge 3 ]; then
127
- echo "Stage 3: Network decoding"
128
- # shellcheck disable=SC2012
129
- [ -z "${checkpoint}" ] && checkpoint="$(ls -dt "${expdir}"/*.pkl | head -1 || true)"
130
- outdir="${expdir}/wav/$(basename "${checkpoint}" .pkl)"
131
- pids=()
132
- for name in "${dev_set}" "${eval_set}"; do
133
- (
134
- [ ! -e "${outdir}/${name}" ] && mkdir -p "${outdir}/${name}"
135
- [ "${n_gpus}" -gt 1 ] && n_gpus=1
136
- echo "Decoding start. See the progress via ${outdir}/${name}/decode.log."
137
- ${cuda_cmd} --gpu "${n_gpus}" "${outdir}/${name}/decode.log" \
138
- parallel-wavegan-decode \
139
- --dumpdir "${dumpdir}/${name}/raw" \
140
- --checkpoint "${checkpoint}" \
141
- --outdir "${outdir}/${name}" \
142
- --verbose "${verbose}"
143
- echo "Successfully finished decoding of ${name} set."
144
- ) &
145
- pids+=($!)
146
- done
147
- i=0; for pid in "${pids[@]}"; do wait "${pid}" || ((++i)); done
148
- [ "${i}" -gt 0 ] && echo "$0: ${i} background jobs are failed." && exit 1;
149
- echo "Successfully finished decoding."
150
- fi
151
- echo "Finished."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/vctk/voc1/cmd.sh DELETED
@@ -1,91 +0,0 @@
1
- # ====== About run.pl, queue.pl, slurm.pl, and ssh.pl ======
2
- # Usage: <cmd>.pl [options] JOB=1:<nj> <log> <command...>
3
- # e.g.
4
- # run.pl --mem 4G JOB=1:10 echo.JOB.log echo JOB
5
- #
6
- # Options:
7
- # --time <time>: Limit the maximum time to execute.
8
- # --mem <mem>: Limit the maximum memory usage.
9
- # -–max-jobs-run <njob>: Limit the number parallel jobs. This is ignored for non-array jobs.
10
- # --num-threads <ngpu>: Specify the number of CPU core.
11
- # --gpu <ngpu>: Specify the number of GPU devices.
12
- # --config: Change the configuration file from default.
13
- #
14
- # "JOB=1:10" is used for "array jobs" and it can control the number of parallel jobs.
15
- # The left string of "=", i.e. "JOB", is replaced by <N>(Nth job) in the command and the log file name,
16
- # e.g. "echo JOB" is changed to "echo 3" for the 3rd job and "echo 8" for 8th job respectively.
17
- # Note that the number must start with a positive number, so you can't use "JOB=0:10" for example.
18
- #
19
- # run.pl, queue.pl, slurm.pl, and ssh.pl have unified interface, not depending on its backend.
20
- # These options are mapping to specific options for each backend and
21
- # it is configured by "conf/queue.conf" and "conf/slurm.conf" by default.
22
- # If jobs failed, your configuration might be wrong for your environment.
23
- #
24
- #
25
- # The official documentaion for run.pl, queue.pl, slurm.pl, and ssh.pl:
26
- # "Parallelization in Kaldi": http://kaldi-asr.org/doc/queue.html
27
- # =========================================================~
28
-
29
-
30
- # Select the backend used by run.sh from "local", "stdout", "sge", "slurm", or "ssh"
31
- cmd_backend="local"
32
-
33
- # Local machine, without any Job scheduling system
34
- if [ "${cmd_backend}" = local ]; then
35
-
36
- # The other usage
37
- export train_cmd="utils/run.pl"
38
- # Used for "*_train.py": "--gpu" is appended optionally by run.sh
39
- export cuda_cmd="utils/run.pl"
40
- # Used for "*_recog.py"
41
- export decode_cmd="utils/run.pl"
42
-
43
- # Local machine, without any Job scheduling system
44
- elif [ "${cmd_backend}" = stdout ]; then
45
-
46
- # The other usage
47
- export train_cmd="utils/stdout.pl"
48
- # Used for "*_train.py": "--gpu" is appended optionally by run.sh
49
- export cuda_cmd="utils/stdout.pl"
50
- # Used for "*_recog.py"
51
- export decode_cmd="utils/stdout.pl"
52
-
53
- # "qsub" (SGE, Torque, PBS, etc.)
54
- elif [ "${cmd_backend}" = sge ]; then
55
- # The default setting is written in conf/queue.conf.
56
- # You must change "-q g.q" for the "queue" for your environment.
57
- # To know the "queue" names, type "qhost -q"
58
- # Note that to use "--gpu *", you have to setup "complex_value" for the system scheduler.
59
-
60
- export train_cmd="utils/queue.pl"
61
- export cuda_cmd="utils/queue.pl"
62
- export decode_cmd="utils/queue.pl"
63
-
64
- # "sbatch" (Slurm)
65
- elif [ "${cmd_backend}" = slurm ]; then
66
- # The default setting is written in conf/slurm.conf.
67
- # You must change "-p cpu" and "-p gpu" for the "partion" for your environment.
68
- # To know the "partion" names, type "sinfo".
69
- # You can use "--gpu * " by defualt for slurm and it is interpreted as "--gres gpu:*"
70
- # The devices are allocated exclusively using "${CUDA_VISIBLE_DEVICES}".
71
-
72
- export train_cmd="utils/slurm.pl"
73
- export cuda_cmd="utils/slurm.pl"
74
- export decode_cmd="utils/slurm.pl"
75
-
76
- elif [ "${cmd_backend}" = ssh ]; then
77
- # You have to create ".queue/machines" to specify the host to execute jobs.
78
- # e.g. .queue/machines
79
- # host1
80
- # host2
81
- # host3
82
- # Assuming you can login them without any password, i.e. You have to set ssh keys.
83
-
84
- export train_cmd="utils/ssh.pl"
85
- export cuda_cmd="utils/ssh.pl"
86
- export decode_cmd="utils/ssh.pl"
87
-
88
- else
89
- echo "$0: Error: Unknown cmd_backend=${cmd_backend}" 1>&2
90
- return 1
91
- fi
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/vctk/voc1/conf/hifigan.v1.yaml DELETED
@@ -1,180 +0,0 @@
1
- # This is the configuration file for VCTK dataset.
2
- # This configuration is based on HiFiGAN V1, which is
3
- # an official configuration. But I found that the optimizer
4
- # setting does not work well with my implementation.
5
- # So I changed optimizer settings as follows:
6
- # - AdamW -> Adam
7
- # - betas: [0.8, 0.99] -> betas: [0.5, 0.9]
8
- # - Scheduler: ExponentialLR -> MultiStepLR
9
- # To match the shift size difference, the upsample scales
10
- # is also modified from the original 256 shift setting.
11
-
12
- ###########################################################
13
- # FEATURE EXTRACTION SETTING #
14
- ###########################################################
15
- sampling_rate: 24000 # Sampling rate.
16
- fft_size: 2048 # FFT size.
17
- hop_size: 300 # Hop size.
18
- win_length: 1200 # Window length.
19
- # If set to null, it will be the same as fft_size.
20
- window: "hann" # Window function.
21
- num_mels: 80 # Number of mel basis.
22
- fmin: 80 # Minimum freq in mel basis calculation.
23
- fmax: 7600 # Maximum frequency in mel basis calculation.
24
- global_gain_scale: 1.0 # Will be multiplied to all of waveform.
25
- trim_silence: false # Whether to trim the start and end of silence.
26
- trim_threshold_in_db: 20 # Need to tune carefully if the recording is not good.
27
- trim_frame_size: 1024 # Frame size in trimming.
28
- trim_hop_size: 256 # Hop size in trimming.
29
- format: "hdf5" # Feature file format. "npy" or "hdf5" is supported.
30
-
31
- ###########################################################
32
- # GENERATOR NETWORK ARCHITECTURE SETTING #
33
- ###########################################################
34
- generator_type: HiFiGANGenerator
35
- generator_params:
36
- in_channels: 80 # Number of input channels.
37
- out_channels: 1 # Number of output channels.
38
- channels: 512 # Number of initial channels.
39
- kernel_size: 7 # Kernel size of initial and final conv layers.
40
- upsample_scales: [5, 5, 4, 3] # Upsampling scales.
41
- upsample_kernel_sizes: [10, 10, 8, 6] # Kernel size for upsampling layers.
42
- resblock_kernel_sizes: [3, 7, 11] # Kernel size for residual blocks.
43
- resblock_dilations: # Dilations for residual blocks.
44
- - [1, 3, 5]
45
- - [1, 3, 5]
46
- - [1, 3, 5]
47
- use_additional_convs: true # Whether to use additional conv layer in residual blocks.
48
- bias: true # Whether to use bias parameter in conv.
49
- nonlinear_activation: "LeakyReLU" # Nonlinear activation type.
50
- nonlinear_activation_params: # Nonlinear activation paramters.
51
- negative_slope: 0.1
52
- use_weight_norm: true # Whether to apply weight normalization.
53
-
54
- ###########################################################
55
- # DISCRIMINATOR NETWORK ARCHITECTURE SETTING #
56
- ###########################################################
57
- discriminator_type: HiFiGANMultiScaleMultiPeriodDiscriminator
58
- discriminator_params:
59
- scales: 3 # Number of multi-scale discriminator.
60
- scale_downsample_pooling: "AvgPool1d" # Pooling operation for scale discriminator.
61
- scale_downsample_pooling_params:
62
- kernel_size: 4 # Pooling kernel size.
63
- stride: 2 # Pooling stride.
64
- padding: 2 # Padding size.
65
- scale_discriminator_params:
66
- in_channels: 1 # Number of input channels.
67
- out_channels: 1 # Number of output channels.
68
- kernel_sizes: [15, 41, 5, 3] # List of kernel sizes.
69
- channels: 128 # Initial number of channels.
70
- max_downsample_channels: 1024 # Maximum number of channels in downsampling conv layers.
71
- max_groups: 16 # Maximum number of groups in downsampling conv layers.
72
- bias: true
73
- downsample_scales: [4, 4, 4, 4, 1] # Downsampling scales.
74
- nonlinear_activation: "LeakyReLU" # Nonlinear activation.
75
- nonlinear_activation_params:
76
- negative_slope: 0.1
77
- follow_official_norm: true # Whether to follow the official norm setting.
78
- periods: [2, 3, 5, 7, 11] # List of period for multi-period discriminator.
79
- period_discriminator_params:
80
- in_channels: 1 # Number of input channels.
81
- out_channels: 1 # Number of output channels.
82
- kernel_sizes: [5, 3] # List of kernel sizes.
83
- channels: 32 # Initial number of channels.
84
- downsample_scales: [3, 3, 3, 3, 1] # Downsampling scales.
85
- max_downsample_channels: 1024 # Maximum number of channels in downsampling conv layers.
86
- bias: true # Whether to use bias parameter in conv layer."
87
- nonlinear_activation: "LeakyReLU" # Nonlinear activation.
88
- nonlinear_activation_params: # Nonlinear activation paramters.
89
- negative_slope: 0.1
90
- use_weight_norm: true # Whether to apply weight normalization.
91
- use_spectral_norm: false # Whether to apply spectral normalization.
92
-
93
- ###########################################################
94
- # STFT LOSS SETTING #
95
- ###########################################################
96
- use_stft_loss: false # Whether to use multi-resolution STFT loss.
97
- use_mel_loss: true # Whether to use Mel-spectrogram loss.
98
- mel_loss_params:
99
- fs: 24000
100
- fft_size: 2048
101
- hop_size: 300
102
- win_length: 1200
103
- window: "hann"
104
- num_mels: 80
105
- fmin: 0
106
- fmax: 12000
107
- log_base: null
108
- generator_adv_loss_params:
109
- average_by_discriminators: false # Whether to average loss by #discriminators.
110
- discriminator_adv_loss_params:
111
- average_by_discriminators: false # Whether to average loss by #discriminators.
112
- use_feat_match_loss: true
113
- feat_match_loss_params:
114
- average_by_discriminators: false # Whether to average loss by #discriminators.
115
- average_by_layers: false # Whether to average loss by #layers in each discriminator.
116
- include_final_outputs: false # Whether to include final outputs in feat match loss calculation.
117
-
118
- ###########################################################
119
- # ADVERSARIAL LOSS SETTING #
120
- ###########################################################
121
- lambda_aux: 45.0 # Loss balancing coefficient for STFT loss.
122
- lambda_adv: 1.0 # Loss balancing coefficient for adversarial loss.
123
- lambda_feat_match: 2.0 # Loss balancing coefficient for feat match loss..
124
-
125
- ###########################################################
126
- # DATA LOADER SETTING #
127
- ###########################################################
128
- batch_size: 16 # Batch size.
129
- batch_max_steps: 8400 # Length of each audio in batch. Make sure dividable by hop_size.
130
- pin_memory: true # Whether to pin memory in Pytorch DataLoader.
131
- num_workers: 2 # Number of workers in Pytorch DataLoader.
132
- remove_short_samples: false # Whether to remove samples the length of which are less than batch_max_steps.
133
- allow_cache: true # Whether to allow cache in dataset. If true, it requires cpu memory.
134
-
135
- ###########################################################
136
- # OPTIMIZER & SCHEDULER SETTING #
137
- ###########################################################
138
- generator_optimizer_type: Adam
139
- generator_optimizer_params:
140
- lr: 2.0e-4
141
- betas: [0.5, 0.9]
142
- weight_decay: 0.0
143
- generator_scheduler_type: MultiStepLR
144
- generator_scheduler_params:
145
- gamma: 0.5
146
- milestones:
147
- - 200000
148
- - 400000
149
- - 600000
150
- - 800000
151
- generator_grad_norm: -1
152
- discriminator_optimizer_type: Adam
153
- discriminator_optimizer_params:
154
- lr: 2.0e-4
155
- betas: [0.5, 0.9]
156
- weight_decay: 0.0
157
- discriminator_scheduler_type: MultiStepLR
158
- discriminator_scheduler_params:
159
- gamma: 0.5
160
- milestones:
161
- - 200000
162
- - 400000
163
- - 600000
164
- - 800000
165
- discriminator_grad_norm: -1
166
-
167
- ###########################################################
168
- # INTERVAL SETTING #
169
- ###########################################################
170
- generator_train_start_steps: 1 # Number of steps to start to train discriminator.
171
- discriminator_train_start_steps: 0 # Number of steps to start to train discriminator.
172
- train_max_steps: 2500000 # Number of training steps.
173
- save_interval_steps: 10000 # Interval steps to save checkpoint.
174
- eval_interval_steps: 1000 # Interval steps to evaluate the network.
175
- log_interval_steps: 100 # Interval steps to record the training log.
176
-
177
- ###########################################################
178
- # OTHER SETTING #
179
- ###########################################################
180
- num_save_intermediate_results: 4 # Number of results to be saved as intermediate results.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/vctk/voc1/conf/multi_band_melgan.v2.yaml DELETED
@@ -1,154 +0,0 @@
1
- # This is the hyperparameter configuration file for MelGAN.
2
- # Please make sure this is adjusted for the VCTK dataset. If you want to
3
- # apply to the other dataset, you might need to carefully change some parameters.
4
- # This configuration requires ~ 6GB memory and will finish within 3 days on Titan V.
5
-
6
- # This configuration is based on multi-band MelGAN but the hop size and sampling
7
- # rate is different from the paper (16kHz vs 24kHz). The number of iteraions
8
- # is now shown in the paper so currently we train 1M iterations (not sure enough
9
- # to converge). Compared to multi_band_melgan.v1 config, Adam optimizer without
10
- # gradient norm is used, which is based on @dathudeptrai advice.
11
- # https://github.com/kan-bayashi/ParallelWaveGAN/issues/143#issuecomment-632539906
12
-
13
- # We found that the use of small batch_max_steps has no bad effect for the quality,
14
- # so we use 8,100 for batch_max_steps to accelerate the training.
15
-
16
- ###########################################################
17
- # FEATURE EXTRACTION SETTING #
18
- ###########################################################
19
- sampling_rate: 24000 # Sampling rate.
20
- fft_size: 2048 # FFT size.
21
- hop_size: 300 # Hop size.
22
- win_length: 1200 # Window length.
23
- # If set to null, it will be the same as fft_size.
24
- window: "hann" # Window function.
25
- num_mels: 80 # Number of mel basis.
26
- fmin: 80 # Minimum freq in mel basis calculation.
27
- fmax: 7600 # Maximum frequency in mel basis calculation.
28
- global_gain_scale: 1.0 # Will be multiplied to all of waveform.
29
- trim_silence: false # Whether to trim the start and end of silence.
30
- trim_threshold_in_db: 60 # Need to tune carefully if the recording is not good.
31
- trim_frame_size: 2048 # Frame size in trimming.
32
- trim_hop_size: 512 # Hop size in trimming.
33
- format: "hdf5" # Feature file format. "npy" or "hdf5" is supported.
34
-
35
- ###########################################################
36
- # GENERATOR NETWORK ARCHITECTURE SETTING #
37
- ###########################################################
38
- generator_type: "MelGANGenerator" # Generator type.
39
- generator_params:
40
- in_channels: 80 # Number of input channels.
41
- out_channels: 4 # Number of output channels.
42
- kernel_size: 7 # Kernel size of initial and final conv layers.
43
- channels: 384 # Initial number of channels for conv layers.
44
- upsample_scales: [5, 5, 3] # List of Upsampling scales.
45
- stack_kernel_size: 3 # Kernel size of dilated conv layers in residual stack.
46
- stacks: 4 # Number of stacks in a single residual stack module.
47
- use_weight_norm: True # Whether to use weight normalization.
48
- use_causal_conv: False # Whether to use causal convolution.
49
-
50
- ###########################################################
51
- # DISCRIMINATOR NETWORK ARCHITECTURE SETTING #
52
- ###########################################################
53
- discriminator_type: "MelGANMultiScaleDiscriminator" # Discriminator type.
54
- discriminator_params:
55
- in_channels: 1 # Number of input channels.
56
- out_channels: 1 # Number of output channels.
57
- scales: 3 # Number of multi-scales.
58
- downsample_pooling: "AvgPool1d" # Pooling type for the input downsampling.
59
- downsample_pooling_params: # Parameters of the above pooling function.
60
- kernel_size: 4
61
- stride: 2
62
- padding: 1
63
- count_include_pad: False
64
- kernel_sizes: [5, 3] # List of kernel size.
65
- channels: 16 # Number of channels of the initial conv layer.
66
- max_downsample_channels: 512 # Maximum number of channels of downsampling layers.
67
- downsample_scales: [4, 4, 4] # List of downsampling scales.
68
- nonlinear_activation: "LeakyReLU" # Nonlinear activation function.
69
- nonlinear_activation_params: # Parameters of nonlinear activation function.
70
- negative_slope: 0.2
71
- use_weight_norm: True # Whether to use weight norm.
72
-
73
- ###########################################################
74
- # STFT LOSS SETTING #
75
- ###########################################################
76
- stft_loss_params:
77
- fft_sizes: [1024, 2048, 512] # List of FFT size for STFT-based loss.
78
- hop_sizes: [120, 240, 50] # List of hop size for STFT-based loss
79
- win_lengths: [600, 1200, 240] # List of window length for STFT-based loss.
80
- window: "hann_window" # Window function for STFT-based loss
81
- use_subband_stft_loss: true
82
- subband_stft_loss_params:
83
- fft_sizes: [384, 683, 171] # List of FFT size for STFT-based loss.
84
- hop_sizes: [30, 60, 10] # List of hop size for STFT-based loss
85
- win_lengths: [150, 300, 60] # List of window length for STFT-based loss.
86
- window: "hann_window" # Window function for STFT-based loss
87
-
88
- ###########################################################
89
- # ADVERSARIAL LOSS SETTING #
90
- ###########################################################
91
- use_feat_match_loss: false # Whether to use feature matching loss.
92
- lambda_adv: 2.5 # Loss balancing coefficient for adversarial loss.
93
-
94
- ###########################################################
95
- # DATA LOADER SETTING #
96
- ###########################################################
97
- batch_size: 64 # Batch size.
98
- batch_max_steps: 8100 # Length of each audio in batch. Make sure dividable by hop_size.
99
- pin_memory: true # Whether to pin memory in Pytorch DataLoader.
100
- num_workers: 4 # Number of workers in Pytorch DataLoader.
101
- remove_short_samples: true # Whether to remove samples the length of which are less than batch_max_steps.
102
- allow_cache: true # Whether to allow cache in dataset. If true, it requires cpu memory.
103
-
104
- ###########################################################
105
- # OPTIMIZER & SCHEDULER SETTING #
106
- ###########################################################
107
- generator_optimizer_type: "Adam" # Generator's optimizer type.
108
- generator_optimizer_params:
109
- lr: 1.0e-3 # Generator's learning rate.
110
- eps: 1.0e-7 # Generator's epsilon.
111
- weight_decay: 0.0 # Generator's weight decay coefficient.
112
- amsgrad: true
113
- generator_grad_norm: -1 # Generator's gradient norm.
114
- generator_scheduler_type: "MultiStepLR" # Generator's scheduler type.
115
- generator_scheduler_params:
116
- gamma: 0.5 # Generator's scheduler gamma.
117
- milestones: # At each milestone, lr will be multiplied by gamma.
118
- - 100000
119
- - 200000
120
- - 300000
121
- - 400000
122
- - 500000
123
- - 600000
124
- discriminator_optimizer_type: "Adam" # Discriminator's optimizer type.
125
- discriminator_optimizer_params:
126
- lr: 1.0e-3 # Discriminator's learning rate.
127
- eps: 1.0e-7 # Discriminator's epsilon.
128
- weight_decay: 0.0 # Discriminator's weight decay coefficient.
129
- amsgrad: true
130
- discriminator_grad_norm: -1 # Discriminator's gradient norm.
131
- discriminator_scheduler_type: "MultiStepLR" # Discriminator's scheduler type.
132
- discriminator_scheduler_params:
133
- gamma: 0.5 # Discriminator's scheduler gamma.
134
- milestones: # At each milestone, lr will be multiplied by gamma.
135
- - 100000
136
- - 200000
137
- - 300000
138
- - 400000
139
- - 500000
140
- - 600000
141
-
142
- ###########################################################
143
- # INTERVAL SETTING #
144
- ###########################################################
145
- discriminator_train_start_steps: 200000 # Number of steps to start to train discriminator.
146
- train_max_steps: 1000000 # Number of training steps.
147
- save_interval_steps: 50000 # Interval steps to save checkpoint.
148
- eval_interval_steps: 1000 # Interval steps to evaluate the network.
149
- log_interval_steps: 1000 # Interval steps to record the training log.
150
-
151
- ###########################################################
152
- # OTHER SETTING #
153
- ###########################################################
154
- num_save_intermediate_results: 4 # Number of results to be saved as intermediate results.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/vctk/voc1/conf/parallel_wavegan.v1.long.yaml DELETED
@@ -1,122 +0,0 @@
1
- # This is the hyperparameter configuration file for Parallel WaveGAN.
2
- # Please make sure this is adjusted for the VCTK corpus. If you want to
3
- # apply to the other dataset, you might need to carefully change some parameters.
4
- # This configuration requires 12 GB GPU memory and takes ~7 days on RTX TITAN.
5
-
6
- ###########################################################
7
- # FEATURE EXTRACTION SETTING #
8
- ###########################################################
9
- sampling_rate: 24000 # Sampling rate.
10
- fft_size: 2048 # FFT size.
11
- hop_size: 300 # Hop size.
12
- win_length: 1200 # Window length.
13
- # If set to null, it will be the same as fft_size.
14
- window: "hann" # Window function.
15
- num_mels: 80 # Number of mel basis.
16
- fmin: 80 # Minimum freq in mel basis calculation.
17
- fmax: 7600 # Maximum frequency in mel basis calculation.
18
- global_gain_scale: 1.0 # Will be multiplied to all of waveform.
19
- trim_silence: false # Whether to trim the start and end of silence.
20
- trim_threshold_in_db: 20 # Need to tune carefully if the recording is not good.
21
- trim_frame_size: 1024 # Frame size in trimming.
22
- trim_hop_size: 256 # Hop size in trimming.
23
- format: "hdf5" # Feature file format. "npy" or "hdf5" is supported.
24
-
25
- ###########################################################
26
- # GENERATOR NETWORK ARCHITECTURE SETTING #
27
- ###########################################################
28
- generator_params:
29
- in_channels: 1 # Number of input channels.
30
- out_channels: 1 # Number of output channels.
31
- kernel_size: 3 # Kernel size of dilated convolution.
32
- layers: 30 # Number of residual block layers.
33
- stacks: 3 # Number of stacks i.e., dilation cycles.
34
- residual_channels: 64 # Number of channels in residual conv.
35
- gate_channels: 128 # Number of channels in gated conv.
36
- skip_channels: 64 # Number of channels in skip conv.
37
- aux_channels: 80 # Number of channels for auxiliary feature conv.
38
- # Must be the same as num_mels.
39
- aux_context_window: 2 # Context window size for auxiliary feature.
40
- # If set to 2, previous 2 and future 2 frames will be considered.
41
- dropout: 0.0 # Dropout rate. 0.0 means no dropout applied.
42
- use_weight_norm: true # Whether to use weight norm.
43
- # If set to true, it will be applied to all of the conv layers.
44
- upsample_net: "ConvInUpsampleNetwork" # Upsampling network architecture.
45
- upsample_params: # Upsampling network parameters.
46
- upsample_scales: [4, 5, 3, 5] # Upsampling scales. Prodcut of these must be the same as hop size.
47
-
48
- ###########################################################
49
- # DISCRIMINATOR NETWORK ARCHITECTURE SETTING #
50
- ###########################################################
51
- discriminator_params:
52
- in_channels: 1 # Number of input channels.
53
- out_channels: 1 # Number of output channels.
54
- kernel_size: 3 # Number of output channels.
55
- layers: 10 # Number of conv layers.
56
- conv_channels: 64 # Number of chnn layers.
57
- bias: true # Whether to use bias parameter in conv.
58
- use_weight_norm: true # Whether to use weight norm.
59
- # If set to true, it will be applied to all of the conv layers.
60
- nonlinear_activation: "LeakyReLU" # Nonlinear function after each conv.
61
- nonlinear_activation_params: # Nonlinear function parameters
62
- negative_slope: 0.2 # Alpha in LeakyReLU.
63
-
64
- ###########################################################
65
- # STFT LOSS SETTING #
66
- ###########################################################
67
- stft_loss_params:
68
- fft_sizes: [1024, 2048, 512] # List of FFT size for STFT-based loss.
69
- hop_sizes: [120, 240, 50] # List of hop size for STFT-based loss
70
- win_lengths: [600, 1200, 240] # List of window length for STFT-based loss.
71
- window: "hann_window" # Window function for STFT-based loss
72
-
73
- ###########################################################
74
- # ADVERSARIAL LOSS SETTING #
75
- ###########################################################
76
- lambda_adv: 4.0 # Loss balancing coefficient.
77
-
78
- ###########################################################
79
- # DATA LOADER SETTING #
80
- ###########################################################
81
- batch_size: 6 # Batch size.
82
- batch_max_steps: 24000 # Length of each audio in batch. Make sure dividable by hop_size.
83
- pin_memory: true # Whether to pin memory in Pytorch DataLoader.
84
- num_workers: 2 # Number of workers in Pytorch DataLoader.
85
- remove_short_samples: true # Whether to remove samples the length of which are less than batch_max_steps.
86
- allow_cache: true # Whether to allow cache in dataset. If true, it requires cpu memory.
87
-
88
- ###########################################################
89
- # OPTIMIZER & SCHEDULER SETTING #
90
- ###########################################################
91
- generator_optimizer_params:
92
- lr: 0.0001 # Generator's learning rate.
93
- eps: 1.0e-6 # Generator's epsilon.
94
- weight_decay: 0.0 # Generator's weight decay coefficient.
95
- generator_scheduler_params:
96
- step_size: 200000 # Generator's scheduler step size.
97
- gamma: 0.5 # Generator's scheduler gamma.
98
- # At each step size, lr will be multiplied by this parameter.
99
- generator_grad_norm: 10 # Generator's gradient norm.
100
- discriminator_optimizer_params:
101
- lr: 0.00005 # Discriminator's learning rate.
102
- eps: 1.0e-6 # Discriminator's epsilon.
103
- weight_decay: 0.0 # Discriminator's weight decay coefficient.
104
- discriminator_scheduler_params:
105
- step_size: 200000 # Discriminator's scheduler step size.
106
- gamma: 0.5 # Discriminator's scheduler gamma.
107
- # At each step size, lr will be multiplied by this parameter.
108
- discriminator_grad_norm: 1 # Discriminator's gradient norm.
109
-
110
- ###########################################################
111
- # INTERVAL SETTING #
112
- ###########################################################
113
- discriminator_train_start_steps: 100000 # Number of steps to start to train discriminator.
114
- train_max_steps: 1000000 # Number of training steps.
115
- save_interval_steps: 5000 # Interval steps to save checkpoint.
116
- eval_interval_steps: 1000 # Interval steps to evaluate the network.
117
- log_interval_steps: 100 # Interval steps to record the training log.
118
-
119
- ###########################################################
120
- # OTHER SETTING #
121
- ###########################################################
122
- num_save_intermediate_results: 4 # Number of results to be saved as intermediate results.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/vctk/voc1/conf/parallel_wavegan.v1.yaml DELETED
@@ -1,122 +0,0 @@
1
- # This is the hyperparameter configuration file for Parallel WaveGAN.
2
- # Please make sure this is adjusted for the VCTK corpus. If you want to
3
- # apply to the other dataset, you might need to carefully change some parameters.
4
- # This configuration requires 12 GB GPU memory and takes ~3 days on RTX TITAN.
5
-
6
- ###########################################################
7
- # FEATURE EXTRACTION SETTING #
8
- ###########################################################
9
- sampling_rate: 24000 # Sampling rate.
10
- fft_size: 2048 # FFT size.
11
- hop_size: 300 # Hop size.
12
- win_length: 1200 # Window length.
13
- # If set to null, it will be the same as fft_size.
14
- window: "hann" # Window function.
15
- num_mels: 80 # Number of mel basis.
16
- fmin: 80 # Minimum freq in mel basis calculation.
17
- fmax: 7600 # Maximum frequency in mel basis calculation.
18
- global_gain_scale: 1.0 # Will be multiplied to all of waveform.
19
- trim_silence: false # Whether to trim the start and end of silence.
20
- trim_threshold_in_db: 20 # Need to tune carefully if the recording is not good.
21
- trim_frame_size: 1024 # Frame size in trimming.
22
- trim_hop_size: 256 # Hop size in trimming.
23
- format: "hdf5" # Feature file format. "npy" or "hdf5" is supported.
24
-
25
- ###########################################################
26
- # GENERATOR NETWORK ARCHITECTURE SETTING #
27
- ###########################################################
28
- generator_params:
29
- in_channels: 1 # Number of input channels.
30
- out_channels: 1 # Number of output channels.
31
- kernel_size: 3 # Kernel size of dilated convolution.
32
- layers: 30 # Number of residual block layers.
33
- stacks: 3 # Number of stacks i.e., dilation cycles.
34
- residual_channels: 64 # Number of channels in residual conv.
35
- gate_channels: 128 # Number of channels in gated conv.
36
- skip_channels: 64 # Number of channels in skip conv.
37
- aux_channels: 80 # Number of channels for auxiliary feature conv.
38
- # Must be the same as num_mels.
39
- aux_context_window: 2 # Context window size for auxiliary feature.
40
- # If set to 2, previous 2 and future 2 frames will be considered.
41
- dropout: 0.0 # Dropout rate. 0.0 means no dropout applied.
42
- use_weight_norm: true # Whether to use weight norm.
43
- # If set to true, it will be applied to all of the conv layers.
44
- upsample_net: "ConvInUpsampleNetwork" # Upsampling network architecture.
45
- upsample_params: # Upsampling network parameters.
46
- upsample_scales: [4, 5, 3, 5] # Upsampling scales. Prodcut of these must be the same as hop size.
47
-
48
- ###########################################################
49
- # DISCRIMINATOR NETWORK ARCHITECTURE SETTING #
50
- ###########################################################
51
- discriminator_params:
52
- in_channels: 1 # Number of input channels.
53
- out_channels: 1 # Number of output channels.
54
- kernel_size: 3 # Number of output channels.
55
- layers: 10 # Number of conv layers.
56
- conv_channels: 64 # Number of chnn layers.
57
- bias: true # Whether to use bias parameter in conv.
58
- use_weight_norm: true # Whether to use weight norm.
59
- # If set to true, it will be applied to all of the conv layers.
60
- nonlinear_activation: "LeakyReLU" # Nonlinear function after each conv.
61
- nonlinear_activation_params: # Nonlinear function parameters
62
- negative_slope: 0.2 # Alpha in LeakyReLU.
63
-
64
- ###########################################################
65
- # STFT LOSS SETTING #
66
- ###########################################################
67
- stft_loss_params:
68
- fft_sizes: [1024, 2048, 512] # List of FFT size for STFT-based loss.
69
- hop_sizes: [120, 240, 50] # List of hop size for STFT-based loss
70
- win_lengths: [600, 1200, 240] # List of window length for STFT-based loss.
71
- window: "hann_window" # Window function for STFT-based loss
72
-
73
- ###########################################################
74
- # ADVERSARIAL LOSS SETTING #
75
- ###########################################################
76
- lambda_adv: 4.0 # Loss balancing coefficient.
77
-
78
- ###########################################################
79
- # DATA LOADER SETTING #
80
- ###########################################################
81
- batch_size: 6 # Batch size.
82
- batch_max_steps: 24000 # Length of each audio in batch. Make sure dividable by hop_size.
83
- pin_memory: true # Whether to pin memory in Pytorch DataLoader.
84
- num_workers: 2 # Number of workers in Pytorch DataLoader.
85
- remove_short_samples: true # Whether to remove samples the length of which are less than batch_max_steps.
86
- allow_cache: true # Whether to allow cache in dataset. If true, it requires cpu memory.
87
-
88
- ###########################################################
89
- # OPTIMIZER & SCHEDULER SETTING #
90
- ###########################################################
91
- generator_optimizer_params:
92
- lr: 0.0001 # Generator's learning rate.
93
- eps: 1.0e-6 # Generator's epsilon.
94
- weight_decay: 0.0 # Generator's weight decay coefficient.
95
- generator_scheduler_params:
96
- step_size: 200000 # Generator's scheduler step size.
97
- gamma: 0.5 # Generator's scheduler gamma.
98
- # At each step size, lr will be multiplied by this parameter.
99
- generator_grad_norm: 10 # Generator's gradient norm.
100
- discriminator_optimizer_params:
101
- lr: 0.00005 # Discriminator's learning rate.
102
- eps: 1.0e-6 # Discriminator's epsilon.
103
- weight_decay: 0.0 # Discriminator's weight decay coefficient.
104
- discriminator_scheduler_params:
105
- step_size: 200000 # Discriminator's scheduler step size.
106
- gamma: 0.5 # Discriminator's scheduler gamma.
107
- # At each step size, lr will be multiplied by this parameter.
108
- discriminator_grad_norm: 1 # Discriminator's gradient norm.
109
-
110
- ###########################################################
111
- # INTERVAL SETTING #
112
- ###########################################################
113
- discriminator_train_start_steps: 100000 # Number of steps to start to train discriminator.
114
- train_max_steps: 1000000 # Number of training steps.
115
- save_interval_steps: 5000 # Interval steps to save checkpoint.
116
- eval_interval_steps: 1000 # Interval steps to evaluate the network.
117
- log_interval_steps: 100 # Interval steps to record the training log.
118
-
119
- ###########################################################
120
- # OTHER SETTING #
121
- ###########################################################
122
- num_save_intermediate_results: 4 # Number of results to be saved as intermediate results.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/vctk/voc1/conf/slurm.conf DELETED
@@ -1,12 +0,0 @@
1
- # Default configuration
2
- command sbatch --export=PATH --ntasks-per-node=1
3
- option time=* --time $0
4
- option mem=* --mem-per-cpu $0
5
- option mem=0 # Do not add anything to qsub_opts
6
- option num_threads=* --cpus-per-task $0 --ntasks-per-node=1
7
- option num_threads=1 --cpus-per-task 1 --ntasks-per-node=1 # Do not add anything to qsub_opts
8
- default gpu=0
9
- option gpu=0 -p cpu
10
- option gpu=* -p gpu --gres=gpu:$0
11
- # note: the --max-jobs-run option is supported as a special case
12
- # by slurm.pl and you don't have to handle it in the config file.
 
 
 
 
 
 
 
 
 
 
 
 
 
audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/vctk/voc1/conf/style_melgan.v1.yaml DELETED
@@ -1,147 +0,0 @@
1
- # This is the configuration file for VCTK dataset.
2
- # This configuration is based on StyleMelGAN paper but
3
- # uses MSE loss instead of Hinge loss. And I found that
4
- # batch_size = 8 is also working good. So maybe if you
5
- # want to accelerate the training, you can reduce the
6
- # batch size (e.g. 8 or 16). Upsampling scales is modified
7
- # to fit the shift size 300 pt.
8
-
9
- ###########################################################
10
- # FEATURE EXTRACTION SETTING #
11
- ###########################################################
12
- sampling_rate: 24000 # Sampling rate.
13
- fft_size: 2048 # FFT size.
14
- hop_size: 300 # Hop size.
15
- win_length: 1200 # Window length.
16
- # If set to null, it will be the same as fft_size.
17
- window: "hann" # Window function.
18
- num_mels: 80 # Number of mel basis.
19
- fmin: 80 # Minimum freq in mel basis calculation.
20
- fmax: 7600 # Maximum frequency in mel basis calculation.
21
- global_gain_scale: 1.0 # Will be multiplied to all of waveform.
22
- trim_silence: false # Whether to trim the start and end of silence.
23
- trim_threshold_in_db: 60 # Need to tune carefully if the recording is not good.
24
- trim_frame_size: 1024 # Frame size in trimming.
25
- trim_hop_size: 256 # Hop size in trimming.
26
- format: "hdf5" # Feature file format. " npy " or " hdf5 " is supported.
27
-
28
- ###########################################################
29
- # GENERATOR NETWORK ARCHITECTURE SETTING #
30
- ###########################################################
31
- generator_type: "StyleMelGANGenerator" # Generator type.
32
- generator_params:
33
- in_channels: 128
34
- aux_channels: 80
35
- channels: 64
36
- out_channels: 1
37
- kernel_size: 9
38
- dilation: 2
39
- bias: True
40
- noise_upsample_scales: [10, 2, 2, 2]
41
- noise_upsample_activation: "LeakyReLU"
42
- noise_upsample_activation_params:
43
- negative_slope: 0.2
44
- upsample_scales: [5, 1, 5, 1, 3, 1, 2, 2, 1]
45
- upsample_mode: "nearest"
46
- gated_function: "softmax"
47
- use_weight_norm: True
48
-
49
- ###########################################################
50
- # DISCRIMINATOR NETWORK ARCHITECTURE SETTING #
51
- ###########################################################
52
- discriminator_type: "StyleMelGANDiscriminator" # Discriminator type.
53
- discriminator_params:
54
- repeats: 4
55
- window_sizes: [512, 1024, 2048, 4096]
56
- pqmf_params:
57
- - [1, None, None, None]
58
- - [2, 62, 0.26700, 9.0]
59
- - [4, 62, 0.14200, 9.0]
60
- - [8, 62, 0.07949, 9.0]
61
- discriminator_params:
62
- out_channels: 1
63
- kernel_sizes: [5, 3]
64
- channels: 16
65
- max_downsample_channels: 512
66
- bias: True
67
- downsample_scales: [4, 4, 4, 1]
68
- nonlinear_activation: "LeakyReLU"
69
- nonlinear_activation_params:
70
- negative_slope: 0.2
71
- use_weight_norm: True
72
-
73
- ###########################################################
74
- # STFT LOSS SETTING #
75
- ###########################################################
76
- stft_loss_params:
77
- fft_sizes: [1024, 2048, 512] # List of FFT size for STFT-based loss.
78
- hop_sizes: [120, 240, 50] # List of hop size for STFT-based loss
79
- win_lengths: [600, 1200, 240] # List of window length for STFT-based loss.
80
- window: "hann_window" # Window function for STFT-based loss
81
- lambda_aux: 1.0 # Loss balancing coefficient for aux loss.
82
-
83
- ###########################################################
84
- # ADVERSARIAL LOSS SETTING #
85
- ###########################################################
86
- lambda_adv: 1.0 # Loss balancing coefficient for adv loss.
87
- generator_adv_loss_params:
88
- average_by_discriminators: false # Whether to average loss by #discriminators.
89
- discriminator_adv_loss_params:
90
- average_by_discriminators: false # Whether to average loss by #discriminators.
91
-
92
- ###########################################################
93
- # DATA LOADER SETTING #
94
- ###########################################################
95
- batch_size: 32 # Batch size.
96
- batch_max_steps: 24000 # Length of each audio in batch. Make sure dividable by hop_size.
97
- pin_memory: true # Whether to pin memory in Pytorch DataLoader.
98
- num_workers: 2 # Number of workers in Pytorch DataLoader.
99
- remove_short_samples: false # Whether to remove samples the length of which are less than batch_max_steps.
100
- allow_cache: true # Whether to allow cache in dataset. If true, it requires cpu memory.
101
-
102
- ###########################################################
103
- # OPTIMIZER & SCHEDULER SETTING #
104
- ###########################################################
105
- generator_optimizer_type: Adam
106
- generator_optimizer_params:
107
- lr: 1.0e-4
108
- betas: [0.5, 0.9]
109
- weight_decay: 0.0
110
- generator_scheduler_type: MultiStepLR
111
- generator_scheduler_params:
112
- gamma: 0.5
113
- milestones:
114
- - 100000
115
- - 300000
116
- - 500000
117
- - 700000
118
- - 900000
119
- generator_grad_norm: -1
120
- discriminator_optimizer_type: Adam
121
- discriminator_optimizer_params:
122
- lr: 2.0e-4
123
- betas: [0.5, 0.9]
124
- weight_decay: 0.0
125
- discriminator_scheduler_type: MultiStepLR
126
- discriminator_scheduler_params:
127
- gamma: 0.5
128
- milestones:
129
- - 200000
130
- - 400000
131
- - 600000
132
- - 800000
133
- discriminator_grad_norm: -1
134
-
135
- ###########################################################
136
- # INTERVAL SETTING #
137
- ###########################################################
138
- discriminator_train_start_steps: 100000 # Number of steps to start to train discriminator.
139
- train_max_steps: 1500000 # Number of training steps.
140
- save_interval_steps: 50000 # Interval steps to save checkpoint.
141
- eval_interval_steps: 1000 # Interval steps to evaluate the network.
142
- log_interval_steps: 100 # Interval steps to record the training log.
143
-
144
- ###########################################################
145
- # OTHER SETTING #
146
- ###########################################################
147
- num_save_intermediate_results: 4 # Number of results to be saved as intermediate results.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/vctk/voc1/local/data_download.sh DELETED
@@ -1,37 +0,0 @@
1
- #!/bin/bash
2
-
3
- # Copyright 2020 Tomoki Hayashi
4
- # MIT License (https://opensource.org/licenses/MIT)
5
-
6
- download_dir=$1
7
-
8
- # check arguments
9
- if [ $# != 1 ]; then
10
- echo "Usage: $0 <download_dir>"
11
- exit 1
12
- fi
13
-
14
- set -euo pipefail
15
-
16
- cwd=$(pwd)
17
- if [ ! -e "${download_dir}/VCTK-Corpus" ]; then
18
- mkdir -p "${download_dir}"
19
- cd "${download_dir}" || exit 1;
20
- wget http://www.udialogue.org/download/VCTK-Corpus.tar.gz
21
- tar xvzf ./VCTK-Corpus.tar.gz
22
- rm ./VCTK-Corpus.tar.gz
23
- cd "${cwd}" || exit 1;
24
- echo "Successfully downloaded data."
25
- else
26
- echo "Already exists. Skipped."
27
- fi
28
-
29
- if [ ! -e "${download_dir}/VCTK-Corpus/lab" ]; then
30
- cd "${download_dir}" || exit 1;
31
- git clone https://github.com/kan-bayashi/VCTKCorpusFullContextLabel.git
32
- cp -r VCTKCorpusFullContextLabel/lab ./VCTK-Corpus
33
- cd "${cwd}" || exit 1;
34
- echo "Successfully downloaded label data."
35
- else
36
- echo "Already exists. Skipped."
37
- fi
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/vctk/voc1/local/data_prep.sh DELETED
@@ -1,118 +0,0 @@
1
- #!/bin/bash
2
-
3
- # Copyright 2020 Tomoki Hayashi
4
- # MIT License (https://opensource.org/licenses/MIT)
5
-
6
- # shellcheck disable=SC1091
7
- . ./path.sh || exit 1;
8
-
9
- fs=24000
10
- num_dev=10
11
- num_eval=10
12
- train_set="train_nodev"
13
- dev_set="dev"
14
- eval_set="eval"
15
- shuffle=false
16
-
17
- # shellcheck disable=SC1091
18
- . utils/parse_options.sh || exit 1;
19
-
20
- db_root=$1
21
- spk=$2
22
- data_dir=$3
23
-
24
- # check arguments
25
- if [ $# != 3 ]; then
26
- echo "Usage: $0 [Options] <db_root> <spk> <data_dir>"
27
- echo "e.g.: $0 downloads/VCTK-Corpus p225 data"
28
- echo ""
29
- echo "Options:"
30
- echo " --fs: target sampling rate (default=24000)."
31
- echo " --num_dev: number of development uttreances (default=10)."
32
- echo " --num_eval: number of evaluation uttreances (default=10)."
33
- echo " --train_set: name of train set (default=train_nodev)."
34
- echo " --dev_set: name of dev set (default=dev)."
35
- echo " --eval_set: name of eval set (default=eval)."
36
- echo " --shuffle: whether to perform shuffle in making dev / eval set (default=false)."
37
- exit 1
38
- fi
39
-
40
- set -euo pipefail
41
-
42
- # check spk existence
43
- [ ! -e "${db_root}/lab/mono/${spk}" ] && \
44
- echo "${spk} does not exist." >&2 && exit 1;
45
-
46
- [ ! -e "${data_dir}/all" ] && mkdir -p "${data_dir}/all"
47
-
48
- # set filenames
49
- scp="${data_dir}/all/wav.scp"
50
- segments="${data_dir}/all/segments"
51
-
52
- # check file existence
53
- [ -e "${scp}" ] && rm "${scp}"
54
- [ -e "${segments}" ] && rm "${segments}"
55
-
56
- # make scp and segments
57
- find "${db_root}/wav48/${spk}" -follow -name "*.wav" | sort | while read -r wav; do
58
- id=$(basename "${wav}" | sed -e "s/\.[^\.]*$//g")
59
- lab=${db_root}/lab/mono/${spk}/${id}.lab
60
-
61
- # check lab existence
62
- if [ ! -e "${lab}" ]; then
63
- echo "${id} does not have a label file. skipped."
64
- continue
65
- fi
66
-
67
- echo "${id} cat ${wav} | sox -t wav - -c 1 -b 16 -t wav - rate ${fs} |" >> "${scp}"
68
-
69
- # parse start and end time from HTS-style mono label
70
- idx=1
71
- while true; do
72
- next_idx=$((idx+1))
73
- next_symbol=$(sed -n "${next_idx}p" "${lab}" | awk '{print $3}')
74
- if [ "${next_symbol}" != "pau" ]; then
75
- start_nsec=$(sed -n "${idx}p" "${lab}" | awk '{print $2}')
76
- break
77
- fi
78
- idx=${next_idx}
79
- done
80
- idx=$(wc -l < "${lab}")
81
- while true; do
82
- prev_idx=$((idx-1))
83
- prev_symbol=$(sed -n "${prev_idx}p" "${lab}" | awk '{print $3}')
84
- if [ "${prev_symbol}" != "pau" ]; then
85
- end_nsec=$(sed -n "${idx}p" "${lab}" | awk '{print $1}')
86
- break
87
- fi
88
- idx=${prev_idx}
89
- done
90
- start_sec=$(echo "${start_nsec}*0.0000001" | bc | sed "s/^\./0./")
91
- end_sec=$(echo "${end_nsec}*0.0000001" | bc | sed "s/^\./0./")
92
- echo "${id} ${id} ${start_sec} ${end_sec}" >> "${segments}"
93
- done
94
-
95
- # split
96
- num_all=$(wc -l < "${scp}")
97
- num_deveval=$((num_dev + num_eval))
98
- num_train=$((num_all - num_deveval))
99
- utils/split_data.sh \
100
- --num_first "${num_train}" \
101
- --num_second "${num_deveval}" \
102
- --shuffle "${shuffle}" \
103
- "${data_dir}/all" \
104
- "${data_dir}/${train_set}" \
105
- "${data_dir}/deveval"
106
- utils/split_data.sh \
107
- --num_first "${num_dev}" \
108
- --num_second "${num_eval}" \
109
- --shuffle "${shuffle}" \
110
- "${data_dir}/deveval" \
111
- "${data_dir}/${dev_set}" \
112
- "${data_dir}/${eval_set}"
113
-
114
- # remove tmp directories
115
- rm -rf "${data_dir}/all"
116
- rm -rf "${data_dir}/deveval"
117
-
118
- echo "Successfully prepared data."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/vctk/voc1/local/decode_from_text.py DELETED
@@ -1,174 +0,0 @@
1
- #!/usr/bin/env python3
2
- # -*- coding: utf-8 -*-
3
-
4
- # Copyright 2019 Tomoki Hayashi
5
- # MIT License (https://opensource.org/licenses/MIT)
6
-
7
- """Decode text with trained VQ-VAE Generator or discrete symbol vocoder."""
8
-
9
- import argparse
10
- import logging
11
- import os
12
- import time
13
-
14
- import parallel_wavegan.models
15
- import soundfile as sf
16
- import torch
17
- import yaml
18
- from parallel_wavegan.utils import load_model
19
- from tqdm import tqdm
20
-
21
-
22
- def main():
23
- """Run decoding process."""
24
- parser = argparse.ArgumentParser(
25
- description=(
26
- "Decode text with trained VQ-VAE decoder "
27
- "(See detail in parallel_wavegan/bin/decode.py)."
28
- )
29
- )
30
- parser.add_argument(
31
- "--text",
32
- required=True,
33
- type=str,
34
- help="kaldi-style text file.",
35
- )
36
- parser.add_argument(
37
- "--utt2spk",
38
- default=None,
39
- type=str,
40
- help="kaldi-style utt2spk file.",
41
- )
42
- parser.add_argument(
43
- "--spk2idx",
44
- default=None,
45
- type=str,
46
- help="kaldi-style spk2idx file.",
47
- )
48
- parser.add_argument(
49
- "--outdir",
50
- type=str,
51
- required=True,
52
- help="directory to save generated speech.",
53
- )
54
- parser.add_argument(
55
- "--checkpoint",
56
- type=str,
57
- required=True,
58
- help="checkpoint file to be loaded.",
59
- )
60
- parser.add_argument(
61
- "--config",
62
- default=None,
63
- type=str,
64
- help=(
65
- "yaml format configuration file. if not explicitly provided, "
66
- "it will be searched in the checkpoint directory. (default=None)"
67
- ),
68
- )
69
- parser.add_argument(
70
- "--verbose",
71
- type=int,
72
- default=1,
73
- help="logging level. higher is more logging. (default=1)",
74
- )
75
- args = parser.parse_args()
76
-
77
- # set logger
78
- if args.verbose > 1:
79
- logging.basicConfig(
80
- level=logging.DEBUG,
81
- format="%(asctime)s (%(module)s:%(lineno)d) %(levelname)s: %(message)s",
82
- )
83
- elif args.verbose > 0:
84
- logging.basicConfig(
85
- level=logging.INFO,
86
- format="%(asctime)s (%(module)s:%(lineno)d) %(levelname)s: %(message)s",
87
- )
88
- else:
89
- logging.basicConfig(
90
- level=logging.WARN,
91
- format="%(asctime)s (%(module)s:%(lineno)d) %(levelname)s: %(message)s",
92
- )
93
- logging.warning("Skip DEBUG/INFO messages")
94
-
95
- # check directory existence
96
- if not os.path.exists(args.outdir):
97
- os.makedirs(args.outdir)
98
-
99
- # load config
100
- if args.config is None:
101
- dirname = os.path.dirname(args.checkpoint)
102
- args.config = os.path.join(dirname, "config.yml")
103
- with open(args.config) as f:
104
- config = yaml.load(f, Loader=yaml.Loader)
105
- config.update(vars(args))
106
-
107
- # setup model
108
- if torch.cuda.is_available():
109
- device = torch.device("cuda")
110
- else:
111
- device = torch.device("cpu")
112
- model = load_model(args.checkpoint, config)
113
- logging.info(f"Loaded model parameters from {args.checkpoint}.")
114
- model.remove_weight_norm()
115
- model = model.eval().to(device)
116
- is_vqvae = isinstance(model, parallel_wavegan.models.VQVAE)
117
-
118
- # setup dataset
119
- with open(args.text) as f:
120
- lines = [l_.replace("\n", "") for l_ in f.readlines()]
121
- text = {l_.split()[0]: list(map(int, l_.split()[1:])) for l_ in lines}
122
-
123
- utt2spk = None
124
- if args.utt2spk is not None:
125
- assert args.spk2idx is not None
126
- with open(args.utt2spk) as f:
127
- lines = [l_.replace("\n", "") for l_ in f.readlines()]
128
- utt2spk = {l_.split()[0]: str(l_.split()[1]) for l_ in lines}
129
- with open(args.spk2idx) as f:
130
- lines = [l_.replace("\n", "") for l_ in f.readlines()]
131
- spk2idx = {l_.split()[0]: int(l_.split()[1]) for l_ in lines}
132
-
133
- # start generation
134
- total_rtf = 0.0
135
- with torch.no_grad(), tqdm(text.items(), desc="[decode]") as pbar:
136
- for idx, items in enumerate(pbar, 1):
137
- utt_id, indices = items
138
- z = torch.LongTensor(indices).view(1, -1).to(device)
139
- g = None
140
- if utt2spk is not None:
141
- spk_idx = spk2idx[utt2spk[utt_id]]
142
- g = torch.tensor(spk_idx).long().view(1).to(device)
143
- if is_vqvae:
144
- # VQVAE case
145
- start = time.time()
146
- y = model.decode(z, None, g).view(-1).cpu().numpy()
147
- rtf = (time.time() - start) / (len(y) / config["sampling_rate"])
148
- pbar.set_postfix({"RTF": rtf})
149
- total_rtf += rtf
150
- else:
151
- # Discrete symbol vocoder case
152
- start = time.time()
153
- g = int(g.item()) if g is not None else None
154
- y = model.inference(z.view(-1, 1), g=g).view(-1).cpu().numpy()
155
- rtf = (time.time() - start) / (len(y) / config["sampling_rate"])
156
- pbar.set_postfix({"RTF": rtf})
157
- total_rtf += rtf
158
-
159
- # save as PCM 16 bit wav file
160
- sf.write(
161
- os.path.join(config["outdir"], f"{utt_id}_gen.wav"),
162
- y,
163
- config["sampling_rate"],
164
- "PCM_16",
165
- )
166
-
167
- # report average RTF
168
- logging.info(
169
- f"Finished generation of {idx} utterances (RTF = {total_rtf / idx:.03f})."
170
- )
171
-
172
-
173
- if __name__ == "__main__":
174
- main()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/vctk/voc1/local/preprocess_hubert.py DELETED
@@ -1,249 +0,0 @@
1
- #!/usr/bin/env python3
2
- # -*- coding: utf-8 -*-
3
-
4
- # Copyright 2019 Tomoki Hayashi
5
- # MIT License (https://opensource.org/licenses/MIT)
6
-
7
- """Perform preprocessing and raw feature extraction."""
8
-
9
- import argparse
10
- import logging
11
- import os
12
-
13
- import librosa
14
- import numpy as np
15
- import resampy
16
- import soundfile as sf
17
- import yaml
18
- from parallel_wavegan.datasets import AudioDataset, AudioSCPDataset
19
- from parallel_wavegan.utils import write_hdf5
20
- from tqdm import tqdm
21
-
22
-
23
- def main():
24
- """Run preprocessing process."""
25
- parser = argparse.ArgumentParser(
26
- description=(
27
- "Preprocess audio and then extract features (See detail in"
28
- " parallel_wavegan/bin/preprocess.py)."
29
- )
30
- )
31
- parser.add_argument(
32
- "--wav-scp",
33
- "--scp",
34
- default=None,
35
- type=str,
36
- help="kaldi-style wav.scp file. you need to specify either scp or rootdir.",
37
- )
38
- parser.add_argument(
39
- "--segments",
40
- default=None,
41
- type=str,
42
- help=(
43
- "kaldi-style segments file. if use, you must to specify both scp and"
44
- " segments."
45
- ),
46
- )
47
- parser.add_argument(
48
- "--text",
49
- default=None,
50
- type=str,
51
- help="kaldi-style text format hubert embedding index.",
52
- )
53
- parser.add_argument(
54
- "--utt2spk",
55
- default=None,
56
- type=str,
57
- help=(
58
- "kaldi-style utt2spk file. If you want to add global conditionning with "
59
- "speaker id, you need to specify this argument."
60
- ),
61
- )
62
- parser.add_argument(
63
- "--spk2idx",
64
- default=None,
65
- type=str,
66
- help=(
67
- "kaldi-style spk2idx file. If you want to add global conditionning with "
68
- "speaker id, you need to specify this argument."
69
- ),
70
- )
71
- parser.add_argument(
72
- "--rootdir",
73
- default=None,
74
- type=str,
75
- help=(
76
- "directory including wav files. you need to specify either scp or rootdir."
77
- ),
78
- )
79
- parser.add_argument(
80
- "--dumpdir",
81
- type=str,
82
- required=True,
83
- help="directory to dump feature files.",
84
- )
85
- parser.add_argument(
86
- "--config",
87
- type=str,
88
- required=True,
89
- help="yaml format configuration file.",
90
- )
91
- parser.add_argument(
92
- "--verbose",
93
- type=int,
94
- default=1,
95
- help="logging level. higher is more logging. (default=1)",
96
- )
97
- args = parser.parse_args()
98
-
99
- # set logger
100
- if args.verbose > 1:
101
- logging.basicConfig(
102
- level=logging.DEBUG,
103
- format="%(asctime)s (%(module)s:%(lineno)d) %(levelname)s: %(message)s",
104
- )
105
- elif args.verbose > 0:
106
- logging.basicConfig(
107
- level=logging.INFO,
108
- format="%(asctime)s (%(module)s:%(lineno)d) %(levelname)s: %(message)s",
109
- )
110
- else:
111
- logging.basicConfig(
112
- level=logging.WARN,
113
- format="%(asctime)s (%(module)s:%(lineno)d) %(levelname)s: %(message)s",
114
- )
115
- logging.warning("Skip DEBUG/INFO messages")
116
-
117
- # load config
118
- with open(args.config) as f:
119
- config = yaml.load(f, Loader=yaml.Loader)
120
- config.update(vars(args))
121
-
122
- # check arguments
123
- if (args.wav_scp is not None and args.rootdir is not None) or (
124
- args.wav_scp is None and args.rootdir is None
125
- ):
126
- raise ValueError("Please specify either --rootdir or --wav-scp.")
127
-
128
- # get dataset
129
- if args.rootdir is not None:
130
- dataset = AudioDataset(
131
- args.rootdir,
132
- "*.wav",
133
- audio_load_fn=sf.read,
134
- return_utt_id=True,
135
- )
136
- else:
137
- dataset = AudioSCPDataset(
138
- args.wav_scp,
139
- segments=args.segments,
140
- return_utt_id=True,
141
- return_sampling_rate=True,
142
- )
143
-
144
- # get text
145
- with open(args.text) as f:
146
- lines = [line.strip() for line in f.readlines()]
147
- text = {
148
- line.split(maxsplit=1)[0]: line.split(maxsplit=1)[1].split() for line in lines
149
- }
150
-
151
- # load spk2utt file
152
- if args.utt2spk is not None:
153
- with open(args.utt2spk) as f:
154
- lines = [l.replace("\n", "") for l in f.readlines()]
155
- utt2spk = {l.split()[0]: l.split()[1] for l in lines}
156
- with open(args.spk2idx) as f:
157
- lines = [l.replace("\n", "") for l in f.readlines()]
158
- spk2idx = {l.split()[0]: int(l.split()[1]) for l in lines}
159
-
160
- # check directly existence
161
- if not os.path.exists(args.dumpdir):
162
- os.makedirs(args.dumpdir, exist_ok=True)
163
-
164
- # process each data
165
- for utt_id, (audio, fs) in tqdm(dataset):
166
- # check
167
- assert len(audio.shape) == 1, f"{utt_id} seems to be multi-channel signal."
168
- assert (
169
- np.abs(audio).max() <= 1.0
170
- ), f"{utt_id} seems to be different from 16 bit PCM."
171
-
172
- # downsample
173
- if fs != config["sampling_rate"]:
174
- audio = resampy.resample(audio, fs, config["sampling_rate"], axis=0)
175
-
176
- # trim silence
177
- if config["trim_silence"]:
178
- audio, _ = librosa.effects.trim(
179
- audio,
180
- top_db=config["trim_threshold_in_db"],
181
- frame_length=config["trim_frame_size"],
182
- hop_length=config["trim_hop_size"],
183
- )
184
-
185
- # use hubert index instead of mel
186
- mel = np.array(text[utt_id]).astype(np.int64).reshape(-1, 1)
187
-
188
- if args.spk2idx is not None:
189
- spk = utt2spk[utt_id]
190
- if spk in spk2idx:
191
- idx = spk2idx[spk]
192
- else:
193
- logging.warn(f"{spk} is unknown speaker.")
194
- max_idx = max(spk2idx.values()) + 1
195
- idx = max_idx
196
-
197
- # concatenate with mel
198
- idx = np.repeat(np.array(idx).reshape(1, 1), len(mel), axis=0)
199
- mel = np.concatenate([mel, idx], axis=1)
200
-
201
- # make sure the audio length and feature length are matched
202
- logging.info(f"Mod: {len(audio) - len(mel) * config['hop_size']}")
203
- if len(mel) * config["hop_size"] <= len(audio):
204
- logging.warning(
205
- "len(mel) * config['hop_size'] <= len(audio), may be errors"
206
- )
207
- mel = mel[: len(audio) // config["hop_size"]]
208
- audio = audio[: len(mel) * config["hop_size"]]
209
- assert len(mel) * config["hop_size"] == len(audio)
210
-
211
- # apply global gain
212
- if config["global_gain_scale"] > 0.0:
213
- audio *= config["global_gain_scale"]
214
- if np.abs(audio).max() >= 1.0:
215
- logging.warn(
216
- f"{utt_id} causes clipping. "
217
- "it is better to re-consider global gain scale."
218
- )
219
- continue
220
-
221
- # save
222
- if config["format"] == "hdf5":
223
- write_hdf5(
224
- os.path.join(args.dumpdir, f"{utt_id}.h5"),
225
- "wave",
226
- audio.astype(np.float32),
227
- )
228
- write_hdf5(
229
- os.path.join(args.dumpdir, f"{utt_id}.h5"),
230
- "feats",
231
- mel.astype(np.float32),
232
- )
233
- elif config["format"] == "npy":
234
- np.save(
235
- os.path.join(args.dumpdir, f"{utt_id}-wave.npy"),
236
- audio.astype(np.float32),
237
- allow_pickle=False,
238
- )
239
- np.save(
240
- os.path.join(args.dumpdir, f"{utt_id}-feats.npy"),
241
- mel.astype(np.float32),
242
- allow_pickle=False,
243
- )
244
- else:
245
- raise ValueError("support only hdf5 or npy format.")
246
-
247
-
248
- if __name__ == "__main__":
249
- main()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/vctk/voc1/path.sh DELETED
@@ -1,33 +0,0 @@
1
- # cuda related
2
- export CUDA_HOME=/usr/local/cuda-11.3
3
- export LD_LIBRARY_PATH="${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}"
4
-
5
- # path related
6
- export PRJ_ROOT="${PWD}/../../.."
7
- if [ -e "${PRJ_ROOT}/tools/venv/bin/activate" ]; then
8
- # shellcheck disable=SC1090
9
- . "${PRJ_ROOT}/tools/venv/bin/activate"
10
- fi
11
-
12
- # python related
13
- export OMP_NUM_THREADS=1
14
- export PYTHONIOENCODING=UTF-8
15
- export MPL_BACKEND=Agg
16
-
17
- # check installation
18
- if ! command -v parallel-wavegan-train > /dev/null; then
19
- echo "Error: It seems setup is not finished." >&2
20
- echo "Error: Please setup your environment by following README.md" >&2
21
- return 1
22
- fi
23
- if ! command -v jq > /dev/null; then
24
- echo "Error: It seems jq is not installed." >&2
25
- echo "Error: Please install via \`sudo apt-get install jq\`." >&2
26
- echo "Error: If you do not have sudo, please download from https://stedolan.github.io/jq/download/." >&2
27
- return 1
28
- fi
29
- if ! command -v yq > /dev/null; then
30
- echo "Error: It seems yq is not installed." >&2
31
- echo "Error: Please install via \`pip install yq\`." >&2
32
- return 1
33
- fi
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/vctk/voc1/run.sh DELETED
@@ -1,188 +0,0 @@
1
- #!/bin/bash
2
-
3
- # Copyright 2020 Tomoki Hayashi
4
- # MIT License (https://opensource.org/licenses/MIT)
5
-
6
- . ./cmd.sh || exit 1;
7
- . ./path.sh || exit 1;
8
-
9
- # basic settings
10
- stage=-1 # stage to start
11
- stop_stage=100 # stage to stop
12
- verbose=1 # verbosity level (lower is less info)
13
- n_gpus=1 # number of gpus in training
14
- n_jobs=16 # number of parallel jobs in feature extraction
15
-
16
- # NOTE(kan-bayashi): renamed to conf to avoid conflict in parse_options.sh
17
- conf=conf/parallel_wavegan.v1.yaml
18
-
19
- # speaker setting
20
- spks="all" # all or you can choose speakers e.g., "p225 p226 p227 ..."
21
-
22
- # directory path setting
23
- download_dir=downloads # directory to save database
24
- dumpdir=dump # directory to dump features
25
-
26
- # training related setting
27
- tag="" # tag for directory to save model
28
- resume="" # checkpoint path to resume training
29
- # (e.g. <path>/<to>/checkpoint-10000steps.pkl)
30
-
31
- # decoding related setting
32
- checkpoint="" # checkpoint path to be used for decoding
33
- # if not provided, the latest one will be used
34
- # (e.g. <path>/<to>/checkpoint-400000steps.pkl)
35
-
36
- # shellcheck disable=SC1091
37
- . utils/parse_options.sh || exit 1;
38
-
39
- train_set="train_nodev_$(echo "${spks}" | tr " " "_")" # name of training data directory
40
- dev_set="dev_$(echo "${spks}" | tr " " "_")" # name of development data directory
41
- eval_set="eval_$(echo "${spks}" | tr " " "_")" # name of evaluation data directory
42
-
43
- set -euo pipefail
44
-
45
- if [ "${stage}" -le -1 ] && [ "${stop_stage}" -ge -1 ]; then
46
- echo "Stage -1: Data download"
47
- local/data_download.sh "${download_dir}"
48
- fi
49
-
50
- if [ "${stage}" -le 0 ] && [ "${stop_stage}" -ge 0 ]; then
51
- echo "Stage 0: Data preparation"
52
- train_data_dirs=""
53
- dev_data_dirs=""
54
- eval_data_dirs=""
55
- # if set to "all", use all of the speakers in the corpus
56
- if [ "${spks}" = "all" ]; then
57
- # NOTE(kan-bayashi): p315 will not be used since it lacks txt data
58
- spks=$(find "${download_dir}/VCTK-Corpus/wav48" \
59
- -maxdepth 1 -name "p*" -exec basename {} \; | sort | grep -v p315)
60
- fi
61
- for spk in ${spks}; do
62
- local/data_prep.sh \
63
- --fs "$(yq ".sampling_rate" "${conf}")" \
64
- --train_set "train_nodev_${spk}" \
65
- --dev_set "dev_${spk}" \
66
- --eval_set "eval_${spk}" \
67
- "${download_dir}/VCTK-Corpus" "${spk}" data
68
- train_data_dirs+=" data/train_nodev_${spk}"
69
- dev_data_dirs+=" data/dev_${spk}"
70
- eval_data_dirs+=" data/eval_${spk}"
71
- done
72
- # shellcheck disable=SC2086
73
- utils/combine_data.sh "data/${train_set}" ${train_data_dirs}
74
- # shellcheck disable=SC2086
75
- utils/combine_data.sh "data/${dev_set}" ${dev_data_dirs}
76
- # shellcheck disable=SC2086
77
- utils/combine_data.sh "data/${eval_set}" ${eval_data_dirs}
78
- fi
79
-
80
- stats_ext=$(grep -q "hdf5" <(yq ".format" "${conf}") && echo "h5" || echo "npy")
81
- if [ "${stage}" -le 1 ] && [ "${stop_stage}" -ge 1 ]; then
82
- echo "Stage 1: Feature extraction"
83
- # extract raw features
84
- pids=()
85
- for name in "${train_set}" "${dev_set}" "${eval_set}"; do
86
- (
87
- [ ! -e "${dumpdir}/${name}/raw" ] && mkdir -p "${dumpdir}/${name}/raw"
88
- echo "Feature extraction start. See the progress via ${dumpdir}/${name}/raw/preprocessing.*.log."
89
- utils/make_subset_data.sh "data/${name}" "${n_jobs}" "${dumpdir}/${name}/raw"
90
- ${train_cmd} JOB=1:${n_jobs} "${dumpdir}/${name}/raw/preprocessing.JOB.log" \
91
- parallel-wavegan-preprocess \
92
- --config "${conf}" \
93
- --scp "${dumpdir}/${name}/raw/wav.JOB.scp" \
94
- --segments "${dumpdir}/${name}/raw/segments.JOB" \
95
- --dumpdir "${dumpdir}/${name}/raw/dump.JOB" \
96
- --verbose "${verbose}"
97
- echo "Successfully finished feature extraction of ${name} set."
98
- ) &
99
- pids+=($!)
100
- done
101
- i=0; for pid in "${pids[@]}"; do wait "${pid}" || ((++i)); done
102
- [ "${i}" -gt 0 ] && echo "$0: ${i} background jobs are failed." && exit 1;
103
- echo "Successfully finished feature extraction."
104
-
105
- # calculate statistics for normalization
106
- echo "Statistics computation start. See the progress via ${dumpdir}/${train_set}/compute_statistics.log."
107
- ${train_cmd} "${dumpdir}/${train_set}/compute_statistics.log" \
108
- parallel-wavegan-compute-statistics \
109
- --config "${conf}" \
110
- --rootdir "${dumpdir}/${train_set}/raw" \
111
- --dumpdir "${dumpdir}/${train_set}" \
112
- --verbose "${verbose}"
113
- echo "Successfully finished calculation of statistics."
114
-
115
- # normalize and dump them
116
- pids=()
117
- for name in "${train_set}" "${dev_set}" "${eval_set}"; do
118
- (
119
- [ ! -e "${dumpdir}/${name}/norm" ] && mkdir -p "${dumpdir}/${name}/norm"
120
- echo "Nomalization start. See the progress via ${dumpdir}/${name}/norm/normalize.*.log."
121
- ${train_cmd} JOB=1:${n_jobs} "${dumpdir}/${name}/norm/normalize.JOB.log" \
122
- parallel-wavegan-normalize \
123
- --config "${conf}" \
124
- --stats "${dumpdir}/${train_set}/stats.${stats_ext}" \
125
- --rootdir "${dumpdir}/${name}/raw/dump.JOB" \
126
- --dumpdir "${dumpdir}/${name}/norm/dump.JOB" \
127
- --verbose "${verbose}"
128
- echo "Successfully finished normalization of ${name} set."
129
- ) &
130
- pids+=($!)
131
- done
132
- i=0; for pid in "${pids[@]}"; do wait "${pid}" || ((++i)); done
133
- [ "${i}" -gt 0 ] && echo "$0: ${i} background jobs are failed." && exit 1;
134
- echo "Successfully finished normalization."
135
- fi
136
-
137
- if [ -z "${tag}" ]; then
138
- expdir="exp/${train_set}_vctk_$(basename "${conf}" .yaml)"
139
- else
140
- expdir="exp/${train_set}_vctk_${tag}"
141
- fi
142
- if [ "${stage}" -le 2 ] && [ "${stop_stage}" -ge 2 ]; then
143
- echo "Stage 2: Network training"
144
- [ ! -e "${expdir}" ] && mkdir -p "${expdir}"
145
- cp "${dumpdir}/${train_set}/stats.${stats_ext}" "${expdir}"
146
- if [ "${n_gpus}" -gt 1 ]; then
147
- train="python -m parallel_wavegan.distributed.launch --nproc_per_node ${n_gpus} -c parallel-wavegan-train"
148
- else
149
- train="parallel-wavegan-train"
150
- fi
151
- echo "Training start. See the progress via ${expdir}/train.log."
152
- ${cuda_cmd} --gpu "${n_gpus}" "${expdir}/train.log" \
153
- ${train} \
154
- --config "${conf}" \
155
- --train-dumpdir "${dumpdir}/${train_set}/norm" \
156
- --dev-dumpdir "${dumpdir}/${dev_set}/norm" \
157
- --outdir "${expdir}" \
158
- --resume "${resume}" \
159
- --verbose "${verbose}"
160
- echo "Successfully finished training."
161
- fi
162
-
163
- if [ "${stage}" -le 3 ] && [ "${stop_stage}" -ge 3 ]; then
164
- echo "Stage 3: Network decoding"
165
- # shellcheck disable=SC2012
166
- [ -z "${checkpoint}" ] && checkpoint="$(ls -dt "${expdir}"/*.pkl | head -1 || true)"
167
- outdir="${expdir}/wav/$(basename "${checkpoint}" .pkl)"
168
- pids=()
169
- for name in "${dev_set}" "${eval_set}"; do
170
- (
171
- [ ! -e "${outdir}/${name}" ] && mkdir -p "${outdir}/${name}"
172
- [ "${n_gpus}" -gt 1 ] && n_gpus=1
173
- echo "Decoding start. See the progress via ${outdir}/${name}/decode.log."
174
- ${cuda_cmd} --gpu "${n_gpus}" "${outdir}/${name}/decode.log" \
175
- parallel-wavegan-decode \
176
- --dumpdir "${dumpdir}/${name}/norm" \
177
- --checkpoint "${checkpoint}" \
178
- --outdir "${outdir}/${name}" \
179
- --verbose "${verbose}"
180
- echo "Successfully finished decoding of ${name} set."
181
- ) &
182
- pids+=($!)
183
- done
184
- i=0; for pid in "${pids[@]}"; do wait "${pid}" || ((++i)); done
185
- [ "${i}" -gt 0 ] && echo "$0: ${i} background jobs are failed." && exit 1;
186
- echo "Successfully finished decoding."
187
- fi
188
- echo "Finished."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/vctk/vq1/cmd.sh DELETED
@@ -1,91 +0,0 @@
1
- # ====== About run.pl, queue.pl, slurm.pl, and ssh.pl ======
2
- # Usage: <cmd>.pl [options] JOB=1:<nj> <log> <command...>
3
- # e.g.
4
- # run.pl --mem 4G JOB=1:10 echo.JOB.log echo JOB
5
- #
6
- # Options:
7
- # --time <time>: Limit the maximum time to execute.
8
- # --mem <mem>: Limit the maximum memory usage.
9
- # -–max-jobs-run <njob>: Limit the number parallel jobs. This is ignored for non-array jobs.
10
- # --num-threads <ngpu>: Specify the number of CPU core.
11
- # --gpu <ngpu>: Specify the number of GPU devices.
12
- # --config: Change the configuration file from default.
13
- #
14
- # "JOB=1:10" is used for "array jobs" and it can control the number of parallel jobs.
15
- # The left string of "=", i.e. "JOB", is replaced by <N>(Nth job) in the command and the log file name,
16
- # e.g. "echo JOB" is changed to "echo 3" for the 3rd job and "echo 8" for 8th job respectively.
17
- # Note that the number must start with a positive number, so you can't use "JOB=0:10" for example.
18
- #
19
- # run.pl, queue.pl, slurm.pl, and ssh.pl have unified interface, not depending on its backend.
20
- # These options are mapping to specific options for each backend and
21
- # it is configured by "conf/queue.conf" and "conf/slurm.conf" by default.
22
- # If jobs failed, your configuration might be wrong for your environment.
23
- #
24
- #
25
- # The official documentaion for run.pl, queue.pl, slurm.pl, and ssh.pl:
26
- # "Parallelization in Kaldi": http://kaldi-asr.org/doc/queue.html
27
- # =========================================================~
28
-
29
-
30
- # Select the backend used by run.sh from "local", "stdout", "sge", "slurm", or "ssh"
31
- cmd_backend="local"
32
-
33
- # Local machine, without any Job scheduling system
34
- if [ "${cmd_backend}" = local ]; then
35
-
36
- # The other usage
37
- export train_cmd="utils/run.pl"
38
- # Used for "*_train.py": "--gpu" is appended optionally by run.sh
39
- export cuda_cmd="utils/run.pl"
40
- # Used for "*_recog.py"
41
- export decode_cmd="utils/run.pl"
42
-
43
- # Local machine, without any Job scheduling system
44
- elif [ "${cmd_backend}" = stdout ]; then
45
-
46
- # The other usage
47
- export train_cmd="utils/stdout.pl"
48
- # Used for "*_train.py": "--gpu" is appended optionally by run.sh
49
- export cuda_cmd="utils/stdout.pl"
50
- # Used for "*_recog.py"
51
- export decode_cmd="utils/stdout.pl"
52
-
53
- # "qsub" (SGE, Torque, PBS, etc.)
54
- elif [ "${cmd_backend}" = sge ]; then
55
- # The default setting is written in conf/queue.conf.
56
- # You must change "-q g.q" for the "queue" for your environment.
57
- # To know the "queue" names, type "qhost -q"
58
- # Note that to use "--gpu *", you have to setup "complex_value" for the system scheduler.
59
-
60
- export train_cmd="utils/queue.pl"
61
- export cuda_cmd="utils/queue.pl"
62
- export decode_cmd="utils/queue.pl"
63
-
64
- # "sbatch" (Slurm)
65
- elif [ "${cmd_backend}" = slurm ]; then
66
- # The default setting is written in conf/slurm.conf.
67
- # You must change "-p cpu" and "-p gpu" for the "partion" for your environment.
68
- # To know the "partion" names, type "sinfo".
69
- # You can use "--gpu * " by defualt for slurm and it is interpreted as "--gres gpu:*"
70
- # The devices are allocated exclusively using "${CUDA_VISIBLE_DEVICES}".
71
-
72
- export train_cmd="utils/slurm.pl"
73
- export cuda_cmd="utils/slurm.pl"
74
- export decode_cmd="utils/slurm.pl"
75
-
76
- elif [ "${cmd_backend}" = ssh ]; then
77
- # You have to create ".queue/machines" to specify the host to execute jobs.
78
- # e.g. .queue/machines
79
- # host1
80
- # host2
81
- # host3
82
- # Assuming you can login them without any password, i.e. You have to set ssh keys.
83
-
84
- export train_cmd="utils/ssh.pl"
85
- export cuda_cmd="utils/ssh.pl"
86
- export decode_cmd="utils/ssh.pl"
87
-
88
- else
89
- echo "$0: Error: Unknown cmd_backend=${cmd_backend}" 1>&2
90
- return 1
91
- fi
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/vctk/vq1/conf/conditioned_melgan_vae.v3.yaml DELETED
@@ -1,130 +0,0 @@
1
- ###########################################################
2
- # THIS IS EXPERIMENTAL CONFIGURATION! BE CAREFUL! #
3
- ###########################################################
4
- # This is the hyperparameter configuration file for VQ-VAE MelGAN.
5
- # Please make sure this is adjusted for the LJSpeech dataset. If you want to
6
- # apply to the other dataset, you might need to carefully change some parameters.
7
- # This configuration performs 5M iters and it requires ~4 GB GPU memory and
8
- # takes ~8 days on TITAN V.
9
-
10
- ###########################################################
11
- # FEATURE EXTRACTION SETTING #
12
- ###########################################################
13
- sampling_rate: 24000 # Sampling rate.
14
- global_gain_scale: 1.0 # Will be multiplied to all of waveform.
15
- trim_silence: true # Whether to trim the start and end of silence.
16
- trim_threshold_in_db: 20 # Need to tune carefully if the recording is not good.
17
- trim_frame_size: 1024 # Frame size in trimming.
18
- trim_hop_size: 256 # Hop size in trimming.
19
- use_global_condition: true # Whether to use global conditioning.
20
- format: "hdf5" # Feature file format. "npy" or "hdf5" is supported.
21
-
22
- ###########################################################
23
- # GENERATOR NETWORK ARCHITECTURE SETTING #
24
- ###########################################################
25
- generator_type: "VQVAE" # Generator type.
26
- generator_params:
27
- in_channels: 1 # Number of input channels.
28
- out_channels: 1 # Number of output channels.
29
- num_embeds: 512 # Number of embeddings.
30
- embed_dim: 256 # Dimension of each emebedding.
31
- num_global_embeds: 128 # Number of global embeddings.
32
- global_embed_dim: 128 # Dimension of each global embedding.
33
- encoder_type: "MelGANDiscriminator" # Encoder type.
34
- decoder_type: "MelGANGenerator" # Decoder type.
35
- encoder_conf:
36
- "out_channels": 256 # Must be the same as embed dim
37
- "downsample_scales": [4, 4, 2, 2]
38
- "max_downsample_channels": 1024
39
- decoder_conf:
40
- "in_channels": 384 # Must be the same as embed dim
41
- "upsample_scales": [4, 4, 2, 2]
42
- "channels": 512
43
- "stacks": 3
44
-
45
- ###########################################################
46
- # DISCRIMINATOR NETWORK ARCHITECTURE SETTING #
47
- ###########################################################
48
- discriminator_type: "MelGANMultiScaleDiscriminator" # Discriminator type.
49
- discriminator_params:
50
- in_channels: 1 # Number of input channels.
51
- out_channels: 1 # Number of output channels.
52
- scales: 3 # Number of multi-scales.
53
- downsample_pooling: "AvgPool1d" # Pooling type for the input downsampling.
54
- downsample_pooling_params: # Parameters of the above pooling function.
55
- kernel_size: 4
56
- stride: 2
57
- padding: 1
58
- count_include_pad: False
59
- kernel_sizes: [5, 3] # List of kernel size.
60
- channels: 16 # Number of channels of the initial conv layer.
61
- max_downsample_channels: 1024 # Maximum number of channels of downsampling layers.
62
- downsample_scales: [4, 4, 4, 4] # List of downsampling scales.
63
- nonlinear_activation: "LeakyReLU" # Nonlinear activation function.
64
- nonlinear_activation_params: # Parameters of nonlinear activation function.
65
- negative_slope: 0.2
66
- use_weight_norm: True # Whether to use weight norm.
67
-
68
- ###########################################################
69
- # STFT LOSS SETTING #
70
- ###########################################################
71
- stft_loss_params:
72
- fft_sizes: [1024, 2048, 512] # List of FFT size for STFT-based loss.
73
- hop_sizes: [120, 240, 50] # List of hop size for STFT-based loss
74
- win_lengths: [600, 1200, 240] # List of window length for STFT-based loss.
75
- window: "hann_window" # Window function for STFT-based loss
76
-
77
- ###########################################################
78
- # ADVERSARIAL LOSS SETTING #
79
- ###########################################################
80
- use_feat_match_loss: true
81
- lambda_commit: 0.25
82
- lambda_feat_match: 25.0
83
- lambda_adv: 4.0
84
- lambda_aux_after_introduce_adv_loss: 1.0
85
-
86
- ###########################################################
87
- # DATA LOADER SETTING #
88
- ###########################################################
89
- batch_size: 16 # Batch size.
90
- batch_max_steps: 8192 # Length of each audio in batch. Make sure dividable by hop_size.
91
- pin_memory: true # Whether to pin memory in Pytorch DataLoader.
92
- num_workers: 2 # Number of workers in Pytorch DataLoader.
93
- remove_short_samples: false # Whether to remove samples the length of which are less than batch_max_steps.
94
- allow_cache: true # Whether to allow cache in dataset. If true, it requires cpu memory.
95
-
96
- ###########################################################
97
- # OPTIMIZER & SCHEDULER SETTING #
98
- ###########################################################
99
- generator_optimizer_params:
100
- lr: 0.0001 # Generator's learning rate.
101
- eps: 1.0e-6 # Generator's epsilon.
102
- weight_decay: 0.0 # Generator's weight decay coefficient.
103
- generator_scheduler_params:
104
- step_size: 5000000 # Generator's scheduler step size.
105
- gamma: 0.5 # Generator's scheduler gamma.
106
- # At each step size, lr will be multiplied by this parameter.
107
- generator_grad_norm: 10 # Generator's gradient norm.
108
- discriminator_optimizer_params:
109
- lr: 0.00005 # Discriminator's learning rate.
110
- eps: 1.0e-6 # Discriminator's epsilon.
111
- weight_decay: 0.0 # Discriminator's weight decay coefficient.
112
- discriminator_scheduler_params:
113
- step_size: 5000000 # Discriminator's scheduler step size.
114
- gamma: 0.5 # Discriminator's scheduler gamma.
115
- # At each step size, lr will be multiplied by this parameter.
116
- discriminator_grad_norm: 1 # Discriminator's gradient norm.
117
-
118
- ###########################################################
119
- # INTERVAL SETTING #
120
- ###########################################################
121
- discriminator_train_start_steps: 100000 # Number of steps to start to train discriminator.
122
- train_max_steps: 5000000 # Number of training steps.
123
- save_interval_steps: 5000 # Interval steps to save checkpoint.
124
- eval_interval_steps: 1000 # Interval steps to evaluate the network.
125
- log_interval_steps: 100 # Interval steps to record the training log.
126
-
127
- ###########################################################
128
- # OTHER SETTING #
129
- ###########################################################
130
- num_save_intermediate_results: 4 # Number of results to be saved as intermediate results.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/vctk/vq1/conf/local_conditioned_melgan_vae.v3.yaml DELETED
@@ -1,134 +0,0 @@
1
- ###########################################################
2
- # THIS IS EXPERIMENTAL CONFIGURATION! BE CAREFUL! #
3
- ###########################################################
4
- # This is the hyperparameter configuration file for VQ-VAE MelGAN.
5
- # Please make sure this is adjusted for the LJSpeech dataset. If you want to
6
- # apply to the other dataset, you might need to carefully change some parameters.
7
- # This configuration performs 5M iters and it requires ~4 GB GPU memory and
8
- # takes ~8 days on TITAN V.
9
-
10
- ###########################################################
11
- # FEATURE EXTRACTION SETTING #
12
- ###########################################################
13
- sampling_rate: 24000 # Sampling rate.
14
- hop_size: 64 # Hop size.
15
- global_gain_scale: 1.0 # Will be multiplied to all of waveform.
16
- trim_silence: true # Whether to trim the start and end of silence.
17
- trim_threshold_in_db: 20 # Need to tune carefully if the recording is not good.
18
- trim_frame_size: 1024 # Frame size in trimming.
19
- trim_hop_size: 256 # Hop size in trimming.
20
- use_global_condition: true # Whether to use global conditioning.
21
- use_local_condition: true # Whether to use local conditioning.
22
- format: "hdf5" # Feature file format. "npy" or "hdf5" is supported.
23
-
24
- ###########################################################
25
- # GENERATOR NETWORK ARCHITECTURE SETTING #
26
- ###########################################################
27
- generator_type: "VQVAE" # Generator type.
28
- generator_params:
29
- in_channels: 1 # Number of input channels.
30
- out_channels: 1 # Number of output channels.
31
- num_embeds: 512 # Number of embeddings.
32
- embed_dim: 256 # Dimension of each emebedding.
33
- num_local_embeds: 2 # Number of local embeddings.
34
- local_embed_dim: 32 # Dimension of each local embedding.
35
- num_global_embeds: 128 # Number of global embeddings.
36
- global_embed_dim: 128 # Dimension of each global embedding.
37
- encoder_type: "MelGANDiscriminator" # Encoder type.
38
- decoder_type: "MelGANGenerator" # Decoder type.
39
- encoder_conf:
40
- "out_channels": 256 # Must be the same as embed dim
41
- "downsample_scales": [4, 4, 2, 2]
42
- "max_downsample_channels": 1024
43
- decoder_conf:
44
- "in_channels": 416 # Must be the same as embed + local embed + global embed dim
45
- "upsample_scales": [4, 4, 2, 2]
46
- "channels": 512
47
- "stacks": 3
48
-
49
- ###########################################################
50
- # DISCRIMINATOR NETWORK ARCHITECTURE SETTING #
51
- ###########################################################
52
- discriminator_type: "MelGANMultiScaleDiscriminator" # Discriminator type.
53
- discriminator_params:
54
- in_channels: 1 # Number of input channels.
55
- out_channels: 1 # Number of output channels.
56
- scales: 3 # Number of multi-scales.
57
- downsample_pooling: "AvgPool1d" # Pooling type for the input downsampling.
58
- downsample_pooling_params: # Parameters of the above pooling function.
59
- kernel_size: 4
60
- stride: 2
61
- padding: 1
62
- count_include_pad: False
63
- kernel_sizes: [5, 3] # List of kernel size.
64
- channels: 16 # Number of channels of the initial conv layer.
65
- max_downsample_channels: 1024 # Maximum number of channels of downsampling layers.
66
- downsample_scales: [4, 4, 4, 4] # List of downsampling scales.
67
- nonlinear_activation: "LeakyReLU" # Nonlinear activation function.
68
- nonlinear_activation_params: # Parameters of nonlinear activation function.
69
- negative_slope: 0.2
70
- use_weight_norm: True # Whether to use weight norm.
71
-
72
- ###########################################################
73
- # STFT LOSS SETTING #
74
- ###########################################################
75
- stft_loss_params:
76
- fft_sizes: [1024, 2048, 512] # List of FFT size for STFT-based loss.
77
- hop_sizes: [120, 240, 50] # List of hop size for STFT-based loss
78
- win_lengths: [600, 1200, 240] # List of window length for STFT-based loss.
79
- window: "hann_window" # Window function for STFT-based loss
80
-
81
- ###########################################################
82
- # ADVERSARIAL LOSS SETTING #
83
- ###########################################################
84
- use_feat_match_loss: true
85
- lambda_commit: 0.25
86
- lambda_feat_match: 25.0
87
- lambda_adv: 4.0
88
- lambda_aux_after_introduce_adv_loss: 1.0
89
-
90
- ###########################################################
91
- # DATA LOADER SETTING #
92
- ###########################################################
93
- batch_size: 16 # Batch size.
94
- batch_max_steps: 8192 # Length of each audio in batch. Make sure dividable by hop_size.
95
- pin_memory: true # Whether to pin memory in Pytorch DataLoader.
96
- num_workers: 2 # Number of workers in Pytorch DataLoader.
97
- remove_short_samples: false # Whether to remove samples the length of which are less than batch_max_steps.
98
- allow_cache: true # Whether to allow cache in dataset. If true, it requires cpu memory.
99
-
100
- ###########################################################
101
- # OPTIMIZER & SCHEDULER SETTING #
102
- ###########################################################
103
- generator_optimizer_params:
104
- lr: 0.0001 # Generator's learning rate.
105
- eps: 1.0e-6 # Generator's epsilon.
106
- weight_decay: 0.0 # Generator's weight decay coefficient.
107
- generator_scheduler_params:
108
- step_size: 5000000 # Generator's scheduler step size.
109
- gamma: 0.5 # Generator's scheduler gamma.
110
- # At each step size, lr will be multiplied by this parameter.
111
- generator_grad_norm: 10 # Generator's gradient norm.
112
- discriminator_optimizer_params:
113
- lr: 0.00005 # Discriminator's learning rate.
114
- eps: 1.0e-6 # Discriminator's epsilon.
115
- weight_decay: 0.0 # Discriminator's weight decay coefficient.
116
- discriminator_scheduler_params:
117
- step_size: 5000000 # Discriminator's scheduler step size.
118
- gamma: 0.5 # Discriminator's scheduler gamma.
119
- # At each step size, lr will be multiplied by this parameter.
120
- discriminator_grad_norm: 1 # Discriminator's gradient norm.
121
-
122
- ###########################################################
123
- # INTERVAL SETTING #
124
- ###########################################################
125
- discriminator_train_start_steps: 100000 # Number of steps to start to train discriminator.
126
- train_max_steps: 5000000 # Number of training steps.
127
- save_interval_steps: 5000 # Interval steps to save checkpoint.
128
- eval_interval_steps: 1000 # Interval steps to evaluate the network.
129
- log_interval_steps: 100 # Interval steps to record the training log.
130
-
131
- ###########################################################
132
- # OTHER SETTING #
133
- ###########################################################
134
- num_save_intermediate_results: 4 # Number of results to be saved as intermediate results.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/vctk/vq1/conf/slurm.conf DELETED
@@ -1,12 +0,0 @@
1
- # Default configuration
2
- command sbatch --export=PATH --ntasks-per-node=1
3
- option time=* --time $0
4
- option mem=* --mem-per-cpu $0
5
- option mem=0 # Do not add anything to qsub_opts
6
- option num_threads=* --cpus-per-task $0 --ntasks-per-node=1
7
- option num_threads=1 --cpus-per-task 1 --ntasks-per-node=1 # Do not add anything to qsub_opts
8
- default gpu=0
9
- option gpu=0 -p cpu
10
- option gpu=* -p gpu --gres=gpu:$0
11
- # note: the --max-jobs-run option is supported as a special case
12
- # by slurm.pl and you don't have to handle it in the config file.
 
 
 
 
 
 
 
 
 
 
 
 
 
audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/vctk/vq1/local/data_download.sh DELETED
@@ -1,37 +0,0 @@
1
- #!/bin/bash
2
-
3
- # Copyright 2020 Tomoki Hayashi
4
- # MIT License (https://opensource.org/licenses/MIT)
5
-
6
- download_dir=$1
7
-
8
- # check arguments
9
- if [ $# != 1 ]; then
10
- echo "Usage: $0 <download_dir>"
11
- exit 1
12
- fi
13
-
14
- set -euo pipefail
15
-
16
- cwd=$(pwd)
17
- if [ ! -e "${download_dir}/VCTK-Corpus" ]; then
18
- mkdir -p "${download_dir}"
19
- cd "${download_dir}" || exit 1;
20
- wget http://www.udialogue.org/download/VCTK-Corpus.tar.gz
21
- tar xvzf ./VCTK-Corpus.tar.gz
22
- rm ./VCTK-Corpus.tar.gz
23
- cd "${cwd}" || exit 1;
24
- echo "Successfully downloaded data."
25
- else
26
- echo "Already exists. Skipped."
27
- fi
28
-
29
- if [ ! -e "${download_dir}/VCTK-Corpus/lab" ]; then
30
- cd "${download_dir}" || exit 1;
31
- git clone https://github.com/kan-bayashi/VCTKCorpusFullContextLabel.git
32
- cp -r VCTKCorpusFullContextLabel/lab ./VCTK-Corpus
33
- cd "${cwd}" || exit 1;
34
- echo "Successfully downloaded label data."
35
- else
36
- echo "Already exists. Skipped."
37
- fi
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/vctk/vq1/local/data_prep.sh DELETED
@@ -1,121 +0,0 @@
1
- #!/bin/bash
2
-
3
- # Copyright 2020 Tomoki Hayashi
4
- # MIT License (https://opensource.org/licenses/MIT)
5
-
6
- # shellcheck disable=SC1091
7
- . ./path.sh || exit 1;
8
-
9
- fs=24000
10
- num_dev=10
11
- num_eval=10
12
- train_set="train_nodev"
13
- dev_set="dev"
14
- eval_set="eval"
15
- shuffle=false
16
-
17
- # shellcheck disable=SC1091
18
- . utils/parse_options.sh || exit 1;
19
-
20
- db_root=$1
21
- spk=$2
22
- data_dir=$3
23
-
24
- # check arguments
25
- if [ $# != 3 ]; then
26
- echo "Usage: $0 [Options] <db_root> <spk> <data_dir>"
27
- echo "e.g.: $0 downloads/VCTK-Corpus p225 data"
28
- echo ""
29
- echo "Options:"
30
- echo " --fs: sampling frequency (default=24000)."
31
- echo " --num_dev: number of development uttreances (default=10)."
32
- echo " --num_eval: number of evaluation uttreances (default=10)."
33
- echo " --train_set: name of train set (default=train_nodev)."
34
- echo " --dev_set: name of dev set (default=dev)."
35
- echo " --eval_set: name of eval set (default=eval)."
36
- echo " --shuffle: whether to perform shuffle in making dev / eval set (default=false)."
37
- exit 1
38
- fi
39
-
40
- set -euo pipefail
41
-
42
- # check spk existence
43
- [ ! -e "${db_root}/lab/mono/${spk}" ] && \
44
- echo "${spk} does not exist." >&2 && exit 1;
45
-
46
- [ ! -e "${data_dir}/all" ] && mkdir -p "${data_dir}/all"
47
-
48
- # set filenames
49
- scp="${data_dir}/all/wav.scp"
50
- segments="${data_dir}/all/segments"
51
- utt2spk="${data_dir}/all/utt2spk"
52
-
53
- # check file existence
54
- [ -e "${scp}" ] && rm "${scp}"
55
- [ -e "${segments}" ] && rm "${segments}"
56
- [ -e "${utt2spk}" ] && rm "${utt2spk}"
57
-
58
- # make scp, utt2spk, and segments
59
- find "${db_root}/wav48/${spk}" -follow -name "*.wav" | sort | while read -r wav; do
60
- id=$(basename "${wav}" | sed -e "s/\.[^\.]*$//g")
61
- lab=${db_root}/lab/mono/${spk}/${id}.lab
62
-
63
- # check lab existence
64
- if [ ! -e "${lab}" ]; then
65
- echo "${id} has not label file. skipped."
66
- continue
67
- fi
68
-
69
- echo "${id} cat ${wav} | sox -t wav - -c 1 -b 16 -t wav - rate ${fs} |" >> "${scp}"
70
- echo "${id} ${spk}" >> "${utt2spk}"
71
-
72
- # parse start and end time from HTS-style mono label
73
- idx=1
74
- while true; do
75
- next_idx=$((idx+1))
76
- next_symbol=$(sed -n "${next_idx}p" "${lab}" | awk '{print $3}')
77
- if [ "${next_symbol}" != "pau" ]; then
78
- start_nsec=$(sed -n "${idx}p" "${lab}" | awk '{print $2}')
79
- break
80
- fi
81
- idx=${next_idx}
82
- done
83
- idx=$(wc -l < "${lab}")
84
- while true; do
85
- prev_idx=$((idx-1))
86
- prev_symbol=$(sed -n "${prev_idx}p" "${lab}" | awk '{print $3}')
87
- if [ "${prev_symbol}" != "pau" ]; then
88
- end_nsec=$(sed -n "${idx}p" "${lab}" | awk '{print $1}')
89
- break
90
- fi
91
- idx=${prev_idx}
92
- done
93
- start_sec=$(echo "${start_nsec}*0.0000001" | bc | sed "s/^\./0./")
94
- end_sec=$(echo "${end_nsec}*0.0000001" | bc | sed "s/^\./0./")
95
- echo "${id} ${id} ${start_sec} ${end_sec}" >> "${segments}"
96
- done
97
-
98
- # split
99
- num_all=$(wc -l < "${scp}")
100
- num_deveval=$((num_dev + num_eval))
101
- num_train=$((num_all - num_deveval))
102
- utils/split_data.sh \
103
- --num_first "${num_train}" \
104
- --num_second "${num_deveval}" \
105
- --shuffle "${shuffle}" \
106
- "${data_dir}/all" \
107
- "${data_dir}/${train_set}" \
108
- "${data_dir}/deveval"
109
- utils/split_data.sh \
110
- --num_first "${num_dev}" \
111
- --num_second "${num_eval}" \
112
- --shuffle "${shuffle}" \
113
- "${data_dir}/deveval" \
114
- "${data_dir}/${dev_set}" \
115
- "${data_dir}/${eval_set}"
116
-
117
- # remove tmp directories
118
- rm -rf "${data_dir}/all"
119
- rm -rf "${data_dir}/deveval"
120
-
121
- echo "Successfully prepared data."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/vctk/vq1/local/data_prep_2mix.sh DELETED
@@ -1,54 +0,0 @@
1
- #!/bin/bash
2
-
3
- # Copyright 2020 Tomoki Hayashi
4
- # MIT License (https://opensource.org/licenses/MIT)
5
-
6
- # shellcheck disable=SC1091
7
- . ./path.sh || exit 1;
8
-
9
- # shellcheck disable=SC1091
10
- . utils/parse_options.sh || exit 1;
11
-
12
- db_root=$1
13
- data_dir_root=$2
14
-
15
- # check arguments
16
- if [ $# != 2 ]; then
17
- echo "Usage: $0 <db_root> <data_dir>"
18
- echo "e.g.: $0 downloads/VCTK-Corpus data"
19
- exit 1
20
- fi
21
-
22
- set -euo pipefail
23
-
24
- for mix_type in min max; do
25
- for dset in tr tt cv; do
26
- for src_spk in s1 s2; do
27
- echo "${mix_type}_${dset}_${src_spk}"
28
- # set filenames
29
- data_dir=${data_dir_root}/${mix_type}_${dset}_${src_spk}
30
- scp="${data_dir}/wav.scp"
31
- utt2spk="${data_dir}/utt2spk"
32
-
33
- # check file existence
34
- [ ! -e "${data_dir}" ] && mkdir -p "${data_dir}"
35
- [ -e "${scp}" ] && rm "${scp}"
36
- [ -e "${utt2spk}" ] && rm "${utt2spk}"
37
-
38
- # make scp, utt2spk, and segments
39
- find "${db_root}/${mix_type}/${dset}/${src_spk}" -follow -name "*.wav" | sort | while read -r wav; do
40
- id=$(basename "${wav}" | sed -e "s/\.[^\.]*$//g")
41
- if [ ${src_spk} = "s1" ]; then
42
- spk=$(echo "${id}" | cut -f 1 -d "_")
43
- else
44
- spk=$(echo "${id}" | cut -f 4 -d "_")
45
- fi
46
- echo "${id} ${wav}" >> "${scp}"
47
- echo "${id} ${spk}" >> "${utt2spk}"
48
- done
49
- done
50
- done
51
- done
52
-
53
-
54
- echo "Successfully prepared data."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/vctk/vq1/local/decode_from_text.py DELETED
@@ -1,174 +0,0 @@
1
- #!/usr/bin/env python3
2
- # -*- coding: utf-8 -*-
3
-
4
- # Copyright 2019 Tomoki Hayashi
5
- # MIT License (https://opensource.org/licenses/MIT)
6
-
7
- """Decode text with trained VQ-VAE Generator or discrete symbol vocoder."""
8
-
9
- import argparse
10
- import logging
11
- import os
12
- import time
13
-
14
- import parallel_wavegan.models
15
- import soundfile as sf
16
- import torch
17
- import yaml
18
- from parallel_wavegan.utils import load_model
19
- from tqdm import tqdm
20
-
21
-
22
- def main():
23
- """Run decoding process."""
24
- parser = argparse.ArgumentParser(
25
- description=(
26
- "Decode text with trained VQ-VAE decoder "
27
- "(See detail in parallel_wavegan/bin/decode.py)."
28
- )
29
- )
30
- parser.add_argument(
31
- "--text",
32
- required=True,
33
- type=str,
34
- help="kaldi-style text file.",
35
- )
36
- parser.add_argument(
37
- "--utt2spk",
38
- default=None,
39
- type=str,
40
- help="kaldi-style utt2spk file.",
41
- )
42
- parser.add_argument(
43
- "--spk2idx",
44
- default=None,
45
- type=str,
46
- help="kaldi-style spk2idx file.",
47
- )
48
- parser.add_argument(
49
- "--outdir",
50
- type=str,
51
- required=True,
52
- help="directory to save generated speech.",
53
- )
54
- parser.add_argument(
55
- "--checkpoint",
56
- type=str,
57
- required=True,
58
- help="checkpoint file to be loaded.",
59
- )
60
- parser.add_argument(
61
- "--config",
62
- default=None,
63
- type=str,
64
- help=(
65
- "yaml format configuration file. if not explicitly provided, "
66
- "it will be searched in the checkpoint directory. (default=None)"
67
- ),
68
- )
69
- parser.add_argument(
70
- "--verbose",
71
- type=int,
72
- default=1,
73
- help="logging level. higher is more logging. (default=1)",
74
- )
75
- args = parser.parse_args()
76
-
77
- # set logger
78
- if args.verbose > 1:
79
- logging.basicConfig(
80
- level=logging.DEBUG,
81
- format="%(asctime)s (%(module)s:%(lineno)d) %(levelname)s: %(message)s",
82
- )
83
- elif args.verbose > 0:
84
- logging.basicConfig(
85
- level=logging.INFO,
86
- format="%(asctime)s (%(module)s:%(lineno)d) %(levelname)s: %(message)s",
87
- )
88
- else:
89
- logging.basicConfig(
90
- level=logging.WARN,
91
- format="%(asctime)s (%(module)s:%(lineno)d) %(levelname)s: %(message)s",
92
- )
93
- logging.warning("Skip DEBUG/INFO messages")
94
-
95
- # check directory existence
96
- if not os.path.exists(args.outdir):
97
- os.makedirs(args.outdir)
98
-
99
- # load config
100
- if args.config is None:
101
- dirname = os.path.dirname(args.checkpoint)
102
- args.config = os.path.join(dirname, "config.yml")
103
- with open(args.config) as f:
104
- config = yaml.load(f, Loader=yaml.Loader)
105
- config.update(vars(args))
106
-
107
- # setup model
108
- if torch.cuda.is_available():
109
- device = torch.device("cuda")
110
- else:
111
- device = torch.device("cpu")
112
- model = load_model(args.checkpoint, config)
113
- logging.info(f"Loaded model parameters from {args.checkpoint}.")
114
- model.remove_weight_norm()
115
- model = model.eval().to(device)
116
- is_vqvae = isinstance(model, parallel_wavegan.models.VQVAE)
117
-
118
- # setup dataset
119
- with open(args.text) as f:
120
- lines = [l_.replace("\n", "") for l_ in f.readlines()]
121
- text = {l_.split()[0]: list(map(int, l_.split()[1:])) for l_ in lines}
122
-
123
- utt2spk = None
124
- if args.utt2spk is not None:
125
- assert args.spk2idx is not None
126
- with open(args.utt2spk) as f:
127
- lines = [l_.replace("\n", "") for l_ in f.readlines()]
128
- utt2spk = {l_.split()[0]: str(l_.split()[1]) for l_ in lines}
129
- with open(args.spk2idx) as f:
130
- lines = [l_.replace("\n", "") for l_ in f.readlines()]
131
- spk2idx = {l_.split()[0]: int(l_.split()[1]) for l_ in lines}
132
-
133
- # start generation
134
- total_rtf = 0.0
135
- with torch.no_grad(), tqdm(text.items(), desc="[decode]") as pbar:
136
- for idx, items in enumerate(pbar, 1):
137
- utt_id, indices = items
138
- z = torch.LongTensor(indices).view(1, -1).to(device)
139
- g = None
140
- if utt2spk is not None:
141
- spk_idx = spk2idx[utt2spk[utt_id]]
142
- g = torch.tensor(spk_idx).long().view(1).to(device)
143
- if is_vqvae:
144
- # VQVAE case
145
- start = time.time()
146
- y = model.decode(z, None, g).view(-1).cpu().numpy()
147
- rtf = (time.time() - start) / (len(y) / config["sampling_rate"])
148
- pbar.set_postfix({"RTF": rtf})
149
- total_rtf += rtf
150
- else:
151
- # Discrete symbol vocoder case
152
- start = time.time()
153
- g = int(g.item()) if g is not None else None
154
- y = model.inference(z.view(-1, 1), g=g).view(-1).cpu().numpy()
155
- rtf = (time.time() - start) / (len(y) / config["sampling_rate"])
156
- pbar.set_postfix({"RTF": rtf})
157
- total_rtf += rtf
158
-
159
- # save as PCM 16 bit wav file
160
- sf.write(
161
- os.path.join(config["outdir"], f"{utt_id}_gen.wav"),
162
- y,
163
- config["sampling_rate"],
164
- "PCM_16",
165
- )
166
-
167
- # report average RTF
168
- logging.info(
169
- f"Finished generation of {idx} utterances (RTF = {total_rtf / idx:.03f})."
170
- )
171
-
172
-
173
- if __name__ == "__main__":
174
- main()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/vctk/vq1/local/setup_for_vc.py DELETED
@@ -1,222 +0,0 @@
1
- #!/usr/bin/env python3
2
- # -*- coding: utf-8 -*-
3
-
4
- # Copyright 2020 Tomoki Hayashi
5
- # MIT License (https://opensource.org/licenses/MIT)
6
-
7
- """Setup features for voice conversion."""
8
-
9
- import argparse
10
- import logging
11
- import os
12
-
13
- import numpy as np
14
- import yaml
15
- from parallel_wavegan.datasets import AudioDataset
16
- from parallel_wavegan.utils import read_hdf5, write_hdf5
17
- from tqdm import tqdm
18
-
19
-
20
- def main():
21
- """Run preprocessing process."""
22
- parser = argparse.ArgumentParser(
23
- description=(
24
- "Normalize dumped raw features (See detail in"
25
- " parallel_wavegan/bin/normalize.py)."
26
- )
27
- )
28
- parser.add_argument(
29
- "--rootdir",
30
- default=None,
31
- type=str,
32
- help=(
33
- "directory including feature files to be normalized. "
34
- "you need to specify either feats-scp or rootdir."
35
- ),
36
- )
37
- parser.add_argument(
38
- "--feats-scp",
39
- default=None,
40
- type=str,
41
- help=(
42
- "kaldi-style feats.scp file. "
43
- "you need to specify either feats-scp or rootdir."
44
- ),
45
- )
46
- parser.add_argument(
47
- "--dumpdir", type=str, required=True, help="directory to dump feature files."
48
- )
49
- parser.add_argument(
50
- "--statdir",
51
- type=str,
52
- default=None,
53
- help="direcotry including statistics files.",
54
- )
55
- parser.add_argument(
56
- "--utt2spk", default=None, type=str, help="kaldi-style utt2spk file."
57
- )
58
- parser.add_argument(
59
- "--spk2idx", default=None, type=str, help="kaldi-style spk2idx file."
60
- )
61
- parser.add_argument(
62
- "--config", type=str, required=True, help="yaml format configuration file."
63
- )
64
- parser.add_argument(
65
- "--verbose",
66
- type=int,
67
- default=1,
68
- help="logging level. higher is more logging. (default=1)",
69
- )
70
- args = parser.parse_args()
71
-
72
- # set logger
73
- if args.verbose > 1:
74
- logging.basicConfig(
75
- level=logging.DEBUG,
76
- format="%(asctime)s (%(module)s:%(lineno)d) %(levelname)s: %(message)s",
77
- )
78
- elif args.verbose > 0:
79
- logging.basicConfig(
80
- level=logging.INFO,
81
- format="%(asctime)s (%(module)s:%(lineno)d) %(levelname)s: %(message)s",
82
- )
83
- else:
84
- logging.basicConfig(
85
- level=logging.WARN,
86
- format="%(asctime)s (%(module)s:%(lineno)d) %(levelname)s: %(message)s",
87
- )
88
- logging.warning("Skip DEBUG/INFO messages")
89
-
90
- # load config
91
- with open(args.config) as f:
92
- config = yaml.load(f, Loader=yaml.Loader)
93
- config.update(vars(args))
94
-
95
- # check arguments
96
- if (args.feats_scp is not None and args.rootdir is not None) or (
97
- args.feats_scp is None and args.rootdir is None
98
- ):
99
- raise ValueError("Please specify either --rootdir or --feats-scp.")
100
-
101
- # check directory existence
102
- if not os.path.exists(args.dumpdir):
103
- os.makedirs(args.dumpdir)
104
-
105
- # load utt2spk and spk2idx
106
- with open(args.utt2spk) as f:
107
- lines = [l_.replace("\n", "") for l_ in f.readlines()]
108
- utt2spk = {l_.split()[0]: l_.split()[1] for l_ in lines}
109
- with open(args.spk2idx) as f:
110
- lines = [l_.replace("\n", "") for l_ in f.readlines()]
111
- spk2idx = {l_.split()[0]: int(l_.split()[1]) for l_ in lines}
112
- spks = list(spk2idx.keys())
113
-
114
- # get dataset
115
- if args.rootdir is not None:
116
- local_query = None
117
- local_load_fn = None
118
- if config["format"] == "hdf5":
119
- audio_query = "*.h5"
120
- audio_load_fn = lambda x: read_hdf5(x, "wave") # NOQA
121
- if config.get("use_local_condition", False):
122
- local_query = "*.h5"
123
- local_load_fn = lambda x: read_hdf5(x, "local") # NOQA
124
- elif config["format"] == "npy":
125
- audio_query = "*-wave.npy"
126
- audio_load_fn = np.load
127
- if config.get("use_local_condition", False):
128
- local_query = "*-local.npy"
129
- local_load_fn = np.load
130
- else:
131
- raise ValueError("support only hdf5 or npy format.")
132
- dataset = AudioDataset(
133
- root_dir=args.rootdir,
134
- audio_query=audio_query,
135
- audio_load_fn=audio_load_fn,
136
- local_query=local_query,
137
- local_load_fn=local_load_fn,
138
- return_utt_id=True,
139
- )
140
- else:
141
- raise NotImplementedError("Not supported.")
142
- logging.info(f"The number of files = {len(dataset)}.")
143
-
144
- # load statistics
145
- if config.get("use_local_condition", False):
146
- spk2lf0avg = {}
147
- for spk in spks:
148
- # FIXME: it is better to remove this hard coding
149
- if config["format"] == "hdf5":
150
- lf0avg = read_hdf5(f"{args.statdir}/stats.h5", f"{spk}/mean")[0]
151
- elif config["format"] == "npy":
152
- lf0avg = np.load(f"{args.statdir}/stats-${spk}.h5")[0][0]
153
- else:
154
- raise ValueError("support only hdf5 or npy format.")
155
- spk2lf0avg[spk] = lf0avg
156
-
157
- # process each file
158
- for items in tqdm(dataset):
159
- if config.get("use_local_condition", False):
160
- utt_id, audio, l_ = items
161
- else:
162
- utt_id, audio = items
163
- source_spk = utt2spk[utt_id]
164
-
165
- # replace global and adjust f0 range
166
- for target_spk in spks:
167
- if target_spk == source_spk:
168
- continue
169
-
170
- # adjust f0 range
171
- if config.get("use_local_condition", False):
172
- l_ = l_.copy()
173
- target_lf0avg = spk2lf0avg[target_spk]
174
- source_lf0avg = spk2lf0avg[source_spk]
175
- l_[:, 0] = l_[:, 0] + target_lf0avg - source_lf0avg
176
-
177
- # get global
178
- g = np.array(spk2idx[target_spk])
179
-
180
- # save
181
- if config["format"] == "hdf5":
182
- write_hdf5(
183
- os.path.join(args.dumpdir, f"{utt_id}_to_{target_spk}.h5"),
184
- "wave",
185
- audio.astype(np.float32),
186
- )
187
- write_hdf5(
188
- os.path.join(args.dumpdir, f"{utt_id}_to_{target_spk}.h5"),
189
- "global",
190
- g.reshape(-1),
191
- )
192
- if config.get("use_local_condition", False):
193
- write_hdf5(
194
- os.path.join(args.dumpdir, f"{utt_id}_to_{target_spk}.h5"),
195
- "local",
196
- l_.astype(np.float32),
197
- )
198
- elif config["format"] == "npy":
199
- np.save(
200
- os.path.join(args.dumpdir, f"{utt_id}_to_{target_spk}-wave.npy"),
201
- audio.astype(np.float32),
202
- allow_pickle=False,
203
- )
204
- np.save(
205
- os.path.join(args.dumpdir, f"{utt_id}_to_{target_spk}-global.npy"),
206
- g.reshape(-1),
207
- allow_pickle=False,
208
- )
209
- if config.get("use_local_condition", False):
210
- np.save(
211
- os.path.join(
212
- args.dumpdir, f"{utt_id}_to_{target_spk}-local.npy"
213
- ),
214
- l_.astype(np.float32),
215
- allow_pickle=False,
216
- )
217
- else:
218
- raise ValueError("support only hdf5 or npy format.")
219
-
220
-
221
- if __name__ == "__main__":
222
- main()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/vctk/vq1/path.sh DELETED
@@ -1,33 +0,0 @@
1
- # cuda related
2
- export CUDA_HOME=/usr/local/cuda-11.3
3
- export LD_LIBRARY_PATH="${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}"
4
-
5
- # path related
6
- export PRJ_ROOT="${PWD}/../../.."
7
- if [ -e "${PRJ_ROOT}/tools/venv/bin/activate" ]; then
8
- # shellcheck disable=SC1090
9
- . "${PRJ_ROOT}/tools/venv/bin/activate"
10
- fi
11
-
12
- # python related
13
- export OMP_NUM_THREADS=1
14
- export PYTHONIOENCODING=UTF-8
15
- export MPL_BACKEND=Agg
16
-
17
- # check installation
18
- if ! command -v parallel-wavegan-train > /dev/null; then
19
- echo "Error: It seems setup is not finished." >&2
20
- echo "Error: Please setup your environment by following README.md" >&2
21
- return 1
22
- fi
23
- if ! command -v jq > /dev/null; then
24
- echo "Error: It seems jq is not installed." >&2
25
- echo "Error: Please install via \`sudo apt-get install jq\`." >&2
26
- echo "Error: If you do not have sudo, please download from https://stedolan.github.io/jq/download/." >&2
27
- return 1
28
- fi
29
- if ! command -v yq > /dev/null; then
30
- echo "Error: It seems yq is not installed." >&2
31
- echo "Error: Please install via \`pip install yq\`." >&2
32
- return 1
33
- fi
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/vctk/vq1/run.sh DELETED
@@ -1,295 +0,0 @@
1
- #!/bin/bash
2
-
3
- # Copyright 2020 Tomoki Hayashi
4
- # MIT License (https://opensource.org/licenses/MIT)
5
-
6
- . ./cmd.sh || exit 1;
7
- . ./path.sh || exit 1;
8
-
9
- # basic settings
10
- stage=-1 # stage to start
11
- stop_stage=100 # stage to stop
12
- verbose=1 # verbosity level (lower is less info)
13
- n_gpus=1 # number of gpus in training
14
- n_jobs=16 # number of parallel jobs in feature extraction
15
-
16
- # NOTE(kan-bayashi): renamed to conf to avoid conflict in parse_options.sh
17
- conf=conf/conditioned_melgan_vae.v3.yaml
18
-
19
- # speaker setting
20
- spks="all" # all or you can choose speakers e.g., "p225 p226 p227 ..."
21
-
22
- # directory path setting
23
- download_dir=downloads # directory to save database
24
- dumpdir=dump # directory to dump features
25
-
26
- # training related setting
27
- tag="" # tag for directory to save model
28
- resume="" # checkpoint path to resume training
29
- # (e.g. <path>/<to>/checkpoint-10000steps.pkl)
30
-
31
- # decoding related setting
32
- checkpoint="" # checkpoint path to be used for decoding
33
- # if not provided, the latest one will be used
34
- # (e.g. <path>/<to>/checkpoint-400000steps.pkl)
35
-
36
- # shellcheck disable=SC1091
37
- . utils/parse_options.sh || exit 1;
38
-
39
- train_set="train_nodev_$(echo "${spks}" | tr " " "_")" # name of training data directory
40
- dev_set="dev_$(echo "${spks}" | tr " " "_")" # name of development data directory
41
- eval_set="eval_$(echo "${spks}" | tr " " "_")" # name of evaluation data directory
42
-
43
- set -euo pipefail
44
-
45
- if [ "${stage}" -le -1 ] && [ "${stop_stage}" -ge -1 ]; then
46
- echo "Stage -1: Data download"
47
- local/data_download.sh "${download_dir}"
48
- fi
49
-
50
- if [ "${stage}" -le 0 ] && [ "${stop_stage}" -ge 0 ]; then
51
- echo "Stage 0: Data preparation"
52
- train_data_dirs=""
53
- dev_data_dirs=""
54
- eval_data_dirs=""
55
- # if set to "all", use all of the speakers in the corpus
56
- if [ "${spks}" = "all" ]; then
57
- # NOTE(kan-bayashi): p315 will not be used since it lacks txt data
58
- spks=$(find "${download_dir}/VCTK-Corpus/wav48" \
59
- -maxdepth 1 -name "p*" -exec basename {} \; | sort | grep -v p315)
60
- fi
61
- for spk in ${spks}; do
62
- local/data_prep.sh \
63
- --fs "$(yq ".sampling_rate" "${conf}")" \
64
- --train_set "train_nodev_${spk}" \
65
- --dev_set "dev_${spk}" \
66
- --eval_set "eval_${spk}" \
67
- "${download_dir}/VCTK-Corpus" "${spk}" data
68
- train_data_dirs+=" data/train_nodev_${spk}"
69
- dev_data_dirs+=" data/dev_${spk}"
70
- eval_data_dirs+=" data/eval_${spk}"
71
- done
72
- # shellcheck disable=SC2086
73
- utils/combine_data.sh "data/${train_set}" ${train_data_dirs}
74
- # shellcheck disable=SC2086
75
- utils/combine_data.sh "data/${dev_set}" ${dev_data_dirs}
76
- # shellcheck disable=SC2086
77
- utils/combine_data.sh "data/${eval_set}" ${eval_data_dirs}
78
-
79
- # make spk2idx
80
- cut -f 2 -d " " "data/${train_set}/utt2spk" | sort | uniq | \
81
- awk '{print $1 " " NR -1}' > "data/${train_set}/spk2idx"
82
- fi
83
-
84
- stats_ext=$(grep -q "hdf5" <(yq ".format" "${conf}") && echo "h5" || echo "npy")
85
- if [ "${stage}" -le 1 ] && [ "${stop_stage}" -ge 1 ]; then
86
- echo "Stage 1: Feature extraction"
87
- # extract raw features
88
- pids=()
89
- for name in "${train_set}" "${dev_set}" "${eval_set}"; do
90
- (
91
- [ ! -e "${dumpdir}/${name}/raw" ] && mkdir -p "${dumpdir}/${name}/raw"
92
- echo "Feature extraction start. See the progress via ${dumpdir}/${name}/raw/preprocessing.*.log."
93
- utils/make_subset_data.sh "data/${name}" "${n_jobs}" "${dumpdir}/${name}/raw"
94
- if [ "$(yq ".use_local_condition" "${conf}")" = "true" ]; then
95
- opts="--extract-f0 --skip-mel-ext"
96
- else
97
- opts="--skip-mel-ext"
98
- fi
99
- ${train_cmd} JOB=1:${n_jobs} "${dumpdir}/${name}/raw/preprocessing.JOB.log" \
100
- parallel-wavegan-preprocess \
101
- --config "${conf}" \
102
- --scp "${dumpdir}/${name}/raw/wav.JOB.scp" \
103
- --segments "${dumpdir}/${name}/raw/segments.JOB" \
104
- --utt2spk "${dumpdir}/${name}/raw/utt2spk.JOB" \
105
- --spk2idx "data/${train_set}/spk2idx" \
106
- --dumpdir "${dumpdir}/${name}/raw/dump.JOB" \
107
- --verbose "${verbose}" \
108
- ${opts}
109
- echo "Successfully finished feature extraction of ${name} set."
110
- ) &
111
- pids+=($!)
112
- done
113
- i=0; for pid in "${pids[@]}"; do wait "${pid}" || ((++i)); done
114
- [ "${i}" -gt 0 ] && echo "$0: ${i} background jobs are failed." && exit 1;
115
- echo "Successfully finished feature extraction."
116
-
117
- if [ "$(yq ".use_local_condition" "${conf}")" = "true" ]; then
118
- # calculate statistics for normalization
119
- echo "Statistics computation start. See the progress via ${dumpdir}/${train_set}/compute_statistics.log."
120
- ${train_cmd} "${dumpdir}/${train_set}/compute_statistics.log" \
121
- parallel-wavegan-compute-statistics \
122
- --config "${conf}" \
123
- --rootdir "${dumpdir}/${train_set}/raw" \
124
- --dumpdir "${dumpdir}/${train_set}" \
125
- --target-feats "local" \
126
- --verbose "${verbose}"
127
- echo "Successfully finished calculation of statistics."
128
-
129
- # normalize and dump them
130
- pids=()
131
- for name in "${train_set}" "${dev_set}" "${eval_set}"; do
132
- (
133
- [ ! -e "${dumpdir}/${name}/norm" ] && mkdir -p "${dumpdir}/${name}/norm"
134
- echo "Nomalization start. See the progress via ${dumpdir}/${name}/norm/normalize.*.log."
135
- ${train_cmd} JOB=1:${n_jobs} "${dumpdir}/${name}/norm/normalize.JOB.log" \
136
- parallel-wavegan-normalize \
137
- --config "${conf}" \
138
- --stats "${dumpdir}/${train_set}/stats.${stats_ext}" \
139
- --rootdir "${dumpdir}/${name}/raw/dump.JOB" \
140
- --dumpdir "${dumpdir}/${name}/norm/dump.JOB" \
141
- --target-feats "local" \
142
- --verbose "${verbose}"
143
- echo "Successfully finished normalization of ${name} set."
144
- ) &
145
- pids+=($!)
146
- done
147
- i=0; for pid in "${pids[@]}"; do wait "${pid}" || ((++i)); done
148
- [ "${i}" -gt 0 ] && echo "$0: ${i} background jobs are failed." && exit 1;
149
- echo "Successfully finished normalization."
150
- fi
151
- fi
152
-
153
- if [ -z "${tag}" ]; then
154
- expdir="exp/${train_set}_vctk_$(basename "${conf}" .yaml)"
155
- else
156
- expdir="exp/${train_set}_vctk_${tag}"
157
- fi
158
- if [ "${stage}" -le 2 ] && [ "${stop_stage}" -ge 2 ]; then
159
- echo "Stage 2: Network training"
160
- [ ! -e "${expdir}" ] && mkdir -p "${expdir}"
161
- if [ "${n_gpus}" -gt 1 ]; then
162
- train="python -m parallel_wavegan.distributed.launch --nproc_per_node ${n_gpus} -c parallel-wavegan-train"
163
- else
164
- train="parallel-wavegan-train"
165
- fi
166
- if [ "$(yq ".use_local_condition" "${conf}")" = "true" ]; then
167
- cp "${dumpdir}/${train_set}/stats.${stats_ext}" "${expdir}"
168
- train_dumpdir="${dumpdir}/${train_set}/norm"
169
- dev_dumpdir="${dumpdir}/${dev_set}/norm"
170
- else
171
- train_dumpdir="${dumpdir}/${train_set}/raw"
172
- dev_dumpdir="${dumpdir}/${dev_set}/raw"
173
- fi
174
- echo "Training start. See the progress via ${expdir}/train.log."
175
- ${cuda_cmd} --gpu "${n_gpus}" "${expdir}/train.log" \
176
- ${train} \
177
- --config "${conf}" \
178
- --train-dumpdir "${train_dumpdir}" \
179
- --dev-dumpdir "${dev_dumpdir}" \
180
- --outdir "${expdir}" \
181
- --resume "${resume}" \
182
- --verbose "${verbose}"
183
- echo "Successfully finished training."
184
- fi
185
-
186
- if [ "${stage}" -le 3 ] && [ "${stop_stage}" -ge 3 ]; then
187
- echo "Stage 3: Network decoding"
188
- # shellcheck disable=SC2012
189
- [ -z "${checkpoint}" ] && checkpoint="$(ls -dt "${expdir}"/*.pkl | head -1 || true)"
190
- outdir="${expdir}/wav/$(basename "${checkpoint}" .pkl)"
191
- pids=()
192
- for name in "${dev_set}" "${eval_set}"; do
193
- (
194
- [ ! -e "${outdir}/${name}" ] && mkdir -p "${outdir}/${name}"
195
- # shellcheck disable=SC2030,SC2031
196
- [ "${n_gpus}" -gt 1 ] && n_gpus=1
197
- echo "Decoding start. See the progress via ${outdir}/${name}/decode.log."
198
- if [ "$(yq ".use_local_condition" "${conf}")" = "true" ]; then
199
- decode_dumpdir="${dumpdir}/${name}/norm"
200
- else
201
- decode_dumpdir="${dumpdir}/${name}/raw"
202
- fi
203
- ${cuda_cmd} --gpu "${n_gpus}" "${outdir}/${name}/decode.log" \
204
- parallel-wavegan-decode \
205
- --dumpdir "${decode_dumpdir}" \
206
- --checkpoint "${checkpoint}" \
207
- --outdir "${outdir}/${name}" \
208
- --verbose "${verbose}"
209
- echo "Successfully finished decoding of ${name} set."
210
- ) &
211
- pids+=($!)
212
- done
213
- i=0; for pid in "${pids[@]}"; do wait "${pid}" || ((++i)); done
214
- [ "${i}" -gt 0 ] && echo "$0: ${i} background jobs are failed." && exit 1;
215
- echo "Successfully finished decoding."
216
- fi
217
-
218
- if [ "${stage}" -le 4 ] && [ "${stop_stage}" -ge 4 ]; then
219
- echo "Stage 4: Voice conversion preparation"
220
- if [ "$(yq ".use_local_condition" "${conf}")" = "true" ]; then
221
- # calculate each speaker statistics for f0 transformation
222
- echo "Statistics computation start. See the progress via ${dumpdir}/${train_set}/compute_statistics_for_vc.log."
223
- ${train_cmd} "${dumpdir}/${train_set}/compute_statistics_for_vc.log" \
224
- parallel-wavegan-compute-statistics \
225
- --config "${conf}" \
226
- --rootdir "${dumpdir}/${train_set}/norm" \
227
- --dumpdir "${dumpdir}/${train_set}" \
228
- --target-feats "local" \
229
- --utt2spk "data/${train_set}/utt2spk" \
230
- --verbose "${verbose}"
231
- echo "Successfully finished calculation of statistics."
232
- fi
233
-
234
- pids=()
235
- for name in "${dev_set}" "${eval_set}"; do
236
- (
237
- if [ "$(yq ".use_local_condition" "${conf}")" = "true" ]; then
238
- vc_rootdir="${dumpdir}/${name}/norm"
239
- vc_dumpdir="${dumpdir}/${name}/norm_vc"
240
- else
241
- vc_rootdir="${dumpdir}/${name}/raw"
242
- vc_dumpdir="${dumpdir}/${name}/raw_vc"
243
- fi
244
- echo "Setup for voice conversion start. See the progress via ${vc_dumpdir}/setup_for_vc.*.log."
245
- [ ! -e "${vc_dumpdir}" ] && mkdir -p "${vc_dumpdir}"
246
- ${train_cmd} JOB=1:${n_jobs} "${vc_dumpdir}/setup_for_vc.JOB.log" \
247
- local/setup_for_vc.py \
248
- --config "${conf}" \
249
- --rootdir "${vc_rootdir}/dump.JOB" \
250
- --dumpdir "${vc_dumpdir}/dump.JOB" \
251
- --statdir "${dumpdir}/${train_set}" \
252
- --utt2spk "data/${name}/utt2spk" \
253
- --spk2idx "data/${train_set}/spk2idx" \
254
- --verbose "${verbose}"
255
- echo "Successfully finished steup of ${name} set for voice conversion."
256
- ) &
257
- pids+=($!)
258
- done
259
- i=0; for pid in "${pids[@]}"; do wait "${pid}" || ((++i)); done
260
- [ "${i}" -gt 0 ] && echo "$0: ${i} background jobs are failed." && exit 1;
261
- echo "Successfully finished setup for voice conversion."
262
- fi
263
-
264
- if [ "${stage}" -le 5 ] && [ "${stop_stage}" -ge 5 ]; then
265
- echo "Stage 5: Network decoding for voice conversion"
266
- # shellcheck disable=SC2012
267
- [ -z "${checkpoint}" ] && checkpoint="$(ls -dt "${expdir}"/*.pkl | head -1 || true)"
268
- outdir="${expdir}/wav/$(basename "${checkpoint}" .pkl)"
269
- pids=()
270
- for name in "${dev_set}" "${eval_set}"; do
271
- (
272
- [ ! -e "${outdir}/${name}" ] && mkdir -p "${outdir}/${name}"
273
- # shellcheck disable=SC2030,SC2031
274
- [ "${n_gpus}" -gt 1 ] && n_gpus=1
275
- echo "Decoding start. See the progress via ${outdir}/${name}/decode_vc.log."
276
- if [ "$(yq ".use_local_condition" "${conf}")" = "true" ]; then
277
- vc_decode_dumpdir="${dumpdir}/${name}/norm_vc"
278
- else
279
- vc_decode_dumpdir="${dumpdir}/${name}/raw_vc"
280
- fi
281
- ${cuda_cmd} JOB=1:${n_jobs} --max-jobs-run 1 --gpu "${n_gpus}" "${outdir}/${name}/decode_vc.JOB.log" \
282
- parallel-wavegan-decode \
283
- --dumpdir "${vc_decode_dumpdir}/dump.JOB" \
284
- --checkpoint "${checkpoint}" \
285
- --outdir "${outdir}/${name}/wav.JOB" \
286
- --verbose "${verbose}"
287
- echo "Successfully finished decoding of ${name} set for voice conversion."
288
- ) &
289
- pids+=($!)
290
- done
291
- i=0; for pid in "${pids[@]}"; do wait "${pid}" || ((++i)); done
292
- [ "${i}" -gt 0 ] && echo "$0: ${i} background jobs are failed." && exit 1;
293
- echo "Successfully finished decoding for voice conversion."
294
- fi
295
- echo "Finished."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/yesno/voc1/cmd.sh DELETED
@@ -1,91 +0,0 @@
1
- # ====== About run.pl, queue.pl, slurm.pl, and ssh.pl ======
2
- # Usage: <cmd>.pl [options] JOB=1:<nj> <log> <command...>
3
- # e.g.
4
- # run.pl --mem 4G JOB=1:10 echo.JOB.log echo JOB
5
- #
6
- # Options:
7
- # --time <time>: Limit the maximum time to execute.
8
- # --mem <mem>: Limit the maximum memory usage.
9
- # -–max-jobs-run <njob>: Limit the number parallel jobs. This is ignored for non-array jobs.
10
- # --num-threads <ngpu>: Specify the number of CPU core.
11
- # --gpu <ngpu>: Specify the number of GPU devices.
12
- # --config: Change the configuration file from default.
13
- #
14
- # "JOB=1:10" is used for "array jobs" and it can control the number of parallel jobs.
15
- # The left string of "=", i.e. "JOB", is replaced by <N>(Nth job) in the command and the log file name,
16
- # e.g. "echo JOB" is changed to "echo 3" for the 3rd job and "echo 8" for 8th job respectively.
17
- # Note that the number must start with a positive number, so you can't use "JOB=0:10" for example.
18
- #
19
- # run.pl, queue.pl, slurm.pl, and ssh.pl have unified interface, not depending on its backend.
20
- # These options are mapping to specific options for each backend and
21
- # it is configured by "conf/queue.conf" and "conf/slurm.conf" by default.
22
- # If jobs failed, your configuration might be wrong for your environment.
23
- #
24
- #
25
- # The official documentaion for run.pl, queue.pl, slurm.pl, and ssh.pl:
26
- # "Parallelization in Kaldi": http://kaldi-asr.org/doc/queue.html
27
- # =========================================================~
28
-
29
-
30
- # Select the backend used by run.sh from "local", "stdout", "sge", "slurm", or "ssh"
31
- cmd_backend="stdout"
32
-
33
- # Local machine, without any Job scheduling system
34
- if [ "${cmd_backend}" = local ]; then
35
-
36
- # The other usage
37
- export train_cmd="utils/run.pl"
38
- # Used for "*_train.py": "--gpu" is appended optionally by run.sh
39
- export cuda_cmd="utils/run.pl"
40
- # Used for "*_recog.py"
41
- export decode_cmd="utils/run.pl"
42
-
43
- # Local machine, without any Job scheduling system
44
- elif [ "${cmd_backend}" = stdout ]; then
45
-
46
- # The other usage
47
- export train_cmd="utils/stdout.pl"
48
- # Used for "*_train.py": "--gpu" is appended optionally by run.sh
49
- export cuda_cmd="utils/stdout.pl"
50
- # Used for "*_recog.py"
51
- export decode_cmd="utils/stdout.pl"
52
-
53
- # "qsub" (SGE, Torque, PBS, etc.)
54
- elif [ "${cmd_backend}" = sge ]; then
55
- # The default setting is written in conf/queue.conf.
56
- # You must change "-q g.q" for the "queue" for your environment.
57
- # To know the "queue" names, type "qhost -q"
58
- # Note that to use "--gpu *", you have to setup "complex_value" for the system scheduler.
59
-
60
- export train_cmd="utils/queue.pl"
61
- export cuda_cmd="utils/queue.pl"
62
- export decode_cmd="utils/queue.pl"
63
-
64
- # "sbatch" (Slurm)
65
- elif [ "${cmd_backend}" = slurm ]; then
66
- # The default setting is written in conf/slurm.conf.
67
- # You must change "-p cpu" and "-p gpu" for the "partion" for your environment.
68
- # To know the "partion" names, type "sinfo".
69
- # You can use "--gpu * " by defualt for slurm and it is interpreted as "--gres gpu:*"
70
- # The devices are allocated exclusively using "${CUDA_VISIBLE_DEVICES}".
71
-
72
- export train_cmd="utils/slurm.pl"
73
- export cuda_cmd="utils/slurm.pl"
74
- export decode_cmd="utils/slurm.pl"
75
-
76
- elif [ "${cmd_backend}" = ssh ]; then
77
- # You have to create ".queue/machines" to specify the host to execute jobs.
78
- # e.g. .queue/machines
79
- # host1
80
- # host2
81
- # host3
82
- # Assuming you can login them without any password, i.e. You have to set ssh keys.
83
-
84
- export train_cmd="utils/ssh.pl"
85
- export cuda_cmd="utils/ssh.pl"
86
- export decode_cmd="utils/ssh.pl"
87
-
88
- else
89
- echo "$0: Error: Unknown cmd_backend=${cmd_backend}" 1>&2
90
- return 1
91
- fi
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/yesno/voc1/conf/hifigan.v1.debug.yaml DELETED
@@ -1,152 +0,0 @@
1
- # This is the configuration file for yesno dataset.
2
- # Note that this configuration is just for debugging.
3
-
4
- ###########################################################
5
- # FEATURE EXTRACTION SETTING #
6
- ###########################################################
7
- sampling_rate: 8000 # Sampling rate.
8
- fft_size: 1024 # FFT size.
9
- hop_size: 256 # Hop size.
10
- win_length: null # Window length.
11
- # If set to null, it will be the same as fft_size.
12
- window: "hann" # Window function.
13
- num_mels: 80 # Number of mel basis.
14
- fmin: 80 # Minimum freq in mel basis calculation.
15
- fmax: 3800 # Maximum frequency in mel basis calculation.
16
- global_gain_scale: 1.0 # Will be multiplied to all of waveform.
17
- trim_silence: true # Whether to trim the start and end of silence.
18
- trim_threshold_in_db: 20 # Need to tune carefully if the recording is not good.
19
- trim_frame_size: 1024 # Frame size in trimming.
20
- trim_hop_size: 256 # Hop size in trimming.
21
- format: "hdf5" # Feature file format. "npy" or "hdf5" is supported.
22
-
23
- ###########################################################
24
- # GENERATOR NETWORK ARCHITECTURE SETTING #
25
- ###########################################################
26
- generator_type: HiFiGANGenerator
27
- generator_params:
28
- in_channels: 80 # Number of input channels.
29
- out_channels: 1 # Number of output channels.
30
- channels: 32 # Number of initial channels.
31
- kernel_size: 7 # Kernel size of initial and final conv layers.
32
- upsample_scales: [8, 8, 2, 2] # Upsampling scales.
33
- upsample_kernel_sizes: [16, 16, 4, 4] # Kernel size for upsampling layers.
34
- resblock_kernel_sizes: [3, 7, 11] # Kernel size for residual blocks.
35
- resblock_dilations: # Dilations for residual blocks.
36
- - [1, 3, 5]
37
- - [1, 3, 5]
38
- - [1, 3, 5]
39
- use_additional_convs: true # Whether to use additional conv layer in residual blocks.
40
- bias: true # Whether to use bias parameter in conv.
41
- nonlinear_activation: "LeakyReLU" # Nonlinear activation type.
42
- nonlinear_activation_params: # Nonlinear activation paramters.
43
- negative_slope: 0.1
44
- use_weight_norm: true # Whether to apply weight normalization.
45
-
46
- ###########################################################
47
- # DISCRIMINATOR NETWORK ARCHITECTURE SETTING #
48
- ###########################################################
49
- discriminator_type: HiFiGANMultiScaleMultiPeriodDiscriminator
50
- discriminator_params:
51
- scales: 2 # Number of multi-scale discriminator.
52
- scale_downsample_pooling: "AvgPool1d" # Pooling operation for scale discriminator.
53
- scale_downsample_pooling_params:
54
- kernel_size: 4 # Pooling kernel size.
55
- stride: 2 # Pooling stride.
56
- padding: 2 # Padding size.
57
- scale_discriminator_params:
58
- in_channels: 1 # Number of input channels.
59
- out_channels: 1 # Number of output channels.
60
- kernel_sizes: [15, 41, 5, 3] # List of kernel sizes.
61
- channels: 16 # Initial number of channels.
62
- max_downsample_channels: 32 # Maximum number of channels in downsampling conv layers.
63
- max_groups: 16 # Maximum number of groups in downsampling conv layers.
64
- bias: true
65
- downsample_scales: [4, 4, 4, 4] # Downsampling scales.
66
- nonlinear_activation: "LeakyReLU" # Nonlinear activation.
67
- nonlinear_activation_params:
68
- negative_slope: 0.1
69
- follow_official_norm: true # Whether to follow the official norm setting.
70
- periods: [2, 3] # List of period for multi-period discriminator.
71
- period_discriminator_params:
72
- in_channels: 1 # Number of input channels.
73
- out_channels: 1 # Number of output channels.
74
- kernel_sizes: [5, 3] # List of kernel sizes.
75
- channels: 32 # Initial number of channels.
76
- downsample_scales: [4, 4, 4, 4] # Downsampling scales.
77
- max_downsample_channels: 32 # Maximum number of channels in downsampling conv layers.
78
- bias: true # Whether to use bias parameter in conv layer."
79
- nonlinear_activation: "LeakyReLU" # Nonlinear activation.
80
- nonlinear_activation_params: # Nonlinear activation paramters.
81
- negative_slope: 0.1
82
- use_weight_norm: true # Whether to apply weight normalization.
83
- use_spectral_norm: false # Whether to apply spectral normalization.
84
-
85
- ###########################################################
86
- # STFT LOSS SETTING #
87
- ###########################################################
88
- use_stft_loss: false
89
- use_mel_loss: true
90
- generator_adv_loss_params:
91
- average_by_discriminators: false # Whether to average loss by #discriminators.
92
- discriminator_adv_loss_params:
93
- average_by_discriminators: false # Whether to average loss by #discriminators.
94
- use_feat_match_loss: true
95
- feat_match_loss_params:
96
- average_by_discriminators: false # Whether to average loss by # discriminators.
97
- average_by_layers: false # Whether to average loss by # layers in each discriminator.
98
- include_final_outputs: true # Whether to include final outputs in feat match loss calculation.
99
-
100
- ###########################################################
101
- # ADVERSARIAL LOSS SETTING #
102
- ###########################################################
103
- lambda_aux: 45.0 # Loss balancing coefficient for STFT loss.
104
- lambda_adv: 1.0 # Loss balancing coefficient for adversarial loss.
105
- lambda_feat_match: 2.0 # Loss balancing coefficient for feat match loss..
106
-
107
- ###########################################################
108
- # DATA LOADER SETTING #
109
- ###########################################################
110
- batch_size: 2 # Batch size.
111
- batch_max_steps: 4096 # Length of each audio in batch. Make sure dividable by hop_size.
112
- pin_memory: true # Whether to pin memory in Pytorch DataLoader.
113
- num_workers: 2 # Number of workers in Pytorch DataLoader.
114
- remove_short_samples: false # Whether to remove samples the length of which are less than batch_max_steps.
115
- allow_cache: true # Whether to allow cache in dataset. If true, it requires cpu memory.
116
-
117
- ###########################################################
118
- # OPTIMIZER & SCHEDULER SETTING #
119
- ###########################################################
120
- generator_optimizer_type: AdamW
121
- generator_optimizer_params:
122
- lr: 0.0002 # Generator's learning rate.
123
- betas: [0.8, 0.99] # Generator's optimizer beta
124
- weight_decay: 0.0 # Generator's weight decay coefficient.
125
- generator_scheduler_type: ExponentialLR
126
- generator_scheduler_params:
127
- gamma: 0.999 # Generator's scheduler gamma.
128
- generator_grad_norm: -1 # Generator's gradient norm.
129
- discriminator_optimizer_type: AdamW
130
- discriminator_optimizer_params:
131
- lr: 0.0002 # Discriminator's learning rate.
132
- betas: [0.8, 0.99] # Discriminator's optimizer beta
133
- weight_decay: 0.0 # Discriminator's weight decay coefficient.
134
- discriminator_scheduler_type: ExponentialLR
135
- discriminator_scheduler_params:
136
- gamma: 0.999 # Discriminator's scheduler gamma.
137
- discriminator_grad_norm: -1 # Discriminator's gradient norm.
138
-
139
- ###########################################################
140
- # INTERVAL SETTING #
141
- ###########################################################
142
- generator_train_start_steps: 5 # Number of steps to start to train discriminator.
143
- discriminator_train_start_steps: 0 # Number of steps to start to train discriminator.
144
- train_max_steps: 10 # Number of training steps.
145
- save_interval_steps: 5 # Interval steps to save checkpoint.
146
- eval_interval_steps: 5 # Interval steps to evaluate the network.
147
- log_interval_steps: 5 # Interval steps to record the training log.
148
-
149
- ###########################################################
150
- # OTHER SETTING #
151
- ###########################################################
152
- num_save_intermediate_results: 4 # Number of results to be saved as intermediate results.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/yesno/voc1/conf/melgan.v1.debug.yaml DELETED
@@ -1,112 +0,0 @@
1
- # This is the configuration file for yesno dataset.
2
- # Note that this configuration is just for debugging.
3
-
4
- ###########################################################
5
- # FEATURE EXTRACTION SETTING #
6
- ###########################################################
7
- sampling_rate: 8000 # Sampling rate.
8
- fft_size: 1024 # FFT size.
9
- hop_size: 256 # Hop size.
10
- win_length: null # Window length.
11
- # If set to null, it will be the same as fft_size.
12
- window: "hann" # Window function.
13
- num_mels: 80 # Number of mel basis.
14
- fmin: 80 # Minimum freq in mel basis calculation.
15
- fmax: 4000 # Maximum frequency in mel basis calculation.
16
- global_gain_scale: 1.0 # Will be multiplied to all of waveform.
17
- trim_silence: true # Whether to trim the start and end of silence.
18
- trim_threshold_in_db: 60 # Need to tune carefully if the recording is not good.
19
- trim_frame_size: 1024 # Frame size in trimming.
20
- trim_hop_size: 256 # Hop size in trimming.
21
- format: "hdf5" # Feature file format. "npy" or "hdf5" is supported.
22
-
23
- ###########################################################
24
- # GENERATOR NETWORK ARCHITECTURE SETTING #
25
- ###########################################################
26
- generator_type: "MelGANGenerator" # Generator type.
27
- generator_params:
28
- in_channels: 80 # Number of input channels.
29
- out_channels: 1 # Number of output channels.
30
- kernel_size: 7 # Kernel size of initial and final conv layers.
31
- channels: 256 # Initial number of channels for conv layers.
32
- upsample_scales: [8, 8, 2, 2] # List of Upsampling scales.
33
- stack_kernel_size: 3 # Kernel size of dilated conv layers in residual stack.
34
- stacks: 1 # Number of stacks in a single residual stack module.
35
- use_weight_norm: True # Whether to use weight normalization.
36
- use_causal_conv: False # Whether to use causal convolution.
37
-
38
- ###########################################################
39
- # DISCRIMINATOR NETWORK ARCHITECTURE SETTING #
40
- ###########################################################
41
- discriminator_params:
42
- in_channels: 1 # Number of input channels.
43
- out_channels: 1 # Number of output channels.
44
- kernel_size: 3 # Number of output channels.
45
- layers: 10 # Number of conv layers.
46
- conv_channels: 32 # Number of chnn layers.
47
- bias: true # Whether to use bias parameter in conv.
48
- use_weight_norm: true # Whether to use weight norm.
49
- # If set to true, it will be applied to all of the conv layers.
50
- nonlinear_activation: "LeakyReLU" # Nonlinear function after each conv.
51
- nonlinear_activation_params: # Nonlinear function parameters
52
- negative_slope: 0.2 # Alpha in LeakyReLU.
53
-
54
- ###########################################################
55
- # STFT LOSS SETTING #
56
- ###########################################################
57
- stft_loss_params:
58
- fft_sizes: [1024, 2048, 512] # List of FFT size for STFT-based loss.
59
- hop_sizes: [120, 240, 50] # List of hop size for STFT-based loss
60
- win_lengths: [600, 1200, 240] # List of window length for STFT-based loss.
61
- window: "hann_window" # Window function for STFT-based loss
62
-
63
- ###########################################################
64
- # ADVERSARIAL LOSS SETTING #
65
- ###########################################################
66
- lambda_adv: 4.0 # Loss balancing coefficient.
67
-
68
- ###########################################################
69
- # DATA LOADER SETTING #
70
- ###########################################################
71
- batch_size: 2 # Batch size.
72
- batch_max_steps: 4096 # Length of each audio in batch. Make sure dividable by hop_size.
73
- pin_memory: true # Whether to pin memory in Pytorch DataLoader.
74
- num_workers: 2 # Number of workers in Pytorch DataLoader.
75
- remove_short_samples: false # Whether to remove samples the length of which are less than batch_max_steps.
76
- allow_cache: true # Whether to allow cache in dataset. If true, it requires cpu memory.
77
-
78
- ###########################################################
79
- # OPTIMIZER & SCHEDULER SETTING #
80
- ###########################################################
81
- generator_optimizer_params:
82
- lr: 0.0001 # Generator's learning rate.
83
- eps: 1.0e-6 # Generator's epsilon.
84
- weight_decay: 0.0 # Generator's weight decay coefficient.
85
- generator_scheduler_params:
86
- step_size: 200000 # Generator's scheduler step size.
87
- gamma: 0.5 # Generator's scheduler gamma.
88
- # At each step size, lr will be multiplied by this parameter.
89
- generator_grad_norm: 10 # Generator's gradient norm.
90
- discriminator_optimizer_params:
91
- lr: 0.00005 # Discriminator's learning rate.
92
- eps: 1.0e-6 # Discriminator's epsilon.
93
- weight_decay: 0.0 # Discriminator's weight decay coefficient.
94
- discriminator_scheduler_params:
95
- step_size: 200000 # Discriminator's scheduler step size.
96
- gamma: 0.5 # Discriminator's scheduler gamma.
97
- # At each step size, lr will be multiplied by this parameter.
98
- discriminator_grad_norm: 1 # Discriminator's gradient norm.
99
-
100
- ###########################################################
101
- # INTERVAL SETTING #
102
- ###########################################################
103
- discriminator_train_start_steps: 5 # Number of steps to start to train discriminator.
104
- train_max_steps: 10 # Number of training steps.
105
- save_interval_steps: 5 # Interval steps to save checkpoint.
106
- eval_interval_steps: 5 # Interval steps to evaluate the network.
107
- log_interval_steps: 5 # Interval steps to record the training log.
108
-
109
- ###########################################################
110
- # OTHER SETTING #
111
- ###########################################################
112
- num_save_intermediate_results: 4 # Number of results to be saved as intermediate results.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/yesno/voc1/conf/melgan.v3.debug.yaml DELETED
@@ -1,121 +0,0 @@
1
- # This is the configuration file for yesno dataset.
2
- # Note that this configuration is just for debugging.
3
-
4
- ###########################################################
5
- # FEATURE EXTRACTION SETTING #
6
- ###########################################################
7
- sampling_rate: 8000 # Sampling rate.
8
- fft_size: 1024 # FFT size.
9
- hop_size: 256 # Hop size.
10
- win_length: null # Window length.
11
- # If set to null, it will be the same as fft_size.
12
- window: "hann" # Window function.
13
- num_mels: 80 # Number of mel basis.
14
- fmin: 0 # Minimum freq in mel basis calculation.
15
- fmax: 4000 # Maximum frequency in mel basis calculation.
16
- global_gain_scale: 0.8 # Will be multiplied to all of waveform.
17
- trim_silence: false # Whether to trim the start and end of silence.
18
- trim_threshold_in_db: 60 # Need to tune carefully if the recording is not good.
19
- trim_frame_size: 1024 # Frame size in trimming.
20
- trim_hop_size: 256 # Hop size in trimming.
21
- format: "hdf5" # Feature file format. " npy " or " hdf5 " is supported.
22
-
23
- ###########################################################
24
- # GENERATOR NETWORK ARCHITECTURE SETTING #
25
- ###########################################################
26
- generator_type: "MelGANGenerator" # Generator type.
27
- generator_params:
28
- in_channels: 80 # Number of input channels.
29
- out_channels: 1 # Number of output channels.
30
- kernel_size: 7 # Kernel size of initial and final conv layers.
31
- channels: 256 # Initial number of channels for conv layers.
32
- upsample_scales: [8, 8, 2, 2] # List of Upsampling scales.
33
- stack_kernel_size: 3 # Kernel size of dilated conv layers in residual stack.
34
- stacks: 1 # Number of stacks in a single residual stack module.
35
- use_weight_norm: True # Whether to use weight normalization.
36
- use_causal_conv: False # Whether to use causal convolution.
37
-
38
- ###########################################################
39
- # DISCRIMINATOR NETWORK ARCHITECTURE SETTING #
40
- ###########################################################
41
- discriminator_type: "MelGANMultiScaleDiscriminator" # Discriminator type.
42
- discriminator_params:
43
- in_channels: 1 # Number of input channels.
44
- out_channels: 1 # Number of output channels.
45
- scales: 3 # Number of multi-scales.
46
- downsample_pooling: "AvgPool1d" # Pooling type for the input downsampling.
47
- downsample_pooling_params: # Parameters of the above pooling function.
48
- kernel_size: 4
49
- stride: 2
50
- padding: 1
51
- count_include_pad: False
52
- kernel_sizes: [5, 3] # List of kernel size.
53
- channels: 16 # Number of channels of the initial conv layer.
54
- max_downsample_channels: 64 # Maximum number of channels of downsampling layers.
55
- downsample_scales: [4, 4, 4, 4] # List of downsampling scales.
56
- nonlinear_activation: "LeakyReLU" # Nonlinear activation function.
57
- nonlinear_activation_params: # Parameters of nonlinear activation function.
58
- negative_slope: 0.2
59
- use_weight_norm: True # Whether to use weight norm.
60
-
61
- ###########################################################
62
- # STFT LOSS SETTING #
63
- ###########################################################
64
- stft_loss_params:
65
- fft_sizes: [1024, 2048, 512] # List of FFT size for STFT-based loss.
66
- hop_sizes: [120, 240, 50] # List of hop size for STFT-based loss
67
- win_lengths: [600, 1200, 240] # List of window length for STFT-based loss.
68
- window: "hann_window" # Window function for STFT-based loss
69
-
70
- ###########################################################
71
- # ADVERSARIAL LOSS SETTING #
72
- ###########################################################
73
- use_feat_match_loss: true # Whether to use feature matching loss.
74
- lambda_feat_match: 25.0 # Loss balancing coefficient for feature matching loss.
75
- lambda_adv: 4.0 # Loss balancing coefficient.
76
-
77
- ###########################################################
78
- # DATA LOADER SETTING #
79
- ###########################################################
80
- batch_size: 2 # Batch size.
81
- batch_max_steps: 4096 # Length of each audio in batch. Make sure dividable by hop_size.
82
- pin_memory: true # Whether to pin memory in Pytorch DataLoader.
83
- num_workers: 2 # Number of workers in Pytorch DataLoader.
84
- remove_short_samples: false # Whether to remove samples the length of which are less than batch_max_steps.
85
- allow_cache: true # Whether to allow cache in dataset. If true, it requires cpu memory.
86
-
87
- ###########################################################
88
- # OPTIMIZER & SCHEDULER SETTING #
89
- ###########################################################
90
- generator_optimizer_params:
91
- lr: 0.0001 # Generator's learning rate.
92
- eps: 1.0e-6 # Generator's epsilon.
93
- weight_decay: 0.0 # Generator's weight decay coefficient.
94
- generator_scheduler_params:
95
- step_size: 200000 # Generator's scheduler step size.
96
- gamma: 0.5 # Generator's scheduler gamma.
97
- # At each step size, lr will be multiplied by this parameter.
98
- generator_grad_norm: 10 # Generator's gradient norm.
99
- discriminator_optimizer_params:
100
- lr: 0.00005 # Discriminator's learning rate.
101
- eps: 1.0e-6 # Discriminator's epsilon.
102
- weight_decay: 0.0 # Discriminator's weight decay coefficient.
103
- discriminator_scheduler_params:
104
- step_size: 200000 # Discriminator's scheduler step size.
105
- gamma: 0.5 # Discriminator's scheduler gamma.
106
- # At each step size, lr will be multiplied by this parameter.
107
- discriminator_grad_norm: 1 # Discriminator's gradient norm.
108
-
109
- ###########################################################
110
- # INTERVAL SETTING #
111
- ###########################################################
112
- discriminator_train_start_steps: 5 # Number of steps to start to train discriminator.
113
- train_max_steps: 10 # Number of training steps.
114
- save_interval_steps: 5 # Interval steps to save checkpoint.
115
- eval_interval_steps: 5 # Interval steps to evaluate the network.
116
- log_interval_steps: 5 # Interval steps to record the training log.
117
-
118
- ###########################################################
119
- # OTHER SETTING #
120
- ###########################################################
121
- num_save_intermediate_results: 4 # Number of results to be saved as intermediate results.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/yesno/voc1/conf/multi_band_melgan.v1.debug.yaml DELETED
@@ -1,126 +0,0 @@
1
- # This is the configuration file for yesno dataset.
2
- # Note that this configuration is just for debugging.
3
-
4
- ###########################################################
5
- # FEATURE EXTRACTION SETTING #
6
- ###########################################################
7
- sampling_rate: 8000 # Sampling rate.
8
- fft_size: 1024 # FFT size.
9
- hop_size: 200 # Hop size.
10
- win_length: null # Window length.
11
- # If set to null, it will be the same as fft_size.
12
- window: "hann" # Window function.
13
- num_mels: 80 # Number of mel basis.
14
- fmin: 0 # Minimum freq in mel basis calculation.
15
- fmax: 4000 # Maximum frequency in mel basis calculation.
16
- global_gain_scale: 0.8 # Will be multiplied to all of waveform.
17
- trim_silence: false # Whether to trim the start and end of silence.
18
- trim_threshold_in_db: 60 # Need to tune carefully if the recording is not good.
19
- trim_frame_size: 1024 # Frame size in trimming.
20
- trim_hop_size: 256 # Hop size in trimming.
21
- format: "hdf5" # Feature file format. " npy " or " hdf5 " is supported.
22
-
23
- ###########################################################
24
- # GENERATOR NETWORK ARCHITECTURE SETTING #
25
- ###########################################################
26
- generator_type: "MelGANGenerator" # Generator type.
27
- generator_params:
28
- in_channels: 80 # Number of input channels.
29
- out_channels: 4 # Number of output channels.
30
- kernel_size: 7 # Kernel size of initial and final conv layers.
31
- channels: 256 # Initial number of channels for conv layers.
32
- upsample_scales: [2, 5, 5] # List of Upsampling scales.
33
- stack_kernel_size: 3 # Kernel size of dilated conv layers in residual stack.
34
- stacks: 1 # Number of stacks in a single residual stack module.
35
- use_weight_norm: True # Whether to use weight normalization.
36
- use_causal_conv: False # Whether to use causal convolution.
37
-
38
- ###########################################################
39
- # DISCRIMINATOR NETWORK ARCHITECTURE SETTING #
40
- ###########################################################
41
- discriminator_type: "MelGANMultiScaleDiscriminator" # Discriminator type.
42
- discriminator_params:
43
- in_channels: 1 # Number of input channels.
44
- out_channels: 1 # Number of output channels.
45
- scales: 3 # Number of multi-scales.
46
- downsample_pooling: "AvgPool1d" # Pooling type for the input downsampling.
47
- downsample_pooling_params: # Parameters of the above pooling function.
48
- kernel_size: 4
49
- stride: 2
50
- padding: 1
51
- count_include_pad: False
52
- kernel_sizes: [5, 3] # List of kernel size.
53
- channels: 16 # Number of channels of the initial conv layer.
54
- max_downsample_channels: 64 # Maximum number of channels of downsampling layers.
55
- downsample_scales: [4, 4, 4] # List of downsampling scales.
56
- nonlinear_activation: "LeakyReLU" # Nonlinear activation function.
57
- nonlinear_activation_params: # Parameters of nonlinear activation function.
58
- negative_slope: 0.2
59
- use_weight_norm: True # Whether to use weight norm.
60
-
61
- ###########################################################
62
- # STFT LOSS SETTING #
63
- ###########################################################
64
- stft_loss_params:
65
- fft_sizes: [1024, 2048, 512] # List of FFT size for STFT-based loss.
66
- hop_sizes: [120, 240, 50] # List of hop size for STFT-based loss
67
- win_lengths: [600, 1200, 240] # List of window length for STFT-based loss.
68
- window: "hann_window" # Window function for STFT-based loss
69
- use_subband_stft_loss: true
70
- subband_stft_loss_params:
71
- fft_sizes: [384, 683, 171] # List of FFT size for STFT-based loss.
72
- hop_sizes: [30, 60, 10] # List of hop size for STFT-based loss
73
- win_lengths: [150, 300, 60] # List of window length for STFT-based loss.
74
- window: "hann_window" # Window function for STFT-based loss
75
-
76
- ###########################################################
77
- # ADVERSARIAL LOSS SETTING #
78
- ###########################################################
79
- use_feat_match_loss: false # Whether to use feature matching loss.
80
- lambda_adv: 2.5 # Loss balancing coefficient.
81
-
82
- ###########################################################
83
- # DATA LOADER SETTING #
84
- ###########################################################
85
- batch_size: 2 # Batch size.
86
- batch_max_steps: 4000 # Length of each audio in batch. Make sure dividable by hop_size.
87
- pin_memory: true # Whether to pin memory in Pytorch DataLoader.
88
- num_workers: 2 # Number of workers in Pytorch DataLoader.
89
- remove_short_samples: false # Whether to remove samples the length of which are less than batch_max_steps.
90
- allow_cache: true # Whether to allow cache in dataset. If true, it requires cpu memory.
91
-
92
- ###########################################################
93
- # OPTIMIZER & SCHEDULER SETTING #
94
- ###########################################################
95
- generator_optimizer_params:
96
- lr: 0.0001 # Generator's learning rate.
97
- eps: 1.0e-6 # Generator's epsilon.
98
- weight_decay: 0.0 # Generator's weight decay coefficient.
99
- generator_scheduler_params:
100
- step_size: 200000 # Generator's scheduler step size.
101
- gamma: 0.5 # Generator's scheduler gamma.
102
- # At each step size, lr will be multiplied by this parameter.
103
- generator_grad_norm: 10 # Generator's gradient norm.
104
- discriminator_optimizer_params:
105
- lr: 0.00005 # Discriminator's learning rate.
106
- eps: 1.0e-6 # Discriminator's epsilon.
107
- weight_decay: 0.0 # Discriminator's weight decay coefficient.
108
- discriminator_scheduler_params:
109
- step_size: 200000 # Discriminator's scheduler step size.
110
- gamma: 0.5 # Discriminator's scheduler gamma.
111
- # At each step size, lr will be multiplied by this parameter.
112
- discriminator_grad_norm: 1 # Discriminator's gradient norm.
113
-
114
- ###########################################################
115
- # INTERVAL SETTING #
116
- ###########################################################
117
- discriminator_train_start_steps: 5 # Number of steps to start to train discriminator.
118
- train_max_steps: 10 # Number of training steps.
119
- save_interval_steps: 5 # Interval steps to save checkpoint.
120
- eval_interval_steps: 5 # Interval steps to evaluate the network.
121
- log_interval_steps: 5 # Interval steps to record the training log.
122
-
123
- ###########################################################
124
- # OTHER SETTING #
125
- ###########################################################
126
- num_save_intermediate_results: 4 # Number of results to be saved as intermediate results.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/yesno/voc1/conf/parallel_wavegan.v1.debug.diff_fs.yaml DELETED
@@ -1,121 +0,0 @@
1
- # This is the configuration file for yesno dataset.
2
- # Note that this configuration is just for debugging.
3
-
4
- ###########################################################
5
- # FEATURE EXTRACTION SETTING #
6
- ###########################################################
7
- sampling_rate: 8000 # Sampling rate.
8
- sampling_rate_for_feats: 4000 # Sampling rate for features.
9
- fft_size: 1024 # FFT size.
10
- hop_size: 256 # Hop size.
11
- win_length: null # Window length.
12
- # If set to null, it will be the same as fft_size.
13
- window: "hann" # Window function.
14
- num_mels: 80 # Number of mel basis.
15
- fmin: 80 # Minimum freq in mel basis calculation.
16
- fmax: 2000 # Maximum frequency in mel basis calculation.
17
- global_gain_scale: 1.0 # Will be multiplied to all of waveform.
18
- trim_silence: true # Whether to trim the start and end of silence.
19
- trim_threshold_in_db: 20 # Need to tune carefully if the recording is not good.
20
- trim_frame_size: 1024 # Frame size in trimming.
21
- trim_hop_size: 256 # Hop size in trimming.
22
- format: "hdf5" # Feature file format. "npy" or "hdf5" is supported.
23
-
24
- ###########################################################
25
- # GENERATOR NETWORK ARCHITECTURE SETTING #
26
- ###########################################################
27
- generator_params:
28
- in_channels: 1 # Number of input channels.
29
- out_channels: 1 # Number of output channels.
30
- kernel_size: 3 # Kernel size of dilated convolution.
31
- layers: 20 # Number of residual block layers.
32
- stacks: 2 # Number of stacks i.e., dilation cycles.
33
- residual_channels: 16 # Number of channels in residual conv.
34
- gate_channels: 32 # Number of channels in gated conv.
35
- skip_channels: 16 # Number of channels in skip conv.
36
- aux_channels: 80 # Number of channels for auxiliary feature conv.
37
- # Must be the same as num_mels.
38
- aux_context_window: 1 # Context window size for auxiliary feature.
39
- # If set to 2, previous 2 and future 2 frames will be considered.
40
- dropout: 0.0 # Dropout rate. 0.0 means no dropout applied.
41
- use_weight_norm: true # Whether to use weight norm.
42
- # If set to true, it will be applied to all of the conv layers.
43
- upsample_net: "ConvInUpsampleNetwork" # Upsampling network architecture.
44
- upsample_params: # Upsampling network parameters.
45
- upsample_scales: [4, 4, 4, 4] # Upsampling scales. Prodcut of these must be the same as hop size.
46
-
47
- ###########################################################
48
- # DISCRIMINATOR NETWORK ARCHITECTURE SETTING #
49
- ###########################################################
50
- discriminator_params:
51
- in_channels: 1 # Number of input channels.
52
- out_channels: 1 # Number of output channels.
53
- kernel_size: 3 # Number of output channels.
54
- layers: 10 # Number of conv layers.
55
- conv_channels: 16 # Number of chnn layers.
56
- bias: true # Whether to use bias parameter in conv.
57
- use_weight_norm: true # Whether to use weight norm.
58
- # If set to true, it will be applied to all of the conv layers.
59
- nonlinear_activation: "LeakyReLU" # Nonlinear function after each conv.
60
- nonlinear_activation_params: # Nonlinear function parameters
61
- negative_slope: 0.2 # Alpha in LeakyReLU.
62
-
63
- ###########################################################
64
- # STFT LOSS SETTING #
65
- ###########################################################
66
- stft_loss_params:
67
- fft_sizes: [1024, 2048, 512] # List of FFT size for STFT-based loss.
68
- hop_sizes: [120, 240, 50] # List of hop size for STFT-based loss
69
- win_lengths: [600, 1200, 240] # List of window length for STFT-based loss.
70
- window: "hann_window" # Window function for STFT-based loss
71
-
72
- ###########################################################
73
- # ADVERSARIAL LOSS SETTING #
74
- ###########################################################
75
- lambda_adv: 4.0 # Loss balancing coefficient.
76
-
77
- ###########################################################
78
- # DATA LOADER SETTING #
79
- ###########################################################
80
- batch_size: 2 # Batch size.
81
- batch_max_steps: 4096 # Length of each audio in batch. Make sure dividable by hop_size.
82
- pin_memory: true # Whether to pin memory in Pytorch DataLoader.
83
- num_workers: 2 # Number of workers in Pytorch DataLoader.
84
- remove_short_samples: false # Whether to remove samples the length of which are less than batch_max_steps.
85
- allow_cache: true # Whether to allow cache in dataset. If true, it requires cpu memory.
86
-
87
- ###########################################################
88
- # OPTIMIZER & SCHEDULER SETTING #
89
- ###########################################################
90
- generator_optimizer_params:
91
- lr: 0.0001 # Generator's learning rate.
92
- eps: 1.0e-6 # Generator's epsilon.
93
- weight_decay: 0.0 # Generator's weight decay coefficient.
94
- generator_scheduler_params:
95
- step_size: 200000 # Generator's scheduler step size.
96
- gamma: 0.5 # Generator's scheduler gamma.
97
- # At each step size, lr will be multiplied by this parameter.
98
- generator_grad_norm: 10 # Generator's gradient norm.
99
- discriminator_optimizer_params:
100
- lr: 0.00005 # Discriminator's learning rate.
101
- eps: 1.0e-6 # Discriminator's epsilon.
102
- weight_decay: 0.0 # Discriminator's weight decay coefficient.
103
- discriminator_scheduler_params:
104
- step_size: 200000 # Discriminator's scheduler step size.
105
- gamma: 0.5 # Discriminator's scheduler gamma.
106
- # At each step size, lr will be multiplied by this parameter.
107
- discriminator_grad_norm: 1 # Discriminator's gradient norm.
108
-
109
- ###########################################################
110
- # INTERVAL SETTING #
111
- ###########################################################
112
- discriminator_train_start_steps: 5 # Number of steps to start to train discriminator.
113
- train_max_steps: 10 # Number of training steps.
114
- save_interval_steps: 5 # Interval steps to save checkpoint.
115
- eval_interval_steps: 5 # Interval steps to evaluate the network.
116
- log_interval_steps: 5 # Interval steps to record the training log.
117
-
118
- ###########################################################
119
- # OTHER SETTING #
120
- ###########################################################
121
- num_save_intermediate_results: 4 # Number of results to be saved as intermediate results.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/yesno/voc1/conf/parallel_wavegan.v1.debug.npy.yaml DELETED
@@ -1,121 +0,0 @@
1
- # This is the configuration file for yesno dataset.
2
- # Note that this configuration is just for debugging.
3
-
4
- ###########################################################
5
- # FEATURE EXTRACTION SETTING #
6
- ###########################################################
7
- sampling_rate: 8000 # Sampling rate.
8
- fft_size: 1024 # FFT size.
9
- hop_size: 256 # Hop size.
10
- win_length: null # Window length.
11
- # If set to null, it will be the same as fft_size.
12
- window: "hann" # Window function.
13
- num_mels: 80 # Number of mel basis.
14
- fmin: 80 # Minimum freq in mel basis calculation.
15
- fmax: 3800 # Maximum frequency in mel basis calculation.
16
- log_base: null # Log base.
17
- global_gain_scale: 1.0 # Will be multiplied to all of waveform.
18
- trim_silence: true # Whether to trim the start and end of silence.
19
- trim_threshold_in_db: 20 # Need to tune carefully if the recording is not good.
20
- trim_frame_size: 1024 # Frame size in trimming.
21
- trim_hop_size: 256 # Hop size in trimming.
22
- format: "npy" # Feature file format. "npy" or "hdf5" is supported.
23
-
24
- ###########################################################
25
- # GENERATOR NETWORK ARCHITECTURE SETTING #
26
- ###########################################################
27
- generator_params:
28
- in_channels: 1 # Number of input channels.
29
- out_channels: 1 # Number of output channels.
30
- kernel_size: 3 # Kernel size of dilated convolution.
31
- layers: 20 # Number of residual block layers.
32
- stacks: 2 # Number of stacks i.e., dilation cycles.
33
- residual_channels: 16 # Number of channels in residual conv.
34
- gate_channels: 32 # Number of channels in gated conv.
35
- skip_channels: 16 # Number of channels in skip conv.
36
- aux_channels: 80 # Number of channels for auxiliary feature conv.
37
- # Must be the same as num_mels.
38
- aux_context_window: 1 # Context window size for auxiliary feature.
39
- # If set to 2, previous 2 and future 2 frames will be considered.
40
- dropout: 0.0 # Dropout rate. 0.0 means no dropout applied.
41
- use_weight_norm: true # Whether to use weight norm.
42
- # If set to true, it will be applied to all of the conv layers.
43
- upsample_net: "ConvInUpsampleNetwork" # Upsampling network architecture.
44
- upsample_params: # Upsampling network parameters.
45
- upsample_scales: [4, 4, 4, 4] # Upsampling scales. Prodcut of these must be the same as hop size.
46
-
47
- ###########################################################
48
- # DISCRIMINATOR NETWORK ARCHITECTURE SETTING #
49
- ###########################################################
50
- discriminator_params:
51
- in_channels: 1 # Number of input channels.
52
- out_channels: 1 # Number of output channels.
53
- kernel_size: 3 # Number of output channels.
54
- layers: 10 # Number of conv layers.
55
- conv_channels: 16 # Number of chnn layers.
56
- bias: true # Whether to use bias parameter in conv.
57
- use_weight_norm: true # Whether to use weight norm.
58
- # If set to true, it will be applied to all of the conv layers.
59
- nonlinear_activation: "LeakyReLU" # Nonlinear function after each conv.
60
- nonlinear_activation_params: # Nonlinear function parameters
61
- negative_slope: 0.2 # Alpha in LeakyReLU.
62
-
63
- ###########################################################
64
- # STFT LOSS SETTING #
65
- ###########################################################
66
- stft_loss_params:
67
- fft_sizes: [1024, 2048, 512] # List of FFT size for STFT-based loss.
68
- hop_sizes: [120, 240, 50] # List of hop size for STFT-based loss
69
- win_lengths: [600, 1200, 240] # List of window length for STFT-based loss.
70
- window: "hann_window" # Window function for STFT-based loss
71
-
72
- ###########################################################
73
- # ADVERSARIAL LOSS SETTING #
74
- ###########################################################
75
- lambda_adv: 4.0 # Loss balancing coefficient.
76
-
77
- ###########################################################
78
- # DATA LOADER SETTING #
79
- ###########################################################
80
- batch_size: 2 # Batch size.
81
- batch_max_steps: 4096 # Length of each audio in batch. Make sure dividable by hop_size.
82
- pin_memory: true # Whether to pin memory in Pytorch DataLoader.
83
- num_workers: 2 # Number of workers in Pytorch DataLoader.
84
- remove_short_samples: false # Whether to remove samples the length of which are less than batch_max_steps.
85
- allow_cache: true # Whether to allow cache in dataset. If true, it requires cpu memory.
86
-
87
- ###########################################################
88
- # OPTIMIZER & SCHEDULER SETTING #
89
- ###########################################################
90
- generator_optimizer_params:
91
- lr: 0.0001 # Generator's learning rate.
92
- eps: 1.0e-6 # Generator's epsilon.
93
- weight_decay: 0.0 # Generator's weight decay coefficient.
94
- generator_scheduler_params:
95
- step_size: 200000 # Generator's scheduler step size.
96
- gamma: 0.5 # Generator's scheduler gamma.
97
- # At each step size, lr will be multiplied by this parameter.
98
- generator_grad_norm: 10 # Generator's gradient norm.
99
- discriminator_optimizer_params:
100
- lr: 0.00005 # Discriminator's learning rate.
101
- eps: 1.0e-6 # Discriminator's epsilon.
102
- weight_decay: 0.0 # Discriminator's weight decay coefficient.
103
- discriminator_scheduler_params:
104
- step_size: 200000 # Discriminator's scheduler step size.
105
- gamma: 0.5 # Discriminator's scheduler gamma.
106
- # At each step size, lr will be multiplied by this parameter.
107
- discriminator_grad_norm: 1 # Discriminator's gradient norm.
108
-
109
- ###########################################################
110
- # INTERVAL SETTING #
111
- ###########################################################
112
- discriminator_train_start_steps: 5 # Number of steps to start to train discriminator.
113
- train_max_steps: 10 # Number of training steps.
114
- save_interval_steps: 5 # Interval steps to save checkpoint.
115
- eval_interval_steps: 5 # Interval steps to evaluate the network.
116
- log_interval_steps: 5 # Interval steps to record the training log.
117
-
118
- ###########################################################
119
- # OTHER SETTING #
120
- ###########################################################
121
- num_save_intermediate_results: 4 # Number of results to be saved as intermediate results.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/yesno/voc1/conf/parallel_wavegan.v1.debug.yaml DELETED
@@ -1,120 +0,0 @@
1
- # This is the configuration file for yesno dataset.
2
- # Note that this configuration is just for debugging.
3
-
4
- ###########################################################
5
- # FEATURE EXTRACTION SETTING #
6
- ###########################################################
7
- sampling_rate: 8000 # Sampling rate.
8
- fft_size: 1024 # FFT size.
9
- hop_size: 256 # Hop size.
10
- win_length: null # Window length.
11
- # If set to null, it will be the same as fft_size.
12
- window: "hann" # Window function.
13
- num_mels: 80 # Number of mel basis.
14
- fmin: 80 # Minimum freq in mel basis calculation.
15
- fmax: 3800 # Maximum frequency in mel basis calculation.
16
- global_gain_scale: 1.0 # Will be multiplied to all of waveform.
17
- trim_silence: true # Whether to trim the start and end of silence.
18
- trim_threshold_in_db: 20 # Need to tune carefully if the recording is not good.
19
- trim_frame_size: 1024 # Frame size in trimming.
20
- trim_hop_size: 256 # Hop size in trimming.
21
- format: "hdf5" # Feature file format. "npy" or "hdf5" is supported.
22
-
23
- ###########################################################
24
- # GENERATOR NETWORK ARCHITECTURE SETTING #
25
- ###########################################################
26
- generator_params:
27
- in_channels: 1 # Number of input channels.
28
- out_channels: 1 # Number of output channels.
29
- kernel_size: 3 # Kernel size of dilated convolution.
30
- layers: 20 # Number of residual block layers.
31
- stacks: 2 # Number of stacks i.e., dilation cycles.
32
- residual_channels: 16 # Number of channels in residual conv.
33
- gate_channels: 32 # Number of channels in gated conv.
34
- skip_channels: 16 # Number of channels in skip conv.
35
- aux_channels: 80 # Number of channels for auxiliary feature conv.
36
- # Must be the same as num_mels.
37
- aux_context_window: 1 # Context window size for auxiliary feature.
38
- # If set to 2, previous 2 and future 2 frames will be considered.
39
- dropout: 0.0 # Dropout rate. 0.0 means no dropout applied.
40
- use_weight_norm: true # Whether to use weight norm.
41
- # If set to true, it will be applied to all of the conv layers.
42
- upsample_net: "ConvInUpsampleNetwork" # Upsampling network architecture.
43
- upsample_params: # Upsampling network parameters.
44
- upsample_scales: [4, 4, 4, 4] # Upsampling scales. Prodcut of these must be the same as hop size.
45
-
46
- ###########################################################
47
- # DISCRIMINATOR NETWORK ARCHITECTURE SETTING #
48
- ###########################################################
49
- discriminator_params:
50
- in_channels: 1 # Number of input channels.
51
- out_channels: 1 # Number of output channels.
52
- kernel_size: 3 # Number of output channels.
53
- layers: 10 # Number of conv layers.
54
- conv_channels: 16 # Number of chnn layers.
55
- bias: true # Whether to use bias parameter in conv.
56
- use_weight_norm: true # Whether to use weight norm.
57
- # If set to true, it will be applied to all of the conv layers.
58
- nonlinear_activation: "LeakyReLU" # Nonlinear function after each conv.
59
- nonlinear_activation_params: # Nonlinear function parameters
60
- negative_slope: 0.2 # Alpha in LeakyReLU.
61
-
62
- ###########################################################
63
- # STFT LOSS SETTING #
64
- ###########################################################
65
- stft_loss_params:
66
- fft_sizes: [1024, 2048, 512] # List of FFT size for STFT-based loss.
67
- hop_sizes: [120, 240, 50] # List of hop size for STFT-based loss
68
- win_lengths: [600, 1200, 240] # List of window length for STFT-based loss.
69
- window: "hann_window" # Window function for STFT-based loss
70
-
71
- ###########################################################
72
- # ADVERSARIAL LOSS SETTING #
73
- ###########################################################
74
- lambda_adv: 4.0 # Loss balancing coefficient.
75
-
76
- ###########################################################
77
- # DATA LOADER SETTING #
78
- ###########################################################
79
- batch_size: 2 # Batch size.
80
- batch_max_steps: 4096 # Length of each audio in batch. Make sure dividable by hop_size.
81
- pin_memory: true # Whether to pin memory in Pytorch DataLoader.
82
- num_workers: 2 # Number of workers in Pytorch DataLoader.
83
- remove_short_samples: false # Whether to remove samples the length of which are less than batch_max_steps.
84
- allow_cache: true # Whether to allow cache in dataset. If true, it requires cpu memory.
85
-
86
- ###########################################################
87
- # OPTIMIZER & SCHEDULER SETTING #
88
- ###########################################################
89
- generator_optimizer_params:
90
- lr: 0.0001 # Generator's learning rate.
91
- eps: 1.0e-6 # Generator's epsilon.
92
- weight_decay: 0.0 # Generator's weight decay coefficient.
93
- generator_scheduler_params:
94
- step_size: 200000 # Generator's scheduler step size.
95
- gamma: 0.5 # Generator's scheduler gamma.
96
- # At each step size, lr will be multiplied by this parameter.
97
- generator_grad_norm: 10 # Generator's gradient norm.
98
- discriminator_optimizer_params:
99
- lr: 0.00005 # Discriminator's learning rate.
100
- eps: 1.0e-6 # Discriminator's epsilon.
101
- weight_decay: 0.0 # Discriminator's weight decay coefficient.
102
- discriminator_scheduler_params:
103
- step_size: 200000 # Discriminator's scheduler step size.
104
- gamma: 0.5 # Discriminator's scheduler gamma.
105
- # At each step size, lr will be multiplied by this parameter.
106
- discriminator_grad_norm: 1 # Discriminator's gradient norm.
107
-
108
- ###########################################################
109
- # INTERVAL SETTING #
110
- ###########################################################
111
- discriminator_train_start_steps: 5 # Number of steps to start to train discriminator.
112
- train_max_steps: 10 # Number of training steps.
113
- save_interval_steps: 5 # Interval steps to save checkpoint.
114
- eval_interval_steps: 5 # Interval steps to evaluate the network.
115
- log_interval_steps: 5 # Interval steps to record the training log.
116
-
117
- ###########################################################
118
- # OTHER SETTING #
119
- ###########################################################
120
- num_save_intermediate_results: 4 # Number of results to be saved as intermediate results.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/yesno/voc1/conf/slurm.conf DELETED
@@ -1,12 +0,0 @@
1
- # Default configuration
2
- command sbatch --export=PATH --ntasks-per-node=1
3
- option time=* --time $0
4
- option mem=* --mem-per-cpu $0
5
- option mem=0 # Do not add anything to qsub_opts
6
- option num_threads=* --cpus-per-task $0 --ntasks-per-node=1
7
- option num_threads=1 --cpus-per-task 1 --ntasks-per-node=1 # Do not add anything to qsub_opts
8
- default gpu=0
9
- option gpu=0 -p cpu
10
- option gpu=* -p gpu --gres=gpu:$0
11
- # note: the --max-jobs-run option is supported as a special case
12
- # by slurm.pl and you don't have to handle it in the config file.
 
 
 
 
 
 
 
 
 
 
 
 
 
audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/yesno/voc1/conf/style_melgan.v1.debug.yaml DELETED
@@ -1,135 +0,0 @@
1
- # This is the configuration file for yesno dataset.
2
- # Note that this configuration is just for debugging.
3
-
4
- ###########################################################
5
- # FEATURE EXTRACTION SETTING #
6
- ###########################################################
7
- sampling_rate: 8000 # Sampling rate.
8
- fft_size: 1024 # FFT size.
9
- hop_size: 256 # Hop size.
10
- win_length: null # Window length.
11
- # If set to null, it will be the same as fft_size.
12
- window: "hann" # Window function.
13
- num_mels: 80 # Number of mel basis.
14
- fmin: 0 # Minimum freq in mel basis calculation.
15
- fmax: 4000 # Maximum frequency in mel basis calculation.
16
- global_gain_scale: 0.8 # Will be multiplied to all of waveform.
17
- trim_silence: false # Whether to trim the start and end of silence.
18
- trim_threshold_in_db: 60 # Need to tune carefully if the recording is not good.
19
- trim_frame_size: 1024 # Frame size in trimming.
20
- trim_hop_size: 256 # Hop size in trimming.
21
- format: "hdf5" # Feature file format. " npy " or " hdf5 " is supported.
22
-
23
- ###########################################################
24
- # GENERATOR NETWORK ARCHITECTURE SETTING #
25
- ###########################################################
26
- generator_type: "StyleMelGANGenerator" # Generator type.
27
- generator_params:
28
- in_channels: 128
29
- aux_channels: 80
30
- channels: 64
31
- out_channels: 1
32
- kernel_size: 9
33
- dilation: 2
34
- bias: True
35
- noise_upsample_scales: [4, 2, 2, 2]
36
- noise_upsample_activation: "LeakyReLU"
37
- noise_upsample_activation_params:
38
- negative_slope: 0.2
39
- upsample_scales: [2, 2, 2, 2, 2, 2, 2, 2, 1]
40
- upsample_mode: "nearest"
41
- gated_function: "softmax"
42
- use_weight_norm: True
43
-
44
- ###########################################################
45
- # DISCRIMINATOR NETWORK ARCHITECTURE SETTING #
46
- ###########################################################
47
- discriminator_type: "StyleMelGANDiscriminator" # Discriminator type.
48
- discriminator_params:
49
- repeats: 4
50
- window_sizes: [512, 1024, 2048, 4096]
51
- pqmf_params:
52
- - [1, None, None, None]
53
- - [2, 62, 0.26700, 9.0]
54
- - [4, 62, 0.14200, 9.0]
55
- - [8, 62, 0.07949, 9.0]
56
- discriminator_params:
57
- out_channels: 1
58
- kernel_sizes: [5, 3]
59
- channels: 16
60
- max_downsample_channels: 512
61
- bias: True
62
- downsample_scales: [4, 4, 4, 1]
63
- nonlinear_activation: "LeakyReLU"
64
- nonlinear_activation_params:
65
- negative_slope: 0.2
66
- use_weight_norm: True
67
-
68
- ###########################################################
69
- # STFT LOSS SETTING #
70
- ###########################################################
71
- stft_loss_params:
72
- fft_sizes: [1024, 2048, 512] # List of FFT size for STFT-based loss.
73
- hop_sizes: [120, 240, 50] # List of hop size for STFT-based loss
74
- win_lengths: [600, 1200, 240] # List of window length for STFT-based loss.
75
- window: "hann_window" # Window function for STFT-based loss
76
- lambda_aux: 1.0 # Loss balancing coefficient for aux loss.
77
-
78
- ###########################################################
79
- # ADVERSARIAL LOSS SETTING #
80
- ###########################################################
81
- lambda_adv: 1.0 # Loss balancing coefficient for adv loss.
82
- generator_adv_loss_params:
83
- average_by_discriminators: false # Whether to average loss by #discriminators.
84
- loss_type: hinge # Loss function type ("mse" or "hinge").
85
- discriminator_adv_loss_params:
86
- average_by_discriminators: false # Whether to average loss by #discriminators.
87
- loss_type: hinge # Loss function type ("mse" or "hinge").
88
-
89
- ###########################################################
90
- # DATA LOADER SETTING #
91
- ###########################################################
92
- batch_size: 2 # Batch size.
93
- batch_max_steps: 8192 # Length of each audio in batch. Make sure dividable by hop_size.
94
- pin_memory: true # Whether to pin memory in Pytorch DataLoader.
95
- num_workers: 2 # Number of workers in Pytorch DataLoader.
96
- remove_short_samples: false # Whether to remove samples the length of which are less than batch_max_steps.
97
- allow_cache: true # Whether to allow cache in dataset. If true, it requires cpu memory.
98
-
99
- ###########################################################
100
- # OPTIMIZER & SCHEDULER SETTING #
101
- ###########################################################
102
- generator_optimizer_type: Adam
103
- generator_optimizer_params:
104
- lr: 0.0001 # Generator's learning rate.
105
- betas: [0.5, 0.9]
106
- weight_decay: 0.0 # Generator's weight decay coefficient.
107
- generator_scheduler_params:
108
- step_size: 200000 # Generator's scheduler step size.
109
- gamma: 0.5 # Generator's scheduler gamma.
110
- # At each step size, lr will be multiplied by this parameter.
111
- generator_grad_norm: -1 # Generator's gradient norm.
112
- discriminator_optimizer_type: Adam
113
- discriminator_optimizer_params:
114
- lr: 0.00005 # Discriminator's learning rate.
115
- betas: [0.5, 0.9]
116
- weight_decay: 0.0 # Discriminator's weight decay coefficient.
117
- discriminator_scheduler_params:
118
- step_size: 200000 # Discriminator's scheduler step size.
119
- gamma: 0.5 # Discriminator's scheduler gamma.
120
- # At each step size, lr will be multiplied by this parameter.
121
- discriminator_grad_norm: -1 # Discriminator's gradient norm.
122
-
123
- ###########################################################
124
- # INTERVAL SETTING #
125
- ###########################################################
126
- discriminator_train_start_steps: 5 # Number of steps to start to train discriminator.
127
- train_max_steps: 10 # Number of training steps.
128
- save_interval_steps: 5 # Interval steps to save checkpoint.
129
- eval_interval_steps: 5 # Interval steps to evaluate the network.
130
- log_interval_steps: 5 # Interval steps to record the training log.
131
-
132
- ###########################################################
133
- # OTHER SETTING #
134
- ###########################################################
135
- num_save_intermediate_results: 4 # Number of results to be saved as intermediate results.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/yesno/voc1/conf/uhifigan.v1.debug.yaml DELETED
@@ -1,155 +0,0 @@
1
- # This is the configuration file for yesno dataset.
2
- # Note that this configuration is just for debugging.
3
-
4
- ###########################################################
5
- # FEATURE EXTRACTION SETTING #
6
- ###########################################################
7
- sampling_rate: 8000 # Sampling rate.
8
- fft_size: 1024 # FFT size.
9
- hop_size: 256 # Hop size.
10
- win_length: null # Window length.
11
- # If set to null, it will be the same as fft_size.
12
- window: "hann" # Window function.
13
- num_mels: 80 # Number of mel basis.
14
- fmin: 80 # Minimum freq in mel basis calculation.
15
- fmax: 3800 # Maximum frequency in mel basis calculation.
16
- global_gain_scale: 1.0 # Will be multiplied to all of waveform.
17
- trim_silence: true # Whether to trim the start and end of silence.
18
- trim_threshold_in_db: 20 # Need to tune carefully if the recording is not good.
19
- trim_frame_size: 1024 # Frame size in trimming.
20
- trim_hop_size: 256 # Hop size in trimming.
21
- format: "hdf5" # Feature file format. "npy" or "hdf5" is supported.
22
-
23
- ###########################################################
24
- # GENERATOR NETWORK ARCHITECTURE SETTING #
25
- ###########################################################
26
- generator_type: UHiFiGANGenerator
27
- generator_params:
28
- in_channels: 80 # Number of input channels.
29
- out_channels: 1 # Number of output channels.
30
- channels: 32 # Number of initial channels.
31
- kernel_size: 7 # Kernel size of initial and final conv layers.
32
- downsample_scales: [2, 2, 8, 8] # Downsampling scales.
33
- downsample_kernel_sizes: [4, 4, 16, 16] # Kernel size for downsampling layers.
34
- upsample_scales: [8, 8, 2, 2] # Upsampling scales.
35
- upsample_kernel_sizes: [16, 16, 4, 4] # Kernel size for upsampling layers.
36
- resblock_kernel_sizes: [3, 7, 11] # Kernel size for residual blocks.
37
- resblock_dilations: # Dilations for residual blocks.
38
- - [1, 3, 5]
39
- - [1, 3, 5]
40
- - [1, 3, 5]
41
- dropout: 0.1 # Probability of dropout.
42
- use_additional_convs: true # Whether to use additional conv layer in residual blocks.
43
- bias: true # Whether to use bias parameter in conv.
44
- nonlinear_activation: "LeakyReLU" # Nonlinear activation type.
45
- nonlinear_activation_params: # Nonlinear activation paramters.
46
- negative_slope: 0.1
47
- use_weight_norm: true # Whether to apply weight normalization.
48
-
49
- ###########################################################
50
- # DISCRIMINATOR NETWORK ARCHITECTURE SETTING #
51
- ###########################################################
52
- discriminator_type: HiFiGANMultiScaleMultiPeriodDiscriminator
53
- discriminator_params:
54
- scales: 2 # Number of multi-scale discriminator.
55
- scale_downsample_pooling: "AvgPool1d" # Pooling operation for scale discriminator.
56
- scale_downsample_pooling_params:
57
- kernel_size: 4 # Pooling kernel size.
58
- stride: 2 # Pooling stride.
59
- padding: 2 # Padding size.
60
- scale_discriminator_params:
61
- in_channels: 1 # Number of input channels.
62
- out_channels: 1 # Number of output channels.
63
- kernel_sizes: [15, 41, 5, 3] # List of kernel sizes.
64
- channels: 16 # Initial number of channels.
65
- max_downsample_channels: 32 # Maximum number of channels in downsampling conv layers.
66
- max_groups: 16 # Maximum number of groups in downsampling conv layers.
67
- bias: true
68
- downsample_scales: [4, 4, 4, 4] # Downsampling scales.
69
- nonlinear_activation: "LeakyReLU" # Nonlinear activation.
70
- nonlinear_activation_params:
71
- negative_slope: 0.1
72
- follow_official_norm: true # Whether to follow the official norm setting.
73
- periods: [2, 3] # List of period for multi-period discriminator.
74
- period_discriminator_params:
75
- in_channels: 1 # Number of input channels.
76
- out_channels: 1 # Number of output channels.
77
- kernel_sizes: [5, 3] # List of kernel sizes.
78
- channels: 32 # Initial number of channels.
79
- downsample_scales: [4, 4, 4, 4] # Downsampling scales.
80
- max_downsample_channels: 32 # Maximum number of channels in downsampling conv layers.
81
- bias: true # Whether to use bias parameter in conv layer."
82
- nonlinear_activation: "LeakyReLU" # Nonlinear activation.
83
- nonlinear_activation_params: # Nonlinear activation paramters.
84
- negative_slope: 0.1
85
- use_weight_norm: true # Whether to apply weight normalization.
86
- use_spectral_norm: false # Whether to apply spectral normalization.
87
-
88
- ###########################################################
89
- # STFT LOSS SETTING #
90
- ###########################################################
91
- use_stft_loss: false
92
- use_mel_loss: true
93
- generator_adv_loss_params:
94
- average_by_discriminators: false # Whether to average loss by #discriminators.
95
- discriminator_adv_loss_params:
96
- average_by_discriminators: false # Whether to average loss by #discriminators.
97
- use_feat_match_loss: true
98
- feat_match_loss_params:
99
- average_by_discriminators: false # Whether to average loss by # discriminators.
100
- average_by_layers: false # Whether to average loss by # layers in each discriminator.
101
- include_final_outputs: true # Whether to include final outputs in feat match loss calculation.
102
-
103
- ###########################################################
104
- # ADVERSARIAL LOSS SETTING #
105
- ###########################################################
106
- lambda_aux: 45.0 # Loss balancing coefficient for STFT loss.
107
- lambda_adv: 1.0 # Loss balancing coefficient for adversarial loss.
108
- lambda_feat_match: 2.0 # Loss balancing coefficient for feat match loss..
109
-
110
- ###########################################################
111
- # DATA LOADER SETTING #
112
- ###########################################################
113
- batch_size: 2 # Batch size.
114
- batch_max_steps: 4096 # Length of each audio in batch. Make sure dividable by hop_size.
115
- pin_memory: true # Whether to pin memory in Pytorch DataLoader.
116
- num_workers: 2 # Number of workers in Pytorch DataLoader.
117
- remove_short_samples: false # Whether to remove samples the length of which are less than batch_max_steps.
118
- allow_cache: true # Whether to allow cache in dataset. If true, it requires cpu memory.
119
-
120
- ###########################################################
121
- # OPTIMIZER & SCHEDULER SETTING #
122
- ###########################################################
123
- generator_optimizer_type: AdamW
124
- generator_optimizer_params:
125
- lr: 0.0002 # Generator's learning rate.
126
- betas: [0.8, 0.99] # Generator's optimizer beta
127
- weight_decay: 0.0 # Generator's weight decay coefficient.
128
- generator_scheduler_type: ExponentialLR
129
- generator_scheduler_params:
130
- gamma: 0.999 # Generator's scheduler gamma.
131
- generator_grad_norm: -1 # Generator's gradient norm.
132
- discriminator_optimizer_type: AdamW
133
- discriminator_optimizer_params:
134
- lr: 0.0002 # Discriminator's learning rate.
135
- betas: [0.8, 0.99] # Discriminator's optimizer beta
136
- weight_decay: 0.0 # Discriminator's weight decay coefficient.
137
- discriminator_scheduler_type: ExponentialLR
138
- discriminator_scheduler_params:
139
- gamma: 0.999 # Discriminator's scheduler gamma.
140
- discriminator_grad_norm: -1 # Discriminator's gradient norm.
141
-
142
- ###########################################################
143
- # INTERVAL SETTING #
144
- ###########################################################
145
- generator_train_start_steps: 5 # Number of steps to start to train discriminator.
146
- discriminator_train_start_steps: 0 # Number of steps to start to train discriminator.
147
- train_max_steps: 10 # Number of training steps.
148
- save_interval_steps: 5 # Interval steps to save checkpoint.
149
- eval_interval_steps: 5 # Interval steps to evaluate the network.
150
- log_interval_steps: 5 # Interval steps to record the training log.
151
-
152
- ###########################################################
153
- # OTHER SETTING #
154
- ###########################################################
155
- num_save_intermediate_results: 4 # Number of results to be saved as intermediate results.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/yesno/voc1/local/data_download.sh DELETED
@@ -1,28 +0,0 @@
1
- #!/bin/bash
2
-
3
- # Copyright 2019 Tomoki Hayashi
4
- # MIT License (https://opensource.org/licenses/MIT)
5
-
6
- download_dir=$1
7
-
8
- # check arguments
9
- if [ $# != 1 ]; then
10
- echo "Usage: $0 <download_dir>"
11
- exit 1
12
- fi
13
-
14
- set -euo pipefail
15
-
16
- cwd=$(pwd)
17
- if [ ! -e "${download_dir}/LJSpeech-1.1" ]; then
18
- mkdir -p "${download_dir}"
19
- cd "${download_dir}"
20
- wget http://www.openslr.org/resources/1/waves_yesno.tar.gz
21
- tar -xvzf waves_yesno.tar.gz
22
- rm ./waves_yesno/README*
23
- rm waves_yesno.tar.gz
24
- cd "${cwd}"
25
- echo "Successfully downloaded data."
26
- else
27
- echo "Already exists. Skipped."
28
- fi
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/yesno/voc1/local/data_prep.sh DELETED
@@ -1,88 +0,0 @@
1
- #!/bin/bash
2
-
3
- # Copyright 2019 Tomoki Hayashi
4
- # MIT License (https://opensource.org/licenses/MIT)
5
-
6
- # shellcheck disable=SC1091
7
- . ./path.sh || exit 1;
8
-
9
- num_dev=10
10
- num_eval=10
11
- train_set="train_nodev"
12
- dev_set="dev"
13
- eval_set="eval"
14
- shuffle=false
15
- use_fake_segments=false
16
-
17
- # shellcheck disable=SC1091
18
- . utils/parse_options.sh || exit 1;
19
-
20
- db_root=$1
21
- data_dir=$2
22
-
23
- # check arguments
24
- if [ $# != 2 ]; then
25
- echo "Usage: $0 [Options] <db_root> <data_dir>"
26
- echo "e.g.: $0 downloads/waves_yesno data"
27
- echo ""
28
- echo "Options:"
29
- echo " --num_dev: number of development uttreances (default=10)."
30
- echo " --num_eval: number of evaluation uttreances (default=10)."
31
- echo " --train_set: name of train set (default=train_nodev)."
32
- echo " --dev_set: name of dev set (default=dev)."
33
- echo " --eval_set: name of eval set (default=eval)."
34
- echo " --shuffle: whether to perform shuffle in making dev / eval set (default=false)."
35
- echo " --use_fake_segments: whether to use fake segments (default=false)."
36
- exit 1
37
- fi
38
-
39
- set -euo pipefail
40
-
41
- [ ! -e "${data_dir}/all" ] && mkdir -p "${data_dir}/all"
42
-
43
- # set filenames
44
- scp="${data_dir}/all/wav.scp"
45
- segments="${data_dir}/all/segments"
46
-
47
- # check file existence
48
- [ -e "${scp}" ] && rm "${scp}"
49
- [ -e "${segments}" ] && rm "${segments}"
50
-
51
- # make all scp
52
- find "${db_root}" -follow -name "*.wav" | sort | while read -r filename; do
53
- id=$(basename "${filename}" | sed -e "s/\.[^\.]*$//g")
54
- echo "${id} ${filename}" >> "${scp}"
55
- # NOTE(kan-bayashi): for integration test
56
- if "${use_fake_segments}"; then
57
- echo "${id}_1 ${id} 0.0 $(soxi -D "${filename}")" >> "${data_dir}/all/segments"
58
- echo "${id}_2 ${id} 0.0 $(soxi -D "${filename}")" >> "${data_dir}/all/segments"
59
- fi
60
- done
61
-
62
- # split
63
- num_all=$(wc -l < "${scp}")
64
- if "${use_fake_segments}"; then
65
- num_all=$(wc -l < "${segments}")
66
- fi
67
- num_deveval=$((num_dev + num_eval))
68
- num_train=$((num_all - num_deveval))
69
- utils/split_data.sh \
70
- --num_first "${num_train}" \
71
- --num_second "${num_deveval}" \
72
- --shuffle "${shuffle}" \
73
- "${data_dir}/all" \
74
- "${data_dir}/${train_set}" \
75
- "${data_dir}/deveval"
76
- utils/split_data.sh \
77
- --num_first "${num_dev}" \
78
- --num_second "${num_eval}" \
79
- --shuffle "${shuffle}" \
80
- "${data_dir}/deveval" \
81
- "${data_dir}/${dev_set}" \
82
- "${data_dir}/${eval_set}"
83
-
84
- # remove tmp directories
85
- rm -rf "${data_dir}/all"
86
- rm -rf "${data_dir}/deveval"
87
-
88
- echo "Successfully prepared data."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/yesno/voc1/path.sh DELETED
@@ -1,33 +0,0 @@
1
- # cuda related
2
- export CUDA_HOME=/usr/local/cuda-11.3
3
- export LD_LIBRARY_PATH="${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}"
4
-
5
- # path related
6
- export PRJ_ROOT="${PWD}/../../.."
7
- if [ -e "${PRJ_ROOT}/tools/venv/bin/activate" ]; then
8
- # shellcheck disable=SC1090
9
- . "${PRJ_ROOT}/tools/venv/bin/activate"
10
- fi
11
-
12
- # python related
13
- export OMP_NUM_THREADS=1
14
- export PYTHONIOENCODING=UTF-8
15
- export MPL_BACKEND=Agg
16
-
17
- # check installation
18
- if ! command -v parallel-wavegan-train > /dev/null; then
19
- echo "Error: It seems setup is not finished." >&2
20
- echo "Error: Please setup your environment by following README.md" >&2
21
- return 1
22
- fi
23
- if ! command -v jq > /dev/null; then
24
- echo "Error: It seems jq is not installed." >&2
25
- echo "Error: Please install via \`sudo apt-get install jq\`." >&2
26
- echo "Error: If you do not have sudo, please download from https://stedolan.github.io/jq/download/." >&2
27
- return 1
28
- fi
29
- if ! command -v yq > /dev/null; then
30
- echo "Error: It seems yq is not installed." >&2
31
- echo "Error: Please install via \`pip install yq\`." >&2
32
- return 1
33
- fi
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/yesno/voc1/run.sh DELETED
@@ -1,178 +0,0 @@
1
- #!/bin/bash
2
-
3
- # Copyright 2019 Tomoki Hayashi
4
- # MIT License (https://opensource.org/licenses/MIT)
5
-
6
- . ./cmd.sh || exit 1;
7
- . ./path.sh || exit 1;
8
-
9
- # basic settings
10
- stage=-1 # stage to start
11
- stop_stage=100 # stage to stop
12
- verbose=1 # verbosity level (lower is less info)
13
- n_gpus=0 # number of gpus in training
14
- n_jobs=2 # number of parallel jobs in feature extraction
15
-
16
- # NOTE(kan-bayashi): renamed to conf to avoid conflict in parse_options.sh
17
- conf=conf/parallel_wavegan.v1.debug.yaml
18
-
19
- # directory path setting
20
- download_dir=downloads # direcotry to save downloaded files
21
- dumpdir=dump # directory to dump features
22
-
23
- # data setting
24
- use_fake_segments=false # for testing
25
-
26
- # training related setting
27
- tag="" # tag for directory to save model
28
- resume="" # checkpoint path to resume training
29
- # (e.g. <path>/<to>/checkpoint-10000steps.pkl)
30
-
31
- # decoding related setting
32
- checkpoint="" # checkpoint path to be used for decoding
33
- # if not provided, the latest one will be used
34
- # (e.g. <path>/<to>/checkpoint-400000steps.pkl)
35
-
36
- # shellcheck disable=SC1091
37
- . utils/parse_options.sh || exit 1;
38
-
39
- train_set="train_nodev" # name of training data directory
40
- dev_set="dev" # name of development data direcotry
41
- eval_set="eval" # name of evaluation data direcotry
42
-
43
- set -euo pipefail
44
-
45
- if [ "${stage}" -le -1 ] && [ "${stop_stage}" -ge -1 ]; then
46
- echo "Stage -1: Data download"
47
- local/data_download.sh "${download_dir}"
48
- fi
49
-
50
- if [ "${stage}" -le 0 ] && [ "${stop_stage}" -ge 0 ]; then
51
- echo "Stage 0: Data preparation"
52
- local/data_prep.sh \
53
- --use_fake_segments "${use_fake_segments}" \
54
- --train_set "${train_set}" \
55
- --dev_set "${dev_set}" \
56
- --eval_set "${eval_set}" \
57
- "${download_dir}/waves_yesno" data
58
- fi
59
-
60
- stats_ext=$(grep -q "hdf5" <(yq ".format" "${conf}") && echo "h5" || echo "npy")
61
- if [ "${stage}" -le 1 ] && [ "${stop_stage}" -ge 1 ]; then
62
- echo "Stage 1: Feature extraction"
63
- # extract raw features
64
- pids=()
65
- for name in "${train_set}" "${dev_set}" "${eval_set}"; do
66
- (
67
- [ ! -e "${dumpdir}/${name}/raw" ] && mkdir -p "${dumpdir}/${name}/raw"
68
- echo "Feature extraction start. See the progress via ${dumpdir}/${name}/raw/preprocessing.*.log."
69
- utils/make_subset_data.sh "data/${name}" "${n_jobs}" "${dumpdir}/${name}/raw"
70
- ${train_cmd} JOB=1:${n_jobs} "${dumpdir}/${name}/raw/preprocessing.JOB.log" \
71
- parallel-wavegan-preprocess \
72
- --config "${conf}" \
73
- --scp "${dumpdir}/${name}/raw/wav.JOB.scp" \
74
- --dumpdir "${dumpdir}/${name}/raw/dump.JOB" \
75
- --verbose "${verbose}"
76
- echo "Successfully finished feature extraction of ${name} set."
77
- ) &
78
- pids+=($!)
79
- done
80
- i=0; for pid in "${pids[@]}"; do wait "${pid}" || ((++i)); done
81
- [ "${i}" -gt 0 ] && echo "$0: ${i} background jobs are failed." && exit 1;
82
- echo "Successfully finished feature extraction."
83
-
84
- # calculate statistics for normalization
85
- echo "Statistics computation start. See the progress via ${dumpdir}/${train_set}/compute_statistics.log."
86
- ${train_cmd} "${dumpdir}/${train_set}/compute_statistics.log" \
87
- parallel-wavegan-compute-statistics \
88
- --config "${conf}" \
89
- --rootdir "${dumpdir}/${train_set}/raw" \
90
- --dumpdir "${dumpdir}/${train_set}" \
91
- --verbose "${verbose}"
92
- echo "Successfully finished calculation of statistics."
93
-
94
- # normalize and dump them
95
- pids=()
96
- for name in "${train_set}" "${dev_set}" "${eval_set}"; do
97
- (
98
- [ ! -e "${dumpdir}/${name}/norm" ] && mkdir -p "${dumpdir}/${name}/norm"
99
- echo "Nomalization start. See the progress via ${dumpdir}/${name}/norm/normalize.*.log."
100
- ${train_cmd} JOB=1:${n_jobs} "${dumpdir}/${name}/norm/normalize.JOB.log" \
101
- parallel-wavegan-normalize \
102
- --config "${conf}" \
103
- --stats "${dumpdir}/${train_set}/stats.${stats_ext}" \
104
- --rootdir "${dumpdir}/${name}/raw/dump.JOB" \
105
- --dumpdir "${dumpdir}/${name}/norm/dump.JOB" \
106
- --verbose "${verbose}"
107
- echo "Successfully finished normalization of ${name} set."
108
- ) &
109
- pids+=($!)
110
- done
111
- i=0; for pid in "${pids[@]}"; do wait "${pid}" || ((++i)); done
112
- [ "${i}" -gt 0 ] && echo "$0: ${i} background jobs are failed." && exit 1;
113
- echo "Successfully finished normalization."
114
- fi
115
-
116
- if [ -z "${tag}" ]; then
117
- expdir="exp/${train_set}_yesno_$(basename "${conf}" .yaml)"
118
- else
119
- expdir="exp/${train_set}_yesno_${tag}"
120
- fi
121
- if [ "${stage}" -le 2 ] && [ "${stop_stage}" -ge 2 ]; then
122
- echo "Stage 2: Network training"
123
- [ ! -e "${expdir}" ] && mkdir -p "${expdir}"
124
- cp "${dumpdir}/${train_set}/stats.${stats_ext}" "${expdir}"
125
- if [ "${n_gpus}" -gt 1 ]; then
126
- train="python -m parallel_wavegan.distributed.launch --nproc_per_node ${n_gpus} -c parallel-wavegan-train"
127
- else
128
- train="parallel-wavegan-train"
129
- fi
130
- echo "Training start. See the progress via ${expdir}/train.log."
131
- ${cuda_cmd} --gpu "${n_gpus}" "${expdir}/train.log" \
132
- ${train} \
133
- --config "${conf}" \
134
- --train-dumpdir "${dumpdir}/${train_set}/norm" \
135
- --dev-dumpdir "${dumpdir}/${dev_set}/norm" \
136
- --outdir "${expdir}" \
137
- --resume "${resume}" \
138
- --verbose "${verbose}"
139
- echo "Successfully finished training."
140
- fi
141
-
142
- if [ "${stage}" -le 3 ] && [ "${stop_stage}" -ge 3 ]; then
143
- echo "Stage 3: Network decoding"
144
- # shellcheck disable=SC2012
145
- [ -z "${checkpoint}" ] && checkpoint="$(ls -dt "${expdir}"/*.pkl | head -1 || true)"
146
- outdir="${expdir}/wav/$(basename "${checkpoint}" .pkl)"
147
- pids=()
148
- for name in "${dev_set}" "${eval_set}"; do
149
- (
150
- [ ! -e "${outdir}/${name}" ] && mkdir -p "${outdir}/${name}"
151
- [ "${n_gpus}" -gt 1 ] && n_gpus=1
152
- echo "Decoding start. See the progress via ${outdir}/${name}/decode.log."
153
- ${cuda_cmd} --gpu "${n_gpus}" "${outdir}/${name}/decode.log" \
154
- parallel-wavegan-decode \
155
- --dumpdir "${dumpdir}/${name}/norm" \
156
- --checkpoint "${checkpoint}" \
157
- --outdir "${outdir}/${name}" \
158
- --verbose "${verbose}"
159
- echo "Successfully finished decoding of ${name} set."
160
-
161
- # NOTE(kan-bayashi): Extra decoding for debugging
162
- echo "Decoding start. See the progress via ${outdir}/${name}/decode.log."
163
- ${cuda_cmd} --gpu "${n_gpus}" "${outdir}/${name}/decode.log" \
164
- parallel-wavegan-decode \
165
- --normalize-before \
166
- --dumpdir "${dumpdir}/${name}/raw" \
167
- --checkpoint "${checkpoint}" \
168
- --outdir "${outdir}/${name}" \
169
- --verbose "${verbose}"
170
- echo "Successfully finished decoding of ${name} set."
171
- ) &
172
- pids+=($!)
173
- done
174
- i=0; for pid in "${pids[@]}"; do wait "${pid}" || ((++i)); done
175
- [ "${i}" -gt 0 ] && echo "$0: ${i} background jobs are failed." && exit 1;
176
- echo "Successfully finished decoding."
177
- fi
178
- echo "Finished."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
audio/shiftyspeech/speech_synthesis/vocoders/ParallelWaveGAN/egs/yesno/vq1/cmd.sh DELETED
@@ -1,91 +0,0 @@
1
- # ====== About run.pl, queue.pl, slurm.pl, and ssh.pl ======
2
- # Usage: <cmd>.pl [options] JOB=1:<nj> <log> <command...>
3
- # e.g.
4
- # run.pl --mem 4G JOB=1:10 echo.JOB.log echo JOB
5
- #
6
- # Options:
7
- # --time <time>: Limit the maximum time to execute.
8
- # --mem <mem>: Limit the maximum memory usage.
9
- # -–max-jobs-run <njob>: Limit the number parallel jobs. This is ignored for non-array jobs.
10
- # --num-threads <ngpu>: Specify the number of CPU core.
11
- # --gpu <ngpu>: Specify the number of GPU devices.
12
- # --config: Change the configuration file from default.
13
- #
14
- # "JOB=1:10" is used for "array jobs" and it can control the number of parallel jobs.
15
- # The left string of "=", i.e. "JOB", is replaced by <N>(Nth job) in the command and the log file name,
16
- # e.g. "echo JOB" is changed to "echo 3" for the 3rd job and "echo 8" for 8th job respectively.
17
- # Note that the number must start with a positive number, so you can't use "JOB=0:10" for example.
18
- #
19
- # run.pl, queue.pl, slurm.pl, and ssh.pl have unified interface, not depending on its backend.
20
- # These options are mapping to specific options for each backend and
21
- # it is configured by "conf/queue.conf" and "conf/slurm.conf" by default.
22
- # If jobs failed, your configuration might be wrong for your environment.
23
- #
24
- #
25
- # The official documentaion for run.pl, queue.pl, slurm.pl, and ssh.pl:
26
- # "Parallelization in Kaldi": http://kaldi-asr.org/doc/queue.html
27
- # =========================================================~
28
-
29
-
30
- # Select the backend used by run.sh from "local", "stdout", "sge", "slurm", or "ssh"
31
- cmd_backend="stdout"
32
-
33
- # Local machine, without any Job scheduling system
34
- if [ "${cmd_backend}" = local ]; then
35
-
36
- # The other usage
37
- export train_cmd="utils/run.pl"
38
- # Used for "*_train.py": "--gpu" is appended optionally by run.sh
39
- export cuda_cmd="utils/run.pl"
40
- # Used for "*_recog.py"
41
- export decode_cmd="utils/run.pl"
42
-
43
- # Local machine, without any Job scheduling system
44
- elif [ "${cmd_backend}" = stdout ]; then
45
-
46
- # The other usage
47
- export train_cmd="utils/stdout.pl"
48
- # Used for "*_train.py": "--gpu" is appended optionally by run.sh
49
- export cuda_cmd="utils/stdout.pl"
50
- # Used for "*_recog.py"
51
- export decode_cmd="utils/stdout.pl"
52
-
53
- # "qsub" (SGE, Torque, PBS, etc.)
54
- elif [ "${cmd_backend}" = sge ]; then
55
- # The default setting is written in conf/queue.conf.
56
- # You must change "-q g.q" for the "queue" for your environment.
57
- # To know the "queue" names, type "qhost -q"
58
- # Note that to use "--gpu *", you have to setup "complex_value" for the system scheduler.
59
-
60
- export train_cmd="utils/queue.pl"
61
- export cuda_cmd="utils/queue.pl"
62
- export decode_cmd="utils/queue.pl"
63
-
64
- # "sbatch" (Slurm)
65
- elif [ "${cmd_backend}" = slurm ]; then
66
- # The default setting is written in conf/slurm.conf.
67
- # You must change "-p cpu" and "-p gpu" for the "partion" for your environment.
68
- # To know the "partion" names, type "sinfo".
69
- # You can use "--gpu * " by defualt for slurm and it is interpreted as "--gres gpu:*"
70
- # The devices are allocated exclusively using "${CUDA_VISIBLE_DEVICES}".
71
-
72
- export train_cmd="utils/slurm.pl"
73
- export cuda_cmd="utils/slurm.pl"
74
- export decode_cmd="utils/slurm.pl"
75
-
76
- elif [ "${cmd_backend}" = ssh ]; then
77
- # You have to create ".queue/machines" to specify the host to execute jobs.
78
- # e.g. .queue/machines
79
- # host1
80
- # host2
81
- # host3
82
- # Assuming you can login them without any password, i.e. You have to set ssh keys.
83
-
84
- export train_cmd="utils/ssh.pl"
85
- export cuda_cmd="utils/ssh.pl"
86
- export decode_cmd="utils/ssh.pl"
87
-
88
- else
89
- echo "$0: Error: Unknown cmd_backend=${cmd_backend}" 1>&2
90
- return 1
91
- fi