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