online-gmm-decodable.h
Go to the documentation of this file.
1 // online2/online-gmm-decodable.h
2 
3 // Copyright 2012 Cisco Systems (author: Matthias Paulik)
4 // 2013 Vassil Panayotov
5 // 2014 Johns Hopkins Universithy (author: Daniel Povey)
6 
7 
8 // See ../../COPYING for clarification regarding multiple authors
9 //
10 // Licensed under the Apache License, Version 2.0 (the "License");
11 // you may not use this file except in compliance with the License.
12 // You may obtain a copy of the License at
13 //
14 // http://www.apache.org/licenses/LICENSE-2.0
15 //
16 // THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 // KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
18 // WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
19 // MERCHANTABLITY OR NON-INFRINGEMENT.
20 // See the Apache 2 License for the specific language governing permissions and
21 // limitations under the License.
22 
23 #ifndef KALDI_ONLINE2_ONLINE_GMM_DECODABLE_H_
24 #define KALDI_ONLINE2_ONLINE_GMM_DECODABLE_H_
25 
26 #include "itf/online-feature-itf.h"
27 #include "matrix/matrix-lib.h"
28 #include "itf/decodable-itf.h"
29 #include "gmm/am-diag-gmm.h"
30 #include "hmm/transition-model.h"
31 
32 namespace kaldi {
33 
34 
36  public:
38  const TransitionModel &trans_model,
39  const BaseFloat scale,
40  OnlineFeatureInterface *input_feats);
41 
42 
44  virtual BaseFloat LogLikelihood(int32 frame, int32 index);
45 
46  virtual bool IsLastFrame(int32 frame) const;
47 
48  virtual int32 NumFramesReady() const;
49 
51  virtual int32 NumIndices() const { return trans_model_.NumTransitionIds(); }
52 
53  private:
54  void CacheFrame(int32 frame);
55 
60  const int32 feat_dim_; // dimensionality of the input features
63  std::vector<std::pair<int32, BaseFloat> > cache_;
64 
66 };
67 
68 } // namespace kaldi
69 
70 #endif // KALDI_ONLINE2_ONLINE_GMM_DECODABLE_H_
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
Definition: chain.dox:20
DecodableInterface provides a link between the (acoustic-modeling and feature-processing) code and th...
Definition: decodable-itf.h:82
DecodableDiagGmmScaledOnline(const AmDiagGmm &am, const TransitionModel &trans_model, const BaseFloat scale, OnlineFeatureInterface *input_feats)
virtual int32 NumIndices() const
Indices are one-based! This is for compatibility with OpenFst.
kaldi::int32 int32
virtual int32 NumFramesReady() const
The call NumFramesReady() will return the number of frames currently available for this decodable obj...
int32 NumTransitionIds() const
Returns the total number of transition-ids (note, these are one-based).
virtual BaseFloat LogLikelihood(int32 frame, int32 index)
Returns the scaled log likelihood.
KALDI_DISALLOW_COPY_AND_ASSIGN(DecodableDiagGmmScaledOnline)
virtual bool IsLastFrame(int32 frame) const
Returns true if this is the last frame.
A class representing a vector.
Definition: kaldi-vector.h:406
std::vector< std::pair< int32, BaseFloat > > cache_
OnlineFeatureInterface is an interface for online feature processing (it is also usable in the offlin...