Skip to content

Commit 011808d

Browse files
committed
trunk: some cosmetic fixes; enable raw feature-type in dump_bottleneck_features.sh
git-svn-id: https://svn.code.sf.net/p/kaldi/code/trunk@4492 5e6a8d80-dfce-4ca6-a32a-6e07a63d50c8
1 parent 520adc0 commit 011808d

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

egs/wsj/s5/steps/nnet2/dump_bottleneck_features.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
# Apache 2.0
55

66

7-
# Begin configuration section.
7+
# Begin configuration section.
8+
feat_type=
89
stage=1
910
nj=4
1011
cmd=run.pl
@@ -59,10 +60,13 @@ splice_opts=`cat $nnetdir/splice_opts 2>/dev/null`
5960
[[ -d $sdata && $data/feats.scp -ot $sdata ]] || split_data.sh $data $nj || exit 1;
6061

6162
## Set up input features of nnet
62-
if [ -f $nnetdir/final.mat ]; then feat_type=lda; else feat_type=delta; fi
63+
if [ -z "$feat_type" ]; then
64+
if [ -f $nnetdir/final.mat ]; then feat_type=lda; else feat_type=delta; fi
65+
fi
6366
echo "$0: feature type is $feat_type"
6467

6568
case $feat_type in
69+
raw) feats="ark,s,cs:apply-cmvn --norm-vars=false --utt2spk=ark:$sdata/JOB/utt2spk scp:$sdata/JOB/cmvn.scp scp:$sdata/JOB/feats.scp ark:- |";;
6670
delta) feats="ark,s,cs:apply-cmvn --norm-vars=false --utt2spk=ark:$sdata/JOB/utt2spk scp:$sdata/JOB/cmvn.scp scp:$sdata/JOB/feats.scp ark:- | add-deltas ark:- ark:- |";;
6771
lda) feats="ark,s,cs:apply-cmvn --norm-vars=false --utt2spk=ark:$sdata/JOB/utt2spk scp:$sdata/JOB/cmvn.scp scp:$sdata/JOB/feats.scp ark:- | splice-feats $splice_opts ark:- ark:- | transform-feats $nnetdir/final.mat ark:- ark:- |"
6872
;;

src/decoder/faster-decoder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ class FasterDecoder {
102102
/// object, but if max_num_frames is >= 0 it will decode no more than
103103
/// that many frames.
104104
void AdvanceDecoding(DecodableInterface *decodable,
105-
int32 max_num_frames = -1);
105+
int32 max_num_frames = -1);
106106

107107
/// Returns the number of frames already decoded.
108108
int32 NumFramesDecoded() const { return num_frames_decoded_; }

src/nnet2/nnet-compute.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,10 @@ NnetComputer::NnetComputer(const Nnet &nnet,
6565
Nnet *nnet_to_update):
6666
nnet_(nnet), nnet_to_update_(nnet_to_update) {
6767
int32 dim = input_feats.NumCols();
68-
KALDI_ASSERT(dim == nnet.InputDim());
69-
68+
if (dim != nnet.InputDim()) {
69+
KALDI_ERR << "Feature dimension is " << dim << " but network expects "
70+
<< nnet.InputDim();
71+
}
7072
forward_data_.resize(nnet.NumComponents() + 1);
7173

7274
int32 left_context = (pad ? nnet_.LeftContext() : 0),

src/tree/cluster-utils.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,6 @@ class RefineClusterer {
776776
void Iterate() {
777777
int32 iter, num_iters = cfg_.num_iters;
778778
for (iter = 0;iter < num_iters;iter++) {
779-
// do not do more than 100 iterations-- this is not an exact algorithm anyway.
780779
int32 cur_t = t_;
781780
for (int32 point = 0;point < num_points_;point++) {
782781
if (t_+1 == 0) {

0 commit comments

Comments
 (0)