Skip to content

Commit f5f02d1

Browse files
committed
[src] Lots of changes: first stab at kaldi10 (non-compatible version of Kaldi)
1 parent 2f95609 commit f5f02d1

File tree

515 files changed

+1652
-63007
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

515 files changed

+1652
-63007
lines changed

src/Makefile

Lines changed: 8 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ SHELL := /bin/bash
66

77

88
SUBDIRS = base matrix util feat tree gmm transform \
9-
fstext hmm lm decoder lat kws cudamatrix nnet \
9+
fstext hmm lm decoder lat kws cudamatrix \
1010
bin fstbin gmmbin fgmmbin featbin \
11-
nnetbin latbin sgmm2 sgmm2bin nnet2 nnet3 rnnlm chain nnet3bin nnet2bin kwsbin \
11+
latbin nnet3 rnnlm chain nnet3bin kwsbin \
1212
ivector ivectorbin online2 online2bin lmbin chainbin rnnlmbin
1313

1414
MEMTESTDIRS = base matrix util feat tree gmm transform \
15-
fstext hmm lm decoder lat nnet kws chain \
15+
fstext hmm lm decoder lat kws chain \
1616
bin fstbin gmmbin fgmmbin featbin \
17-
nnetbin latbin sgmm2 nnet2 nnet3 rnnlm nnet2bin nnet3bin sgmm2bin kwsbin \
17+
latbin nnet3 rnnlm nnet3bin kwsbin \
1818
ivector ivectorbin online2 online2bin lmbin
1919

2020
CUDAMEMTESTDIR = cudamatrix
@@ -23,9 +23,6 @@ SUBDIRS_LIB = $(filter-out %bin, $(SUBDIRS))
2323

2424
KALDI_SONAME ?= libkaldi.so
2525

26-
# Optional subdirectories
27-
EXT_SUBDIRS = online onlinebin # python-kaldi-decoding
28-
EXT_SUBDIRS_LIB = $(filter-out %bin, $(EXT_SUBDIRS))
2926

3027
include kaldi.mk
3128

@@ -72,19 +69,6 @@ endif
7269
endif
7370
endif
7471

75-
biglibext: $(EXT_SUBDIRS_LIB)
76-
ifeq ($(KALDI_FLAVOR), dynamic)
77-
ifeq ($(shell uname), Darwin)
78-
$(CXX) -dynamiclib -o $(KALDILIBDIR)/libkaldi_ext.dylib -install_name @rpath/libkaldi_ext.dylib -framework Accelerate $(LDFLAGS) $(EXT_SUBDIRS_LIB:=/*.dylib)
79-
else
80-
ifeq ($(shell uname), Linux)
81-
#$(warning The following command will probably fail, in that case add -fPIC to your CXXFLAGS and remake all.)
82-
$(CXX) -shared -o $(KALDILIBDIR)/libkaldi_ext.so -Wl,-soname=libkaldi_ext.so,--whole-archive $(EXT_SUBDIRS_LIB:=/kaldi-*.a) -Wl,--no-whole-archive
83-
else
84-
$(error Dynamic libraries not supported on this platform. Run configure with --static flag. )
85-
endif
86-
endif
87-
endif
8872

8973
kaldi.mk:
9074
@[ -f kaldi.mk ] || { echo "kaldi.mk does not exist; you have to run ./configure"; exit 1; }
@@ -143,9 +127,9 @@ $(EXT_SUBDIRS) : checkversion kaldi.mk mklibdir ext_depend
143127
### Dependency list ###
144128
# this is necessary for correct parallel compilation
145129
#1)The tools depend on all the libraries
146-
bin fstbin gmmbin fgmmbin sgmm2bin featbin nnetbin nnet2bin nnet3bin chainbin latbin ivectorbin lmbin kwsbin online2bin rnnlmbin: \
130+
bin fstbin gmmbin fgmmbin sgmm2bin featbin nnet3bin chainbin latbin ivectorbin lmbin kwsbin online2bin rnnlmbin: \
147131
base matrix util feat tree gmm transform sgmm2 fstext hmm \
148-
lm decoder lat cudamatrix nnet nnet2 nnet3 ivector chain kws online2 rnnlm
132+
lm decoder lat cudamatrix nnet3 ivector chain kws online2 rnnlm
149133

150134
#2)The libraries have inter-dependencies
151135
base: base/.depend.mk
@@ -162,15 +146,13 @@ lm: base util matrix fstext
162146
decoder: base util matrix gmm hmm tree transform lat
163147
lat: base util hmm tree matrix
164148
cudamatrix: base util matrix
165-
nnet: base util hmm tree matrix cudamatrix
166-
nnet2: base util matrix lat gmm hmm tree transform cudamatrix
167149
nnet3: base util matrix lat gmm hmm tree transform cudamatrix chain fstext
168150
rnnlm: base util matrix cudamatrix nnet3 lm hmm
169151
chain: lat hmm tree fstext matrix cudamatrix util base
170152
ivector: base util matrix transform tree gmm
171153
#3)Dependencies for optional parts of Kaldi
172-
onlinebin: base matrix util feat tree gmm transform sgmm2 fstext hmm lm decoder lat cudamatrix nnet nnet2 online
154+
onlinebin: base matrix util feat tree gmm transform sgmm2 fstext hmm lm decoder lat cudamatrix online
173155
# python-kaldi-decoding: base matrix util feat tree gmm transform sgmm2 fstext hmm decoder lat online
174156
online: decoder gmm transform feat matrix util base lat hmm tree
175-
online2: decoder gmm transform feat matrix util base lat hmm tree ivector cudamatrix nnet2 nnet3 chain
157+
online2: decoder gmm transform feat matrix util base lat hmm tree ivector cudamatrix nnet3 chain
176158
kws: base util hmm tree matrix lat

src/bin/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ BINFILES = align-equal align-equal-compiled acc-tree-stats \
2222
matrix-sum build-pfile-from-ali get-post-on-ali tree-info am-info \
2323
vector-sum matrix-sum-rows est-pca sum-lda-accs sum-mllt-accs \
2424
transform-vec align-text matrix-dim post-to-smat compile-graph \
25-
compare-int-vector
25+
compare-int-vector cuda-gpu-available
2626

2727

2828
OBJFILES =

src/bin/acc-lda.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
#include "base/kaldi-common.h"
2323
#include "util/common-utils.h"
24-
#include "hmm/transition-model.h"
24+
#include "hmm/transitions.h"
2525
#include "hmm/posterior.h"
2626
#include "transform/lda-estimate.h"
2727

@@ -57,7 +57,7 @@ int main(int argc, char *argv[]) {
5757
std::string posteriors_rspecifier = po.GetArg(3);
5858
std::string acc_wxfilename = po.GetArg(4);
5959

60-
TransitionModel trans_model;
60+
Transitions trans_model;
6161
{
6262
bool binary_read;
6363
Input ki(model_rxfilename, &binary_read);

src/bin/acc-tree-stats.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include "util/common-utils.h"
2323
#include "tree/context-dep.h"
2424
#include "tree/build-tree-utils.h"
25-
#include "hmm/transition-model.h"
25+
#include "hmm/transitions.h"
2626
#include "hmm/tree-accu.h"
2727

2828
/** @brief Accumulate tree statistics for decision tree training. The
@@ -62,7 +62,7 @@ int main(int argc, char *argv[]) {
6262

6363
AccumulateTreeStatsInfo acc_tree_stats_info(opts);
6464

65-
TransitionModel trans_model;
65+
Transitions trans_model;
6666
{
6767
bool binary;
6868
Input ki(model_filename, &binary);

src/bin/add-self-loops.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
// See the Apache 2 License for the specific language governing permissions and
1919
// limitations under the License.
2020

21-
#include "hmm/transition-model.h"
21+
#include "hmm/transitions.h"
2222
#include "hmm/hmm-utils.h"
2323
#include "tree/context-dep.h"
2424
#include "util/common-utils.h"
@@ -88,7 +88,7 @@ int main(int argc, char *argv[]) {
8888
"standard input" : disambig_in_filename);
8989
}
9090

91-
TransitionModel trans_model;
91+
Transitions trans_model;
9292
ReadKaldiObject(model_in_filename, &trans_model);
9393

9494

src/bin/ali-to-pdf.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
*/
2222
#include "base/kaldi-common.h"
2323
#include "gmm/am-diag-gmm.h"
24-
#include "hmm/transition-model.h"
24+
#include "hmm/transitions.h"
2525
#include "hmm/hmm-utils.h"
2626
#include "util/common-utils.h"
2727
#include "fst/fstlib.h"
@@ -48,7 +48,7 @@ int main(int argc, char *argv[]) {
4848
alignments_rspecifier = po.GetArg(2),
4949
pdfs_wspecifier = po.GetArg(3);
5050

51-
TransitionModel trans_model;
51+
Transitions trans_model;
5252
ReadKaldiObject(model_filename, &trans_model);
5353

5454
SequentialInt32VectorReader reader(alignments_rspecifier);

src/bin/ali-to-phones.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121

2222
#include "base/kaldi-common.h"
23-
#include "hmm/transition-model.h"
23+
#include "hmm/transitions.h"
2424
#include "hmm/hmm-utils.h"
2525
#include "util/common-utils.h"
2626
#include "fst/fstlib.h"
@@ -68,7 +68,7 @@ int main(int argc, char *argv[]) {
6868
std::string model_filename = po.GetArg(1),
6969
alignments_rspecifier = po.GetArg(2);
7070

71-
TransitionModel trans_model;
71+
Transitions trans_model;
7272
ReadKaldiObject(model_filename, &trans_model);
7373

7474
SequentialInt32VectorReader reader(alignments_rspecifier);

src/bin/ali-to-post.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include "base/kaldi-common.h"
2323
#include "util/common-utils.h"
2424
#include "gmm/am-diag-gmm.h"
25-
#include "hmm/transition-model.h"
25+
#include "hmm/transitions.h"
2626
#include "hmm/hmm-utils.h"
2727
#include "hmm/posterior.h"
2828

src/bin/align-compiled-mapped.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
#include "base/kaldi-common.h"
2222
#include "util/common-utils.h"
23-
#include "hmm/transition-model.h"
23+
#include "hmm/transitions.h"
2424
#include "hmm/hmm-utils.h"
2525
#include "fstext/fstext-lib.h"
2626
#include "decoder/decoder-wrappers.h"
@@ -74,7 +74,7 @@ int main(int argc, char *argv[]) {
7474
std::string alignment_wspecifier = po.GetArg(4);
7575
std::string scores_wspecifier = po.GetOptArg(5);
7676

77-
TransitionModel trans_model;
77+
Transitions trans_model;
7878
ReadKaldiObject(model_in_filename, &trans_model);
7979

8080
SequentialBaseFloatMatrixReader loglikes_reader(feature_rspecifier);

src/bin/align-equal-compiled.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include "base/kaldi-common.h"
2222
#include "util/common-utils.h"
2323
#include "tree/context-dep.h"
24-
#include "hmm/transition-model.h"
24+
#include "hmm/transitions.h"
2525
#include "fstext/fstext-lib.h"
2626
#include "decoder/training-graph-compiler.h"
2727

src/bin/align-equal.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include "base/kaldi-common.h"
2222
#include "util/common-utils.h"
2323
#include "tree/context-dep.h"
24-
#include "hmm/transition-model.h"
24+
#include "hmm/transitions.h"
2525
#include "fstext/fstext-lib.h"
2626
#include "decoder/training-graph-compiler.h"
2727

@@ -65,7 +65,7 @@ int main(int argc, char *argv[]) {
6565
ContextDependency ctx_dep;
6666
ReadKaldiObject(tree_in_filename, &ctx_dep);
6767

68-
TransitionModel trans_model;
68+
Transitions trans_model;
6969
ReadKaldiObject(model_in_filename, &trans_model);
7070

7171
// need VectorFst because we will change it by adding subseq symbol.

src/bin/align-mapped.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
#include "base/kaldi-common.h"
2222
#include "util/common-utils.h"
23-
#include "hmm/transition-model.h"
23+
#include "hmm/transitions.h"
2424
#include "fstext/fstext-lib.h"
2525
#include "decoder/decoder-wrappers.h"
2626
#include "decoder/training-graph-compiler.h"
@@ -72,7 +72,7 @@ int main(int argc, char *argv[]) {
7272
ContextDependency ctx_dep;
7373
ReadKaldiObject(tree_in_filename, &ctx_dep);
7474

75-
TransitionModel trans_model;
75+
Transitions trans_model;
7676
ReadKaldiObject(model_in_filename, &trans_model);
7777

7878
VectorFst<StdArc> *lex_fst = fst::ReadFstKaldi(lex_in_filename);

src/bin/am-info.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include "base/kaldi-common.h"
2121
#include "util/common-utils.h"
2222
#include "gmm/am-diag-gmm.h"
23-
#include "hmm/transition-model.h"
23+
#include "hmm/transitions.h"
2424

2525
int main(int argc, char *argv[]) {
2626
try {
@@ -45,7 +45,7 @@ int main(int argc, char *argv[]) {
4545

4646
std::string model_in_filename = po.GetArg(1);
4747

48-
TransitionModel trans_model;
48+
Transitions trans_model;
4949
{
5050
bool binary_read;
5151
Input ki(model_in_filename, &binary_read);

src/bin/build-pfile-from-ali.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ using std::vector;
2525

2626
#include "base/kaldi-common.h"
2727
#include "gmm/am-diag-gmm.h"
28-
#include "hmm/transition-model.h"
28+
#include "hmm/transitions.h"
2929
#include "hmm/hmm-utils.h"
3030
#include "util/common-utils.h"
3131

@@ -64,7 +64,7 @@ int main(int argc, char *argv[]) {
6464
feature_rspecifier = po.GetArg(3),
6565
pfile_wspecifier = po.GetArg(4);
6666

67-
TransitionModel trans_model;
67+
Transitions trans_model;
6868
AmDiagGmm am_gmm;
6969
{
7070
bool binary;

src/bin/build-tree-two-level.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
#include "base/kaldi-common.h"
2222
#include "util/common-utils.h"
23-
#include "hmm/hmm-topology.h"
23+
#include "hmm/topology.h"
2424
#include "tree/context-dep.h"
2525
#include "tree/build-tree.h"
2626
#include "tree/build-tree-utils.h"
@@ -112,7 +112,7 @@ int main(int argc, char *argv[]) {
112112
ReadRootsFile(ki.Stream(), &phone_sets, &is_shared_root, &is_split_root);
113113
}
114114

115-
HmmTopology topo;
115+
Topology topo;
116116
ReadKaldiObject(topo_filename, &topo);
117117

118118
BuildTreeStatsType stats;

src/bin/build-tree.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
#include "base/kaldi-common.h"
2222
#include "util/common-utils.h"
23-
#include "hmm/hmm-topology.h"
23+
#include "hmm/topology.h"
2424
#include "tree/context-dep.h"
2525
#include "tree/build-tree.h"
2626
#include "tree/build-tree-utils.h"
@@ -91,7 +91,7 @@ int main(int argc, char *argv[]) {
9191
ReadRootsFile(ki.Stream(), &phone_sets, &is_shared_root, &is_split_root);
9292
}
9393

94-
HmmTopology topo;
94+
Topology topo;
9595
ReadKaldiObject(topo_filename, &topo);
9696

9797
BuildTreeStatsType stats;

src/bin/compile-graph.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include "base/kaldi-common.h"
2121
#include "util/common-utils.h"
2222
#include "tree/context-dep.h"
23-
#include "hmm/transition-model.h"
23+
#include "hmm/transitions.h"
2424
#include "hmm/hmm-utils.h"
2525
#include "fstext/fstext-lib.h"
2626
#include "fstext/push-special.h"
@@ -81,7 +81,7 @@ int main(int argc, char *argv[]) {
8181
ContextDependency ctx_dep; // the tree.
8282
ReadKaldiObject(tree_rxfilename, &ctx_dep);
8383

84-
TransitionModel trans_model;
84+
Transitions trans_model;
8585
ReadKaldiObject(model_rxfilename, &trans_model);
8686

8787
VectorFst<StdArc> *lex_fst = fst::ReadFstKaldi(lex_rxfilename),

src/bin/compile-questions.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919

2020
#include "base/kaldi-common.h"
2121
#include "util/common-utils.h"
22-
#include "hmm/hmm-topology.h"
22+
#include "hmm/topology.h"
2323
#include "tree/build-tree-questions.h"
2424

2525

2626
namespace kaldi {
27-
int32 ProcessTopo(const HmmTopology &topo, const std::vector<std::vector<int32> > &questions) {
27+
int32 ProcessTopo(const Topology &topo, const std::vector<std::vector<int32> > &questions) {
2828
std::vector<int32> seen_phones; // ids of phones seen in questions.
2929
for (size_t i = 0; i < questions.size(); i++)
3030
for (size_t j= 0; j < questions[i].size(); j++) seen_phones.push_back(questions[i][j]);
@@ -93,7 +93,7 @@ int main(int argc, char *argv[]) {
9393
questions_rxfilename = po.GetArg(2),
9494
questions_out_filename = po.GetArg(3);
9595

96-
HmmTopology topo; // just needed for checking, and to get the
96+
Topology topo; // just needed for checking, and to get the
9797
// largest number of pdf-classes for any phone.
9898
ReadKaldiObject(topo_filename, &topo);
9999

src/bin/compile-train-graphs-fsts.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include "base/kaldi-common.h"
2222
#include "util/common-utils.h"
2323
#include "tree/context-dep.h"
24-
#include "hmm/transition-model.h"
24+
#include "hmm/transitions.h"
2525
#include "fstext/fstext-lib.h"
2626
#include "decoder/training-graph-compiler.h"
2727

@@ -80,7 +80,7 @@ int main(int argc, char *argv[]) {
8080
ContextDependency ctx_dep; // the tree.
8181
ReadKaldiObject(tree_rxfilename, &ctx_dep);
8282

83-
TransitionModel trans_model;
83+
Transitions trans_model;
8484
ReadKaldiObject(model_rxfilename, &trans_model);
8585

8686
// need VectorFst because we will change it by adding subseq symbol.

0 commit comments

Comments
 (0)