Commit 369e909a authored by Saeed SARFJOO's avatar Saeed SARFJOO
Browse files

make cpu-based kaldi version

parent 2ae4784d
diff --git a/src/Makefile b/src/Makefile
index 1b37ebce7..ce8958c71 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -8,14 +8,14 @@ SHELL := /bin/bash
SUBDIRS = base matrix util feat tree gmm transform \
fstext hmm lm decoder lat kws cudamatrix nnet \
bin fstbin gmmbin fgmmbin featbin \
- nnetbin latbin sgmm2 sgmm2bin nnet2 nnet3 rnnlm chain nnet3bin nnet2bin kwsbin \
- ivector ivectorbin online2 online2bin lmbin chainbin rnnlmbin
+ nnetbin latbin sgmm2 sgmm2bin nnet2 nnet3 chain nnet2bin kwsbin \
+ ivector ivectorbin online2 lmbin chainbin
MEMTESTDIRS = base matrix util feat tree gmm transform \
fstext hmm lm decoder lat nnet kws chain \
bin fstbin gmmbin fgmmbin featbin \
- nnetbin latbin sgmm2 nnet2 nnet3 rnnlm nnet2bin nnet3bin sgmm2bin kwsbin \
- ivector ivectorbin online2 online2bin lmbin
+ nnetbin latbin sgmm2 nnet2 nnet3 nnet2bin sgmm2bin kwsbin \
+ ivector ivectorbin online2 lmbin
CUDAMEMTESTDIR = cudamatrix
@@ -150,7 +150,7 @@ $(EXT_SUBDIRS) : mklibdir ext_depend
### Dependency list ###
# this is necessary for correct parallel compilation
#1)The tools depend on all the libraries
-bin fstbin gmmbin fgmmbin sgmm2bin featbin nnetbin nnet2bin nnet3bin chainbin latbin ivectorbin lmbin kwsbin online2bin rnnlmbin: \
+bin fstbin gmmbin fgmmbin sgmm2bin featbin nnetbin nnet2bin chainbin latbin ivectorbin lmbin kwsbin: \
base matrix util feat tree gmm transform sgmm2 fstext hmm \
lm decoder lat cudamatrix nnet nnet2 nnet3 ivector chain kws online2 rnnlm
diff --git a/src/configure b/src/configure
index b94731da9..e7dc9dbb3 100755
--- a/src/configure
......@@ -147,7 +179,7 @@ index 000000000..c670b1d3e
\ No newline at end of file
diff --git a/src/gmmbin/gmm-compute-likes-gmmubm.cc b/src/gmmbin/gmm-compute-likes-gmmubm.cc
new file mode 100644
index 000000000..010b2b923
index 000000000..593f325d6
--- /dev/null
+++ b/src/gmmbin/gmm-compute-likes-gmmubm.cc
@@ -0,0 +1,156 @@
......@@ -254,7 +286,7 @@ index 000000000..010b2b923
+ if (gselect_rspecifier != "") {
+ if (!gselect_reader.HasKey(key)) {
+ KALDI_WARN << "No gselect information for utterance " << key;
+ num_err;
+ num_err++;
+ continue;
+ }
+ const std::vector<std::vector<int32> > &gselect =
......@@ -263,11 +295,11 @@ index 000000000..010b2b923
+ KALDI_WARN << "gselect information for utterance " << key
+ << " has wrong size " << gselect.size() << " vs. "
+ << file_frames;
+ num_err;
+ num_err++;
+ continue;
+ }
+
+ for (int32 i = 0; i < file_frames; i) {
+ for (int32 i = 0; i < file_frames; i++) {
+ SubVector<BaseFloat> data(mat, i);
+ const std::vector<int32> &this_gselect = gselect[i];
+ int32 gselect_size = this_gselect.size();
......@@ -280,21 +312,21 @@ index 000000000..010b2b923
+ likesUBM(i) = loglikesUBM.LogSumExp();
+ }
+ } else { // no gselect..
+ for (int32 i = 0; i < file_frames; i){
+ for (int32 i = 0; i < file_frames; i++){
+ likes(i) = dgmm.LogLikelihood(mat.Row(i));
+ likesUBM(i) = dubm.LogLikelihood(mat.Row(i));
+ }
+
+ }
+
+ tot_like = likes.Sum();
+ tot_frames = file_frames;
+ tot_like += likes.Sum();
+ tot_frames += file_frames;
+ if (average)
+ average_likes_writer.Write(key, (likes.Sum() - likesUBM.Sum())/ file_frames);
+ //average_likes_writer.Write(key, (likes.Sum())/ file_frames);
+ else
+ likes_writer.Write(key, likes);
+ num_done;
+ num_done++;
+ }
+ KALDI_LOG << "Done " << num_done << " files; " << num_err
+ << " with errors.";
......@@ -307,7 +339,6 @@ index 000000000..010b2b923
+ return -1;
+ }
+}
\ No newline at end of file
diff --git a/src/makefiles/default_rules.mk b/src/makefiles/default_rules.mk
index 7af6497ab..dac42bcd5 100644
--- a/src/makefiles/default_rules.mk
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment