Skip to content

Commit

Permalink
More changes after Dan review.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilya Platonov committed Apr 13, 2016
1 parent 4b5f8ce commit 7dda2e6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion egs/wsj/s5/steps/online/nnet3/decode.sh
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ if [ $stage -le 0 ]; then
--max-active=$max_active --beam=$beam --lattice-beam=$lattice_beam \
--acoustic-scale=$acwt --word-symbol-table=$graphdir/words.txt \
$srcdir/${iter}.mdl $graphdir/HCLG.fst $spk2utt_rspecifier "$wav_rspecifier" \
$lat_wspecifier || exit 1;
"$lat_wspecifier" || exit 1;
fi

if ! $skip_scoring ; then
Expand Down
8 changes: 4 additions & 4 deletions src/nnet3/online-nnet3-decodable-simple.cc
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ void DecodableNnet3SimpleOnline::ComputeForFrame(int32 subsampled_frame) {
input_frame_begin = subsampled_frame * subsample - left_context_;
else
input_frame_begin = subsampled_frame * subsample;
int32 max_possible_input_frame_end = features_ready /* - ( features_ready - right_context_) % subsample */;
int32 max_possible_input_frame_end = features_ready;
if (input_finished && opts_.pad_input)
max_possible_input_frame_end += right_context_;
int32 input_frame_end = std::min<int32>(max_possible_input_frame_end,
Expand Down Expand Up @@ -126,12 +126,13 @@ void DecodableNnet3SimpleOnline::ComputeForFrame(int32 subsampled_frame) {
int32 mfcc_dim = am_nnet_.GetNnet().InputDim("input");
int32 ivector_dim = am_nnet_.GetNnet().InputDim("ivector");
// MFCCs in the left chunk
SubMatrix<BaseFloat> mfcc_mat = features.ColRange(0,mfcc_dim);
SubMatrix<BaseFloat> mfcc_mat(features.ColRange(0, mfcc_dim));

Vector<BaseFloat> input_ivector;
if(ivector_dim != -1){
// iVectors in the right chunk
SubMatrix<BaseFloat> ivector_mat = features.ColRange(mfcc_dim,ivector_dim);
KALDI_ASSERT(features.NumCols() == mfcc_dim + ivector_dim && "Mismatch in features dim");
SubMatrix<BaseFloat> ivector_mat(features.ColRange(mfcc_dim, ivector_dim));
// Get last ivector... not sure if GetCurrentIvector is needed in the online context
// I think it should work fine just getting the last row for testing
input_ivector = ivector_mat.Row(ivector_mat.NumRows() - 1);
Expand Down Expand Up @@ -203,7 +204,6 @@ void DecodableNnet3SimpleOnline::DoNnetComputation(
scaled_loglikes_.Resize(0, 0);
// the following statement just swaps the pointers if we're not using a GPU.
cu_output.Swap(&scaled_loglikes_);
// current_log_post_subsampled_offset_ = output_t_start / subsample;
}

} // namespace nnet3
Expand Down

0 comments on commit 7dda2e6

Please sign in to comment.