Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge master into kaldi10 #3105

Merged
merged 13 commits into from
Mar 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ if [ $stage -le 0 ]; then
fi
utils/data/get_uniform_subsegments.py \
--max-segment-duration=$window \
--overlap-duration=$(echo "$window-$period" | bc) \
--overlap-duration=$(perl -e "print ($window-$period);") \
--max-remaining-duration=$min_segment \
--constant-duration=True \
$segments > $dir/subsegments
Expand Down
2 changes: 1 addition & 1 deletion egs/callhome_diarization/v1/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ if [ $stage -le 6 ]; then

der=$(grep -oP 'DIARIZATION\ ERROR\ =\ \K[0-9]+([.][0-9]+)?' \
exp/tuning/${dataset}_t${threshold})
if [ $(echo $der'<'$best_der | bc -l) -eq 1 ]; then
if [ $(perl -e "print ($der < $best_der ? 1 : 0);") -eq 1 ]; then
best_der=$der
best_threshold=$threshold
fi
Expand Down
2 changes: 1 addition & 1 deletion egs/callhome_diarization/v2/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ if [ $stage -le 10 ]; then

der=$(grep -oP 'DIARIZATION\ ERROR\ =\ \K[0-9]+([.][0-9]+)?' \
$nnet_dir/tuning/${dataset}_t${threshold})
if [ $(echo $der'<'$best_der | bc -l) -eq 1 ]; then
if [ $(perl -e "print ($der < $best_der ? 1 : 0);") -eq 1 ]; then
best_der=$der
best_threshold=$threshold
fi
Expand Down
2 changes: 1 addition & 1 deletion egs/dihard_2018/v1/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ if [ $stage -le 7 ]; then

der=$(grep -oP 'DIARIZATION\ ERROR\ =\ \K[0-9]+([.][0-9]+)?' \
$ivec_dir/tuning/dihard_2018_dev_t${threshold})
if [ $(echo $der'<'$best_der | bc -l) -eq 1 ]; then
if [ $(perl -e "print ($der < $best_der ? 1 : 0);") -eq 1 ]; then
best_der=$der
best_threshold=$threshold
fi
Expand Down
2 changes: 1 addition & 1 deletion egs/dihard_2018/v2/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ if [ $stage -le 12 ]; then

der=$(grep -oP 'DIARIZATION\ ERROR\ =\ \K[0-9]+([.][0-9]+)?' \
$nnet_dir/tuning/dihard_2018_dev_t${threshold})
if [ $(echo $der'<'$best_der | bc -l) -eq 1 ]; then
if [ $(perl -e "print ($der < $best_der ? 1 : 0);") -eq 1 ]; then
best_der=$der
best_threshold=$threshold
fi
Expand Down
2 changes: 1 addition & 1 deletion egs/rm/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ About the Resource Management corpus:

Each subdirectory of this directory contains the
scripts for a sequence of experiments.
s5 is the currently recommmended setup.
s5 is the currently recommended setup.

s5: This is the "new-new-style" recipe. It is now finished.
All further work will be on top of this style of recipe. Note:
Expand Down
4 changes: 2 additions & 2 deletions egs/sre08/v1/local/score_sre08.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ tot_eer=0.0
printf '% 12s' 'EER:'
for condition in $(seq 8); do
eer=$(awk '{print $3}' $scores | paste - $trials | awk -v c=$condition '{n=4+c; if ($n == "Y") print $1, $4}' | compute-eer - 2>/dev/null)
tot_eer=$(echo "$tot_eer+$eer" | bc)
tot_eer=$(perl -e "print ($tot_eer+$eer);")
eers[$condition]=$eer
done

eers[0]=$(echo "$tot_eer/8" | bc -l)
eers[0]=$(perl -e "print ($tot_eer/8.0);")

for i in $(seq 0 8); do
printf '% 7.2f' ${eers[$i]}
Expand Down
8 changes: 7 additions & 1 deletion egs/swbd/s5c/local/score_sclite_conf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ for f in $data/stm $data/glm $lang/words.txt $lang/phones/word_boundary.int \
[ ! -f $f ] && echo "$0: expecting file $f to exist" && exit 1;
done

if [ -f $dir/../frame_subsampling_factor ]; then
factor=$(cat $dir/../frame_subsampling_factor) || exit 1
frame_shift_opt="--frame-shift=0.0$factor"
echo "$0: $dir/../frame_subsampling_factor exists, using $frame_shift_opt"
fi

name=`basename $data`; # e.g. eval2000

mkdir -p $dir/scoring/log
Expand All @@ -51,7 +57,7 @@ if [ $stage -le 0 ]; then
ACWT=\`perl -e \"print 1.0/LMWT\;\"\` '&&' \
lattice-add-penalty --word-ins-penalty=$wip "ark:gunzip -c $dir/lat.*.gz|" ark:- \| \
lattice-align-words $lang/phones/word_boundary.int $model ark:- ark:- \| \
lattice-to-ctm-conf --decode-mbr=$decode_mbr --acoustic-scale=\$ACWT ark:- - \| \
lattice-to-ctm-conf $frame_shift_opt --decode-mbr=$decode_mbr --acoustic-scale=\$ACWT ark:- - \| \
utils/int2sym.pl -f 5 $lang/words.txt \| \
utils/convert_ctm.pl $data/segments $data/reco2file_and_channel \
'>' $dir/score_LMWT_${wip}/$name.ctm || exit 1;
Expand Down
2 changes: 1 addition & 1 deletion egs/wsj/s5/local/chain/tuning/run_tdnn_1g.sh
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ if [ $stage -le 15 ]; then
echo "$0: creating neural net configs using the xconfig parser";

num_targets=$(tree-info $tree_dir/tree |grep num-pdfs|awk '{print $2}')
learning_rate_factor=$(echo "print 0.5/$xent_regularize" | python)
learning_rate_factor=$(echo "print(0.5/$xent_regularize)" | python)
tdnn_opts="l2-regularize=0.01 dropout-proportion=0.0 dropout-per-dim-continuous=true"
tdnnf_opts="l2-regularize=0.01 dropout-proportion=0.0 bypass-scale=0.66"
linear_opts="l2-regularize=0.01 orthonormal-constraint=-1.0"
Expand Down
6 changes: 2 additions & 4 deletions egs/wsj/s5/steps/segmentation/internal/merge_targets.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

# Copyright 2017 Vimal Manohar
# Apache 2.0
Expand All @@ -16,8 +16,6 @@
option.
"""

from __future__ import print_function
from __future__ import division
import argparse
import logging
import numpy as np
Expand Down Expand Up @@ -111,7 +109,7 @@ def should_remove_frame(row, dim):
# source[2] = [ 0 0 0 ]
"""
assert len(row) % dim == 0
num_sources = len(row) / dim
num_sources = len(row) // dim

max_idx = np.argmax(row)
max_val = row[max_idx]
Expand Down
6 changes: 3 additions & 3 deletions egs/wsj/s5/utils/data/perturb_data_dir_volume.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ for line in sys.stdin.readlines():
parts = line.strip().split()
if line.strip()[-1] == '|':
if re.search('sox --vol', ' '.join(parts[-11:])):
print 'true'
print('true')
sys.exit(0)
elif re.search(':[0-9]+$', line.strip()) is not None:
continue
else:
if ' '.join(parts[1:3]) == 'sox --vol':
print 'true'
print('true')
sys.exit(0)
print 'false'
print('false')
"` || exit 1

if $volume_perturb_done; then
Expand Down
6 changes: 3 additions & 3 deletions src/bin/compute-wer-bootci.cc
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ int main(int argc, char *argv[]) {

try {
const char *usage =
"Compute a bootstrapping of WER to extract the 95\% confidence interval.\n"
"Compute a bootstrapping of WER to extract the 95% confidence interval.\n"
"Take a reference and a transcription file, in integer or text format,\n"
"and outputs overall WER statistics to standard output along with its\n"
"confidence interval using the bootstrap method of Bisani and Ney.\n"
Expand Down Expand Up @@ -234,12 +234,12 @@ int main(int argc, char *argv[]) {
std::cout.precision(2);
std::cerr.precision(2);
std::cout << "Set1: %WER " << std::fixed << 100*mean_wer <<
" 95\% Conf Interval [ " << 100*mean_wer-100*interval <<
" 95% Conf Interval [ " << 100*mean_wer-100*interval <<
", " << 100*mean_wer+100*interval << " ]" << '\n';

if(!hyp2_rspecifier.empty()) {
std::cout << "Set2: %WER " << std::fixed << 100*mean_wer2 <<
" 95\% Conf Interval [ " << 100*mean_wer2-100*interval2 <<
" 95% Conf Interval [ " << 100*mean_wer2-100*interval2 <<
", " << 100*mean_wer2+100*interval2 << " ]" << '\n';

std::cout << "Probability of Set2 improving Set1: " << std::fixed <<
Expand Down
2 changes: 2 additions & 0 deletions src/cudamatrix/cu-device.cc
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,14 @@ void CuDevice::Initialize() {
CUBLAS_SAFE_CALL(cublasCreate(&cublas_handle_));
CUBLAS_SAFE_CALL(cublasSetStream(cublas_handle_, cudaStreamPerThread));

#if CUDA_VERSION >= 9000
if (device_options_.use_tensor_cores) {
// Enable tensor cores in CUBLAS
// Note if the device does not support tensor cores this will fall back to normal math mode
CUBLAS_SAFE_CALL(cublasSetMathMode(cublas_handle_,
CUBLAS_TENSOR_OP_MATH));
}
#endif

// Initialize the cuSPARSE library
CUSPARSE_SAFE_CALL(cusparseCreate(&cusparse_handle_));
Expand Down
Loading