model-common.h
Go to the documentation of this file.
1 // gmm/model-common.h
2 
3 // Copyright 2009-2012 Saarland University; Microsoft Corporation;
4 // Johns Hopkins University (author: Daniel Povey)
5 
6 // See ../../COPYING for clarification regarding multiple authors
7 //
8 // Licensed under the Apache License, Version 2.0 (the "License");
9 // you may not use this file except in compliance with the License.
10 // You may obtain a copy of the License at
11 //
12 // http://www.apache.org/licenses/LICENSE-2.0
13 //
14 // THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 // KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
16 // WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
17 // MERCHANTABLITY OR NON-INFRINGEMENT.
18 // See the Apache 2 License for the specific language governing permissions and
19 // limitations under the License.
20 
21 
22 #ifndef KALDI_GMM_MODEL_COMMON_H_
23 #define KALDI_GMM_MODEL_COMMON_H_
24 #include "matrix/matrix-lib.h"
25 
26 namespace kaldi {
27 
29  kGmmMeans = 0x001, // m
30  kGmmVariances = 0x002, // v
31  kGmmWeights = 0x004, // w
32  kGmmTransitions = 0x008, // t ... not really part of GMM.
33  kGmmAll = 0x00F // a
34 };
35 typedef uint16 GmmFlagsType;
36 GmmFlagsType StringToGmmFlags(std::string str);
39 
41 std::string GmmFlagsToString(GmmFlagsType gmm_flags);
42 
43 // Make sure that the flags make sense, i.e. if there is variance
44 // accumulation that there is also mean accumulation
45 GmmFlagsType AugmentGmmFlags(GmmFlagsType flags);
46 
54  kSgmmTransitions = 0x040,
56  kSgmmAll = 0x0FF
57 };
58 
59 typedef uint16 SgmmUpdateFlagsType;
60 SgmmUpdateFlagsType StringToSgmmUpdateFlags(std::string str);
61 
64  kSgmmStateParams = 0x002,
65  kSgmmNormalizers = 0x004,
67  kSgmmWriteAll = 0x00F
68 };
69 
70 typedef uint16 SgmmWriteFlagsType;
71 
72 SgmmWriteFlagsType StringToSgmmWriteFlags(std::string str);
73 
85 void GetSplitTargets(const Vector<BaseFloat> &state_occs,
86  int32 target_components,
87  BaseFloat power,
88  BaseFloat min_count,
89  std::vector<int32> *targets);
90 
91 } // End namespace kaldi
92 
93 
94 #endif // KALDI_GMM_MODEL_COMMON_H_
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
Definition: chain.dox:20
uint16 SgmmWriteFlagsType
Bitwise OR of the above flags.
Definition: model-common.h:70
GmmFlagsType AugmentGmmFlags(GmmFlagsType f)
Returns "augmented" version of flags: e.g.
Definition: model-common.cc:52
GmmFlagsType StringToGmmFlags(std::string str)
Convert string which is some subset of "mSwa" to flags.
Definition: model-common.cc:26
kaldi::int32 int32
SgmmUpdateFlagsType StringToSgmmUpdateFlags(std::string str)
Definition: model-common.cc:64
uint16 GmmFlagsType
Bitwise OR of the above flags.
Definition: model-common.h:35
void GetSplitTargets(const Vector< BaseFloat > &state_occs, int32 target_components, BaseFloat power, BaseFloat min_count, std::vector< int32 > *targets)
Get Gaussian-mixture or substate-mixture splitting targets, according to a power rule (e...
t .. not really part of SGMM.
Definition: model-common.h:55
float BaseFloat
Definition: kaldi-types.h:29
uint16 SgmmUpdateFlagsType
Bitwise OR of the above flags.
Definition: model-common.h:59
SgmmWriteFlags
Definition: model-common.h:62
GmmUpdateFlags
Definition: model-common.h:28
The letters correspond to the variable names.
Definition: model-common.h:48
A class representing a vector.
Definition: kaldi-vector.h:406
SgmmUpdateFlags
Definition: model-common.h:47
std::string GmmFlagsToString(GmmFlagsType flags)
Convert GMM flags to string.
Definition: model-common.cc:43
SgmmUpdateFlagsType StringToSgmmWriteFlags(std::string str)
Definition: model-common.cc:86
u [ for SSGMM ]
Definition: model-common.h:56