pull/522/head
Hui Zhang 5 years ago
parent 76290375b7
commit 16dcdf34dc

@ -0,0 +1,10 @@
export MAIN_ROOT=${PWD}
export PATH=${MAIN_ROOT}:${PWD}/tools:${PATH}
export LC_ALL=C
# Use UTF-8 in Python to avoid UnicodeDecodeError when LC_ALL=C
export PYTHONIOENCODING=UTF-8
export PYTHONPATH=${MAIN_ROOT}:${PYTHONPATH}
export export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib/

@ -29,9 +29,9 @@ model:
use_gru: True
share_rnn_weights: False
training:
n_epoch: 20
n_epoch: 30
lr: 5e-4
lr_decay: 1.0
lr_decay: 0.83
weight_decay: 1e-06
global_grad_clip: 5.0
max_iteration: 500000

@ -0,0 +1,28 @@
#! /usr/bin/env bash
# grid-search for hyper-parameters in language model
python3 -u ${MAIN_ROOT}/tune.py \
--device 'gpu' \
--nproc 1 \
--config conf/deepspeech2.yaml \
--num_batches=-1 \
--batch_size=128 \
--beam_size=500 \
--num_proc_bsearch=12 \
--num_alphas=45 \
--num_betas=8 \
--alpha_from=1.0 \
--alpha_to=3.2 \
--beta_from=0.1 \
--beta_to=0.45 \
--cutoff_prob=1.0 \
--cutoff_top_n=40 \
--checkpoint_path ${1}
if [ $? -ne 0 ]; then
echo "Failed in tuning!"
exit 1
fi
exit 0

@ -6,3 +6,5 @@ export LC_ALL=C
# Use UTF-8 in Python to avoid UnicodeDecodeError when LC_ALL=C
export PYTHONIOENCODING=UTF-8
export PYTHONPATH=${MAIN_ROOT}:${PYTHONPATH}
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib/

@ -6,3 +6,5 @@ export LC_ALL=C
# Use UTF-8 in Python to avoid UnicodeDecodeError when LC_ALL=C
export PYTHONIOENCODING=UTF-8
export PYTHONPATH=${MAIN_ROOT}:${PYTHONPATH}
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib/

@ -6,3 +6,5 @@ export LC_ALL=C
# Use UTF-8 in Python to avoid UnicodeDecodeError when LC_ALL=C
export PYTHONIOENCODING=UTF-8
export PYTHONPATH=${MAIN_ROOT}:${PYTHONPATH}
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib/

@ -281,8 +281,8 @@ class GRUCellShare(nn.RNNCellBase):
self.hidden_size = hidden_size
self.input_size = input_size
self._gate_activation = F.sigmoid
#self._activation = paddle.tanh
self._activation = F.relu
self._activation = paddle.tanh
#self._activation = F.relu
def forward(self, inputs, states=None):
if states is None:

@ -29,7 +29,7 @@ if [ $? != 0 ]; then
fi
tar -zxvf libsndfile-1.0.28.tar.gz
cd libsndfile-1.0.28
./configure > /dev/null && make > /dev/null && make install > /dev/null
./configure > /dev/null; make > /dev/null; make install > /dev/null
cd ..
rm -rf libsndfile-1.0.28
rm libsndfile-1.0.28.tar.gz

@ -27,7 +27,7 @@ if __name__ == '__main__':
text = np.array([[1, 2], [1, 2]], dtype='int32')
text_len = np.array([2] * batch_size, dtype='int32')
place = paddle.CUDAPinnedPlace()
place = paddle.CUDAPlace(0)
audio = paddle.to_tensor(
audio, dtype='float32', place=place, stop_gradient=True)
audio_len = paddle.to_tensor(

@ -22,7 +22,6 @@ import codecs
import json
from collections import Counter
import os.path
import _init_paths
from data_utils.utility import read_manifest
from utils.utility import add_arguments, print_arguments

@ -15,7 +15,6 @@
import argparse
import functools
import _init_paths
from data_utils.normalizer import FeatureNormalizer
from data_utils.augmentor.augmentation import AugmentationPipeline
from data_utils.featurizer.audio_featurizer import AudioFeaturizer

Loading…
Cancel
Save