From 837aaa9ed2959c1cc163041d6883728a3f7c1cb0 Mon Sep 17 00:00:00 2001 From: Yibing Liu Date: Wed, 30 May 2018 21:23:39 -0700 Subject: [PATCH] Update training & profiling scripts for new config --- fluid/DeepASR/README.md | 36 +++++++++++++++++++++-- fluid/DeepASR/examples/aishell/profile.sh | 6 ++-- fluid/DeepASR/examples/aishell/train.sh | 11 +++---- fluid/DeepASR/tools/profile.py | 4 ++- 4 files changed, 45 insertions(+), 12 deletions(-) diff --git a/fluid/DeepASR/README.md b/fluid/DeepASR/README.md index 0c3c95a6..6b9913fd 100644 --- a/fluid/DeepASR/README.md +++ b/fluid/DeepASR/README.md @@ -1,6 +1,36 @@ The minimum PaddlePaddle version needed for the code sample in this directory is the lastest develop branch. If you are on a version of PaddlePaddle earlier than this, [please update your installation](http://www.paddlepaddle.org/docs/develop/documentation/en/build_and_install/pip_install_en.html). ---- -### TODO +## Deep Automatic Speech Recognition -This project is still under active development. +### Introduction +TBD + +### Installation + +#### Kaldi +The decoder depends on [kaldi](https://github.com/kaldi-asr/kaldi), install it by flowing its instructions. Then + +```shell +export KALDI_ROOT= +``` + +#### Decoder + +```shell +git clone https://github.com/PaddlePaddle/models.git +cd models/fluid/DeepASR/decoder +sh setup.sh +``` + +### Data reprocessing +TBD + +### Training +TBD + + +### Inference & Decoding +TBD + +### Question and Contribution +TBD diff --git a/fluid/DeepASR/examples/aishell/profile.sh b/fluid/DeepASR/examples/aishell/profile.sh index 231ebf07..a7397c30 100644 --- a/fluid/DeepASR/examples/aishell/profile.sh +++ b/fluid/DeepASR/examples/aishell/profile.sh @@ -1,7 +1,7 @@ -export CUDA_VISIBLE_DEVICES=2,3,4,5 +export CUDA_VISIBLE_DEVICES=0,1,2,3 python -u ../../tools/profile.py --feature_lst data/train_feature.lst \ --label_lst data/train_label.lst \ --mean_var data/aishell/global_mean_var \ --parallel \ - --frame_dim 2640 \ - --class_num 101 \ + --frame_dim 80 \ + --class_num 3040 \ diff --git a/fluid/DeepASR/examples/aishell/train.sh b/fluid/DeepASR/examples/aishell/train.sh index 41c0df2c..c536c932 100644 --- a/fluid/DeepASR/examples/aishell/train.sh +++ b/fluid/DeepASR/examples/aishell/train.sh @@ -1,13 +1,14 @@ -export CUDA_VISIBLE_DEVICES=2,3,4,5 +export CUDA_VISIBLE_DEVICES=0,1,2,3 python -u ../../train.py --train_feature_lst data/train_feature.lst \ --train_label_lst data/train_label.lst \ --val_feature_lst data/val_feature.lst \ --val_label_lst data/val_label.lst \ --mean_var data/aishell/global_mean_var \ --checkpoints checkpoints \ - --frame_dim 2640 \ - --class_num 101 \ + --frame_dim 80 \ + --class_num 3040 \ --infer_models '' \ - --batch_size 128 \ - --learning_rate 0.00016 \ + --batch_size 64 \ + --learning_rate 6.4e-5 \ --parallel +~ diff --git a/fluid/DeepASR/tools/profile.py b/fluid/DeepASR/tools/profile.py index 5af55614..801252c8 100644 --- a/fluid/DeepASR/tools/profile.py +++ b/fluid/DeepASR/tools/profile.py @@ -147,7 +147,7 @@ def profile(args): ltrans = [ trans_add_delta.TransAddDelta(2, 2), trans_mean_variance_norm.TransMeanVarianceNorm(args.mean_var), - trans_splice.TransSplice(), trans_delay.TransDelay(5) + trans_splice.TransSplice(5, 5), trans_delay.TransDelay(5) ] data_reader = reader.AsyncDataReader(args.feature_lst, args.label_lst, -1) @@ -170,6 +170,8 @@ def profile(args): frames_seen = 0 # load_data (features, labels, lod, _) = batch_data + features = np.reshape(features, (-1, 11, 3, args.frame_dim)) + features = np.transpose(features, (0, 2, 1, 3)) feature_t.set(features, place) feature_t.set_lod([lod]) label_t.set(labels, place) -- GitLab