[asr] remove useless conf of librispeech (#1227)

* remve useless conf

* format code

* update conf

* update conf

* update conf
pull/1236/head
Hui Zhang 4 years ago committed by GitHub
parent 425b085f94
commit bb2a370b23
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -127,10 +127,10 @@ HiFiGAN checkpoint contains files listed below.
```text ```text
hifigan_csmsc_ckpt_0.1.1 hifigan_csmsc_ckpt_0.1.1
├── default.yaml # default config used to train hifigan ├── default.yaml # default config used to train hifigan
├── feats_stats.npy # generator parameters of hifigan ├── feats_stats.npy # generator parameters of hifigan
└── snapshot_iter_2500000.pdz # statistics used to normalize spectrogram when training hifigan └── snapshot_iter_2500000.pdz # statistics used to normalize spectrogram when training hifigan
``` ```
## Acknowledgement ## Acknowledgement
We adapted some code from https://github.com/kan-bayashi/ParallelWaveGAN. We adapted some code from https://github.com/kan-bayashi/ParallelWaveGAN.

@ -47,63 +47,51 @@ data:
dev_manifest: data/manifest.dev dev_manifest: data/manifest.dev
test_manifest: data/manifest.test test_manifest: data/manifest.test
collator: collator:
vocab_filepath: data/lang_char/vocab.txt vocab_filepath: data/lang_char/vocab.txt
unit_type: 'spm' unit_type: 'spm'
spm_model_prefix: 'data/lang_char/bpe_unigram_5000' spm_model_prefix: 'data/lang_char/bpe_unigram_5000'
mean_std_filepath: "" mean_std_filepath: ""
augmentation_config: conf/preprocess.yaml augmentation_config: conf/preprocess.yaml
batch_size: 16
raw_wav: True # use raw_wav or kaldi feature
spectrum_type: fbank #linear, mfcc, fbank
feat_dim: 80 feat_dim: 80
delta_delta: False
dither: 1.0
target_sample_rate: 16000
max_freq: None
n_fft: None
stride_ms: 10.0 stride_ms: 10.0
window_ms: 25.0 window_ms: 25.0
use_dB_normalization: True sortagrad: 0 # Feed samples from shortest to longest ; -1: enabled for all epochs, 0: disabled, other: enabled for 'other' epochs
target_dB: -20 batch_size: 16
random_seed: 0 maxlen_in: 512 # if input length > maxlen-in, batchsize is automatically reduced
keep_transcription_text: False maxlen_out: 150 # if output length > maxlen-out, batchsize is automatically reduced
sortagrad: True minibatches: 0 # for debug
shuffle_method: batch_shuffle batch_count: auto
num_workers: 2 batch_bins: 0
batch_frames_in: 0
batch_frames_out: 0
batch_frames_inout: 0
augmentation_config: conf/preprocess.yaml
num_workers: 0
subsampling_factor: 1
num_encs: 1
training: training:
n_epoch: 240 n_epoch: 120
accum_grad: 8 accum_grad: 8
global_grad_clip: 5.0 global_grad_clip: 5.0
optim: adam optim: adam
optim_conf: optim_conf:
lr: 0.001 lr: 0.001
weight_decay: 1e-06 weight_decay: 1e-06
scheduler: warmuplr scheduler: warmuplr
scheduler_conf: scheduler_conf:
warmup_steps: 25000 warmup_steps: 25000
lr_decay: 1.0
log_interval: 100 log_interval: 100
checkpoint: checkpoint:
kbest_n: 50 kbest_n: 50
latest_n: 5 latest_n: 5
decoding: decoding:
batch_size: 128 batch_size: 128
error_rate_type: wer error_rate_type: wer
decoding_method: attention # 'attention', 'ctc_greedy_search', 'ctc_prefix_beam_search', 'attention_rescoring' decoding_method: attention # 'attention', 'ctc_greedy_search', 'ctc_prefix_beam_search', 'attention_rescoring'
lang_model_path: data/lm/common_crawl_00.prune01111.trie.klm
alpha: 2.5
beta: 0.3
beam_size: 10 beam_size: 10
cutoff_prob: 1.0
cutoff_top_n: 0
num_proc_bsearch: 8
ctc_weight: 0.5 # ctc weight for attention rescoring decode mode. ctc_weight: 0.5 # ctc weight for attention rescoring decode mode.
decoding_chunk_size: -1 # decoding chunk size. Defaults to -1. decoding_chunk_size: -1 # decoding chunk size. Defaults to -1.
# <0: for decoding, use full chunk. # <0: for decoding, use full chunk.

@ -34,36 +34,35 @@ model:
lsm_weight: 0.1 # label smoothing option lsm_weight: 0.1 # label smoothing option
length_normalized_loss: false length_normalized_loss: false
data: data:
train_manifest: data/manifest.train train_manifest: data/manifest.train
dev_manifest: data/manifest.dev dev_manifest: data/manifest.dev
test_manifest: data/manifest.test test_manifest: data/manifest.test
collator: collator:
vocab_filepath: data/lang_char/vocab.txt vocab_filepath: data/lang_char/vocab.txt
unit_type: 'spm' unit_type: 'spm'
spm_model_prefix: 'data/lang_char/bpe_unigram_5000' spm_model_prefix: 'data/lang_char/bpe_unigram_5000'
mean_std_filepath: "" mean_std_filepath: ""
augmentation_config: conf/preprocess.yaml augmentation_config: conf/preprocess.yaml
batch_size: 64
raw_wav: True # use raw_wav or kaldi feature
spectrum_type: fbank #linear, mfcc, fbank
feat_dim: 80 feat_dim: 80
delta_delta: False
dither: 1.0
target_sample_rate: 16000
max_freq: None
n_fft: None
stride_ms: 10.0 stride_ms: 10.0
window_ms: 25.0 window_ms: 25.0
use_dB_normalization: True sortagrad: 0 # Feed samples from shortest to longest ; -1: enabled for all epochs, 0: disabled, other: enabled for 'other' epochs
target_dB: -20 batch_size: 64
random_seed: 0 maxlen_in: 512 # if input length > maxlen-in, batchsize is automatically reduced
keep_transcription_text: False maxlen_out: 150 # if output length > maxlen-out, batchsize is automatically reduced
sortagrad: True minibatches: 0 # for debug
shuffle_method: batch_shuffle batch_count: auto
num_workers: 2 batch_bins: 0
batch_frames_in: 0
batch_frames_out: 0
batch_frames_inout: 0
augmentation_config: conf/preprocess.yaml
num_workers: 0
subsampling_factor: 1
num_encs: 1
training: training:
@ -101,6 +100,4 @@ decoding:
# >0: for decoding, use fixed chunk size as set. # >0: for decoding, use fixed chunk size as set.
# 0: used for training, it's prohibited here. # 0: used for training, it's prohibited here.
num_decoding_left_chunks: -1 # number of left chunks for decoding. Defaults to -1. num_decoding_left_chunks: -1 # number of left chunks for decoding. Defaults to -1.
simulate_streaming: true # simulate streaming inference. Defaults to False. simulate_streaming: true # simulate streaming inference. Defaults to False.

@ -34,6 +34,7 @@ model:
# hybrid CTC/attention # hybrid CTC/attention
model_conf: model_conf:
ctc_weight: 0.3 ctc_weight: 0.3
ctc_grad_norm_type: null
lsm_weight: 0.1 # label smoothing option lsm_weight: 0.1 # label smoothing option
length_normalized_loss: false length_normalized_loss: false
@ -50,25 +51,24 @@ collator:
spm_model_prefix: 'data/lang_char/bpe_unigram_5000' spm_model_prefix: 'data/lang_char/bpe_unigram_5000'
mean_std_filepath: "" mean_std_filepath: ""
augmentation_config: conf/preprocess.yaml augmentation_config: conf/preprocess.yaml
batch_size: 16
raw_wav: True # use raw_wav or kaldi feature
spectrum_type: fbank #linear, mfcc, fbank
feat_dim: 80 feat_dim: 80
delta_delta: False
dither: 1.0
target_sample_rate: 16000
max_freq: None
n_fft: None
stride_ms: 10.0 stride_ms: 10.0
window_ms: 25.0 window_ms: 25.0
use_dB_normalization: True sortagrad: 0 # Feed samples from shortest to longest ; -1: enabled for all epochs, 0: disabled, other: enabled for 'other' epochs
target_dB: -20 batch_size: 16
random_seed: 0 maxlen_in: 512 # if input length > maxlen-in, batchsize is automatically reduced
keep_transcription_text: False maxlen_out: 150 # if output length > maxlen-out, batchsize is automatically reduced
sortagrad: True minibatches: 0 # for debug
shuffle_method: batch_shuffle batch_count: auto
num_workers: 2 batch_bins: 0
batch_frames_in: 0
batch_frames_out: 0
batch_frames_inout: 0
augmentation_config: conf/preprocess.yaml
num_workers: 0
subsampling_factor: 1
num_encs: 1
training: training:
n_epoch: 70 n_epoch: 70

@ -51,24 +51,23 @@ collator:
spm_model_prefix: 'data/lang_char/bpe_unigram_5000' spm_model_prefix: 'data/lang_char/bpe_unigram_5000'
mean_std_filepath: "" mean_std_filepath: ""
augmentation_config: conf/preprocess.yaml augmentation_config: conf/preprocess.yaml
batch_size: 32
raw_wav: True # use raw_wav or kaldi feature
spectrum_type: fbank #linear, mfcc, fbank
feat_dim: 80 feat_dim: 80
delta_delta: False
dither: 1.0
target_sample_rate: 16000
max_freq: None
n_fft: None
stride_ms: 10.0 stride_ms: 10.0
window_ms: 25.0 window_ms: 25.0
use_dB_normalization: True sortagrad: 0 # Feed samples from shortest to longest ; -1: enabled for all epochs, 0: disabled, other: enabled for 'other' epochs
target_dB: -20 batch_size: 32
random_seed: 0 maxlen_in: 512 # if input length > maxlen-in, batchsize is automatically reduced
keep_transcription_text: False maxlen_out: 150 # if output length > maxlen-out, batchsize is automatically reduced
sortagrad: True minibatches: 0 # for debug
shuffle_method: batch_shuffle batch_count: auto
num_workers: 2 batch_bins: 0
batch_frames_in: 0
batch_frames_out: 0
batch_frames_inout: 0
augmentation_config: conf/preprocess.yaml
num_workers: 0
subsampling_factor: 1
num_encs: 1
training: training:

@ -265,7 +265,7 @@ class U2Trainer(Trainer):
batch_frames_in=config.collator.batch_frames_in, batch_frames_in=config.collator.batch_frames_in,
batch_frames_out=config.collator.batch_frames_out, batch_frames_out=config.collator.batch_frames_out,
batch_frames_inout=config.collator.batch_frames_inout, batch_frames_inout=config.collator.batch_frames_inout,
preprocess_conf=config.collator.augmentation_config, preprocess_conf=config.collator.augmentation_config,
n_iter_processes=config.collator.num_workers, n_iter_processes=config.collator.num_workers,
subsampling_factor=1, subsampling_factor=1,
num_encs=1) num_encs=1)
@ -284,7 +284,7 @@ class U2Trainer(Trainer):
batch_frames_in=0, batch_frames_in=0,
batch_frames_out=0, batch_frames_out=0,
batch_frames_inout=0, batch_frames_inout=0,
preprocess_conf=config.collator.augmentation_config, preprocess_conf=config.collator.augmentation_config,
n_iter_processes=config.collator.num_workers, n_iter_processes=config.collator.num_workers,
subsampling_factor=1, subsampling_factor=1,
num_encs=1) num_encs=1)

@ -106,7 +106,7 @@ class Frontend():
for seg in segments: for seg in segments:
phones = [] phones = []
# Replace all English words in the sentence # Replace all English words in the sentence
seg = re.sub('[a-zA-Z]+','',seg) seg = re.sub('[a-zA-Z]+', '', seg)
seg_cut = psg.lcut(seg) seg_cut = psg.lcut(seg)
initials = [] initials = []
finals = [] finals = []

@ -942,7 +942,12 @@ class StyleFastSpeech2Inference(FastSpeech2Inference):
""" """
spk_id = paddle.to_tensor(spk_id) spk_id = paddle.to_tensor(spk_id)
normalized_mel, d_outs, p_outs, e_outs = self.acoustic_model.inference( normalized_mel, d_outs, p_outs, e_outs = self.acoustic_model.inference(
text, durations=None, pitch=None, energy=None, spk_emb=spk_emb, spk_id=spk_id) text,
durations=None,
pitch=None,
energy=None,
spk_emb=spk_emb,
spk_id=spk_id)
# priority: groundtruth > scale/bias > previous output # priority: groundtruth > scale/bias > previous output
# set durations # set durations
if isinstance(durations, np.ndarray): if isinstance(durations, np.ndarray):
@ -995,9 +1000,8 @@ class StyleFastSpeech2Inference(FastSpeech2Inference):
pitch=pitch, pitch=pitch,
energy=energy, energy=energy,
use_teacher_forcing=True, use_teacher_forcing=True,
spk_emb=spk_emb, spk_emb=spk_emb,
spk_id=spk_id spk_id=spk_id)
)
logmel = self.normalizer.inverse(normalized_mel) logmel = self.normalizer.inverse(normalized_mel)
return logmel return logmel

Loading…
Cancel
Save