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

incorporate changes made by Guoli Ye to CE utilities #26

Merged
merged 1 commit into from
Jan 7, 2016
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
13 changes: 11 additions & 2 deletions src/net/ce-loss.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

// Copyright 2011 Brno University of Technology (author: Karel Vesely)
// 2015 Yajie Miao
// 2015 Guoli Ye

// See ../../COPYING for clarification regarding multiple authors
//
Expand Down Expand Up @@ -75,7 +76,11 @@ void CE::Eval(const CuMatrixBase<BaseFloat> &net_out, const std::vector<int32> &
if (sequences_progress_ > report_step_) {
KALDI_LOG << "After " << sequences_num_ << " sequences (" << frames_/(100.0 * 3600) << "Hr): "
<< "CE-Obj = " << obj_progress_/sequences_progress_
<< " FrameAcc = " << 100.0*(correct_progress_/frames_progress_) << "%";
<< "Frame-level CE-Obj = " << obj_progress_/frames_progress_
<< " FrameAcc = " << 100.0*(double(correct_progress_)/frames_progress_) << "%"
<< " obj_progress_= " << obj_progress_
<< " sequences_progress_= " << sequences_progress_
<< " frames_progress_= " << frames_progress_ ;
// reset
sequences_progress_ = 0;
frames_progress_ = 0;
Expand Down Expand Up @@ -148,7 +153,11 @@ void CE::EvalParallel(const CuMatrixBase<BaseFloat> &net_out,
if (sequences_progress_ > report_step_) {
KALDI_LOG << "After " << sequences_num_ << " sequences (" << frames_/(100.0 * 3600) << "Hr): "
<< "CE-Obj = " << obj_progress_/sequences_progress_
<< " FrameAcc = " << 100.0*(correct_progress_/frames_progress_) << "%";
<< "Frame-level CE-Obj = " << obj_progress_/frames_progress_
<< " FrameAcc = " << 100.0*(double(correct_progress_)/frames_progress_) << "%"
<< " obj_progress_= " << obj_progress_
<< " sequences_progress_= " << sequences_progress_
<< " frames_progress_= " << frames_progress_ ;
// reset
sequences_progress_ = 0;
frames_progress_ = 0;
Expand Down
4 changes: 4 additions & 0 deletions src/netbin/train-ce-parallel.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// netbin/train-ce-parallel.cc

// Copyright 2015 Yajie Miao
// Guoli Ye

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -149,6 +150,9 @@ int main(int argc, char *argv[]) {
}
}

// guoye: add here, I think I fix the bugs. Set the original lengths of utterances before padding
net.SetSeqLengths(frame_num_utt);

// Propagation and CTC training
net.Propagate(CuMatrix<BaseFloat>(feat_mat_host), &net_out);
ce.EvalParallel(net_out, target_host, &obj_diff, frame_mask_host, cur_sequence_num);
Expand Down