diag-gmm-normal.h
Go to the documentation of this file.
1 // gmm/diag-gmm-normal.h
2 
3 // Copyright 2009-2011 Saarland University Korbinian Riedhammer Yanmin Qian
4 //
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 #ifndef KALDI_GMM_DIAG_GMM_NORMAL_H_
22 #define KALDI_GMM_DIAG_GMM_NORMAL_H_ 1
23 
24 #include <vector>
25 
26 #include "base/kaldi-common.h"
27 #include "gmm/model-common.h"
28 #include "gmm/diag-gmm.h"
29 #include "matrix/matrix-lib.h"
30 
31 namespace kaldi {
32 
33 
34 class DiagGmm;
35 
46  public:
49 
50  explicit DiagGmmNormal(const DiagGmm &gmm) {
51  CopyFromDiagGmm(gmm);
52  }
53 
55  void Resize(int32 nMix, int32 dim);
56 
58  void CopyFromDiagGmm(const DiagGmm &diaggmm);
59 
61  void CopyToDiagGmm(DiagGmm *diaggmm, GmmFlagsType flags = kGmmAll) const;
62 
63  int32 NumGauss() { return weights_.Dim(); }
64  int32 Dim() { return means_.NumCols(); }
65 
69 
71 };
72 
73 } // End namespace kaldi
74 
75 #endif // KALDI_GMM_DIAG_GMM_NORMAL_H_
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
Definition: chain.dox:20
Definition for Gaussian Mixture Model with diagonal covariances in normal mode: where the parameters ...
MatrixIndexT NumCols() const
Returns number of columns (or zero for empty matrix).
Definition: kaldi-matrix.h:67
void Resize(int32 nMix, int32 dim)
Resizes arrays to this dim. Does not initialize data.
kaldi::int32 int32
void CopyFromDiagGmm(const DiagGmm &diaggmm)
Copies from given DiagGmm.
uint16 GmmFlagsType
Bitwise OR of the above flags.
Definition: model-common.h:35
KALDI_DISALLOW_COPY_AND_ASSIGN(DiagGmmNormal)
Matrix< double > vars_
diagonal variance
MatrixIndexT Dim() const
Returns the dimension of the vector.
Definition: kaldi-vector.h:64
Matrix< double > means_
Means.
Definition for Gaussian Mixture Model with diagonal covariances.
Definition: diag-gmm.h:42
Vector< double > weights_
weights (not log).
DiagGmmNormal(const DiagGmm &gmm)
DiagGmmNormal()
Empty constructor.
void CopyToDiagGmm(DiagGmm *diaggmm, GmmFlagsType flags=kGmmAll) const
Copies to DiagGmm the requested parameters.