kaldi Namespace Reference

This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for mispronunciations detection tasks, the reference: More...

Namespaces

 cu
 
 decoder
 
 differentiable_transform
 
 discriminative
 
 internal
 
 kws_internal
 
 nnet1
 
 nnet2
 
 nnet3
 
 sparse_vector_utils
 
 unittest
 

Classes

class  AccumAmDiagGmm
 
class  AccumDiagGmm
 
class  AccumFullGmm
 Class for computing the maximum-likelihood estimates of the parameters of a Gaussian mixture model. More...
 
class  AccumulateMultiThreadedClass
 
struct  AccumulateTreeStatsInfo
 
struct  AccumulateTreeStatsOptions
 
struct  ActivePath
 
class  AffineXformStats
 
class  AgglomerativeClusterer
 The AgglomerativeClusterer class contains the necessary mechanisms for the actual clustering algorithm. More...
 
struct  AhcCluster
 AhcCluster is the cluster object for the agglomerative clustering. More...
 
struct  AlignConfig
 
struct  AlignedTermsPair
 
class  AmDiagGmm
 
class  AmSgmm2
 Class for definition of the subspace Gmm acoustic model. More...
 
class  ArbitraryResample
 Class ArbitraryResample allows you to resample a signal (assumed zero outside the sample region, not periodic) at arbitrary specified time values, which don't have to be linearly spaced. More...
 
class  ArcPosteriorComputer
 
class  ArpaFileParser
 ArpaFileParser is an abstract base class for ARPA LM file conversion. More...
 
struct  ArpaLine
 
class  ArpaLmCompiler
 
class  ArpaLmCompilerImpl
 
class  ArpaLmCompilerImplInterface
 
struct  ArpaParseOptions
 Options that control ArpaFileParser. More...
 
class  basic_filebuf
 
class  basic_pipebuf
 
class  BasicHolder
 BasicHolder is valid for float, double, bool, and integer types. More...
 
class  BasicPairVectorHolder
 BasicPairVectorHolder is a Holder for a vector of pairs of a basic type, e.g. More...
 
class  BasicVectorHolder
 A Holder for a vector of basic types, e.g. More...
 
class  BasicVectorVectorHolder
 BasicVectorVectorHolder is a Holder for a vector of vector of a basic type, e.g. More...
 
class  BasisFmllrAccus
 Stats for fMLLR subspace estimation. More...
 
class  BasisFmllrEstimate
 Estimation functions for basis fMLLR. More...
 
struct  BasisFmllrOptions
 
class  BiglmFasterDecoder
 This is as FasterDecoder, but does online composition between HCLG and the "difference language model", which is a deterministic FST that represents the difference between the language model you want and the language model you compiled HCLG with. More...
 
struct  BiglmFasterDecoderOptions
 
class  BottomUpClusterer
 
struct  ClatRescoreTuple
 
class  Clusterable
 
struct  ClusterKMeansOptions
 
class  CompactLatticeHolder
 
class  CompactLatticeToKwsProductFstMapper
 
struct  CompareFirstMemberOfPair
 Comparator object for pairs that compares only the first pair. More...
 
struct  ComparePosteriorByPdfs
 
struct  CompareReverseSecond
 
class  CompartmentalizedBottomUpClusterer
 
struct  CompBotClustElem
 
struct  ComposeLatticePrunedOptions
 
class  CompressedAffineXformStats
 
class  CompressedMatrix
 
class  ComputeNormalizersClass
 
class  ConfigLine
 This class is responsible for parsing input like hi-there xx=yyy a=b c empty= f-oo=Append(bar, sss) ba_z=123 bing='a b c' baz="a b c d='a b' e" and giving you access to the fields, in this case. More...
 
class  ConstantEventMap
 
class  ConstArpaLm
 
class  ConstArpaLmBuilder
 
class  ConstArpaLmDeterministicFst
 This class wraps a ConstArpaLm format language model with the interface defined in DeterministicOnDemandFst. More...
 
class  ConstIntegerSet
 
class  ContextDependency
 
class  ContextDependencyInterface
 context-dep-itf.h provides a link between the tree-building code in ../tree/, and the FST code in ../fstext/ (particularly, ../fstext/context-dep.h). More...
 
struct  CountStats
 
class  CovarianceStats
 
struct  CuAllocatorOptions
 
class  CuArray
 Class CuArray represents a vector of an integer or struct of type T. More...
 
class  CuArrayBase
 Class CuArrayBase, CuSubArray and CuArray are analogues of classes CuVectorBase, CuSubVector and CuVector, except that they are intended to store things other than float/double: they are intended to store integers or small structs. More...
 
class  CuBlockMatrix
 The class CuBlockMatrix holds a vector of objects of type CuMatrix, say, M_1, M_2, . More...
 
class  CuCompressedMatrix
 Class CuCompressedMatrix, templated on an integer type (expected to be one of: int8, uint8, int16, uint16), this provides a way to approximate a CuMatrix in a more memory-efficient format. More...
 
class  CuCompressedMatrixBase
 Class CuCompressedMatrixBase is an abstract base class that allows you to compress a matrix of type CuMatrix<BaseFloat>. More...
 
class  CuMatrix
 This class represents a matrix that's stored on the GPU if we have one, and in memory if not. More...
 
class  CuMatrixBase
 Matrix for CUDA computing. More...
 
class  CuPackedMatrix
 Matrix for CUDA computing. More...
 
class  CuRand
 
class  CuSparseMatrix
 
class  CuSpMatrix
 
class  CuSubArray
 
class  CuSubMatrix
 This class is used for a piece of a CuMatrix. More...
 
class  CuSubVector
 
class  CuTpMatrix
 
class  CuValue
 The following class is used to simulate non-const references to Real, e.g. More...
 
class  CuVector
 
class  CuVectorBase
 Vector for CUDA computing. More...
 
class  DecisionTreeSplitter
 
class  DecodableAmDiagGmm
 
class  DecodableAmDiagGmmRegtreeFmllr
 
class  DecodableAmDiagGmmRegtreeMllr
 
class  DecodableAmDiagGmmScaled
 
class  DecodableAmDiagGmmUnmapped
 DecodableAmDiagGmmUnmapped is a decodable object that takes indices that correspond to pdf-id's plus one. More...
 
class  DecodableAmSgmm2
 
class  DecodableAmSgmm2Scaled
 
class  DecodableDiagGmmScaledOnline
 
class  DecodableInterface
 DecodableInterface provides a link between the (acoustic-modeling and feature-processing) code and the decoder. More...
 
class  DecodableMapped
 
class  DecodableMatrixMapped
 This is like DecodableMatrixScaledMapped, but it doesn't support an acoustic scale, and it does support a frame offset, whereby you can state that the first row of 'likes' is actually the n'th row of the matrix of available log-likelihoods. More...
 
class  DecodableMatrixMappedOffset
 This decodable class returns log-likes stored in a matrix; it supports repeatedly writing to the matrix and setting a time-offset representing the frame-index of the first row of the matrix. More...
 
class  DecodableMatrixScaled
 
class  DecodableMatrixScaledMapped
 
class  DecodableSum
 
class  DecodableSumScaled
 
class  DecodeUtteranceLatticeFasterClass
 This class basically does the same job as the function DecodeUtteranceLatticeFaster, but in a way that allows us to build a multi-threaded command line program more easily. More...
 
class  DeltaFeatures
 
struct  DeltaFeaturesOptions
 
class  DeterminizeLatticeTask
 
class  DiagGmm
 Definition for Gaussian Mixture Model with diagonal covariances. More...
 
class  DiagGmmNormal
 Definition for Gaussian Mixture Model with diagonal covariances in normal mode: where the parameters are stored as means and variances (instead of the exponential form that the DiagGmm class is stored as). More...
 
struct  DummyOptions
 
struct  EbwAmSgmm2Options
 This header implements a form of Extended Baum-Welch training for SGMMs. More...
 
class  EbwAmSgmm2Updater
 
struct  EbwOptions
 
class  EbwUpdatePhoneVectorsClass
 
struct  EbwWeightOptions
 
class  EigenvalueDecomposition
 
struct  error_stats
 
class  EventMap
 A class that is capable of representing a generic mapping from EventType (which is a vector of (key, value) pairs) to EventAnswerType which is just an integer. More...
 
struct  EventMapVectorEqual
 
struct  EventMapVectorHash
 
class  ExampleClass
 
class  ExampleFeatureComputer
 This class is only added for documentation, it is not intended to ever be used. More...
 
struct  ExampleFeatureComputerOptions
 This class is only added for documentation, it is not intended to ever be used. More...
 
class  FasterDecoder
 
struct  FasterDecoderOptions
 
class  FbankComputer
 Class for computing mel-filterbank features; see Computing MFCC features for more information. More...
 
struct  FbankOptions
 FbankOptions contains basic options for computing filterbank features. More...
 
class  FeatureTransformEstimate
 Class for computing a feature transform used for preconditioning of the training data in neural-networks. More...
 
class  FeatureTransformEstimateMulti
 
struct  FeatureTransformEstimateOptions
 
struct  FeatureWindowFunction
 
class  FileInputImpl
 
class  FileOutputImpl
 
class  FmllrDiagGmmAccs
 This does not work with multiple feature transforms. More...
 
struct  FmllrOptions
 
class  FmllrRawAccs
 
struct  FmllrRawOptions
 
class  FmllrSgmm2Accs
 Class for computing the accumulators needed for the maximum-likelihood estimate of FMLLR transforms for a subspace GMM acoustic model. More...
 
class  Fmpe
 
struct  FmpeOptions
 
struct  FmpeStats
 
struct  FmpeUpdateOptions
 
struct  FrameExtractionOptions
 
class  FullGmm
 Definition for Gaussian Mixture Model with full covariances. More...
 
class  FullGmmNormal
 Definition for Gaussian Mixture Model with full covariances in normal mode: where the parameters are stored as means and variances (instead of the exponential form that the FullGmm class is stored as). More...
 
class  GaussClusterable
 GaussClusterable wraps Gaussian statistics in a form accessible to generic clustering algorithms. More...
 
struct  GaussInfo
 
class  GaussPostHolder
 
class  GeneralMatrix
 This class is a wrapper that enables you to store a matrix in one of three forms: either as a Matrix<BaseFloat>, or a CompressedMatrix, or a SparseMatrix<BaseFloat>. More...
 
class  GenericHolder
 GenericHolder serves to document the requirements of the Holder interface; it's not intended to be used. More...
 
class  HashList
 
struct  HmmCacheHash
 
class  HmmTopology
 A class for storing topology information for phones. More...
 
struct  HtkHeader
 A structure containing the HTK header. More...
 
class  HtkMatrixHolder
 
struct  HTransducerConfig
 Configuration class for the GetHTransducer() function; see The HTransducerConfig configuration class for context. More...
 
class  Input
 
class  InputImplBase
 
union  Int32AndFloat
 
struct  Int32IsZero
 
class  Interval
 
struct  IvectorEstimationOptions
 
class  IvectorExtractor
 
class  IvectorExtractorComputeDerivedVarsClass
 
struct  IvectorExtractorEstimationOptions
 Options for training the IvectorExtractor, e.g. variance flooring. More...
 
struct  IvectorExtractorOptions
 
class  IvectorExtractorStats
 IvectorExtractorStats is a class used to update the parameters of the ivector extractor. More...
 
struct  IvectorExtractorStatsOptions
 Options for IvectorExtractorStats, which is used to update the parameters of IvectorExtractor. More...
 
class  IvectorExtractorUpdateProjectionClass
 
class  IvectorExtractorUpdateWeightClass
 
class  IvectorExtractorUtteranceStats
 These are the stats for a particular utterance, i.e. More...
 
class  IvectorExtractTask
 
class  IvectorTask
 
class  KaldiFatalError
 Kaldi fatal runtime error exception. More...
 
class  KaldiObjectHolder
 KaldiObjectHolder works for Kaldi objects that have the "standard" Read and Write functions, and a copy constructor. More...
 
class  KaldiRnnlmWrapper
 
struct  KaldiRnnlmWrapperOpts
 
class  KwsAlignment
 
class  KwsProductFstToKwsLexicographicFstMapper
 
class  KwsTerm
 
class  KwsTermsAligner
 
struct  KwsTermsAlignerOptions
 
struct  LatticeArcRecord
 This is used in CompactLatticeLimitDepth. More...
 
class  LatticeBiglmFasterDecoder
 This is as LatticeFasterDecoder, but does online composition between HCLG and the "difference language model", which is a deterministic FST that represents the difference between the language model you want and the language model you compiled HCLG with. More...
 
struct  LatticeFasterDecoderConfig
 
class  LatticeFasterDecoderTpl
 This is the "normal" lattice-generating decoder. More...
 
class  LatticeFasterOnlineDecoderTpl
 LatticeFasterOnlineDecoderTpl is as LatticeFasterDecoderTpl but also supports an efficient way to get the best path (see the function BestPathEnd()), which is useful in endpointing and in situations where you might want to frequently access the best path. More...
 
class  LatticeHolder
 
struct  LatticeIncrementalDecoderConfig
 The normal decoder, lattice-faster-decoder.h, sometimes has an issue when doing real-time applications with long utterances, that each time you get the lattice the lattice determinization can take a considerable amount of time; this introduces latency. More...
 
class  LatticeIncrementalDecoderTpl
 This is an extention to the "normal" lattice-generating decoder. More...
 
class  LatticeIncrementalDeterminizer
 This class is used inside LatticeIncrementalDecoderTpl; it handles some of the details of incremental determinization. More...
 
class  LatticeIncrementalOnlineDecoderTpl
 LatticeIncrementalOnlineDecoderTpl is as LatticeIncrementalDecoderTpl but also supports an efficient way to get the best path (see the function BestPathEnd()), which is useful in endpointing and in situations where you might want to frequently access the best path. More...
 
class  LatticeLexiconWordAligner
 
class  LatticePhoneAligner
 
class  LatticeReader
 LatticeReader provides (static) functions for reading both Lattice and CompactLattice, in text form. More...
 
class  LatticeSimpleDecoder
 Simplest possible decoder, included largely for didactic purposes and as a means to debug more highly optimized decoders. More...
 
struct  LatticeSimpleDecoderConfig
 
class  LatticeWordAligner
 
struct  LbfgsOptions
 This is an implementation of L-BFGS. More...
 
class  LdaEstimate
 Class for computing linear discriminant analysis (LDA) transform. More...
 
struct  LdaEstimateOptions
 
struct  LinearCgdOptions
 
class  LinearResample
 LinearResample is a special case of ArbitraryResample, where we want to resample a signal at linearly spaced intervals (this means we want to upsample or downsample the signal). More...
 
class  LinearVtln
 
class  LmState
 
class  LogisticRegression
 
struct  LogisticRegressionConfig
 
struct  LogMessageEnvelope
 Log message severity and source location info. More...
 
struct  MapDiagGmmOptions
 Configuration variables for Maximum A Posteriori (MAP) update. More...
 
struct  MapTransitionUpdateConfig
 
class  Matrix
 A class for storing matrices. More...
 
class  MatrixBase
 Base class which provides matrix operations not involving resizing or allocation. More...
 
class  MelBanks
 
struct  MelBanksOptions
 
class  MessageLogger
 
class  MfccComputer
 
struct  MfccOptions
 MfccOptions contains basic options for computing MFCC features. More...
 
class  MinimumBayesRisk
 This class does the word-level Minimum Bayes Risk computation, and gives you either the 1-best MBR output together with the expected Bayes Risk, or a sausage-like structure. More...
 
struct  MinimumBayesRiskOptions
 The implementation of the Minimum Bayes Risk decoding method described in "Minimum Bayes Risk decoding and system combination based on a recursion for edit distance", Haihua Xu, Daniel Povey, Lidia Mangu and Jie Zhu, Computer Speech and Language, 2011 This is a slightly more principled way to do Minimum Bayes Risk (MBR) decoding than the standard "Confusion Network" method. More...
 
class  MleAmSgmm2Accs
 Class for the accumulators associated with the phonetic-subspace model parameters. More...
 
struct  MleAmSgmm2Options
 Configuration variables needed in the SGMM estimation process. More...
 
class  MleAmSgmm2Updater
 
struct  MleDiagGmmOptions
 Configuration variables like variance floor, minimum occupancy, etc. More...
 
struct  MleFullGmmOptions
 Configuration variables like variance floor, minimum occupancy, etc. More...
 
class  MleSgmm2SpeakerAccs
 Class for the accumulators required to update the speaker vectors v_s. More...
 
struct  MleTransitionUpdateConfig
 
class  MlltAccs
 A class for estimating Maximum Likelihood Linear Transform, also known as global Semi-tied Covariance (STC), for GMMs. More...
 
class  MultiThreadable
 
class  MultiThreader
 
class  MyTaskClass
 
class  MyThreadClass
 
struct  NccfInfo
 
struct  NGram
 A parsed n-gram from ARPA LM file. More...
 
class  NumberIstream
 
class  OfflineFeatureTpl
 This templated class is intended for offline feature extraction, i.e. More...
 
class  OffsetFileInputImpl
 
class  OnlineAppendFeature
 This online-feature class implements combination of two feature streams (such as pitch, plp) into one stream. More...
 
class  OnlineAudioSourceItf
 
class  OnlineBaseFeature
 Add a virtual class for "source" features such as MFCC or PLP or pitch features. More...
 
class  OnlineCacheFeature
 This feature type can be used to cache its input, to avoid repetition of computation in a multi-pass decoding context. More...
 
class  OnlineCacheInput
 
class  OnlineCmnInput
 
class  OnlineCmvn
 This class does an online version of the cepstral mean and [optionally] variance, but note that this is not equivalent to the offline version. More...
 
struct  OnlineCmvnOptions
 
struct  OnlineCmvnState
 Struct OnlineCmvnState stores the state of CMVN adaptation between utterances (but not the state of the computation within an utterance). More...
 
class  OnlineDecodableDiagGmmScaled
 
class  OnlineDeltaFeature
 
class  OnlineDeltaInput
 
struct  OnlineEndpointConfig
 
struct  OnlineEndpointRule
 This header contains a simple facility for endpointing, that should be used in conjunction with the "online2" online decoding code; see ../online2bin/online2-wav-gmm-latgen-faster-endpoint.cc. More...
 
class  OnlineFasterDecoder
 
struct  OnlineFasterDecoderOpts
 
class  OnlineFeatInputItf
 
class  OnlineFeatureInterface
 OnlineFeatureInterface is an interface for online feature processing (it is also usable in the offline setting, but currently we're not using it for that). More...
 
class  OnlineFeatureMatrix
 
struct  OnlineFeatureMatrixOptions
 
class  OnlineFeaturePipeline
 OnlineFeaturePipeline is a class that's responsible for putting together the various stages of the feature-processing pipeline, in an online setting. More...
 
struct  OnlineFeaturePipelineCommandLineConfig
 This configuration class is to set up OnlineFeaturePipelineConfig, which in turn is the configuration class for OnlineFeaturePipeline. More...
 
struct  OnlineFeaturePipelineConfig
 This configuration class is responsible for storing the configuration options for OnlineFeaturePipeline, but it does not set them. More...
 
class  OnlineFeInput
 
class  OnlineGenericBaseFeature
 This is a templated class for online feature extraction; it's templated on a class like MfccComputer or PlpComputer that does the basic feature extraction. More...
 
struct  OnlineGmmAdaptationState
 
struct  OnlineGmmDecodingAdaptationPolicyConfig
 This configuration class controls when to re-estimate the basis-fMLLR during online decoding. More...
 
struct  OnlineGmmDecodingConfig
 
class  OnlineGmmDecodingModels
 This class is used to read, store and give access to the models used for 3 phases of decoding (first-pass with online-CMN features; the ML models used for estimating transforms; and the discriminatively trained models). More...
 
class  OnlineIvectorEstimationStats
 This class helps us to efficiently estimate iVectors in situations where the data is coming in frame by frame. More...
 
struct  OnlineIvectorExtractionConfig
 This class includes configuration variables relating to the online iVector extraction, but not including configuration for the "base feature", i.e. More...
 
struct  OnlineIvectorExtractionInfo
 This struct contains various things that are needed (as const references) by class OnlineIvectorExtractor. More...
 
struct  OnlineIvectorExtractorAdaptationState
 This class stores the adaptation state from the online iVector extractor, which can help you to initialize the adaptation state for the next utterance of the same speaker in a more informed way. More...
 
class  OnlineIvectorFeature
 OnlineIvectorFeature is an online feature-extraction class that's responsible for extracting iVectors from raw features such as MFCC, PLP or filterbank. More...
 
class  OnlineLdaInput
 
class  OnlineMatrixFeature
 This class takes a Matrix<BaseFloat> and wraps it as an OnlineFeatureInterface: this can be useful where some earlier stage of feature processing has been done offline but you want to use part of the online pipeline. More...
 
class  OnlineMatrixInput
 
struct  OnlineNnet2DecodingConfig
 
struct  OnlineNnet2DecodingThreadedConfig
 
class  OnlineNnet2FeaturePipeline
 OnlineNnet2FeaturePipeline is a class that's responsible for putting together the various parts of the feature-processing pipeline for neural networks, in an online setting. More...
 
struct  OnlineNnet2FeaturePipelineConfig
 This configuration class is to set up OnlineNnet2FeaturePipelineInfo, which in turn is the configuration class for OnlineNnet2FeaturePipeline. More...
 
struct  OnlineNnet2FeaturePipelineInfo
 This class is responsible for storing configuration variables, objects and options for OnlineNnet2FeaturePipeline (including the actual LDA and CMVN-stats matrices, and the iVector extractor, which is a member of ivector_extractor_info. More...
 
class  OnlinePaSource
 
class  OnlinePitchFeature
 
class  OnlinePitchFeatureImpl
 
class  OnlineProcessPitch
 This online-feature class implements post processing of pitch features. More...
 
class  OnlineSilenceWeighting
 
struct  OnlineSilenceWeightingConfig
 
class  OnlineSpeexDecoder
 
class  OnlineSpeexEncoder
 
class  OnlineSpliceFrames
 
struct  OnlineSpliceOptions
 
class  OnlineTcpVectorSource
 
class  OnlineTimer
 class OnlineTimer is used to test real-time decoding algorithms and evaluate how long the decoding of a particular utterance would take. More...
 
class  OnlineTimingStats
 class OnlineTimingStats stores statistics from timing of online decoding, which will enable the Print() function to print out the average real-time factor and average delay per utterance. More...
 
class  OnlineTransform
 This online-feature class implements any affine or linear transform. More...
 
class  OnlineUdpInput
 
class  OnlineVectorSource
 
class  OptimizableInterface
 OptimizableInterface provides a virtual class for optimizable objects. More...
 
class  OptimizeLbfgs
 
class  OptionsItf
 
class  OtherReal
 This class provides a way for switching between double and float types. More...
 
class  OtherReal< double >
 A specialized class for switching from double to float. More...
 
class  OtherReal< float >
 A specialized class for switching from float to double. More...
 
class  Output
 
class  OutputImplBase
 
class  PackedMatrix
 Packed matrix: base class for triangular and symmetric matrices. More...
 
struct  PairHasher
 A hashing function-object for pairs of ints. More...
 
class  ParseOptions
 The class ParseOptions is for parsing command-line options; see Parsing command-line options for more documentation. More...
 
struct  PhoneAlignLatticeOptions
 
class  PipeInputImpl
 
class  PipeOutputImpl
 
struct  PitchExtractionOptions
 
class  PitchFrameInfo
 
class  PitchInterpolator
 
struct  PitchInterpolatorOptions
 
struct  PitchInterpolatorStats
 
class  Plda
 
struct  PldaConfig
 
struct  PldaEstimationConfig
 
class  PldaEstimator
 
class  PldaStats
 
class  PldaUnsupervisedAdaptor
 This class takes unlabeled iVectors from the domain of interest and uses their mean and variance to adapt your PLDA matrices to a new domain. More...
 
struct  PldaUnsupervisedAdaptorConfig
 
class  PlpComputer
 This is the new-style interface to the PLP computation. More...
 
struct  PlpOptions
 PlpOptions contains basic options for computing PLP features. More...
 
class  PosteriorHolder
 
struct  ProcessPitchOptions
 
class  Profiler
 
class  ProfileStats
 
class  PrunedCompactLatticeComposer
 PrunedCompactLatticeComposer implements an algorithm for pruned composition. More...
 
class  Questions
 This class defines, for each EventKeyType, a set of initial questions that it tries and also a number of iterations for which to refine the questions to increase likelihood. More...
 
struct  QuestionsForKey
 QuestionsForKey is a class used to define the questions for a key, and also options that allow us to refine the question during tree-building (i.e. More...
 
class  RandomAccessTableReader
 Allows random access to a collection of objects in an archive or script file; see The Table concept. More...
 
class  RandomAccessTableReaderArchiveImplBase
 
class  RandomAccessTableReaderDSortedArchiveImpl
 
class  RandomAccessTableReaderImplBase
 
class  RandomAccessTableReaderMapped
 This class is for when you are reading something in random access, but it may actually be stored per-speaker (or something similar) but the keys you're using are per utterance. More...
 
class  RandomAccessTableReaderScriptImpl
 
class  RandomAccessTableReaderSortedArchiveImpl
 
class  RandomAccessTableReaderUnsortedArchiveImpl
 
struct  RandomState
 
struct  RecognizedWord
 
class  RecyclingVector
 This class serves as a storage for feature vectors with an option to limit the memory usage by removing old elements. More...
 
class  RefineClusterer
 
struct  RefineClustersOptions
 
class  RegressionTree
 A regression tree is a clustering of Gaussian densities in an acoustic model, such that the group of Gaussians at each node of the tree are transformed by the same transform. More...
 
class  RegtreeFmllrDiagGmm
 An FMLLR (feature-space MLLR) transformation, also called CMLLR (constrained MLLR) is an affine transformation of the feature vectors. More...
 
class  RegtreeFmllrDiagGmmAccs
 Class for computing the accumulators needed for the maximum-likelihood estimate of FMLLR transforms for an acoustic model that uses diagonal Gaussian mixture models as emission densities. More...
 
struct  RegtreeFmllrOptions
 Configuration variables for FMLLR transforms. More...
 
class  RegtreeMllrDiagGmm
 An MLLR mean transformation is an affine transformation of Gaussian means. More...
 
class  RegtreeMllrDiagGmmAccs
 Class for computing the maximum-likelihood estimates of the parameters of an acoustic model that uses diagonal Gaussian mixture models as emission densities. More...
 
struct  RegtreeMllrOptions
 Configuration variables for FMLLR transforms. More...
 
class  RnnlmDeterministicFst
 
struct  RspecifierOptions
 
class  ScalarClusterable
 ScalarClusterable clusters scalars with x^2 loss. More...
 
class  Semaphore
 
class  SequentialTableReader
 A templated class for reading objects sequentially from an archive or script file; see The Table concept. More...
 
class  SequentialTableReaderArchiveImpl
 
class  SequentialTableReaderBackgroundImpl
 
class  SequentialTableReaderImplBase
 
class  SequentialTableReaderScriptImpl
 
struct  Sgmm2FmllrConfig
 Configuration variables needed in the estimation of FMLLR for SGMMs. More...
 
class  Sgmm2FmllrGlobalParams
 Global adaptation parameters. More...
 
class  Sgmm2GauPost
 indexed by time. More...
 
struct  Sgmm2GauPostElement
 This is the entry for a single time. More...
 
struct  Sgmm2GselectConfig
 
struct  Sgmm2LikelihoodCache
 Sgmm2LikelihoodCache caches SGMM likelihoods at two levels: the final pdf likelihoods, and the sub-state level likelihoods, which means that with the SCTM system we can avoid redundant computation. More...
 
struct  Sgmm2PerFrameDerivedVars
 Holds the per-frame precomputed quantities x(t), x_{i}(t), z_{i}(t), and n_{i}(t) (cf. More...
 
class  Sgmm2PerSpkDerivedVars
 
class  Sgmm2Project
 
struct  Sgmm2SplitSubstatesConfig
 
class  ShiftedDeltaFeatures
 
struct  ShiftedDeltaFeaturesOptions
 
class  SimpleDecoder
 Simplest possible decoder, included largely for didactic purposes and as a means to debug more highly optimized decoders. More...
 
class  SimpleOptions
 The class SimpleOptions is an implementation of OptionsItf that allows setting and getting option values programmatically, i.e., via getter and setter methods. More...
 
class  SingleUtteranceGmmDecoder
 You will instantiate this class when you want to decode a single utterance using the online-decoding setup. More...
 
class  SingleUtteranceNnet2Decoder
 You will instantiate this class when you want to decode a single utterance using the online-decoding setup for neural nets. More...
 
class  SingleUtteranceNnet2DecoderThreaded
 You will instantiate this class when you want to decode a single utterance using the online-decoding setup for neural nets. More...
 
class  SingleUtteranceNnet3DecoderTpl
 You will instantiate this class when you want to decode a single utterance using the online-decoding setup for neural nets. More...
 
class  SingleUtteranceNnet3IncrementalDecoderTpl
 You will instantiate this class when you want to decode a single utterance using the online-decoding setup for neural nets. More...
 
struct  SlidingWindowCmnOptions
 
struct  SolverOptions
 This class describes the options for maximizing various quadratic objective functions. More...
 
class  SparseMatrix
 
class  SparseVector
 
class  SpectrogramComputer
 Class for computing spectrogram features. More...
 
struct  SpectrogramOptions
 SpectrogramOptions contains basic options for computing spectrogram features. More...
 
struct  SpeexOptions
 
class  SphinxMatrixHolder
 A class for reading/writing Sphinx format matrices. More...
 
class  SplitEventMap
 
class  SplitRadixComplexFft
 
class  SplitRadixRealFft
 
class  SpMatrix
 Packed symetric matrix class. More...
 
class  StandardInputImpl
 
class  StandardOutputImpl
 
struct  StringHasher
 A hashing function object for strings. More...
 
class  SubMatrix
 Sub-matrix representation. More...
 
class  SubVector
 Represents a non-allocating general vector which can be defined as a sub-vector of higher-level vector [or as the row of a matrix]. More...
 
class  TableEventMap
 
class  TableWriter
 A templated class for writing objects to an archive or script file; see The Table concept. More...
 
class  TableWriterArchiveImpl
 
class  TableWriterBothImpl
 
class  TableWriterImplBase
 
class  TableWriterScriptImpl
 
class  TaskSequencer
 
struct  TaskSequencerConfig
 
class  TcpServer
 
class  ThreadSynchronizer
 class ThreadSynchronizer acts to guard an arbitrary type of buffer between a producing and a consuming thread (note: it's all symmetric between the two thread types). More...
 
class  TidToTstateMapper
 
class  Timer
 
class  TokenHolder
 
class  TokenVectorHolder
 
class  TpMatrix
 Packed symetric matrix class. More...
 
class  TrainingGraphCompiler
 
struct  TrainingGraphCompilerOptions
 
class  TransitionModel
 
class  TreeClusterer
 
struct  TreeClusterOptions
 
class  TreeRenderer
 
class  TwvMetrics
 
struct  TwvMetricsOptions
 
class  TwvMetricsStats
 
struct  UbmClusteringOptions
 
class  UpdatePhoneVectorsClass
 
class  UpdateWClass
 
struct  VadEnergyOptions
 
class  Vector
 A class representing a vector. More...
 
class  VectorBase
 Provides a vector abstraction class. More...
 
class  VectorClusterable
 VectorClusterable wraps vectors in a form accessible to generic clustering algorithms. More...
 
class  VectorFstToKwsLexicographicFstMapper
 
struct  VectorHasher
 A hashing function-object for vectors. More...
 
class  WaveData
 This class's purpose is to read in Wave files. More...
 
struct  WaveHeaderReadGofer
 
class  WaveHolder
 
class  WaveInfo
 This class reads and hold wave file header information. More...
 
class  WaveInfoHolder
 
class  WordAlignedLatticeTester
 
class  WordAlignLatticeLexiconInfo
 This class extracts some information from the lexicon and stores it in a suitable form for the word-alignment code to use. More...
 
struct  WordAlignLatticeLexiconOpts
 
struct  WordBoundaryInfo
 
struct  WordBoundaryInfoNewOpts
 
struct  WordBoundaryInfoOpts
 
struct  WspecifierOptions
 

Typedefs

typedef void(* LogHandler) (const LogMessageEnvelope &envelope, const char *message)
 Type of third-party logging function. More...
 
typedef float BaseFloat
 
typedef float float32
 
typedef double double64
 
typedef int32 MatrixIndexT
 
typedef int32 SignedMatrixIndexT
 
typedef uint32 UnsignedMatrixIndexT
 
typedef basic_pipebuf< char > PipebufType
 
typedef std::vector< std::string > KeyList
 
typedef TableWriter< KaldiObjectHolder< MatrixBase< BaseFloat > > > BaseFloatMatrixWriter
 
typedef SequentialTableReader< KaldiObjectHolder< Matrix< BaseFloat > > > SequentialBaseFloatMatrixReader
 
typedef RandomAccessTableReader< KaldiObjectHolder< Matrix< BaseFloat > > > RandomAccessBaseFloatMatrixReader
 
typedef RandomAccessTableReaderMapped< KaldiObjectHolder< Matrix< BaseFloat > > > RandomAccessBaseFloatMatrixReaderMapped
 
typedef TableWriter< KaldiObjectHolder< MatrixBase< double > > > DoubleMatrixWriter
 
typedef SequentialTableReader< KaldiObjectHolder< Matrix< double > > > SequentialDoubleMatrixReader
 
typedef RandomAccessTableReader< KaldiObjectHolder< Matrix< double > > > RandomAccessDoubleMatrixReader
 
typedef RandomAccessTableReaderMapped< KaldiObjectHolder< Matrix< double > > > RandomAccessDoubleMatrixReaderMapped
 
typedef TableWriter< KaldiObjectHolder< CompressedMatrix > > CompressedMatrixWriter
 
typedef TableWriter< KaldiObjectHolder< VectorBase< BaseFloat > > > BaseFloatVectorWriter
 
typedef SequentialTableReader< KaldiObjectHolder< Vector< BaseFloat > > > SequentialBaseFloatVectorReader
 
typedef RandomAccessTableReader< KaldiObjectHolder< Vector< BaseFloat > > > RandomAccessBaseFloatVectorReader
 
typedef RandomAccessTableReaderMapped< KaldiObjectHolder< Vector< BaseFloat > > > RandomAccessBaseFloatVectorReaderMapped
 
typedef TableWriter< KaldiObjectHolder< VectorBase< double > > > DoubleVectorWriter
 
typedef SequentialTableReader< KaldiObjectHolder< Vector< double > > > SequentialDoubleVectorReader
 
typedef RandomAccessTableReader< KaldiObjectHolder< Vector< double > > > RandomAccessDoubleVectorReader
 
typedef TableWriter< KaldiObjectHolder< CuMatrix< BaseFloat > > > BaseFloatCuMatrixWriter
 
typedef SequentialTableReader< KaldiObjectHolder< CuMatrix< BaseFloat > > > SequentialBaseFloatCuMatrixReader
 
typedef RandomAccessTableReader< KaldiObjectHolder< CuMatrix< BaseFloat > > > RandomAccessBaseFloatCuMatrixReader
 
typedef RandomAccessTableReaderMapped< KaldiObjectHolder< CuMatrix< BaseFloat > > > RandomAccessBaseFloatCuMatrixReaderMapped
 
typedef TableWriter< KaldiObjectHolder< CuMatrix< double > > > DoubleCuMatrixWriter
 
typedef SequentialTableReader< KaldiObjectHolder< CuMatrix< double > > > SequentialDoubleCuMatrixReader
 
typedef RandomAccessTableReader< KaldiObjectHolder< CuMatrix< double > > > RandomAccessDoubleCuMatrixReader
 
typedef RandomAccessTableReaderMapped< KaldiObjectHolder< CuMatrix< double > > > RandomAccessDoubleCuMatrixReaderMapped
 
typedef TableWriter< KaldiObjectHolder< CuVector< BaseFloat > > > BaseFloatCuVectorWriter
 
typedef SequentialTableReader< KaldiObjectHolder< CuVector< BaseFloat > > > SequentialBaseFloatCuVectorReader
 
typedef RandomAccessTableReader< KaldiObjectHolder< CuVector< BaseFloat > > > RandomAccessBaseFloatCuVectorReader
 
typedef RandomAccessTableReaderMapped< KaldiObjectHolder< CuVector< BaseFloat > > > RandomAccessBaseFloatCuVectorReaderMapped
 
typedef TableWriter< KaldiObjectHolder< CuVector< double > > > DoubleCuVectorWriter
 
typedef SequentialTableReader< KaldiObjectHolder< CuVector< double > > > SequentialDoubleCuVectorReader
 
typedef RandomAccessTableReader< KaldiObjectHolder< CuVector< double > > > RandomAccessDoubleCuVectorReader
 
typedef TableWriter< BasicHolder< int32 > > Int32Writer
 
typedef SequentialTableReader< BasicHolder< int32 > > SequentialInt32Reader
 
typedef RandomAccessTableReader< BasicHolder< int32 > > RandomAccessInt32Reader
 
typedef TableWriter< BasicVectorHolder< int32 > > Int32VectorWriter
 
typedef SequentialTableReader< BasicVectorHolder< int32 > > SequentialInt32VectorReader
 
typedef RandomAccessTableReader< BasicVectorHolder< int32 > > RandomAccessInt32VectorReader
 
typedef TableWriter< BasicVectorVectorHolder< int32 > > Int32VectorVectorWriter
 
typedef SequentialTableReader< BasicVectorVectorHolder< int32 > > SequentialInt32VectorVectorReader
 
typedef RandomAccessTableReader< BasicVectorVectorHolder< int32 > > RandomAccessInt32VectorVectorReader
 
typedef TableWriter< BasicPairVectorHolder< int32 > > Int32PairVectorWriter
 
typedef SequentialTableReader< BasicPairVectorHolder< int32 > > SequentialInt32PairVectorReader
 
typedef RandomAccessTableReader< BasicPairVectorHolder< int32 > > RandomAccessInt32PairVectorReader
 
typedef TableWriter< BasicPairVectorHolder< BaseFloat > > BaseFloatPairVectorWriter
 
typedef SequentialTableReader< BasicPairVectorHolder< BaseFloat > > SequentialBaseFloatPairVectorReader
 
typedef RandomAccessTableReader< BasicPairVectorHolder< BaseFloat > > RandomAccessBaseFloatPairVectorReader
 
typedef TableWriter< BasicHolder< BaseFloat > > BaseFloatWriter
 
typedef SequentialTableReader< BasicHolder< BaseFloat > > SequentialBaseFloatReader
 
typedef RandomAccessTableReader< BasicHolder< BaseFloat > > RandomAccessBaseFloatReader
 
typedef RandomAccessTableReaderMapped< BasicHolder< BaseFloat > > RandomAccessBaseFloatReaderMapped
 
typedef TableWriter< BasicHolder< double > > DoubleWriter
 
typedef SequentialTableReader< BasicHolder< double > > SequentialDoubleReader
 
typedef RandomAccessTableReader< BasicHolder< double > > RandomAccessDoubleReader
 
typedef TableWriter< BasicHolder< bool > > BoolWriter
 
typedef SequentialTableReader< BasicHolder< bool > > SequentialBoolReader
 
typedef RandomAccessTableReader< BasicHolder< bool > > RandomAccessBoolReader
 
typedef TableWriter< TokenHolderTokenWriter
 TokenWriter is a writer specialized for std::string where the strings are nonempty and whitespace-free. More...
 
typedef SequentialTableReader< TokenHolderSequentialTokenReader
 
typedef RandomAccessTableReader< TokenHolderRandomAccessTokenReader
 
typedef TableWriter< TokenVectorHolderTokenVectorWriter
 TokenVectorWriter is a writer specialized for sequences of std::string where the strings are nonempty and whitespace-free. More...
 
typedef SequentialTableReader< TokenVectorHolderSequentialTokenVectorReader
 
typedef RandomAccessTableReader< TokenVectorHolderRandomAccessTokenVectorReader
 
typedef TableWriter< KaldiObjectHolder< GeneralMatrix > > GeneralMatrixWriter
 
typedef SequentialTableReader< KaldiObjectHolder< GeneralMatrix > > SequentialGeneralMatrixReader
 
typedef RandomAccessTableReader< KaldiObjectHolder< GeneralMatrix > > RandomAccessGeneralMatrixReader
 
typedef RandomAccessTableReaderMapped< KaldiObjectHolder< GeneralMatrix > > RandomAccessGeneralMatrixReaderMapped
 
typedef OfflineFeatureTpl< FbankComputerFbank
 
typedef OfflineFeatureTpl< MfccComputerMfcc
 
typedef OfflineFeatureTpl< PlpComputerPlp
 
typedef OfflineFeatureTpl< SpectrogramComputerSpectrogram
 
typedef OnlineGenericBaseFeature< MfccComputerOnlineMfcc
 
typedef OnlineGenericBaseFeature< PlpComputerOnlinePlp
 
typedef OnlineGenericBaseFeature< FbankComputerOnlineFbank
 
typedef std::vector< std::pair< EventType, Clusterable * > > BuildTreeStatsType
 
typedef uint16 uint_smaller
 
typedef int16 int_smaller
 
typedef int32 EventKeyType
 Things of type EventKeyType can take any value. More...
 
typedef int32 EventValueType
 Given current code, things of type EventValueType should generally be nonnegative and in a reasonably small range (e.g. More...
 
typedef int32 EventAnswerType
 As far as the event-map code itself is concerned, things of type EventAnswerType may take any value except kNoAnswer (== -1). More...
 
typedef std::vector< std::pair< EventKeyType, EventValueType > > EventType
 
typedef TableWriter< KaldiObjectHolder< AmDiagGmm > > MapAmDiagGmmWriter
 
typedef RandomAccessTableReader< KaldiObjectHolder< AmDiagGmm > > RandomAccessMapAmDiagGmmReader
 
typedef RandomAccessTableReaderMapped< KaldiObjectHolder< AmDiagGmm > > RandomAccessMapAmDiagGmmReaderMapped
 
typedef SequentialTableReader< KaldiObjectHolder< AmDiagGmm > > MapAmDiagGmmSeqReader
 
typedef uint16 GmmFlagsType
 Bitwise OR of the above flags. More...
 
typedef uint16 SgmmUpdateFlagsType
 Bitwise OR of the above flags. More...
 
typedef uint16 SgmmWriteFlagsType
 Bitwise OR of the above flags. More...
 
typedef TableWriter< KaldiObjectHolder< RegtreeFmllrDiagGmm > > RegtreeFmllrDiagGmmWriter
 
typedef RandomAccessTableReader< KaldiObjectHolder< RegtreeFmllrDiagGmm > > RandomAccessRegtreeFmllrDiagGmmReader
 
typedef RandomAccessTableReaderMapped< KaldiObjectHolder< RegtreeFmllrDiagGmm > > RandomAccessRegtreeFmllrDiagGmmReaderMapped
 
typedef SequentialTableReader< KaldiObjectHolder< RegtreeFmllrDiagGmm > > RegtreeFmllrDiagGmmSeqReader
 
typedef TableWriter< KaldiObjectHolder< RegtreeMllrDiagGmm > > RegtreeMllrDiagGmmWriter
 
typedef RandomAccessTableReader< KaldiObjectHolder< RegtreeMllrDiagGmm > > RandomAccessRegtreeMllrDiagGmmReader
 
typedef RandomAccessTableReaderMapped< KaldiObjectHolder< RegtreeMllrDiagGmm > > RandomAccessRegtreeMllrDiagGmmReaderMapped
 
typedef SequentialTableReader< KaldiObjectHolder< RegtreeMllrDiagGmm > > RegtreeMllrDiagGmmSeqReader
 
typedef unordered_map< std::pair< int32, std::vector< int32 > >, fst::VectorFst< fst::StdArc > *, HmmCacheHashHmmCacheType
 HmmCacheType is a map from (central-phone, sequence of pdf-ids) to FST, used as cache in GetHmmAsFsa, as an optimization. More...
 
typedef std::vector< std::vector< std::pair< int32, BaseFloat > > > Posterior
 Posterior is a typedef for storing acoustic-state (actually, transition-id) posteriors over an utterance. More...
 
typedef std::vector< std::vector< std::pair< int32, Vector< BaseFloat > > > > GaussPost
 GaussPost is a typedef for storing Gaussian-level posteriors for an utterance. More...
 
typedef TableWriter< PosteriorHolderPosteriorWriter
 
typedef SequentialTableReader< PosteriorHolderSequentialPosteriorReader
 
typedef RandomAccessTableReader< PosteriorHolderRandomAccessPosteriorReader
 
typedef TableWriter< GaussPostHolderGaussPostWriter
 
typedef SequentialTableReader< GaussPostHolderSequentialGaussPostReader
 
typedef RandomAccessTableReader< GaussPostHolderRandomAccessGaussPostReader
 
typedef LatticeFasterDecoderConfig LatticeBiglmFasterDecoderConfig
 
typedef LatticeFasterDecoderTpl< fst::StdFst, decoder::StdTokenLatticeFasterDecoder
 
typedef LatticeFasterOnlineDecoderTpl< fst::StdFst > LatticeFasterOnlineDecoder
 
typedef LatticeIncrementalDecoderTpl< fst::StdFst, decoder::StdTokenLatticeIncrementalDecoder
 
typedef LatticeIncrementalOnlineDecoderTpl< fst::StdFst > LatticeIncrementalOnlineDecoder
 
typedef fst::LatticeWeightTpl< BaseFloatLatticeWeight
 
typedef fst::CompactLatticeWeightTpl< LatticeWeight, int32CompactLatticeWeight
 
typedef fst::CompactLatticeWeightCommonDivisorTpl< LatticeWeight, int32CompactLatticeWeightCommonDivisor
 
typedef fst::ArcTpl< LatticeWeightLatticeArc
 
typedef fst::ArcTpl< CompactLatticeWeightCompactLatticeArc
 
typedef fst::VectorFst< LatticeArcLattice
 
typedef fst::VectorFst< CompactLatticeArcCompactLattice
 
typedef TableWriter< LatticeHolderLatticeWriter
 
typedef SequentialTableReader< LatticeHolderSequentialLatticeReader
 
typedef RandomAccessTableReader< LatticeHolderRandomAccessLatticeReader
 
typedef TableWriter< CompactLatticeHolderCompactLatticeWriter
 
typedef SequentialTableReader< CompactLatticeHolderSequentialCompactLatticeReader
 
typedef RandomAccessTableReader< CompactLatticeHolderRandomAccessCompactLatticeReader
 
typedef Lattice::StateId StateId
 
typedef Lattice::Arc Arc
 
typedef fst::StdArc::Label Label
 
typedef std::vector< std::pair< Label, Label > > LabelPairVector
 
typedef KaldiObjectHolder< Sgmm2GauPostSgmm2GauPostHolder
 
typedef RandomAccessTableReader< Sgmm2GauPostHolderRandomAccessSgmm2GauPostReader
 
typedef SequentialTableReader< Sgmm2GauPostHolderSequentialSgmm2GauPostReader
 
typedef TableWriter< Sgmm2GauPostHolderSgmm2GauPostWriter
 
typedef fst::LexicographicWeight< TropicalWeight, TropicalWeight > StdLStdWeight
 
typedef fst::LexicographicWeight< TropicalWeight, StdLStdWeightStdLStdLStdWeight
 
typedef fst::ArcTpl< StdLStdLStdWeightStdLStdLStdArc
 
typedef fst::ProductWeight< TropicalWeight, ArcticWeightStdXStdprimeWeight
 
typedef fst::ProductWeight< LogWeight, StdXStdprimeWeightLogXStdXStdprimeWeight
 
typedef fst::ArcTpl< LogXStdXStdprimeWeightLogXStdXStdprimeArc
 
typedef StdLStdLStdWeight KwsLexicographicWeight
 
typedef StdLStdLStdArc KwsLexicographicArc
 
typedef fst::VectorFst< KwsLexicographicArcKwsLexicographicFst
 
typedef LogXStdXStdprimeWeight KwsProductWeight
 
typedef LogXStdXStdprimeArc KwsProductArc
 
typedef fst::VectorFst< KwsProductArcKwsProductFst
 
typedef Arc::Weight Weight
 
typedef kaldi::int32 int32
 
typedef SingleUtteranceNnet3DecoderTpl< fst::Fst< fst::StdArc > > SingleUtteranceNnet3Decoder
 
typedef SingleUtteranceNnet3IncrementalDecoderTpl< fst::Fst< fst::StdArc > > SingleUtteranceNnet3IncrementalDecoder
 

Enumerations

enum  CompressionMethod {
  kAutomaticMethod = 1, kSpeechFeature = 2, kTwoByteAuto = 3, kTwoByteSignedInteger = 4,
  kOneByteAuto = 5, kOneByteUnsignedInteger = 6, kOneByteZeroOne = 7
}
 
enum  MatrixTransposeType { kTrans = 112, kNoTrans = 111 }
 
enum  MatrixResizeType { kSetZero, kUndefined, kCopyData }
 
enum  MatrixStrideType { kDefaultStride, kStrideEqualNumCols }
 
enum  SpCopyType { kTakeLower, kTakeUpper, kTakeMean, kTakeMeanAndCheck }
 
enum  GeneralMatrixType { kFullMatrix, kCompressedMatrix, kSparseMatrix }
 
enum  OutputType { kNoOutput, kFileOutput, kStandardOutput, kPipeOutput }
 
enum  InputType {
  kNoInput, kFileInput, kStandardInput, kOffsetFileInput,
  kPipeInput
}
 
enum  WspecifierType { kNoWspecifier, kArchiveWspecifier, kScriptWspecifier, kBothWspecifier }
 
enum  RspecifierType { kNoRspecifier, kArchiveRspecifier, kScriptRspecifier }
 
enum  ShellType { kBash = 0 }
 
enum  AllKeysType { kAllKeysInsistIdentical, kAllKeysIntersection, kAllKeysUnion }
 Typedef used when we get "all keys" from a set of stats– used in specifying which kinds of questions to ask. More...
 
enum  GmmUpdateFlags {
  kGmmMeans = 0x001, kGmmVariances = 0x002, kGmmWeights = 0x004, kGmmTransitions = 0x008,
  kGmmAll = 0x00F
}
 
enum  SgmmUpdateFlags {
  kSgmmPhoneVectors = 0x001, kSgmmPhoneProjections = 0x002, kSgmmPhoneWeightProjections = 0x004, kSgmmCovarianceMatrix = 0x008,
  kSgmmSubstateWeights = 0x010, kSgmmSpeakerProjections = 0x020, kSgmmTransitions = 0x040, kSgmmSpeakerWeightProjections = 0x080,
  kSgmmAll = 0x0FF
}
 
enum  SgmmWriteFlags {
  kSgmmGlobalParams = 0x001, kSgmmStateParams = 0x002, kSgmmNormalizers = 0x004, kSgmmBackgroundGmms = 0x008,
  kSgmmWriteAll = 0x00F
}
 
enum  cova_type { full, diag }
 Generate features for a certain covariance type covariance_type == 0: full covariance covariance_type == 1: diagonal covariance. More...
 
enum  { kEps = 0, kDisambig, kBos, kEos }
 
enum  CuCompressedMatrixType { kCompressedMatrixInt8 = 1, kCompressedMatrixUint8 = 2, kCompressedMatrixInt16 = 3, kCompressedMatrixUint16 = 4 }
 
enum  DetectionDecision {
  kKwsFalseAlarm, kKwsMiss, kKwsCorr, kKwsCorrUndetected,
  kKwsUnseen
}
 

Functions

template<class T >
void WriteBasicType (std::ostream &os, bool binary, T t)
 WriteBasicType is the name of the write function for bool, integer types, and floating-point types. More...
 
template<class T >
void ReadBasicType (std::istream &is, bool binary, T *t)
 ReadBasicType is the name of the read function for bool, integer types, and floating-point types. More...
 
template<class T >
void WriteIntegerPairVector (std::ostream &os, bool binary, const std::vector< std::pair< T, T > > &v)
 Function for writing STL vectors of pairs of integer types. More...
 
template<class T >
void ReadIntegerPairVector (std::istream &is, bool binary, std::vector< std::pair< T, T > > *v)
 Function for reading STL vector of pairs of integer types. More...
 
template<class T >
void WriteIntegerVector (std::ostream &os, bool binary, const std::vector< T > &v)
 Function for writing STL vectors of integer types. More...
 
template<class T >
void ReadIntegerVector (std::istream &is, bool binary, std::vector< T > *v)
 Function for reading STL vector of integer types. More...
 
void InitKaldiOutputStream (std::ostream &os, bool binary)
 InitKaldiOutputStream initializes an opened stream for writing by writing an optional binary header and modifying the floating-point precision; it will typically not be called by users directly. More...
 
bool InitKaldiInputStream (std::istream &is, bool *binary)
 Initialize an opened stream for reading by detecting the binary header and. More...
 
void UnitTestIo (bool binary)
 
template<>
void WriteBasicType< bool > (std::ostream &os, bool binary, bool b)
 
template<>
void ReadBasicType< bool > (std::istream &is, bool binary, bool *b)
 
template<>
void WriteBasicType< float > (std::ostream &os, bool binary, float f)
 
template<>
void WriteBasicType< double > (std::ostream &os, bool binary, double f)
 
template<>
void ReadBasicType< float > (std::istream &is, bool binary, float *f)
 
template<>
void ReadBasicType< double > (std::istream &is, bool binary, double *d)
 
void CheckToken (const char *token)
 
void WriteToken (std::ostream &os, bool binary, const char *token)
 The WriteToken functions are for writing nonempty sequences of non-space characters. More...
 
int Peek (std::istream &is, bool binary)
 Peek consumes whitespace (if binary == false) and then returns the peek() value of the stream. More...
 
void WriteToken (std::ostream &os, bool binary, const std::string &token)
 
void ReadToken (std::istream &is, bool binary, std::string *token)
 ReadToken gets the next token and puts it in str (exception on failure). More...
 
int PeekToken (std::istream &is, bool binary)
 PeekToken will return the first character of the next token, or -1 if end of file. More...
 
void ExpectToken (std::istream &is, bool binary, const char *token)
 ExpectToken tries to read in the given token, and throws an exception on failure. More...
 
void ExpectToken (std::istream &is, bool binary, const std::string &token)
 
template<class T >
void ReadBasicType (std::istream &is, bool binary, T *t, bool add)
 
void ExpectPretty (std::istream &is, bool binary, const char *token)
 ExpectPretty attempts to read the text in "token", but only in non-binary mode. More...
 
void ExpectPretty (std::istream &is, bool binary, const std::string &token)
 
void MyFunction2 ()
 
void MyFunction1 ()
 
void UnitTestError ()
 
void VerifySymbolRange (const std::string &trace, const bool want_found, const std::string &want_symbol)
 
void TestLocateSymbolRange ()
 
void SetProgramName (const char *basename)
 Called by ParseOptions to set base name (no directory) of the executing program. More...
 
static const char * GetShortFileName (const char *path)
 
static std::string KaldiGetStackTrace ()
 
void KaldiAssertFailure_ (const char *func, const char *file, int32 line, const char *cond_str)
 
LogHandler SetLogHandler (LogHandler)
 Set logging handler. More...
 
int32 GetVerboseLevel ()
 Get verbosity level, usually set via command line '–verbose=' switch. More...
 
void SetVerboseLevel (int32 i)
 This should be rarely used, except by programs using Kaldi as library; command-line programs set the verbose level automatically from ParseOptions. More...
 
template<class I >
void UnitTestGcdLcmTpl ()
 
void UnitTestRoundUpToNearestPowerOfTwo ()
 
void UnitTestDivideRoundingDown ()
 
void UnitTestGcdLcm ()
 
void UnitTestRand ()
 
void UnitTestLogAddSub ()
 
void UnitTestDefines ()
 
void UnitTestAssertFunc ()
 
template<class I >
void UnitTestFactorizeTpl ()
 
void UnitTestFactorize ()
 
void UnitTestApproxEqual ()
 
template<class Real >
void UnitTestExpSpeed ()
 
template<class Real >
void UnitTestLogSpeed ()
 
int32 RoundUpToNearestPowerOfTwo (int32 n)
 
int Rand (struct RandomState *state)
 
bool WithProb (BaseFloat prob, struct RandomState *state)
 
int32 RandInt (int32 min_val, int32 max_val, struct RandomState *state)
 
int32 RandPoisson (float lambda, struct RandomState *state)
 
void RandGauss2 (float *a, float *b, RandomState *state)
 
void RandGauss2 (double *a, double *b, RandomState *state)
 
double Exp (double x)
 
float Exp (float x)
 
double Log (double x)
 
float Log (float x)
 
double Log1p (double x)
 
float Log1p (float x)
 
float RandUniform (struct RandomState *state=NULL)
 Returns a random number strictly between 0 and 1. More...
 
float RandGauss (struct RandomState *state=NULL)
 
template<class Float >
Float RandPrune (Float post, BaseFloat prune_thresh, struct RandomState *state=NULL)
 
double LogAdd (double x, double y)
 
float LogAdd (float x, float y)
 
double LogSub (double x, double y)
 
float LogSub (float x, float y)
 
static bool ApproxEqual (float a, float b, float relative_tolerance=0.001)
 return abs(a - b) <= relative_tolerance * (abs(a)+abs(b)). More...
 
static void AssertEqual (float a, float b, float relative_tolerance=0.001)
 assert abs(a - b) <= relative_tolerance * (abs(a)+abs(b)) More...
 
static int32 DivideRoundingDown (int32 a, int32 b)
 Returns a / b, rounding towards negative infinity in all cases. More...
 
template<class I >
Gcd (I m, I n)
 
template<class I >
Lcm (I m, I n)
 Returns the least common multiple of two integers. More...
 
template<class I >
void Factorize (I m, std::vector< I > *factors)
 
double Hypot (double x, double y)
 
float Hypot (float x, float y)
 
std::string CharToString (const char &c)
 
void Sleep (float seconds)
 
int MachineIsLittleEndian ()
 
void TimerTest ()
 
void cblas_Xcopy (const int N, const float *X, const int incX, float *Y, const int incY)
 
void cblas_Xcopy (const int N, const double *X, const int incX, double *Y, const int incY)
 
float cblas_Xasum (const int N, const float *X, const int incX)
 
double cblas_Xasum (const int N, const double *X, const int incX)
 
void cblas_Xrot (const int N, float *X, const int incX, float *Y, const int incY, const float c, const float s)
 
void cblas_Xrot (const int N, double *X, const int incX, double *Y, const int incY, const double c, const double s)
 
float cblas_Xdot (const int N, const float *const X, const int incX, const float *const Y, const int incY)
 
double cblas_Xdot (const int N, const double *const X, const int incX, const double *const Y, const int incY)
 
void cblas_Xaxpy (const int N, const float alpha, const float *X, const int incX, float *Y, const int incY)
 
void cblas_Xaxpy (const int N, const double alpha, const double *X, const int incX, double *Y, const int incY)
 
void cblas_Xscal (const int N, const float alpha, float *data, const int inc)
 
void cblas_Xscal (const int N, const double alpha, double *data, const int inc)
 
void cblas_Xspmv (const float alpha, const int num_rows, const float *Mdata, const float *v, const int v_inc, const float beta, float *y, const int y_inc)
 
void cblas_Xspmv (const double alpha, const int num_rows, const double *Mdata, const double *v, const int v_inc, const double beta, double *y, const int y_inc)
 
void cblas_Xtpmv (MatrixTransposeType trans, const float *Mdata, const int num_rows, float *y, const int y_inc)
 
void cblas_Xtpmv (MatrixTransposeType trans, const double *Mdata, const int num_rows, double *y, const int y_inc)
 
void cblas_Xtpsv (MatrixTransposeType trans, const float *Mdata, const int num_rows, float *y, const int y_inc)
 
void cblas_Xtpsv (MatrixTransposeType trans, const double *Mdata, const int num_rows, double *y, const int y_inc)
 
void cblas_Xspmv (MatrixIndexT dim, float alpha, const float *Mdata, const float *ydata, MatrixIndexT ystride, float beta, float *xdata, MatrixIndexT xstride)
 
void cblas_Xspmv (MatrixIndexT dim, double alpha, const double *Mdata, const double *ydata, MatrixIndexT ystride, double beta, double *xdata, MatrixIndexT xstride)
 
void cblas_Xspr2 (MatrixIndexT dim, float alpha, const float *Xdata, MatrixIndexT incX, const float *Ydata, MatrixIndexT incY, float *Adata)
 
void cblas_Xspr2 (MatrixIndexT dim, double alpha, const double *Xdata, MatrixIndexT incX, const double *Ydata, MatrixIndexT incY, double *Adata)
 
void cblas_Xspr (MatrixIndexT dim, float alpha, const float *Xdata, MatrixIndexT incX, float *Adata)
 
void cblas_Xspr (MatrixIndexT dim, double alpha, const double *Xdata, MatrixIndexT incX, double *Adata)
 
void cblas_Xgemv (MatrixTransposeType trans, MatrixIndexT num_rows, MatrixIndexT num_cols, float alpha, const float *Mdata, MatrixIndexT stride, const float *xdata, MatrixIndexT incX, float beta, float *ydata, MatrixIndexT incY)
 
void cblas_Xgemv (MatrixTransposeType trans, MatrixIndexT num_rows, MatrixIndexT num_cols, double alpha, const double *Mdata, MatrixIndexT stride, const double *xdata, MatrixIndexT incX, double beta, double *ydata, MatrixIndexT incY)
 
void cblas_Xgbmv (MatrixTransposeType trans, MatrixIndexT num_rows, MatrixIndexT num_cols, MatrixIndexT num_below, MatrixIndexT num_above, float alpha, const float *Mdata, MatrixIndexT stride, const float *xdata, MatrixIndexT incX, float beta, float *ydata, MatrixIndexT incY)
 
void cblas_Xgbmv (MatrixTransposeType trans, MatrixIndexT num_rows, MatrixIndexT num_cols, MatrixIndexT num_below, MatrixIndexT num_above, double alpha, const double *Mdata, MatrixIndexT stride, const double *xdata, MatrixIndexT incX, double beta, double *ydata, MatrixIndexT incY)
 
template<typename Real >
void Xgemv_sparsevec (MatrixTransposeType trans, MatrixIndexT num_rows, MatrixIndexT num_cols, Real alpha, const Real *Mdata, MatrixIndexT stride, const Real *xdata, MatrixIndexT incX, Real beta, Real *ydata, MatrixIndexT incY)
 
void cblas_Xgemm (const float alpha, MatrixTransposeType transA, const float *Adata, MatrixIndexT a_num_rows, MatrixIndexT a_num_cols, MatrixIndexT a_stride, MatrixTransposeType transB, const float *Bdata, MatrixIndexT b_stride, const float beta, float *Mdata, MatrixIndexT num_rows, MatrixIndexT num_cols, MatrixIndexT stride)
 
void cblas_Xgemm (const double alpha, MatrixTransposeType transA, const double *Adata, MatrixIndexT a_num_rows, MatrixIndexT a_num_cols, MatrixIndexT a_stride, MatrixTransposeType transB, const double *Bdata, MatrixIndexT b_stride, const double beta, double *Mdata, MatrixIndexT num_rows, MatrixIndexT num_cols, MatrixIndexT stride)
 
void cblas_Xsymm (const float alpha, MatrixIndexT sz, const float *Adata, MatrixIndexT a_stride, const float *Bdata, MatrixIndexT b_stride, const float beta, float *Mdata, MatrixIndexT stride)
 
void cblas_Xsymm (const double alpha, MatrixIndexT sz, const double *Adata, MatrixIndexT a_stride, const double *Bdata, MatrixIndexT b_stride, const double beta, double *Mdata, MatrixIndexT stride)
 
void cblas_Xger (MatrixIndexT num_rows, MatrixIndexT num_cols, float alpha, const float *xdata, MatrixIndexT incX, const float *ydata, MatrixIndexT incY, float *Mdata, MatrixIndexT stride)
 
void cblas_Xger (MatrixIndexT num_rows, MatrixIndexT num_cols, double alpha, const double *xdata, MatrixIndexT incX, const double *ydata, MatrixIndexT incY, double *Mdata, MatrixIndexT stride)
 
void cblas_Xsyrk (const MatrixTransposeType trans, const MatrixIndexT dim_c, const MatrixIndexT other_dim_a, const float alpha, const float *A, const MatrixIndexT a_stride, const float beta, float *C, const MatrixIndexT c_stride)
 
void cblas_Xsyrk (const MatrixTransposeType trans, const MatrixIndexT dim_c, const MatrixIndexT other_dim_a, const double alpha, const double *A, const MatrixIndexT a_stride, const double beta, double *C, const MatrixIndexT c_stride)
 
void cblas_Xsbmv1 (const MatrixIndexT dim, const double *A, const double alpha, const double *x, const double beta, double *y)
 matrix-vector multiply using a banded matrix; we always call this with b = 1 meaning we're multiplying by a diagonal matrix. More...
 
void cblas_Xsbmv1 (const MatrixIndexT dim, const float *A, const float alpha, const float *x, const float beta, float *y)
 
void mul_elements (const MatrixIndexT dim, const double *a, double *b)
 This is not really a wrapper for CBLAS as CBLAS does not have this; in future we could extend this somehow. More...
 
void mul_elements (const MatrixIndexT dim, const float *a, float *b)
 
void clapack_Xtptri (KaldiBlasInt *num_rows, float *Mdata, KaldiBlasInt *result)
 
void clapack_Xtptri (KaldiBlasInt *num_rows, double *Mdata, KaldiBlasInt *result)
 
void clapack_Xgetrf2 (KaldiBlasInt *num_rows, KaldiBlasInt *num_cols, float *Mdata, KaldiBlasInt *stride, KaldiBlasInt *pivot, KaldiBlasInt *result)
 
void clapack_Xgetrf2 (KaldiBlasInt *num_rows, KaldiBlasInt *num_cols, double *Mdata, KaldiBlasInt *stride, KaldiBlasInt *pivot, KaldiBlasInt *result)
 
void clapack_Xgetri2 (KaldiBlasInt *num_rows, float *Mdata, KaldiBlasInt *stride, KaldiBlasInt *pivot, float *p_work, KaldiBlasInt *l_work, KaldiBlasInt *result)
 
void clapack_Xgetri2 (KaldiBlasInt *num_rows, double *Mdata, KaldiBlasInt *stride, KaldiBlasInt *pivot, double *p_work, KaldiBlasInt *l_work, KaldiBlasInt *result)
 
void clapack_Xgesvd (char *v, char *u, KaldiBlasInt *num_cols, KaldiBlasInt *num_rows, float *Mdata, KaldiBlasInt *stride, float *sv, float *Vdata, KaldiBlasInt *vstride, float *Udata, KaldiBlasInt *ustride, float *p_work, KaldiBlasInt *l_work, KaldiBlasInt *result)
 
void clapack_Xgesvd (char *v, char *u, KaldiBlasInt *num_cols, KaldiBlasInt *num_rows, double *Mdata, KaldiBlasInt *stride, double *sv, double *Vdata, KaldiBlasInt *vstride, double *Udata, KaldiBlasInt *ustride, double *p_work, KaldiBlasInt *l_work, KaldiBlasInt *result)
 
void clapack_Xsptri (KaldiBlasInt *num_rows, float *Mdata, KaldiBlasInt *ipiv, float *work, KaldiBlasInt *result)
 
void clapack_Xsptri (KaldiBlasInt *num_rows, double *Mdata, KaldiBlasInt *ipiv, double *work, KaldiBlasInt *result)
 
void clapack_Xsptrf (KaldiBlasInt *num_rows, float *Mdata, KaldiBlasInt *ipiv, KaldiBlasInt *result)
 
void clapack_Xsptrf (KaldiBlasInt *num_rows, double *Mdata, KaldiBlasInt *ipiv, KaldiBlasInt *result)
 
template<typename Real >
std::ostream & operator<< (std::ostream &os, const MatrixBase< Real > &M)
 
template<typename Real >
std::istream & operator>> (std::istream &is, Matrix< Real > &M)
 
template<typename Real >
std::istream & operator>> (std::istream &is, MatrixBase< Real > &M)
 
template<typename Real >
bool ReadHtk (std::istream &is, Matrix< Real > *M_ptr, HtkHeader *header_ptr)
 Extension of the HTK header. More...
 
template bool ReadHtk (std::istream &is, Matrix< float > *M, HtkHeader *header_ptr)
 
template bool ReadHtk (std::istream &is, Matrix< double > *M, HtkHeader *header_ptr)
 
template<typename Real >
bool WriteHtk (std::ostream &os, const MatrixBase< Real > &M, HtkHeader htk_hdr)
 
template bool WriteHtk (std::ostream &os, const MatrixBase< float > &M, HtkHeader htk_hdr)
 
template bool WriteHtk (std::ostream &os, const MatrixBase< double > &M, HtkHeader htk_hdr)
 
template<class Real >
bool WriteSphinx (std::ostream &os, const MatrixBase< Real > &M)
 
template bool WriteSphinx (std::ostream &os, const MatrixBase< float > &M)
 
template bool WriteSphinx (std::ostream &os, const MatrixBase< double > &M)
 
template<typename Real >
Real TraceMatMatMat (const MatrixBase< Real > &A, MatrixTransposeType transA, const MatrixBase< Real > &B, MatrixTransposeType transB, const MatrixBase< Real > &C, MatrixTransposeType transC)
 Returns tr(A B C) More...
 
template float TraceMatMatMat (const MatrixBase< float > &A, MatrixTransposeType transA, const MatrixBase< float > &B, MatrixTransposeType transB, const MatrixBase< float > &C, MatrixTransposeType transC)
 
template double TraceMatMatMat (const MatrixBase< double > &A, MatrixTransposeType transA, const MatrixBase< double > &B, MatrixTransposeType transB, const MatrixBase< double > &C, MatrixTransposeType transC)
 
template<typename Real >
Real TraceMatMatMatMat (const MatrixBase< Real > &A, MatrixTransposeType transA, const MatrixBase< Real > &B, MatrixTransposeType transB, const MatrixBase< Real > &C, MatrixTransposeType transC, const MatrixBase< Real > &D, MatrixTransposeType transD)
 Returns tr(A B C D) More...
 
template float TraceMatMatMatMat (const MatrixBase< float > &A, MatrixTransposeType transA, const MatrixBase< float > &B, MatrixTransposeType transB, const MatrixBase< float > &C, MatrixTransposeType transC, const MatrixBase< float > &D, MatrixTransposeType transD)
 
template double TraceMatMatMatMat (const MatrixBase< double > &A, MatrixTransposeType transA, const MatrixBase< double > &B, MatrixTransposeType transB, const MatrixBase< double > &C, MatrixTransposeType transC, const MatrixBase< double > &D, MatrixTransposeType transD)
 
template<typename Real >
void SortSvd (VectorBase< Real > *s, MatrixBase< Real > *U, MatrixBase< Real > *Vt=NULL, bool sort_on_absolute_value=true)
 Function to ensure that SVD is sorted. More...
 
template void SortSvd (VectorBase< float > *s, MatrixBase< float > *U, MatrixBase< float > *Vt, bool)
 
template void SortSvd (VectorBase< double > *s, MatrixBase< double > *U, MatrixBase< double > *Vt, bool)
 
template<typename Real >
void CreateEigenvalueMatrix (const VectorBase< Real > &real, const VectorBase< Real > &imag, MatrixBase< Real > *D)
 Creates the eigenvalue matrix D that is part of the decomposition used Matrix::Eig. More...
 
template void CreateEigenvalueMatrix (const VectorBase< float > &re, const VectorBase< float > &im, MatrixBase< float > *D)
 
template void CreateEigenvalueMatrix (const VectorBase< double > &re, const VectorBase< double > &im, MatrixBase< double > *D)
 
template<typename Real >
bool AttemptComplexPower (Real *x_re, Real *x_im, Real power)
 The following function is used in Matrix::Power, and separately tested, so we declare it here mainly for the testing code to see. More...
 
template bool AttemptComplexPower (float *x_re, float *x_im, float power)
 
template bool AttemptComplexPower (double *x_re, double *x_im, double power)
 
template float TraceMatMat (const MatrixBase< float > &A, const MatrixBase< float > &B, MatrixTransposeType trans)
 
template double TraceMatMat (const MatrixBase< double > &A, const MatrixBase< double > &B, MatrixTransposeType trans)
 
template<typename Real >
bool ApproxEqual (const MatrixBase< Real > &A, const MatrixBase< Real > &B, Real tol=0.01)
 
template<typename Real >
void AssertEqual (const MatrixBase< Real > &A, const MatrixBase< Real > &B, float tol=0.01)
 
template<typename Real >
double TraceMat (const MatrixBase< Real > &A)
 Returns trace of matrix. More...
 
template<typename Real >
bool SameDim (const MatrixBase< Real > &M, const MatrixBase< Real > &N)
 
template<typename Real >
std::ostream & operator<< (std::ostream &os, const VectorBase< Real > &rv)
 
template<typename Real >
std::istream & operator>> (std::istream &in, VectorBase< Real > &v)
 Input from a C++ stream. More...
 
template<typename Real >
std::istream & operator>> (std::istream &in, Vector< Real > &v)
 Input from a C++ stream. More...
 
template<typename Real >
Real VecVec (const VectorBase< Real > &v1, const VectorBase< Real > &v2)
 Returns dot product between v1 and v2. More...
 
template float VecVec (const VectorBase< float > &a, const VectorBase< float > &b)
 
template double VecVec (const VectorBase< double > &a, const VectorBase< double > &b)
 
template<typename Real , typename OtherReal >
Real VecVec (const VectorBase< Real > &ra, const VectorBase< OtherReal > &rb)
 
template float VecVec (const VectorBase< float > &ra, const VectorBase< double > &rb)
 
template double VecVec (const VectorBase< double > &ra, const VectorBase< float > &rb)
 
template<typename Real >
Real VecMatVec (const VectorBase< Real > &v1, const MatrixBase< Real > &M, const VectorBase< Real > &v2)
 Returns $ v_1^T M v_2 $ . More...
 
template float VecMatVec (const VectorBase< float > &v1, const MatrixBase< float > &M, const VectorBase< float > &v2)
 
template double VecMatVec (const VectorBase< double > &v1, const MatrixBase< double > &M, const VectorBase< double > &v2)
 
template<typename Real >
bool ApproxEqual (const VectorBase< Real > &a, const VectorBase< Real > &b, Real tol=0.01)
 
template<typename Real >
void AssertEqual (VectorBase< Real > &a, VectorBase< Real > &b, float tol=0.01)
 
template<typename Real >
void ComplexMul (const Real &a_re, const Real &a_im, Real *b_re, Real *b_im)
 ComplexMul implements, inline, the complex multiplication b *= a. More...
 
template<typename Real >
void ComplexAddProduct (const Real &a_re, const Real &a_im, const Real &b_re, const Real &b_im, Real *c_re, Real *c_im)
 ComplexMul implements, inline, the complex operation c += (a * b). More...
 
template<typename Real >
void ComplexImExp (Real x, Real *a_re, Real *a_im)
 ComplexImExp implements a <– exp(i x), inline. More...
 
template<typename Real >
void ComplexFt (const VectorBase< Real > &in, VectorBase< Real > *out, bool forward)
 ComplexFt is the same as ComplexFft but it implements the Fourier transform in an inefficient way. More...
 
template void ComplexFt (const VectorBase< float > &in, VectorBase< float > *out, bool forward)
 
template void ComplexFt (const VectorBase< double > &in, VectorBase< double > *out, bool forward)
 
template<typename Real >
void ComplexFftRecursive (Real *data, int nffts, int N, const int *factor_begin, const int *factor_end, bool forward, Vector< Real > *tmp_vec)
 ComplexFftRecursive is a recursive function that computes the complex FFT of size N. More...
 
template<typename Real >
void ComplexFft (VectorBase< Real > *v, bool forward, Vector< Real > *tmp_work=NULL)
 The function ComplexFft does an Fft on the vector argument v. More...
 
template<typename Real >
void RealFftInefficient (VectorBase< Real > *v, bool forward)
 Inefficient version of Fourier transform, for testing purposes. More...
 
template void RealFftInefficient (VectorBase< float > *v, bool forward)
 
template void RealFftInefficient (VectorBase< double > *v, bool forward)
 
template void ComplexFft (VectorBase< float > *v, bool forward, Vector< float > *tmp_in)
 
template void ComplexFft (VectorBase< double > *v, bool forward, Vector< double > *tmp_in)
 
template<typename Real >
void RealFft (VectorBase< Real > *v, bool forward)
 RealFft is a fourier transform of real inputs. More...
 
template void RealFft (VectorBase< float > *v, bool forward)
 
template void RealFft (VectorBase< double > *v, bool forward)
 
template<typename Real >
void ComputeDctMatrix (Matrix< Real > *M)
 ComputeDctMatrix computes a matrix corresponding to the DCT, such that M * v equals the DCT of vector v. More...
 
template void ComputeDctMatrix (Matrix< float > *M)
 
template void ComputeDctMatrix (Matrix< double > *M)
 
template<typename Real >
void ComputePca (const MatrixBase< Real > &X, MatrixBase< Real > *U, MatrixBase< Real > *A, bool print_eigs=false, bool exact=true)
 ComputePCA does a PCA computation, using either outer products or inner products, whichever is more efficient. More...
 
template void ComputePca (const MatrixBase< float > &X, MatrixBase< float > *U, MatrixBase< float > *A, bool print_eigs, bool exact)
 
template void ComputePca (const MatrixBase< double > &X, MatrixBase< double > *U, MatrixBase< double > *A, bool print_eigs, bool exact)
 
template<typename Real >
void AddOuterProductPlusMinus (Real alpha, const VectorBase< Real > &a, const VectorBase< Real > &b, MatrixBase< Real > *plus, MatrixBase< Real > *minus)
 
template void AddOuterProductPlusMinus< float > (float alpha, const VectorBase< float > &a, const VectorBase< float > &b, MatrixBase< float > *plus, MatrixBase< float > *minus)
 
template void AddOuterProductPlusMinus< double > (double alpha, const VectorBase< double > &a, const VectorBase< double > &b, MatrixBase< double > *plus, MatrixBase< double > *minus)
 
template<typename Real1 , typename Real2 >
void AssertSameDim (const MatrixBase< Real1 > &mat1, const MatrixBase< Real2 > &mat2)
 
template<typename Real >
std::string NameOf ()
 
template<typename Real >
static void CsvResult (std::string test, int dim, BaseFloat measure, std::string units)
 
template<typename Real >
static void UnitTestRealFftSpeed ()
 
template<typename Real >
static void UnitTestSplitRadixRealFftSpeed ()
 
template<typename Real >
static void UnitTestSvdSpeed ()
 
template<typename Real >
static void UnitTestAddMatMatSpeed ()
 
template<typename Real >
static void UnitTestAddRowSumMatSpeed ()
 
template<typename Real >
static void UnitTestAddColSumMatSpeed ()
 
template<typename Real >
static void UnitTestAddVecToRowsSpeed ()
 
template<typename Real >
static void UnitTestAddVecToColsSpeed ()
 
template<typename Real >
static void MatrixUnitSpeedTest ()
 
template<typename Real >
void RandPosdefSpMatrix (MatrixIndexT dim, SpMatrix< Real > *matrix)
 
template<typename Real >
static void InitRandNonsingular (MatrixBase< Real > *M)
 
template<typename Real >
static void InitRandNonsingular (SpMatrix< Real > *M)
 
template<typename Real >
static void CholeskyUnitTestTr ()
 
template<typename Real >
static void SlowMatMul ()
 
template<typename Real >
static void UnitTestAddToDiagMatrix ()
 
template<typename Real >
static void UnitTestAddDiagVecMat ()
 
template<typename Real >
static void UnitTestAddMatDiagVec ()
 
template<typename Real >
static void UnitTestAddMatMatElements ()
 
template<typename Real >
static void UnitTestAddSp ()
 
template<typename Real , typename OtherReal >
static void UnitTestSpAddDiagVec ()
 
template<typename Real >
static void UnitTestSpAddVecVec ()
 
template<typename Real >
static void UnitTestCopyRowsAndCols ()
 
template<typename Real >
static void UnitTestSpliceRows ()
 
template<typename Real >
static void UnitTestRemoveRow ()
 
template<typename Real >
static void UnitTestSubvector ()
 
static int32 DoubleFactorial (int32 i)
 
template<typename Real >
static void UnitTestSetRandn ()
 
template<typename Real >
static void UnitTestSetRandUniform ()
 
template<typename Real >
static void UnitTestSimpleForVec ()
 
template<typename Real >
static void UnitTestVectorMax ()
 
template<typename Real >
static void UnitTestVectorMin ()
 
template<typename Real >
static void UnitTestReplaceValue ()
 
template<typename Real >
static void UnitTestNorm ()
 
template<typename Real >
static void UnitTestCopyRows ()
 
template<typename Real >
static void UnitTestCopyToRows ()
 
template<typename Real >
static void UnitTestAddRows ()
 
template<typename Real >
static void UnitTestAddToRows ()
 
template<typename Real >
static void UnitTestCopyCols ()
 
template<typename Real >
static void UnitTestSimpleForMat ()
 
template<typename Real >
static void UnitTestRow ()
 
template<typename Real >
static void UnitTestAxpy ()
 
template<typename Real >
static void UnitTestCopySp ()
 
template<typename Real >
static void UnitTestPower ()
 
template<typename Real >
static void UnitTestPowerAbs ()
 
template<typename Real >
static void UnitTestHeaviside ()
 
template<typename Real >
static void UnitTestAddOuterProductPlusMinus ()
 
template<typename Real >
static void UnitTestSger ()
 
template<typename Real >
static void UnitTestDeterminant ()
 
template<typename Real >
static void UnitTestDeterminantSign ()
 
template<typename Real >
static void UnitTestSpVec ()
 
template<typename Real >
static void UnitTestTraceProduct ()
 
template<typename Real >
static void UnitTestSvd ()
 
template<typename Real >
static void UnitTestSvdBad ()
 
template<typename Real >
static void UnitTestSvdZero ()
 
template<typename Real >
static void UnitTestSvdNodestroy ()
 
template<typename Real >
static void UnitTestSvdJustvec ()
 
template<typename Real >
static void UnitTestEigSymmetric ()
 
template<typename Real >
static void UnitTestEig ()
 
template<typename Real >
static void UnitTestEigSp ()
 
template<typename Real >
static Real NonOrthogonality (const MatrixBase< Real > &M, MatrixTransposeType transM)
 
template<typename Real >
static Real NonDiagonalness (const SpMatrix< Real > &S)
 
template<typename Real >
static Real NonUnitness (const SpMatrix< Real > &S)
 
template<typename Real >
static void UnitTestTridiagonalize ()
 
template<typename Real >
static void UnitTestTridiagonalizeAndQr ()
 
template<typename Real >
static void UnitTestMmul ()
 
template<typename Real >
static void UnitTestMmulSym ()
 
template<typename Real >
static void UnitTestAddVecVec ()
 
template<typename Real >
static void UnitTestVecmul ()
 
template<typename Real >
static void UnitTestInverse ()
 
template<typename Real >
static void UnitTestMulElements ()
 
template<typename Real >
static void UnitTestDotprod ()
 
template<class Real >
void PlaceNansInGaps (Matrix< Real > *mat)
 
template<typename Real >
static void UnitTestResizeCopyDataDifferentStrideType ()
 Make sure that when Resize() is called with resize_type = kCopyData and a stride_type different from this's stride_type, the resized matrix is equivalent to the original matrix (modulo the stride). More...
 
template<typename Real >
static void UnitTestResize ()
 
template<typename Real >
static void UnitTestTp2Sp ()
 
template<typename Real >
static void UnitTestTp2 ()
 
template<typename Real >
static void UnitTestAddDiagMat2 ()
 
template<typename Real >
static void UnitTestAddDiagMatMat ()
 
template<typename Real >
static void UnitTestOrthogonalizeRows ()
 
template<typename Real >
static void UnitTestTransposeScatter ()
 
template<typename Real >
static void UnitTestRankNUpdate ()
 
template<typename Real >
static void UnitTestSpInvert ()
 
template<typename Real >
static void UnitTestTpInvert ()
 
template<typename Real >
static void UnitTestLimitCondInvert ()
 
template<typename Real >
static void UnitTestFloorChol ()
 
template<typename Real >
static void UnitTestFloorUnit ()
 
template<typename Real >
static void UnitTestFloorCeiling ()
 
template<typename Real >
static void UnitTestMat2Vec ()
 
template<typename Real >
static void UnitTestLimitCond ()
 
template<typename Real >
static void UnitTestTanh ()
 
template<typename Real >
static void UnitTestSigmoid ()
 
template<typename Real >
static void UnitTestSoftHinge ()
 
template<typename Real >
static void UnitTestSimple ()
 
template<typename Real >
static void UnitTestIo ()
 
template<typename Real >
static void UnitTestIoCross ()
 
template<typename Real >
static void UnitTestHtkIo ()
 
template<typename Real >
static void UnitTestRange ()
 
template<typename Real >
static void UnitTestScale ()
 
template<typename Real >
static void UnitTestMul ()
 
template<typename Real >
static void UnitTestApplyExpSpecial ()
 
template<typename Real >
static void UnitTestInnerProd ()
 
template<typename Real >
static void UnitTestAddToDiag ()
 
template<typename Real >
static void UnitTestScaleDiag ()
 
template<typename Real >
static void UnitTestSetDiag ()
 
template<typename Real >
static void UnitTestTraceSpSpLower ()
 
template<typename Real >
static void UnitTestAddMatSmat ()
 
template<typename Real >
static void UnitTestAddMat2Sp ()
 
template<typename Real >
static void UnitTestAddMatSelf ()
 
template<typename Real >
static void UnitTestAddMat2 ()
 
template<typename Real >
static void UnitTestSymAddMat2 ()
 
template<typename Real >
static void UnitTestSolve ()
 
template<typename Real >
static void UnitTestMax2 ()
 
template<typename Real >
static void UnitTestMaxAbsEig ()
 
template<typename Real >
static void UnitTestLbfgs ()
 
template<typename Real >
static void UnitTestLinearCgd ()
 
template<typename Real >
static void UnitTestMaxMin ()
 
template<typename Real >
static bool approx_equal (Real a, Real b)
 
template<typename Real >
static void UnitTestTrace ()
 
template<typename Real >
static void UnitTestComplexFt ()
 
template<typename Real >
static void UnitTestDct ()
 
template<typename Real >
static void UnitTestComplexFft ()
 
template<typename Real >
static void UnitTestSplitRadixComplexFft ()
 
template<typename Real >
static void UnitTestTranspose ()
 
template<typename Real >
static void UnitTestAddVecToRows ()
 
template<typename Real >
static void UnitTestAddVec2Sp ()
 
template<typename Real >
static void UnitTestAddVecToCols ()
 
template<typename Real >
static void UnitTestComplexFft2 ()
 
template<typename Real >
static void UnitTestSplitRadixComplexFft2 ()
 
template<typename Real >
static void UnitTestRealFft ()
 
template<typename Real >
static void UnitTestSplitRadixRealFft ()
 
template<typename Real >
static void UnitTestRealFftSpeed ()
 
template<typename Real >
static void UnitTestSplitRadixRealFftSpeed ()
 
template<typename Real >
void UnitTestComplexPower ()
 
template<typename Real >
void UnitTestNonsymmetricPower ()
 
void UnitTestAddVecCross ()
 
template<typename Real >
static void UnitTestPca (bool full_test)
 
template<typename Real >
static void UnitTestPca2 (bool full_test)
 
template<typename Real >
static void UnitTestSvdSpeed ()
 
template<typename Real >
static void UnitTestCompressedMatrix2 ()
 
template<typename Real >
static void UnitTestCompressedMatrix ()
 
template<typename Real >
static void UnitTestGeneralMatrix ()
 
template<typename Real >
static void UnitTestExtractCompressedMatrix ()
 
template<typename Real >
static void UnitTestTridiag ()
 
template<typename Real >
static void UnitTestRandCategorical ()
 
template<class Real >
static void UnitTestAddMatMatNans ()
 
template<class Real >
static void UnitTestTopEigs ()
 
template<typename Real >
static void UnitTestTriVecSolver ()
 
template<typename Real >
static void MatrixUnitTest (bool full_test)
 
template<class Real >
int32 LinearCgd (const LinearCgdOptions &opts, const SpMatrix< Real > &A, const VectorBase< Real > &b, VectorBase< Real > *x)
 
template int32 LinearCgd< float > (const LinearCgdOptions &opts, const SpMatrix< float > &A, const VectorBase< float > &b, VectorBase< float > *x)
 
template int32 LinearCgd< double > (const LinearCgdOptions &opts, const SpMatrix< double > &A, const VectorBase< double > &b, VectorBase< double > *x)
 
template<typename Real >
std::ostream & operator<< (std::ostream &out, const PackedMatrix< Real > &M)
 
template<typename Real >
std::istream & operator>> (std::istream &is, PackedMatrix< Real > &M)
 
template<typename Real >
void HouseBackward (MatrixIndexT dim, const Real *x, Real *v, Real *beta)
 
template<typename Real >
void Givens (Real a, Real b, Real *c, Real *s)
 Create Givens rotations, as in Golub and Van Loan 3rd ed., page 216. More...
 
template<typename Real >
void QrStep (MatrixIndexT n, Real *diag, Real *off_diag, MatrixBase< Real > *Q)
 
template<typename Real >
void QrInternal (MatrixIndexT n, Real *diag, Real *off_diag, MatrixBase< Real > *Q)
 
template<>
double SolveQuadraticProblem (const SpMatrix< double > &H, const VectorBase< double > &g, const SolverOptions &opts, VectorBase< double > *x)
 
template<>
float SolveQuadraticProblem (const SpMatrix< float > &H, const VectorBase< float > &g, const SolverOptions &opts, VectorBase< float > *x)
 
double TraceSpSp (const SpMatrix< double > &A, const SpMatrix< double > &B)
 
float TraceSpSp (const SpMatrix< float > &A, const SpMatrix< float > &B)
 Returns tr(A B). More...
 
template<typename Real , typename OtherReal >
Real TraceSpSp (const SpMatrix< Real > &A, const SpMatrix< OtherReal > &B)
 Returns tr(A B). More...
 
template float TraceSpSp< float, double > (const SpMatrix< float > &A, const SpMatrix< double > &B)
 
template double TraceSpSp< double, float > (const SpMatrix< double > &A, const SpMatrix< float > &B)
 
template<typename Real >
Real TraceSpMat (const SpMatrix< Real > &A, const MatrixBase< Real > &B)
 Returns tr(A B). More...
 
template float TraceSpMat (const SpMatrix< float > &A, const MatrixBase< float > &B)
 
template double TraceSpMat (const SpMatrix< double > &A, const MatrixBase< double > &B)
 
template<typename Real >
Real TraceMatSpMat (const MatrixBase< Real > &A, MatrixTransposeType transA, const SpMatrix< Real > &B, const MatrixBase< Real > &C, MatrixTransposeType transC)
 Returns tr(A B C) (A and C may be transposed as specified by transA and transC). More...
 
template float TraceMatSpMat (const MatrixBase< float > &A, MatrixTransposeType transA, const SpMatrix< float > &B, const MatrixBase< float > &C, MatrixTransposeType transC)
 
template double TraceMatSpMat (const MatrixBase< double > &A, MatrixTransposeType transA, const SpMatrix< double > &B, const MatrixBase< double > &C, MatrixTransposeType transC)
 
template<typename Real >
Real TraceMatSpMatSp (const MatrixBase< Real > &A, MatrixTransposeType transA, const SpMatrix< Real > &B, const MatrixBase< Real > &C, MatrixTransposeType transC, const SpMatrix< Real > &D)
 Returns tr (A B C D) (A and C may be transposed as specified by transA and transB). More...
 
template float TraceMatSpMatSp (const MatrixBase< float > &A, MatrixTransposeType transA, const SpMatrix< float > &B, const MatrixBase< float > &C, MatrixTransposeType transC, const SpMatrix< float > &D)
 
template double TraceMatSpMatSp (const MatrixBase< double > &A, MatrixTransposeType transA, const SpMatrix< double > &B, const MatrixBase< double > &C, MatrixTransposeType transC, const SpMatrix< double > &D)
 
template<typename Real >
Real SolveQuadraticMatrixProblem (const SpMatrix< Real > &Q, const MatrixBase< Real > &Y, const SpMatrix< Real > &P, const SolverOptions &opts, MatrixBase< Real > *M)
 Maximizes the auxiliary function :

\[ Q(x) = tr(M^T P Y) - 0.5 tr(P M Q M^T) \]

Like a numerically stable version of $ M := Y Q^{-1} $. More...

 
template<typename Real >
Real SolveDoubleQuadraticMatrixProblem (const MatrixBase< Real > &G, const SpMatrix< Real > &P1, const SpMatrix< Real > &P2, const SpMatrix< Real > &Q1, const SpMatrix< Real > &Q2, const SolverOptions &opts, MatrixBase< Real > *M)
 Maximizes the auxiliary function :

\[ Q(M) = tr(M^T G) -0.5 tr(P_1 M Q_1 M^T) -0.5 tr(P_2 M Q_2 M^T). \]

Encountered in matrix update with a prior. More...

 
template<typename Real >
Real VecSpVec (const VectorBase< Real > &v1, const SpMatrix< Real > &M, const VectorBase< Real > &v2)
 Computes v1^T * M * v2. More...
 
template float VecSpVec (const VectorBase< float > &v1, const SpMatrix< float > &M, const VectorBase< float > &v2)
 
template double VecSpVec (const VectorBase< double > &v1, const SpMatrix< double > &M, const VectorBase< double > &v2)
 
template<typename Real >
Real TraceSpSpLower (const SpMatrix< Real > &A, const SpMatrix< Real > &B)
 
template double TraceSpSpLower (const SpMatrix< double > &A, const SpMatrix< double > &B)
 
template float TraceSpSpLower (const SpMatrix< float > &A, const SpMatrix< float > &B)
 
template float SolveQuadraticMatrixProblem (const SpMatrix< float > &Q, const MatrixBase< float > &Y, const SpMatrix< float > &SigmaInv, const SolverOptions &opts, MatrixBase< float > *M)
 
template double SolveQuadraticMatrixProblem (const SpMatrix< double > &Q, const MatrixBase< double > &Y, const SpMatrix< double > &SigmaInv, const SolverOptions &opts, MatrixBase< double > *M)
 
template float SolveDoubleQuadraticMatrixProblem (const MatrixBase< float > &G, const SpMatrix< float > &P1, const SpMatrix< float > &P2, const SpMatrix< float > &Q1, const SpMatrix< float > &Q2, const SolverOptions &opts, MatrixBase< float > *M)
 
template double SolveDoubleQuadraticMatrixProblem (const MatrixBase< double > &G, const SpMatrix< double > &P1, const SpMatrix< double > &P2, const SpMatrix< double > &Q1, const SpMatrix< double > &Q2, const SolverOptions &opts, MatrixBase< double > *M)
 
template<typename Real >
bool ApproxEqual (const SpMatrix< Real > &A, const SpMatrix< Real > &B, Real tol=0.01)
 
template<typename Real >
void AssertEqual (const SpMatrix< Real > &A, const SpMatrix< Real > &B, Real tol=0.01)
 
template<typename Real >
Real SolveQuadraticProblem (const SpMatrix< Real > &H, const VectorBase< Real > &g, const SolverOptions &opts, VectorBase< Real > *x)
 Maximizes the auxiliary function

\[ Q(x) = x.g - 0.5 x^T H x \]

using a numerically stable method. More...

 
template<typename Real >
void UnitTestSparseVectorSum ()
 
template<typename Real >
void UnitTestSparseVectorAddToVec ()
 
template<typename Real >
void UnitTestSparseVectorMax ()
 
template<typename Real >
void UnitTestSparseVectorVecSvec ()
 
template<typename Real >
void UnitTestSparseMatrixSum ()
 
template<typename Real >
void UnitTestSparseMatrixFrobeniusNorm ()
 
template<typename Real >
void UnitTestSparseMatrixAddToMat ()
 
template<typename Real >
void UnitTestSparseMatrixConstructor ()
 
template<typename Real >
void UnitTestSparseMatrixTraceMatSmat ()
 
template<typename Real >
void UnitTestMatrixAddMatSmat ()
 
template<typename Real >
void UnitTestMatrixAddSmatMat ()
 
template<typename Real >
void SparseMatrixUnitTest ()
 
template<typename Real >
Real VecSvec (const VectorBase< Real > &vec, const SparseVector< Real > &svec)
 
template float VecSvec (const VectorBase< float > &vec, const SparseVector< float > &svec)
 
template double VecSvec (const VectorBase< double > &vec, const SparseVector< double > &svec)
 
template<typename Real >
Real TraceMatSmat (const MatrixBase< Real > &A, const SparseMatrix< Real > &B, MatrixTransposeType trans)
 
template float TraceMatSmat (const MatrixBase< float > &A, const SparseMatrix< float > &B, MatrixTransposeType trans)
 
template double TraceMatSmat (const MatrixBase< double > &A, const SparseMatrix< double > &B, MatrixTransposeType trans)
 
void AppendGeneralMatrixRows (const std::vector< const GeneralMatrix * > &src, GeneralMatrix *mat)
 Appends all the matrix rows of a list of GeneralMatrixes, to get a single GeneralMatrix. More...
 
void FilterCompressedMatrixRows (const CompressedMatrix &in, const std::vector< bool > &keep_rows, Matrix< BaseFloat > *out)
 Outputs a Matrix<Real> containing only the rows r of "in" such that keep_rows[r] == true. More...
 
template<typename Real >
void FilterMatrixRows (const Matrix< Real > &in, const std::vector< bool > &keep_rows, Matrix< Real > *out)
 Outputs a Matrix<Real> containing only the rows r of "in" such that keep_keep_rows[r] == true. More...
 
template void FilterMatrixRows (const Matrix< float > &in, const std::vector< bool > &keep_rows, Matrix< float > *out)
 
template void FilterMatrixRows (const Matrix< double > &in, const std::vector< bool > &keep_rows, Matrix< double > *out)
 
template<typename Real >
void FilterSparseMatrixRows (const SparseMatrix< Real > &in, const std::vector< bool > &keep_rows, SparseMatrix< Real > *out)
 Outputs a SparseMatrix<Real> containing only the rows r of "in" such that keep_rows[r] == true. More...
 
template void FilterSparseMatrixRows (const SparseMatrix< float > &in, const std::vector< bool > &keep_rows, SparseMatrix< float > *out)
 
template void FilterSparseMatrixRows (const SparseMatrix< double > &in, const std::vector< bool > &keep_rows, SparseMatrix< double > *out)
 
void FilterGeneralMatrixRows (const GeneralMatrix &in, const std::vector< bool > &keep_rows, GeneralMatrix *out)
 Outputs a GeneralMatrix containing only the rows r of "in" such that keep_rows[r] == true. More...
 
void ExtractRowRangeWithPadding (const GeneralMatrix &in, int32 row_offset, int32 num_rows, GeneralMatrix *out)
 This function extracts a row-range of a GeneralMatrix and writes as a GeneralMatrix containing the same type of underlying matrix. More...
 
template<class CharT , class Traits >
void swap (basic_filebuf< CharT, Traits > &x, basic_filebuf< CharT, Traits > &y)
 
template<class Int >
void TestSetOfNumbers (bool binary)
 
template<class T >
int32 LevenshteinEditDistance (const std::vector< T > &a, const std::vector< T > &b)
 
template<class T >
int32 LevenshteinEditDistance (const std::vector< T > &ref, const std::vector< T > &hyp, int32 *ins, int32 *del, int32 *sub)
 
template<class T >
int32 LevenshteinAlignment (const std::vector< T > &a, const std::vector< T > &b, T eps_symbol, std::vector< std::pair< T, T > > *output)
 
void TestEditDistance ()
 
void TestEditDistanceString ()
 
void TestEditDistance2 ()
 
void TestEditDistance2String ()
 
void TestLevenshteinAlignment ()
 
template<class Int , class T >
void TestHashList ()
 
static bool prefixp (const std::string &pfx, const std::string &str)
 
static std::string cygprefix ("/cygdrive/")
 
static std::string MapCygwinPathNoTmp (const std::string &filename)
 
std::string MapCygwinPath (const std::string &filename)
 
static FILE * CygwinCompatPopen (const char *command, const char *mode)
 
bool ParseMatrixRangeSpecifier (const std::string &range, const int rows, const int cols, std::vector< int32 > *row_range, std::vector< int32 > *col_range)
 
bool ExtractObjectRange (const GeneralMatrix &input, const std::string &range, GeneralMatrix *output)
 GeneralMatrix is always of type BaseFloat. More...
 
template<class Real >
bool ExtractObjectRange (const CompressedMatrix &input, const std::string &range, Matrix< Real > *output)
 CompressedMatrix is always of the type BaseFloat but it is more efficient to provide template as it uses CompressedMatrix's own conversion to Matrix<Real> More...
 
template bool ExtractObjectRange (const CompressedMatrix &, const std::string &, Matrix< float > *)
 
template bool ExtractObjectRange (const CompressedMatrix &, const std::string &, Matrix< double > *)
 
template<class Real >
bool ExtractObjectRange (const Matrix< Real > &input, const std::string &range, Matrix< Real > *output)
 The template is specialized with a version that actually does something, for types Matrix<float> and Matrix<double>. More...
 
template bool ExtractObjectRange (const Matrix< double > &, const std::string &, Matrix< double > *)
 
template bool ExtractObjectRange (const Matrix< float > &, const std::string &, Matrix< float > *)
 
template<class Real >
bool ExtractObjectRange (const Vector< Real > &input, const std::string &range, Vector< Real > *output)
 The template is specialized types Vector<float> and Vector<double>. More...
 
template bool ExtractObjectRange (const Vector< double > &, const std::string &, Vector< double > *)
 
template bool ExtractObjectRange (const Vector< float > &, const std::string &, Vector< float > *)
 
bool ExtractRangeSpecifier (const std::string &rxfilename_with_range, std::string *data_rxfilename, std::string *range)
 
template<class T >
bool ExtractObjectRange (const T &input, const std::string &range, T *output)
 This templated function exists so that we can write .scp files with 'object ranges' specified: the canonical example is a [first:last] range of rows of a matrix, or [first-row:last-row,first-column,last-column] of a matrix. More...
 
void UnitTestClassifyRxfilename ()
 
void UnitTestClassifyWxfilename ()
 
void UnitTestIoNew (bool binary)
 
void UnitTestIoPipe (bool binary)
 
void UnitTestIoStandard ()
 
void UnitTestNativeFilename ()
 
std::string PrintableRxfilename (const std::string &rxfilename)
 PrintableRxfilename turns the rxfilename into a more human-readable form for error reporting, i.e. More...
 
std::string PrintableWxfilename (const std::string &wxfilename)
 PrintableWxfilename turns the wxfilename into a more human-readable form for error reporting, i.e. More...
 
OutputType ClassifyWxfilename (const std::string &wxfilename)
 ClassifyWxfilename interprets filenames as follows: More...
 
InputType ClassifyRxfilename (const std::string &rxfilename)
 ClassifyRxfilenames interprets filenames for reading as follows: More...
 
template<>
void ReadKaldiObject (const std::string &filename, Matrix< float > *m)
 
template<>
void ReadKaldiObject (const std::string &filename, Matrix< double > *m)
 
template<class C >
void ReadKaldiObject (const std::string &filename, C *c)
 
template<class C >
void WriteKaldiObject (const C &c, const std::string &filename, bool binary)
 
void UnitTestReadScriptFile ()
 
void UnitTestClassifyWspecifier ()
 
void UnitTestClassifyRspecifier ()
 
void UnitTestTableSequentialInt32 (bool binary)
 
void UnitTestTableSequentialBool (bool binary)
 
void UnitTestTableSequentialDouble (bool binary)
 
void UnitTestTableSequentialDoubleBoth (bool binary, bool read_scp)
 
void UnitTestTableSequentialInt32VectorBoth (bool binary, bool read_scp)
 
void UnitTestTableSequentialInt32PairVectorBoth (bool binary, bool read_scp)
 
void UnitTestTableSequentialInt32VectorVectorBoth (bool binary, bool read_scp)
 
void UnitTestTableSequentialInt32Script (bool binary)
 
void UnitTestTableSequentialDoubleMatrixBoth (bool binary, bool read_scp)
 
void UnitTestTableSequentialBaseFloatVectorBoth (bool binary, bool read_scp)
 
template<class T >
void RandomizeVector (std::vector< T > *v)
 
void UnitTestTableRandomBothDouble (bool binary, bool read_scp, bool sorted, bool called_sorted, bool once)
 
void UnitTestRangesMatrix (bool binary)
 
void UnitTestTableRandomBothDoubleMatrix (bool binary, bool read_scp, bool sorted, bool called_sorted, bool once)
 
bool ReadScriptFile (const std::string &rxfilename, bool warn, std::vector< std::pair< std::string, std::string > > *script_out)
 
bool ReadScriptFile (std::istream &is, bool warn, std::vector< std::pair< std::string, std::string > > *script_out)
 
bool WriteScriptFile (std::ostream &os, const std::vector< std::pair< std::string, std::string > > &script)
 
bool WriteScriptFile (const std::string &wxfilename, const std::vector< std::pair< std::string, std::string > > &script)
 
WspecifierType ClassifyWspecifier (const std::string &wspecifier, std::string *archive_wxfilename, std::string *script_wxfilename, WspecifierOptions *opts)
 
RspecifierType ClassifyRspecifier (const std::string &rspecifier, std::string *rxfilename, RspecifierOptions *opts)
 
void TestThreads ()
 
void TestTaskSequencer ()
 
template<class C >
void RunMultiThreaded (const C &c_in)
 Here, class C should inherit from MultiThreadable. More...
 
void UnitTestParseOptions ()
 
static bool MustBeQuoted (const std::string &str, ShellType st)
 
static std::string QuoteAndEscape (const std::string &str, ShellType st)
 
template<class C >
void ReadConfigFromFile (const std::string &config_filename, C *c)
 This template is provided for convenience in reading config classes from files; this is not the standard way to read configuration options, but may occasionally be needed. More...
 
template<class C1 , class C2 >
void ReadConfigsFromFile (const std::string &conf, C1 *c1, C2 *c2)
 This variant of the template ReadConfigFromFile is for if you need to read two config classes from the same file. More...
 
bool WriteIntegerVectorSimple (const std::string &wxfilename, const std::vector< int32 > &v)
 WriteToList attempts to write this list of integers, one per line, to the given file, in text format. More...
 
bool ReadIntegerVectorSimple (const std::string &rxfilename, std::vector< int32 > *v)
 ReadFromList attempts to read this list of integers, one per line, from the given file, in text format. More...
 
bool WriteIntegerVectorVectorSimple (const std::string &wxfilename, const std::vector< std::vector< int32 > > &list)
 
bool ReadIntegerVectorVectorSimple (const std::string &rxfilename, std::vector< std::vector< int32 > > *list)
 
void UnitTestSimpleOptions ()
 
template<typename T >
static bool SetOptionImpl (const std::string &key, const T &value, std::map< std::string, T *> &some_map)
 
template<typename T >
static bool GetOptionImpl (const std::string &key, T *value, std::map< std::string, T *> &some_map)
 
static void TestIsSorted ()
 
static void TestIsSortedAndUniq ()
 
static void TestUniq ()
 
static void TestSortAndUniq ()
 
void TestCopySetToVector ()
 
void TestCopyMapToVector ()
 
void TestCopyMapKeysToVector ()
 
void TestCopyMapValuesToVector ()
 
void TestCopyMapKeysToSet ()
 
void TestCopyMapValuesToSet ()
 
void TestContainsNullPointers ()
 
void TestReverseVector ()
 
void TestMergePairVectorSumming ()
 
template<typename T >
void SortAndUniq (std::vector< T > *vec)
 Sorts and uniq's (removes duplicates) from a vector. More...
 
template<typename T >
bool IsSorted (const std::vector< T > &vec)
 Returns true if the vector is sorted. More...
 
template<typename T >
bool IsSortedAndUniq (const std::vector< T > &vec)
 Returns true if the vector is sorted and contains each element only once. More...
 
template<typename T >
void Uniq (std::vector< T > *vec)
 Removes duplicate elements from a sorted list. More...
 
template<class T >
void CopySetToVector (const std::set< T > &s, std::vector< T > *v)
 Copies the elements of a set to a vector. More...
 
template<class T >
void CopySetToVector (const unordered_set< T > &s, std::vector< T > *v)
 
template<class A , class B >
void CopyMapToVector (const std::map< A, B > &m, std::vector< std::pair< A, B > > *v)
 Copies the (key, value) pairs in a map to a vector of pairs. More...
 
template<class A , class B >
void CopyMapKeysToVector (const std::map< A, B > &m, std::vector< A > *v)
 Copies the keys in a map to a vector. More...
 
template<class A , class B >
void CopyMapValuesToVector (const std::map< A, B > &m, std::vector< B > *v)
 Copies the values in a map to a vector. More...
 
template<class A , class B >
void CopyMapKeysToSet (const std::map< A, B > &m, std::set< A > *s)
 Copies the keys in a map to a set. More...
 
template<class A , class B >
void CopyMapValuesToSet (const std::map< A, B > &m, std::set< B > *s)
 Copies the values in a map to a set. More...
 
template<class A >
void CopyVectorToSet (const std::vector< A > &v, std::set< A > *s)
 Copies the contents of a vector to a set. More...
 
template<class A >
void DeletePointers (std::vector< A *> *v)
 Deletes any non-NULL pointers in the vector v, and sets the corresponding entries of v to NULL. More...
 
template<class A >
bool ContainsNullPointers (const std::vector< A *> &v)
 Returns true if the vector of pointers contains NULL pointers. More...
 
template<typename A , typename B >
void CopyVectorToVector (const std::vector< A > &vec_in, std::vector< B > *vec_out)
 Copies the contents a vector of one type to a vector of another type. More...
 
template<typename T >
void ReverseVector (std::vector< T > *vec)
 Reverses the contents of a vector. More...
 
template<typename I , typename F >
void MergePairVectorSumming (std::vector< std::pair< I, F > > *vec)
 For a vector of pair<I, F> where I is an integer and F a floating-point or integer type, this function sorts a vector of type vector<pair<I, F> > on the I value and then merges elements with equal I values, summing these over the F component and then removing any F component with zero value. More...
 
char GetRandChar ()
 
char GetRandDelim ()
 
void TestSplitStringToVector ()
 
void TestSplitStringToIntegers ()
 
void TestSplitStringToFloats ()
 
void TestConvertStringToInteger ()
 
template<class Real >
void TestConvertStringToReal ()
 
template<class Real >
void TestNan ()
 
template<class Real >
void TestInf ()
 
std::string TrimTmp (std::string s)
 
void TestTrim ()
 
void TestSplitStringOnFirstSpace ()
 
void TestIsToken ()
 
void TestIsLine ()
 
void TestStringsApproxEqual ()
 
void UnitTestConfigLineParse ()
 
void UnitTestReadConfig ()
 
template<class F >
bool SplitStringToFloats (const std::string &full, const char *delim, bool omit_empty_strings, std::vector< F > *out)
 
template bool SplitStringToFloats (const std::string &full, const char *delim, bool omit_empty_strings, std::vector< float > *out)
 
template bool SplitStringToFloats (const std::string &full, const char *delim, bool omit_empty_strings, std::vector< double > *out)
 
void SplitStringToVector (const std::string &full, const char *delim, bool omit_empty_strings, std::vector< std::string > *out)
 Split a string using any of the single character delimiters. More...
 
void JoinVectorToString (const std::vector< std::string > &vec_in, const char *delim, bool omit_empty_strings, std::string *str_out)
 Joins the elements of a vector of strings into a single string using "delim" as the delimiter. More...
 
void Trim (std::string *str)
 Removes the beginning and trailing whitespaces from a string. More...
 
bool IsToken (const std::string &token)
 Returns true if "token" is nonempty, and all characters are printable and whitespace-free. More...
 
void SplitStringOnFirstSpace (const std::string &line, std::string *first, std::string *rest)
 Removes leading and trailing white space from the string, then splits on the first section of whitespace found (if present), putting the part before the whitespace in "first" and the rest in "rest". More...
 
bool IsLine (const std::string &line)
 Returns true if "line" is free of
characters and unprintable characters, and does not contain leading or trailing whitespace. More...
 
template<typename T >
bool ConvertStringToReal (const std::string &str, T *out)
 ConvertStringToReal converts a string into either float or double and returns false if there was any kind of problem (i.e. More...
 
template bool ConvertStringToReal (const std::string &str, float *out)
 
template bool ConvertStringToReal (const std::string &str, double *out)
 
bool StringsApproxEqualInternal (const char *a, const char *b, int32 decimal_places_tolerance, int32 places_into_number)
 
bool StringsApproxEqual (const std::string &a, const std::string &b, int32 decimal_places_check=2)
 This function returns true when two text strings are approximately equal, and false when they are not. More...
 
void ExpectOneOrTwoTokens (std::istream &is, bool binary, const std::string &token1, const std::string &token2)
 This function is like ExpectToken but for two tokens, and it will either accept token1 and then token2, or just token2. More...
 
bool IsValidName (const std::string &name)
 Returns true if 'name' would be a valid name for a component or node in a nnet3Nnet. More...
 
void ReadConfigLines (std::istream &is, std::vector< std::string > *lines)
 This function reads in a config file and *appends* its contents to a vector of lines; it is responsible for removing comments (anything after '#') and stripping out any lines that contain only whitespace after comment removal. More...
 
void ParseConfigLines (const std::vector< std::string > &lines, std::vector< ConfigLine > *config_lines)
 This function converts config-lines from a simple sequence of strings as output by ReadConfigLines(), into a sequence of first-tokens and name-value pairs. More...
 
template<class I >
bool SplitStringToIntegers (const std::string &full, const char *delim, bool omit_empty_strings, std::vector< I > *out)
 Split a string (e.g. More...
 
template<class Int >
bool ConvertStringToInteger (const std::string &str, Int *out)
 Converts a string into an integer via strtoll and returns false if there was any kind of problem (i.e. More...
 
void UnitTestOnlineCmvn ()
 
void ComputePowerSpectrum (VectorBase< BaseFloat > *waveform)
 
void ComputeDeltas (const DeltaFeaturesOptions &delta_opts, const MatrixBase< BaseFloat > &input_features, Matrix< BaseFloat > *output_features)
 
void ComputeShiftedDeltas (const ShiftedDeltaFeaturesOptions &delta_opts, const MatrixBase< BaseFloat > &input_features, Matrix< BaseFloat > *output_features)
 
void InitIdftBases (int32 n_bases, int32 dimension, Matrix< BaseFloat > *mat_out)
 
void SpliceFrames (const MatrixBase< BaseFloat > &input_features, int32 left_context, int32 right_context, Matrix< BaseFloat > *output_features)
 
void ReverseFrames (const MatrixBase< BaseFloat > &input_features, Matrix< BaseFloat > *output_features)
 
void SlidingWindowCmnInternal (const SlidingWindowCmnOptions &opts, const MatrixBase< double > &input, MatrixBase< double > *output)
 
void SlidingWindowCmn (const SlidingWindowCmnOptions &opts, const MatrixBase< BaseFloat > &input, MatrixBase< BaseFloat > *output)
 Applies sliding-window cepstral mean and/or variance normalization. More...
 
int64 FirstSampleOfFrame (int32 frame, const FrameExtractionOptions &opts)
 
int32 NumFrames (int64 num_samples, const FrameExtractionOptions &opts, bool flush=true)
 This function returns the number of frames that we can extract from a wave file with the given number of samples in it (assumed to have the same sampling rate as specified in 'opts'). More...
 
void Dither (VectorBase< BaseFloat > *waveform, BaseFloat dither_value)
 
void Preemphasize (VectorBase< BaseFloat > *waveform, BaseFloat preemph_coeff)
 
void ProcessWindow (const FrameExtractionOptions &opts, const FeatureWindowFunction &window_function, VectorBase< BaseFloat > *window, BaseFloat *log_energy_pre_window=NULL)
 This function does all the windowing steps after actually extracting the windowed signal: depending on the configuration, it does dithering, dc offset removal, preemphasis, and multiplication by the windowing function. More...
 
void ExtractWindow (int64 sample_offset, const VectorBase< BaseFloat > &wave, int32 f, const FrameExtractionOptions &opts, const FeatureWindowFunction &window_function, Vector< BaseFloat > *window, BaseFloat *log_energy_pre_window)
 
void ComputeLifterCoeffs (BaseFloat Q, VectorBase< BaseFloat > *coeffs)
 
BaseFloat Durbin (int n, const BaseFloat *pAC, BaseFloat *pLP, BaseFloat *pTmp)
 
void Lpc2Cepstrum (int n, const BaseFloat *pLPC, BaseFloat *pCepst)
 
void GetEqualLoudnessVector (const MelBanks &mel_banks, Vector< BaseFloat > *ans)
 
BaseFloat ComputeLpc (const VectorBase< BaseFloat > &autocorr_in, Vector< BaseFloat > *lpc_out)
 
void GetOutput (OnlineFeatureInterface *a, Matrix< BaseFloat > *output)
 
bool RandomSplit (int32 wav_dim, std::vector< int32 > *piece_dim, int32 num_pieces, int32 trials=5)
 
void TestOnlineMatrixCacheFeature ()
 
void TestOnlineDeltaFeature ()
 
void TestOnlineSpliceFrames ()
 
void TestOnlineMfcc ()
 
void TestOnlinePlp ()
 
void TestOnlineTransform ()
 
void TestOnlineAppendFeature ()
 
void TestRecyclingVector ()
 
std::string ConvertIntToString (const int &number)
 
bool DirExist (const std::string &dirname)
 
static void UnitTestSimple ()
 
static void UnitTestSnipEdges ()
 
static void UnitTestPieces ()
 
static void UnitTestDelay ()
 
static void UnitTestSearch ()
 
static void UnitTestComputeGPE ()
 
static void UnitTestKeele ()
 
static void UnitTestPenaltyFactor ()
 
static void UnitTestKeeleNccfBallast ()
 
static void UnitTestPitchExtractionSpeed ()
 
static void UnitTestPitchExtractorCompareKeele ()
 
void UnitTestDiffSampleRate ()
 
void UnitTestProcess ()
 
static void UnitTestFeatNoKeele ()
 
static void UnitTestFeatWithKeele ()
 
BaseFloat NccfToPovFeature (BaseFloat n)
 This function processes the NCCF n to a POV feature f by applying the formula f = (1.0001 - n)^0.15 - 1.0 This is a nonlinear function designed to make the output reasonably Gaussian distributed. More...
 
BaseFloat NccfToPov (BaseFloat n)
 This function processes the NCCF n to a reasonably accurate probability of voicing p by applying the formula: More...
 
void ComputeCorrelation (const VectorBase< BaseFloat > &wave, int32 first_lag, int32 last_lag, int32 nccf_window_size, VectorBase< BaseFloat > *inner_prod, VectorBase< BaseFloat > *norm_prod)
 This function computes some dot products that are required while computing the NCCF. More...
 
void ComputeNccf (const VectorBase< BaseFloat > &inner_prod, const VectorBase< BaseFloat > &norm_prod, BaseFloat nccf_ballast, VectorBase< BaseFloat > *nccf_vec)
 Computes the NCCF as a fraction of the numerator term (a dot product between two vectors) and a denominator term which equals sqrt(e1*e2 + nccf_ballast) where e1 and e2 are both dot-products of bits of the wave with themselves, and e1*e2 is supplied as "norm_prod". More...
 
void SelectLags (const PitchExtractionOptions &opts, Vector< BaseFloat > *lags)
 This function selects the lags at which we measure the NCCF: we need to select lags from 1/max_f0 to 1/min_f0, in a geometric progression with ratio 1 + d. More...
 
void ComputeLocalCost (const VectorBase< BaseFloat > &nccf_pitch, const VectorBase< BaseFloat > &lags, const PitchExtractionOptions &opts, VectorBase< BaseFloat > *local_cost)
 This function computes the local-cost for the Viterbi computation, see eq. More...
 
void ComputeKaldiPitchFirstPass (const PitchExtractionOptions &opts, const VectorBase< BaseFloat > &wave, Matrix< BaseFloat > *output)
 This function is called from ComputeKaldiPitch when the user specifies opts.simulate_first_pass_online == true. More...
 
void ComputeKaldiPitch (const PitchExtractionOptions &opts, const VectorBase< BaseFloat > &wave, Matrix< BaseFloat > *output)
 This function extracts (pitch, NCCF) per frame, using the pitch extraction method described in "A Pitch Extraction Algorithm Tuned for Automatic Speech Recognition", Pegah Ghahremani, Bagher BabaAli, Daniel Povey, Korbinian Riedhammer, Jan Trmal and Sanjeev Khudanpur, ICASSP 2014. More...
 
template<typename Real >
void AppendVector (const VectorBase< Real > &src, Vector< Real > *dst)
 
void ProcessPitch (const ProcessPitchOptions &opts, const MatrixBase< BaseFloat > &input, Matrix< BaseFloat > *output)
 This function processes the raw (NCCF, pitch) quantities computed by ComputeKaldiPitch, and processes them into features. More...
 
void ComputeAndProcessKaldiPitch (const PitchExtractionOptions &pitch_opts, const ProcessPitchOptions &process_opts, const VectorBase< BaseFloat > &wave, Matrix< BaseFloat > *output)
 This function combines ComputeKaldiPitch and ProcessPitch. More...
 
void ResampleWaveform (BaseFloat orig_freq, const VectorBase< BaseFloat > &wave, BaseFloat new_freq, Vector< BaseFloat > *new_wave)
 Downsample or upsample a waveform. More...
 
void DownsampleWaveForm (BaseFloat orig_freq, const VectorBase< BaseFloat > &wave, BaseFloat new_freq, Vector< BaseFloat > *new_wave)
 This function is deprecated. More...
 
void UnitTestFFTbasedBlockConvolution ()
 
void UnitTestFFTbasedConvolution ()
 
void ElementwiseProductOfFft (const Vector< BaseFloat > &a, Vector< BaseFloat > *b)
 
void ConvolveSignals (const Vector< BaseFloat > &filter, Vector< BaseFloat > *signal)
 
void FFTbasedConvolveSignals (const Vector< BaseFloat > &filter, Vector< BaseFloat > *signal)
 
void FFTbasedBlockConvolveSignals (const Vector< BaseFloat > &filter, Vector< BaseFloat > *signal)
 
static void WriteUint32 (std::ostream &os, int32 i)
 
static void WriteUint16 (std::ostream &os, int16 i)
 
void TestGenRandStats ()
 
void TestBuildTree ()
 
void TestTrivialTree ()
 
void TestPossibleValues ()
 
void TestConvertStats ()
 
void TestSplitStatsByKey ()
 
void TestFindAllKeys ()
 
void TestDoTableSplit ()
 
void TestClusterEventMapGetMappingAndRenumberEventMap ()
 
void TestClusterEventMapGetMappingAndRenumberEventMap2 ()
 
void TestClusterEventMap ()
 
void TestClusterEventMapRestricted ()
 
void TestShareEventMapLeaves ()
 
void TestQuestionsInitRand ()
 
void TestSplitDecisionTree ()
 
void TestBuildTreeStatsIo (bool binary)
 
void WriteBuildTreeStats (std::ostream &os, bool binary, const BuildTreeStatsType &stats)
 Writes BuildTreeStats object. This works even if pointers are NULL. More...
 
void ReadBuildTreeStats (std::istream &is, bool binary, const Clusterable &example, BuildTreeStatsType *stats)
 Reads BuildTreeStats object. More...
 
bool PossibleValues (EventKeyType key, const BuildTreeStatsType &stats, std::vector< EventValueType > *ans)
 Convenience function e.g. More...
 
static void GetEventKeys (const EventType &vec, std::vector< EventKeyType > *keys)
 
void FindAllKeys (const BuildTreeStatsType &stats, AllKeysType keys_type, std::vector< EventKeyType > *keys)
 FindAllKeys puts in *keys the (sorted, unique) list of all key identities in the stats. More...
 
EventMapDoTableSplit (const EventMap &orig, EventKeyType key, const BuildTreeStatsType &stats, int32 *num_leaves)
 DoTableSplit does a complete split on this key (e.g. More...
 
EventMapDoTableSplitMultiple (const EventMap &orig, const std::vector< EventKeyType > &keys, const BuildTreeStatsType &stats, int32 *num_leaves)
 DoTableSplitMultiple does a complete split on all the keys, in order from keys[0], keys[1] and so on. More...
 
void SplitStatsByMap (const BuildTreeStatsType &stats_in, const EventMap &e, std::vector< BuildTreeStatsType > *stats_out)
 Splits stats according to the EventMap, indexing them at output by the leaf type. More...
 
void SplitStatsByKey (const BuildTreeStatsType &stats_in, EventKeyType key, std::vector< BuildTreeStatsType > *stats_out)
 SplitStatsByKey splits stats up according to the value of a particular key, which must be always defined and nonnegative. More...
 
void FilterStatsByKey (const BuildTreeStatsType &stats_in, EventKeyType key, std::vector< EventValueType > &values, bool include_if_present, BuildTreeStatsType *stats_out)
 FilterStatsByKey filters the stats according the value of a specified key. More...
 
ClusterableSumStats (const BuildTreeStatsType &stats_in)
 Sums stats, or returns NULL stats_in has no non-NULL stats. More...
 
BaseFloat SumNormalizer (const BuildTreeStatsType &stats_in)
 Sums the normalizer [typically, data-count] over the stats. More...
 
BaseFloat SumObjf (const BuildTreeStatsType &stats_in)
 Sums the objective function over the stats. More...
 
void SumStatsVec (const std::vector< BuildTreeStatsType > &stats_in, std::vector< Clusterable * > *stats_out)
 Sum a vector of stats. More...
 
BaseFloat ObjfGivenMap (const BuildTreeStatsType &stats_in, const EventMap &e)
 Cluster the stats given the event map return the total objf given those clusters. More...
 
BaseFloat ComputeInitialSplit (const std::vector< Clusterable *> &summed_stats, const Questions &q_opts, EventKeyType key, std::vector< EventValueType > *yes_set)
 
BaseFloat FindBestSplitForKey (const BuildTreeStatsType &stats, const Questions &qcfg, EventKeyType key, std::vector< EventValueType > *yes_set)
 FindBestSplitForKey is a function used in DoDecisionTreeSplit. More...
 
EventMapSplitDecisionTree (const EventMap &orig, const BuildTreeStatsType &stats, Questions &qcfg, BaseFloat thresh, int32 max_leaves, int32 *num_leaves, BaseFloat *objf_impr_out, BaseFloat *smallest_split_change_out)
 Does a decision-tree split at the leaves of an EventMap. More...
 
int ClusterEventMapGetMapping (const EventMap &e_in, const BuildTreeStatsType &stats, BaseFloat thresh, std::vector< EventMap * > *mapping)
 "ClusterEventMapGetMapping" clusters the leaves of the EventMap, with "thresh" a delta-likelihood threshold to control how many leaves we combine (might be the same as the delta-like threshold used in splitting. More...
 
EventMapRenumberEventMap (const EventMap &e_in, int32 *num_leaves)
 RenumberEventMap [intended to be used after calling ClusterEventMap] renumbers an EventMap so its leaves are consecutive. More...
 
EventMapMapEventMapLeaves (const EventMap &e_in, const std::vector< int32 > &mapping)
 This function remaps the event-map leaves using this mapping, indexed by the number at leaf. More...
 
EventMapClusterEventMap (const EventMap &e_in, const BuildTreeStatsType &stats, BaseFloat thresh, int32 *num_removed)
 This is as ClusterEventMapGetMapping but a more convenient interface that exposes less of the internals. More...
 
EventMapShareEventMapLeaves (const EventMap &e_in, EventKeyType key, std::vector< std::vector< EventValueType > > &values, int32 *num_leaves)
 ShareEventMapLeaves performs a quite specific function that allows us to generate trees where, for a certain list of phones, and for all states in the phone, all the pdf's are shared. More...
 
void DeleteBuildTreeStats (BuildTreeStatsType *stats)
 This frees the Clusterable* pointers in "stats", where non-NULL, and sets them to NULL. More...
 
EventMapGetToLengthMap (const BuildTreeStatsType &stats, int32 P, const std::vector< EventValueType > *phones, int32 default_length)
 
static int32 ClusterEventMapRestrictedHelper (const EventMap &e_in, const BuildTreeStatsType &stats, BaseFloat thresh, std::vector< EventKeyType > keys, std::vector< EventMap *> *leaf_mapping)
 
EventMapClusterEventMapRestrictedByKeys (const EventMap &e_in, const BuildTreeStatsType &stats, BaseFloat thresh, const std::vector< EventKeyType > &keys, int32 *num_removed)
 This is as ClusterEventMap, but first splits the stats on the keys specified in "keys" (e.g. More...
 
EventMapClusterEventMapRestrictedByMap (const EventMap &e_in, const BuildTreeStatsType &stats, BaseFloat thresh, const EventMap &e_restrict, int32 *num_removed)
 This version of ClusterEventMapRestricted restricts the clustering to only allow things that "e_restrict" maps to the same value to be clustered together. More...
 
EventMapClusterEventMapToNClustersRestrictedByMap (const EventMap &e_in, const BuildTreeStatsType &stats, int32 num_clusters, const EventMap &e_restrict, int32 *num_removed)
 This version of ClusterEventMapRestrictedByMap clusters to get a specific number of clusters as specified by 'num_clusters'. More...
 
EventMapGetStubMap (int32 P, const std::vector< std::vector< int32 > > &phone_sets, const std::vector< int32 > &phone2num_pdf_classes, const std::vector< bool > &share_roots, int32 *num_leaves)
 GetStubMap is used in tree-building functions to get the initial to-states map, before the decision-tree-building process. More...
 
bool ConvertStats (int32 oldN, int32 oldP, int32 newN, int32 newP, BuildTreeStatsType *stats)
 Converts stats from a given context-window (N) and central-position (P) to a different N and P, by possibly reducing context. More...
 
EventMapTrivialTree (int32 *num_leaves)
 Returns a tree with just one node. More...
 
void CreateRandomQuestions (const BuildTreeStatsType &stats, int32 num_quest, Questions *cfg_out)
 CreateRandomQuestions will initialize a Questions randomly, in a reasonable way [for testing purposes, or when hand-designed questions are not available]. More...
 
void GenRandStats (int32 dim, int32 num_stats, int32 N, int32 P, const std::vector< int32 > &phone_ids, const std::vector< int32 > &hmm_lengths, const std::vector< bool > &is_ctx_dep, bool ensure_all_phones_covered, BuildTreeStatsType *stats_out)
 GenRandStats generates random statistics of the form used by BuildTree. More...
 
EventMapBuildTree (Questions &qopts, const std::vector< std::vector< int32 > > &phone_sets, const std::vector< int32 > &phone2num_pdf_classes, const std::vector< bool > &share_roots, const std::vector< bool > &do_split, const BuildTreeStatsType &stats, BaseFloat thresh, int32 max_leaves, BaseFloat cluster_thresh, int32 P, bool round_num_leaves=true)
 BuildTree is the normal way to build a set of decision trees. More...
 
static void ComputeTreeMapping (const EventMap &small_tree, const EventMap &big_tree, const BuildTreeStatsType &stats, std::vector< int32 > *leaf_map)
 
EventMapBuildTreeTwoLevel (Questions &qopts, const std::vector< std::vector< int32 > > &phone_sets, const std::vector< int32 > &phone2num_pdf_classes, const std::vector< bool > &share_roots, const std::vector< bool > &do_split, const BuildTreeStatsType &stats, int32 max_leaves_first, int32 max_leaves_second, bool cluster_leaves, int32 P, std::vector< int32 > *leaf_map)
 BuildTreeTwoLevel builds a two-level tree, useful for example in building tied mixture systems with multiple codebooks. More...
 
void ReadSymbolTableAsIntegers (std::string filename, bool include_eps, std::vector< int32 > *syms)
 included here because it's used in some tree-building calling code. More...
 
static void RemoveDuplicates (std::vector< std::vector< int32 > > *vecs)
 
static void ObtainSetsOfPhones (const std::vector< std::vector< int32 > > &phone_sets, const std::vector< int32 > &assignments, const std::vector< int32 > &clust_assignments, int32 num_leaves, std::vector< std::vector< int32 > > *sets_out)
 ObtainSetsOfPhones is called by AutomaticallyObtainQuestions. More...
 
void AutomaticallyObtainQuestions (BuildTreeStatsType &stats, const std::vector< std::vector< int32 > > &phone_sets_in, const std::vector< int32 > &all_pdf_classes_in, int32 P, std::vector< std::vector< int32 > > *questions_out)
 Outputs sets of phones that are reasonable for questions to ask in the tree-building algorithm. More...
 
void KMeansClusterPhones (BuildTreeStatsType &stats, const std::vector< std::vector< int32 > > &phone_sets_in, const std::vector< int32 > &all_pdf_classes_in, int32 P, int32 num_classes, std::vector< std::vector< int32 > > *sets_out)
 This function clusters the phones (or some initially specified sets of phones) into sets of phones, using a k-means algorithm. More...
 
void ReadRootsFile (std::istream &is, std::vector< std::vector< int32 > > *phone_sets, std::vector< bool > *is_shared_root, std::vector< bool > *is_split_root)
 Reads the roots file (throws on error). More...
 
static void TestClusterUtils ()
 
static void TestClusterUtilsVector ()
 
static void TestObjfPlus ()
 
static void TestObjfMinus ()
 
static void TestDistance ()
 
static void TestSumObjfAndSumNormalizer ()
 
static void TestSum ()
 
static void TestEnsureClusterableVectorNotNull ()
 
static void TestAddToClusters ()
 
static void TestAddToClustersOptimized ()
 
static void TestClusterBottomUp ()
 
static void TestRefineClusters ()
 
static void TestClusterKMeans ()
 
static void TestClusterKMeansVector ()
 
static void TestTreeCluster ()
 
static void TestClusterTopDown ()
 
BaseFloat SumClusterableObjf (const std::vector< Clusterable * > &vec)
 Returns the total objective function after adding up all the statistics in the vector (pointers may be NULL). More...
 
BaseFloat SumClusterableNormalizer (const std::vector< Clusterable * > &vec)
 Returns the total normalizer (usually count) of the cluster (pointers may be NULL). More...
 
ClusterableSumClusterable (const std::vector< Clusterable * > &vec)
 Sums stats (ptrs may be NULL). Returns NULL if no non-NULL stats present. More...
 
void EnsureClusterableVectorNotNull (std::vector< Clusterable * > *stats)
 Fills in any (NULL) holes in "stats" vector, with empty stats, because certain algorithms require non-NULL stats. More...
 
void AddToClusters (const std::vector< Clusterable * > &stats, const std::vector< int32 > &assignments, std::vector< Clusterable * > *clusters)
 Given stats and a vector "assignments" of the same size (that maps to cluster indices), sums the stats up into "clusters." It will add to any stats already present in "clusters" (although typically "clusters" will be empty when called), and it will extend with NULL pointers for any unseen indices. More...
 
void AddToClustersOptimized (const std::vector< Clusterable * > &stats, const std::vector< int32 > &assignments, const Clusterable &total, std::vector< Clusterable * > *clusters)
 AddToClustersOptimized does the same as AddToClusters (it sums up the stats within each cluster, except it uses the sum of all the stats ("total") to optimize the computation for speed, if possible. More...
 
BaseFloat ClusterBottomUp (const std::vector< Clusterable * > &points, BaseFloat thresh, int32 min_clust, std::vector< Clusterable * > *clusters_out, std::vector< int32 > *assignments_out)
 A bottom-up clustering algorithm. More...
 
bool operator> (const CompBotClustElem &a, const CompBotClustElem &b)
 
BaseFloat ClusterBottomUpCompartmentalized (const std::vector< std::vector< Clusterable * > > &points, BaseFloat thresh, int32 min_clust, std::vector< std::vector< Clusterable * > > *clusters_out, std::vector< std::vector< int32 > > *assignments_out)
 This is a bottom-up clustering where the points are pre-clustered in a set of compartments, such that only points in the same compartment are clustered together. More...
 
BaseFloat RefineClusters (const std::vector< Clusterable * > &points, std::vector< Clusterable * > *clusters, std::vector< int32 > *assignments, RefineClustersOptions cfg=RefineClustersOptions())
 RefineClusters is mainly used internally by other clustering algorithms. More...
 
BaseFloat ClusterKMeansOnce (const std::vector< Clusterable *> &points, int32 num_clust, std::vector< Clusterable *> *clusters_out, std::vector< int32 > *assignments_out, ClusterKMeansOptions &cfg)
 ClusterKMeansOnce is called internally by ClusterKMeans; it is equivalent to calling ClusterKMeans with cfg.num_tries == 1. More...
 
BaseFloat ClusterKMeans (const std::vector< Clusterable * > &points, int32 num_clust, std::vector< Clusterable * > *clusters_out, std::vector< int32 > *assignments_out, ClusterKMeansOptions cfg=ClusterKMeansOptions())
 ClusterKMeans is a K-means-like clustering algorithm. More...
 
BaseFloat TreeCluster (const std::vector< Clusterable * > &points, int32 max_clust, std::vector< Clusterable * > *clusters_out, std::vector< int32 > *assignments_out, std::vector< int32 > *clust_assignments_out, int32 *num_leaves_out, TreeClusterOptions cfg=TreeClusterOptions())
 TreeCluster is a top-down clustering algorithm, using a binary tree (not necessarily balanced). More...
 
BaseFloat ClusterTopDown (const std::vector< Clusterable * > &points, int32 max_clust, std::vector< Clusterable * > *clusters_out, std::vector< int32 > *assignments_out, TreeClusterOptions cfg=TreeClusterOptions())
 A clustering algorithm that internally uses TreeCluster, but does not give you the information about the structure of the tree. More...
 
void TestContextDep ()
 
void TestMonophoneContextDependency ()
 
void TestGenRandContextDependency ()
 
ContextDependencyGenRandContextDependency (const std::vector< int32 > &phones, bool ensure_all_covered, std::vector< int32 > *num_pdf_classes)
 GenRandContextDependency is mainly of use for debugging. More...
 
ContextDependencyGenRandContextDependencyLarge (const std::vector< int32 > &phones, int N, int P, bool ensure_all_covered, std::vector< int32 > *num_pdf_classes)
 GenRandContextDependencyLarge is like GenRandContextDependency but generates a larger tree with specified N and P for use in "one-time" larger-scale tests. More...
 
ContextDependencyMonophoneContextDependency (const std::vector< int32 > &phones, const std::vector< int32 > &phone2num_pdf_classes)
 
ContextDependencyMonophoneContextDependencyShared (const std::vector< std::vector< int32 > > &phone_sets, const std::vector< int32 > &phone2num_pdf_classes)
 
void TestEventMap ()
 
void TestEventTypeIo (bool binary)
 
EventMapRandomEventMap (const std::vector< EventKeyType > &keys)
 
void TestEventMapIo (bool binary)
 
void TestEventMapPrune ()
 
void TestEventMapMapValues ()
 
void WriteEventType (std::ostream &os, bool binary, const EventType &evec)
 
void ReadEventType (std::istream &is, bool binary, EventType *evec)
 
std::string EventTypeToString (const EventType &evec)
 
static bool IsLeafNode (const EventMap *e)
 
static bool GetTreeStructureInternal (const EventMap &map, std::vector< const EventMap *> *nonleaf_nodes, std::map< const EventMap *, const EventMap *> *nonleaf_parents, std::vector< const EventMap *> *leaf_parents)
 
bool GetTreeStructure (const EventMap &map, int32 *num_leaves, std::vector< int32 > *parents)
 This function gets the tree structure of the EventMap "map" in a convenient form. More...
 
std::pair< EventKeyType, EventValueTypeMakeEventPair (EventKeyType k, EventValueType v)
 
void ClusterGaussiansToUbm (const AmDiagGmm &am, const Vector< BaseFloat > &state_occs, UbmClusteringOptions opts, DiagGmm *ubm_out)
 Clusters the Gaussians in an acoustic model to a single GMM with specified number of components. More...
 
void InitRandomGmm (DiagGmm *gmm_in)
 
void UnitTestDiagGmmGenerate ()
 
void UnitTestDiagGmm ()
 
std::ostream & operator<< (std::ostream &os, const kaldi::DiagGmm &gmm)
 ostream operator that calls DiagGMM::Write() More...
 
std::istream & operator>> (std::istream &is, kaldi::DiagGmm &gmm)
 istream operator that calls DiagGMM::Read() More...
 
void UnitTestEstimateMmieDiagGmm ()
 
static bool EBWUpdateGaussian (BaseFloat D, GmmFlagsType flags, const VectorBase< double > &orig_mean, const VectorBase< double > &orig_var, const VectorBase< double > &x_stats, const VectorBase< double > &x2_stats, double occ, VectorBase< double > *mean, VectorBase< double > *var, double *auxf_impr)
 
void UpdateEbwDiagGmm (const AccumDiagGmm &num_stats, const AccumDiagGmm &den_stats, GmmFlagsType flags, const EbwOptions &opts, DiagGmm *gmm, BaseFloat *auxf_change_out, BaseFloat *count_out, int32 *num_floored_out)
 
void UpdateEbwWeightsDiagGmm (const AccumDiagGmm &num_stats, const AccumDiagGmm &den_stats, const EbwWeightOptions &opts, DiagGmm *gmm, BaseFloat *auxf_change_out, BaseFloat *count_out)
 
void UpdateEbwAmDiagGmm (const AccumAmDiagGmm &num_stats, const AccumAmDiagGmm &den_stats, GmmFlagsType flags, const EbwOptions &opts, AmDiagGmm *am_gmm, BaseFloat *auxf_change_out, BaseFloat *count_out, int32 *num_floored_out)
 
void UpdateEbwWeightsAmDiagGmm (const AccumAmDiagGmm &num_stats, const AccumAmDiagGmm &den_stats, const EbwWeightOptions &opts, AmDiagGmm *am_gmm, BaseFloat *auxf_change_out, BaseFloat *count_out)
 
void IsmoothStatsDiagGmm (const AccumDiagGmm &src_stats, double tau, AccumDiagGmm *dst_stats)
 I-Smooth the stats. src_stats and dst_stats do not have to be different. More...
 
void DiagGmmToStats (const DiagGmm &gmm, GmmFlagsType flags, double state_occ, AccumDiagGmm *dst_stats)
 Creates stats from the GMM. Resizes them as needed. More...
 
void IsmoothStatsAmDiagGmm (const AccumAmDiagGmm &src_stats, double tau, AccumAmDiagGmm *dst_stats)
 Smooth "dst_stats" with "src_stats". More...
 
void IsmoothStatsAmDiagGmmFromModel (const AmDiagGmm &src_model, double tau, AccumAmDiagGmm *dst_stats)
 This version of the I-smoothing function takes a model as input. More...
 
std::ostream & operator<< (std::ostream &rOut, const kaldi::FullGmm &gmm)
 ostream operator that calls FullGmm::Write() More...
 
std::istream & operator>> (std::istream &rIn, kaldi::FullGmm &gmm)
 istream operator that calls FullGmm::Read() More...
 
void GetSingleStatsDerivative (double ml_count, double ml_x_stats, double ml_x2_stats, double disc_count, double disc_x_stats, double disc_x2_stats, double model_mean, double model_var, BaseFloat min_variance, double *ml_x_stats_deriv, double *ml_x2_stats_deriv)
 
void GetStatsDerivative (const DiagGmm &gmm, const AccumDiagGmm &num_acc, const AccumDiagGmm &den_acc, const AccumDiagGmm &ml_acc, BaseFloat min_variance, BaseFloat min_gaussian_occupancy, AccumDiagGmm *out_accs)
 
void GetStatsDerivative (const AmDiagGmm &gmm, const AccumAmDiagGmm &num_accs, const AccumAmDiagGmm &den_accs, const AccumAmDiagGmm &ml_accs, BaseFloat min_variance, BaseFloat min_gaussian_occupancy, AccumAmDiagGmm *out_accs)
 
void DoRescalingUpdate (const AccumDiagGmm &old_ml_acc, const AccumDiagGmm &new_ml_acc, BaseFloat min_variance, BaseFloat min_gaussian_occupancy, DiagGmm *gmm, double *tot_count, double *tot_divergence)
 
void DoRescalingUpdate (const AccumAmDiagGmm &old_ml_accs, const AccumAmDiagGmm &new_ml_accs, BaseFloat min_variance, BaseFloat min_gaussian_occupancy, AmDiagGmm *am_gmm)
 
void ResizeModel (int32 dim, AmDiagGmm *am_gmm)
 
void MleAmDiagGmmUpdate (const MleDiagGmmOptions &config, const AccumAmDiagGmm &amdiaggmm_acc, GmmFlagsType flags, AmDiagGmm *am_gmm, BaseFloat *obj_change_out, BaseFloat *count_out)
 for computing the maximum-likelihood estimates of the parameters of an acoustic model that uses diagonal Gaussian mixture models as emission densities. More...
 
void MapAmDiagGmmUpdate (const MapDiagGmmOptions &config, const AccumAmDiagGmm &diag_gmm_acc, GmmFlagsType flags, AmDiagGmm *gmm, BaseFloat *obj_change_out, BaseFloat *count_out)
 Maximum A Posteriori update. More...
 
BaseFloat MlObjective (const DiagGmm &gmm, const AccumDiagGmm &diaggmm_acc)
 Calc using the DiagGMM exponential form. More...
 
void MleDiagGmmUpdate (const MleDiagGmmOptions &config, const AccumDiagGmm &diag_gmm_acc, GmmFlagsType flags, DiagGmm *gmm, BaseFloat *obj_change_out, BaseFloat *count_out, int32 *floored_elements_out=NULL, int32 *floored_gauss_out=NULL, int32 *removed_gauss_out=NULL)
 for computing the maximum-likelihood estimates of the parameters of a Gaussian mixture model. More...
 
void MapDiagGmmUpdate (const MapDiagGmmOptions &config, const AccumDiagGmm &diag_gmm_acc, GmmFlagsType flags, DiagGmm *gmm, BaseFloat *obj_change_out, BaseFloat *count_out)
 Maximum A Posteriori estimation of the model. More...
 
GmmFlagsType AugmentGmmFlags (GmmFlagsType f)
 Returns "augmented" version of flags: e.g. More...
 
BaseFloat MlObjective (const FullGmm &gmm, const AccumFullGmm &fullgmm_acc)
 Calc using the DiagGMM exponential form. More...
 
void MleFullGmmUpdate (const MleFullGmmOptions &config, const AccumFullGmm &fullgmm_acc, GmmFlagsType flags, FullGmm *gmm, BaseFloat *obj_change_out, BaseFloat *count_out)
 for computing the maximum-likelihood estimates of the parameters of a Gaussian mixture model. More...
 
GmmFlagsType StringToGmmFlags (std::string str)
 Convert string which is some subset of "mSwa" to flags. More...
 
std::string GmmFlagsToString (GmmFlagsType gmm_flags)
 Convert GMM flags to string. More...
 
SgmmUpdateFlagsType StringToSgmmUpdateFlags (std::string str)
 
SgmmUpdateFlagsType StringToSgmmWriteFlags (std::string str)
 
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.g. More...
 
static BaseFloat CalBasisFmllrStepSize (const AffineXformStats &spk_stats, const Matrix< BaseFloat > &spk_stats_tmp_K, const std::vector< SpMatrix< BaseFloat > > &spk_stats_tmp_G, const Matrix< BaseFloat > &delta, const Matrix< BaseFloat > &A, const Matrix< BaseFloat > &S, int32 max_iters)
 This function takes the step direction (delta) of fMLLR matrix as argument, and optimize step size using Newton's method. More...
 
void InitCmvnStats (int32 dim, Matrix< double > *stats)
 This function initializes the matrix to dimension 2 by (dim+1); 1st "dim" elements of 1st row are mean stats, 1st "dim" elements of 2nd row are var stats, last element of 1st row is count, last element of 2nd row is zero. More...
 
void AccCmvnStats (const VectorBase< BaseFloat > &feat, BaseFloat weight, MatrixBase< double > *stats)
 Accumulation from a single frame (weighted). More...
 
void AccCmvnStats (const MatrixBase< BaseFloat > &feats, const VectorBase< BaseFloat > *weights, MatrixBase< double > *stats)
 Accumulation from a feature file (possibly weighted– useful in excluding silence). More...
 
void ApplyCmvn (const MatrixBase< double > &stats, bool norm_vars, MatrixBase< BaseFloat > *feats)
 Apply cepstral mean and variance normalization to a matrix of features. More...
 
void ApplyCmvnReverse (const MatrixBase< double > &stats, bool norm_vars, MatrixBase< BaseFloat > *feats)
 This is as ApplyCmvn, but does so in the reverse sense, i.e. More...
 
void FakeStatsForSomeDims (const std::vector< int32 > &dims, MatrixBase< double > *stats)
 Modify the stats so that for some dimensions (specified in "dims"), we replace them with "fake" stats that have zero mean and unit variance; this is done to disable CMVN for those dimensions. More...
 
static void ComputeGconsts (const VectorBase< BaseFloat > &weights, const MatrixBase< BaseFloat > &means, const MatrixBase< BaseFloat > &inv_vars, VectorBase< BaseFloat > *gconsts_out)
 
void UnitTestFmllrDiagGmm ()
 
void UnitTestFmllrDiagGmmDiagonal ()
 
void UnitTestFmllrDiagGmmOffset ()
 
BaseFloat ComputeFmllrMatrixDiagGmm (const MatrixBase< BaseFloat > &in_xform, const AffineXformStats &stats, std::string fmllr_type, int32 num_iters, MatrixBase< BaseFloat > *out_xform)
 This function internally calls ComputeFmllrMatrixDiagGmm{Full, Diagonal, Offset}, depending on "fmllr_type". More...
 
void FmllrInnerUpdate (SpMatrix< double > &inv_G, VectorBase< double > &k, double beta, int32 row, MatrixBase< double > *transform)
 This function does one row of the inner-loop fMLLR transform update. More...
 
BaseFloat ComputeFmllrMatrixDiagGmmFull (const MatrixBase< BaseFloat > &in_xform, const AffineXformStats &stats, int32 num_iters, MatrixBase< BaseFloat > *out_xform)
 Updates the FMLLR matrix using Mark Gales' row-by-row update. More...
 
BaseFloat ComputeFmllrMatrixDiagGmmDiagonal (const MatrixBase< BaseFloat > &in_xform, const AffineXformStats &stats, MatrixBase< BaseFloat > *out_xform)
 This does diagonal fMLLR (i.e. More...
 
BaseFloat ComputeFmllrMatrixDiagGmmOffset (const MatrixBase< BaseFloat > &in_xform, const AffineXformStats &stats, MatrixBase< BaseFloat > *out_xform)
 This does offset-only fMLLR, i.e. it only estimates an offset. More...
 
void ApplyFeatureTransformToStats (const MatrixBase< BaseFloat > &xform, AffineXformStats *stats)
 This function applies a feature-level transform to stats (useful for certain techniques based on fMLLR). More...
 
void ApplyModelTransformToStats (const MatrixBase< BaseFloat > &xform, AffineXformStats *stats)
 ApplyModelTransformToStats takes a transform "xform", which must be diagonal (i.e. More...
 
float FmllrAuxFuncDiagGmm (const MatrixBase< float > &xform, const AffineXformStats &stats)
 Returns the (diagonal-GMM) FMLLR auxiliary function value given the transform and the stats. More...
 
double FmllrAuxFuncDiagGmm (const MatrixBase< double > &xform, const AffineXformStats &stats)
 
BaseFloat FmllrAuxfGradient (const MatrixBase< BaseFloat > &xform, const AffineXformStats &stats, MatrixBase< BaseFloat > *grad_out)
 Returns the (diagonal-GMM) FMLLR auxiliary function value given the transform and the stats. More...
 
void InitFmllr (int32 dim, Matrix< BaseFloat > *out_fmllr)
 
BaseFloat ComputeFmllrDiagGmm (const FmllrDiagGmmAccs &accs, const FmllrOptions &opts, Matrix< BaseFloat > *out_fmllr, BaseFloat *logdet)
 
BaseFloat ComputeFmllrLogDet (const Matrix< BaseFloat > &fmllr_mat)
 
BaseFloat ComputeFmllrMatrixDiagGmmDiagonal2 (const MatrixBase< BaseFloat > &in_xform, const AffineXformStats &stats, MatrixBase< BaseFloat > *out_xform)
 
void UnitTestFmllrRaw (bool use_offset)
 
void GetFeatDeriv (const DiagGmm &gmm, const Matrix< BaseFloat > &feats, Matrix< BaseFloat > *deriv)
 
BaseFloat GetGmmLike (const DiagGmm &gmm, const Matrix< BaseFloat > &feats)
 
void TestFmpe ()
 
BaseFloat ComputeAmGmmFeatureDeriv (const AmDiagGmm &am_gmm, const TransitionModel &trans_model, const Posterior &posterior, const MatrixBase< BaseFloat > &features, Matrix< BaseFloat > *direct_deriv, const AccumAmDiagGmm *model_diff=NULL, Matrix< BaseFloat > *indirect_deriv=NULL)
 Computes derivatives of the likelihood of these states (weighted), w.r.t. More...
 
static bool GetActiveParents (int32 node, const vector< int32 > &parents, const vector< bool > &is_active, vector< int32 > *active_parents_out)
 
static void RandFullCova (Matrix< BaseFloat > *matrix)
 
static void generate_features (cova_type covariance_type, size_t n_gaussians, size_t dim, Matrix< BaseFloat > &trans_mat, size_t frames_per_gaussian, std::vector< Vector< BaseFloat > *> &train_feats, std::vector< Vector< BaseFloat > *> &adapt_feats)
 
void UnitTestRegtreeFmllrDiagGmm (cova_type feature_type, size_t max_bclass)
 
static void ComputeMllrMatrix (const Matrix< double > &K, const vector< SpMatrix< double > > &G, Matrix< BaseFloat > *out)
 
static BaseFloat MllrAuxFunction (const Matrix< BaseFloat > &xform, const AffineXformStats &stats)
 
bool ComposeTransforms (const Matrix< BaseFloat > &a, const Matrix< BaseFloat > &b, bool b_is_affine, Matrix< BaseFloat > *c)
 
void ApplyAffineTransform (const MatrixBase< BaseFloat > &xform, VectorBase< BaseFloat > *vec)
 Applies the affine transform 'xform' to the vector 'vec' and overwrites the contents of 'vec'. More...
 
TransitionModelGenRandTransitionModel (ContextDependency **ctx_dep_out)
 
HmmTopology GetDefaultTopology (const std::vector< int32 > &phones)
 This function returns a HmmTopology object giving a normal 3-state topology, covering all phones in the list "phones". More...
 
HmmTopology GenRandTopology (const std::vector< int32 > &phones, const std::vector< int32 > &num_pdf_classes)
 This method of generating an arbitrary HmmTopology object allows you to specify the number of pdf-classes for each phone separately. More...
 
HmmTopology GenRandTopology ()
 This version of GenRandTopology() generates the phone list and number of pdf classes randomly. More...
 
void GeneratePathThroughHmm (const HmmTopology &topology, bool reorder, int32 phone, std::vector< std::pair< int32, int32 > > *path)
 This function generates a random path through the HMM for the given phone. More...
 
void GenerateRandomAlignment (const ContextDependencyInterface &ctx_dep, const TransitionModel &trans_model, bool reorder, const std::vector< int32 > &phone_sequence, std::vector< int32 > *alignment)
 For use in test code, this function generates an alignment (a sequence of transition-ids) corresponding to a given phone sequence. More...
 
void TestHmmTopology ()
 
void TestConvertPhnxToProns ()
 
void TestAccumulateTreeStatsOptions ()
 
void TestSplitToPhones ()
 
void TestConvertAlignment ()
 
fst::VectorFst< fst::StdArc > * GetHmmAsFsa (std::vector< int32 > context_window, const ContextDependencyInterface &ctx_dep, const TransitionModel &trans_model, const HTransducerConfig &config, HmmCacheType *cache=NULL)
 Called by GetHTransducer() and probably will not need to be called directly; it creates and returns the FST corresponding to the phone. More...
 
fst::VectorFst< fst::StdArc > * GetHmmAsFsaSimple (std::vector< int32 > context_window, const ContextDependencyInterface &ctx_dep, const TransitionModel &trans_model, BaseFloat prob_scale)
 Included mainly as a form of documentation, not used in any other code currently. More...
 
static fst::VectorFst< fst::StdArc > * MakeTrivialAcceptor (int32 label)
 This utility function, used in GetHTransducer(), creates an FSA (finite state acceptor, i.e. More...
 
fst::VectorFst< fst::StdArc > * GetHTransducer (const std::vector< std::vector< int32 > > &ilabel_info, const ContextDependencyInterface &ctx_dep, const TransitionModel &trans_model, const HTransducerConfig &config, std::vector< int32 > *disambig_syms_left)
 Returns the H tranducer; result owned by caller. More...
 
void GetIlabelMapping (const std::vector< std::vector< int32 > > &ilabel_info_old, const ContextDependencyInterface &ctx_dep, const TransitionModel &trans_model, std::vector< int32 > *old2new_map)
 GetIlabelMapping produces a mapping that's similar to HTK's logical-to-physical model mapping (i.e. More...
 
fst::VectorFst< fst::StdArc > * GetPdfToTransitionIdTransducer (const TransitionModel &trans_model)
 Returns a transducer from pdfs plus one (input) to transition-ids (output). More...
 
static void AddSelfLoopsReorder (const TransitionModel &trans_model, const std::vector< int32 > &disambig_syms, BaseFloat self_loop_scale, bool check_no_self_loops, fst::VectorFst< fst::StdArc > *fst)
 
static void AddSelfLoopsNoReorder (const TransitionModel &trans_model, const std::vector< int32 > &disambig_syms, BaseFloat self_loop_scale, bool check_no_self_loops, fst::VectorFst< fst::StdArc > *fst)
 
void AddSelfLoops (const TransitionModel &trans_model, const std::vector< int32 > &disambig_syms, BaseFloat self_loop_scale, bool reorder, bool check_no_self_loops, fst::VectorFst< fst::StdArc > *fst)
 For context, see AddSelfLoops(). More...
 
static bool IsReordered (const TransitionModel &trans_model, const std::vector< int32 > &alignment)
 
static bool SplitToPhonesInternal (const TransitionModel &trans_model, const std::vector< int32 > &alignment, bool reordered, std::vector< std::vector< int32 > > *split_output)
 
bool SplitToPhones (const TransitionModel &trans_model, const std::vector< int32 > &alignment, std::vector< std::vector< int32 > > *split_alignment)
 SplitToPhones splits up the TransitionIds in "alignment" into their individual phones (one vector per instance of a phone). More...
 
static void ConvertAlignmentForPhone (const TransitionModel &old_trans_model, const TransitionModel &new_trans_model, const ContextDependencyInterface &new_ctx_dep, const std::vector< int32 > &old_phone_alignment, const std::vector< int32 > &new_phone_window, bool old_is_reordered, bool new_is_reordered, std::vector< int32 > *new_phone_alignment)
 This function is used internally inside ConvertAlignment; it converts the alignment for a single phone. More...
 
static bool ComputeNewPhoneLengths (const HmmTopology &topology, const std::vector< int32 > &mapped_phones, const std::vector< int32 > &old_lengths, int32 conversion_shift, int32 subsample_factor, std::vector< int32 > *new_lengths)
 This function, called from ConvertAlignmentInternal(), works out suitable new lengths of phones in the case where subsample_factor != 1. More...
 
static bool ConvertAlignmentInternal (const TransitionModel &old_trans_model, const TransitionModel &new_trans_model, const ContextDependencyInterface &new_ctx_dep, const std::vector< int32 > &old_alignment, int32 conversion_shift, int32 subsample_factor, bool new_is_reordered, const std::vector< int32 > *phone_map, std::vector< int32 > *new_alignment)
 This function is the same as 'ConvertAligment', but instead of the 'repeat_frames' option it supports the 'conversion_shift' option; see the documentation of ComputeNewPhoneLengths() for what 'conversion_shift' is for. More...
 
bool ConvertAlignment (const TransitionModel &old_trans_model, const TransitionModel &new_trans_model, const ContextDependencyInterface &new_ctx_dep, const std::vector< int32 > &old_alignment, int32 subsample_factor, bool repeat_frames, bool reorder, const std::vector< int32 > *phone_map, std::vector< int32 > *new_alignment)
 ConvertAlignment converts an alignment that was created using one model, to another model. More...
 
static BaseFloat GetScaledTransitionLogProb (const TransitionModel &trans_model, int32 trans_id, BaseFloat transition_scale, BaseFloat self_loop_scale)
 
void AddTransitionProbs (const TransitionModel &trans_model, const std::vector< int32 > &disambig_syms, BaseFloat transition_scale, BaseFloat self_loop_scale, fst::VectorFst< fst::StdArc > *fst)
 Adds transition-probs, with the supplied scales (see Scaling of transition and acoustic probabilities), to the graph. More...
 
void AddTransitionProbs (const TransitionModel &trans_model, BaseFloat transition_scale, BaseFloat self_loop_scale, Lattice *lat)
 This is as AddSelfLoops(), but operates on a Lattice, where it affects the graph part of the weight (the first element of the pair). More...
 
bool ConvertPhnxToProns (const std::vector< int32 > &phnx, const std::vector< int32 > &words, int32 word_start_sym, int32 word_end_sym, std::vector< std::vector< int32 > > *prons)
 
void GetRandomAlignmentForPhone (const ContextDependencyInterface &ctx_dep, const TransitionModel &trans_model, const std::vector< int32 > &phone_window, std::vector< int32 > *alignment)
 
void ChangeReorderingOfAlignment (const TransitionModel &trans_model, std::vector< int32 > *alignment)
 
void GetPdfToPhonesMap (const TransitionModel &trans_model, std::vector< std::set< int32 > > *pdf2phones)
 
void ConvertTransitionIdsToPdfs (const TransitionModel &trans_model, const std::vector< int32 > &disambig_syms, fst::VectorFst< fst::StdArc > *fst)
 Converts all transition-ids in the FST to pdfs plus one. More...
 
void TestVectorToPosteriorEntry ()
 
void TestPosteriorIo ()
 
void WritePosterior (std::ostream &os, bool binary, const Posterior &post)
 stand-alone function for writing a Posterior. More...
 
void ReadPosterior (std::istream &os, bool binary, Posterior *post)
 stand-alone function for reading a Posterior. More...
 
void ScalePosterior (BaseFloat scale, Posterior *post)
 Scales the BaseFloat (weight) element in the posterior entries. More...
 
BaseFloat TotalPosterior (const Posterior &post)
 Returns the total of all the weights in "post". More...
 
bool PosteriorEntriesAreDisjoint (const std::vector< std::pair< int32, BaseFloat > > &post_elem1, const std::vector< std::pair< int32, BaseFloat > > &post_elem2)
 Returns true if the two lists of pairs have no common .first element. More...
 
int32 MergePosteriors (const Posterior &post1, const Posterior &post2, bool merge, bool drop_frames, Posterior *post)
 Merge two sets of posteriors, which must have the same length. More...
 
void AlignmentToPosterior (const std::vector< int32 > &ali, Posterior *post)
 Convert an alignment to a posterior (with a scale of 1.0 on each entry). More...
 
void SortPosteriorByPdfs (const TransitionModel &tmodel, Posterior *post)
 Sorts posterior entries so that transition-ids with same pdf-id are next to each other. More...
 
void ConvertPosteriorToPdfs (const TransitionModel &tmodel, const Posterior &post_in, Posterior *post_out)
 Converts a posterior over transition-ids to be a posterior over pdf-ids. More...
 
void ConvertPosteriorToPhones (const TransitionModel &tmodel, const Posterior &post_in, Posterior *post_out)
 Converts a posterior over transition-ids to be a posterior over phones. More...
 
void WeightSilencePost (const TransitionModel &trans_model, const ConstIntegerSet< int32 > &silence_set, BaseFloat silence_scale, Posterior *post)
 Weight any silence phones in the posterior (i.e. More...
 
void WeightSilencePostDistributed (const TransitionModel &trans_model, const ConstIntegerSet< int32 > &silence_set, BaseFloat silence_scale, Posterior *post)
 This is similar to WeightSilencePost, except that on each frame it works out the amount by which the overall posterior would be reduced, and scales down everything on that frame by the same amount. More...
 
static BaseFloat GetTotalPosterior (const std::vector< std::pair< int32, BaseFloat > > &post_entry)
 
BaseFloat VectorToPosteriorEntry (const VectorBase< BaseFloat > &log_likes, int32 num_gselect, BaseFloat min_post, std::vector< std::pair< int32, BaseFloat > > *post_entry)
 Given a vector of log-likelihoods (typically of Gaussians in a GMM but could be of pdf-ids), a number gselect >= 1 and a minimum posterior 0 <= min_post < 1, it gets the posterior for each element of log-likes by applying Softmax(), then prunes the posteriors using "gselect" and "min_post" (keeping at least one), and outputs the result into "post_entry", sorted from greatest to least posterior. More...
 
template<typename Real >
void PosteriorToMatrix (const Posterior &post, const int32 post_dim, Matrix< Real > *mat)
 This converts a Posterior to a Matrix. More...
 
template void PosteriorToMatrix< float > (const Posterior &post, const int32 post_dim, Matrix< float > *mat)
 
template void PosteriorToMatrix< double > (const Posterior &post, const int32 post_dim, Matrix< double > *mat)
 
template<typename Real >
void PosteriorToPdfMatrix (const Posterior &post, const TransitionModel &model, Matrix< Real > *mat)
 This converts a Posterior to a Matrix. More...
 
template void PosteriorToPdfMatrix< float > (const Posterior &post, const TransitionModel &model, Matrix< float > *mat)
 
template void PosteriorToPdfMatrix< double > (const Posterior &post, const TransitionModel &model, Matrix< double > *mat)
 
void TestTransitionModel ()
 
bool GetPdfsForPhones (const TransitionModel &trans_model, const std::vector< int32 > &phones, std::vector< int32 > *pdfs)
 Works out which pdfs might correspond to the given phones. More...
 
bool GetPhonesForPdfs (const TransitionModel &trans_model, const std::vector< int32 > &pdfs, std::vector< int32 > *phones)
 Works out which phones might correspond to the given pdfs. More...
 
static int32 MapPhone (const std::vector< int32 > &phone_map, int32 phone)
 
void TrimTrailingWhitespace (std::string *str)
 
static fst::StdVectorFstCreateGenFst (bool seps, const fst::SymbolTable *pst)
 
ArpaLmCompilerCompile (bool seps, const std::string &infile)
 
fst::StdArc::StateId AddToChainFsa (fst::StdMutableFst *fst, fst::StdArc::StateId last_state, int64 symbol)
 
void AddSelfLoops (fst::StdMutableFst *fst)
 
bool CoverageTest (bool seps, const std::string &infile)
 
bool ScoringTest (bool seps, const std::string &infile, const std::string &sentence, float expected)
 
bool ThrowsExceptionTest (bool seps, const std::string &infile)
 
bool BuildConstArpaLm (const ArpaParseOptions &options, const std::string &arpa_rxfilename, const std::string &const_arpa_wxfilename)
 
template<typename FST >
bool DecodeUtteranceLatticeIncremental (LatticeIncrementalDecoderTpl< FST > &decoder, DecodableInterface &decodable, const TransitionModel &trans_model, const fst::SymbolTable *word_syms, std::string utt, double acoustic_scale, bool determinize, bool allow_partial, Int32VectorWriter *alignments_writer, Int32VectorWriter *words_writer, CompactLatticeWriter *compact_lattice_writer, LatticeWriter *lattice_writer, double *like_ptr)
 TODO. More...
 
template<typename FST >
bool DecodeUtteranceLatticeFaster (LatticeFasterDecoderTpl< FST > &decoder, DecodableInterface &decodable, const TransitionModel &trans_model, const fst::SymbolTable *word_syms, std::string utt, double acoustic_scale, bool determinize, bool allow_partial, Int32VectorWriter *alignments_writer, Int32VectorWriter *words_writer, CompactLatticeWriter *compact_lattice_writer, LatticeWriter *lattice_writer, double *like_ptr)
 This function DecodeUtteranceLatticeFaster is used in several decoders, and we have moved it here. More...
 
template bool DecodeUtteranceLatticeIncremental (LatticeIncrementalDecoderTpl< fst::Fst< fst::StdArc > > &decoder, DecodableInterface &decodable, const TransitionModel &trans_model, const fst::SymbolTable *word_syms, std::string utt, double acoustic_scale, bool determinize, bool allow_partial, Int32VectorWriter *alignment_writer, Int32VectorWriter *words_writer, CompactLatticeWriter *compact_lattice_writer, LatticeWriter *lattice_writer, double *like_ptr)
 
template bool DecodeUtteranceLatticeIncremental (LatticeIncrementalDecoderTpl< fst::GrammarFst > &decoder, DecodableInterface &decodable, const TransitionModel &trans_model, const fst::SymbolTable *word_syms, std::string utt, double acoustic_scale, bool determinize, bool allow_partial, Int32VectorWriter *alignment_writer, Int32VectorWriter *words_writer, CompactLatticeWriter *compact_lattice_writer, LatticeWriter *lattice_writer, double *like_ptr)
 
template bool DecodeUtteranceLatticeFaster (LatticeFasterDecoderTpl< fst::Fst< fst::StdArc > > &decoder, DecodableInterface &decodable, const TransitionModel &trans_model, const fst::SymbolTable *word_syms, std::string utt, double acoustic_scale, bool determinize, bool allow_partial, Int32VectorWriter *alignment_writer, Int32VectorWriter *words_writer, CompactLatticeWriter *compact_lattice_writer, LatticeWriter *lattice_writer, double *like_ptr)
 
template bool DecodeUtteranceLatticeFaster (LatticeFasterDecoderTpl< fst::GrammarFst > &decoder, DecodableInterface &decodable, const TransitionModel &trans_model, const fst::SymbolTable *word_syms, std::string utt, double acoustic_scale, bool determinize, bool allow_partial, Int32VectorWriter *alignment_writer, Int32VectorWriter *words_writer, CompactLatticeWriter *compact_lattice_writer, LatticeWriter *lattice_writer, double *like_ptr)
 
bool DecodeUtteranceLatticeSimple (LatticeSimpleDecoder &decoder, DecodableInterface &decodable, const TransitionModel &trans_model, const fst::SymbolTable *word_syms, std::string utt, double acoustic_scale, bool determinize, bool allow_partial, Int32VectorWriter *alignment_writer, Int32VectorWriter *words_writer, CompactLatticeWriter *compact_lattice_writer, LatticeWriter *lattice_writer, double *like_ptr)
 
void ModifyGraphForCarefulAlignment (fst::VectorFst< fst::StdArc > *fst)
 This function modifies the decoding graph for what we call "careful alignment". More...
 
void AlignUtteranceWrapper (const AlignConfig &config, const std::string &utt, BaseFloat acoustic_scale, fst::VectorFst< fst::StdArc > *fst, DecodableInterface *decodable, Int32VectorWriter *alignment_writer, BaseFloatWriter *scores_writer, int32 *num_done, int32 *num_error, int32 *num_retried, double *tot_like, int64 *frame_count, BaseFloatVectorWriter *per_frame_acwt_writer=NULL)
 AlignUtteranceWapper is a wrapper for alignment code used in training, that is called from many different binaries, e.g. More...
 
static void AddCompactLatticeArcToLattice (const CompactLatticeArc &clat_arc, LatticeArc::StateId src_state, Lattice *lat)
 
static int32 TotalNumArcs (const CompactLattice &clat)
 
void ComposeCompactLatticePruned (const ComposeLatticePrunedOptions &opts, const CompactLattice &clat, fst::DeterministicOnDemandFst< fst::StdArc > *det_fst, CompactLattice *composed_clat)
 Does pruned composition of a lattice 'clat' with a DeterministicOnDemandFst 'det_fst'; implements LM rescoring. More...
 
BaseFloat SentenceLevelConfidence (const CompactLattice &clat, int32 *num_paths, std::vector< int32 > *best_sentence, std::vector< int32 > *second_best_sentence)
 Caution: this function is not the only way to get confidences in Kaldi. More...
 
BaseFloat SentenceLevelConfidence (const Lattice &lat, int32 *num_paths, std::vector< int32 > *best_sentence, std::vector< int32 > *second_best_sentence)
 This version of SentenceLevelConfidence takes as input a state-level lattice. More...
 
CompactLatticeRandCompactLattice ()
 
LatticeRandLattice ()
 
void TestCompactLatticeTable (bool binary)
 
void TestCompactLatticeTableCross (bool binary)
 
void TestLatticeTable (bool binary)
 
void TestLatticeTableCross (bool binary)
 
template<class OrigWeightType >
CompactLatticeConvertToCompactLattice (fst::VectorFst< OrigWeightType > *ifst)
 Converts lattice types if necessary, deleting its input. More...
 
template<>
CompactLatticeConvertToCompactLattice (CompactLattice *ifst)
 
template<class OrigWeightType >
LatticeConvertToLattice (fst::VectorFst< OrigWeightType > *ifst)
 Converts lattice types if necessary, deleting its input. More...
 
template<>
LatticeConvertToLattice (Lattice *ifst)
 
bool WriteCompactLattice (std::ostream &os, bool binary, const CompactLattice &t)
 
CompactLatticeReadCompactLatticeText (std::istream &is)
 
LatticeReadLatticeText (std::istream &is)
 
bool ReadCompactLattice (std::istream &is, bool binary, CompactLattice **clat)
 
bool WriteLattice (std::ostream &os, bool binary, const Lattice &t)
 
bool ReadLattice (std::istream &is, bool binary, Lattice **lat)
 
void GetPerFrameAcousticCosts (const Lattice &nbest, Vector< BaseFloat > *per_frame_loglikes)
 This function extracts the per-frame log likelihoods from a linear lattice (which we refer to as an 'nbest' lattice elsewhere in Kaldi code). More...
 
int32 LatticeStateTimes (const Lattice &lat, vector< int32 > *times)
 This function iterates over the states of a topologically sorted lattice and counts the time instance corresponding to each state. More...
 
int32 CompactLatticeStateTimes (const CompactLattice &lat, vector< int32 > *times)
 As LatticeStateTimes, but in the CompactLattice format. More...
 
bool ComputeCompactLatticeAlphas (const CompactLattice &clat, vector< double > *alpha)
 
bool ComputeCompactLatticeBetas (const CompactLattice &clat, vector< double > *beta)
 
template<class LatType >
bool PruneLattice (BaseFloat beam, LatType *lat)
 
template bool PruneLattice (BaseFloat beam, Lattice *lat)
 
template bool PruneLattice (BaseFloat beam, CompactLattice *lat)
 
BaseFloat LatticeForwardBackward (const Lattice &lat, Posterior *arc_post, double *acoustic_like_sum=NULL)
 This function does the forward-backward over lattices and computes the posterior probabilities of the arcs. More...
 
void LatticeActivePhones (const Lattice &lat, const TransitionModel &trans, const vector< int32 > &silence_phones, vector< std::set< int32 > > *active_phones)
 Given a lattice, and a transition model to map pdf-ids to phones, outputs for each frame the set of phones active on that frame. More...
 
void ConvertLatticeToPhones (const TransitionModel &trans_model, Lattice *lat)
 Given a lattice, and a transition model to map pdf-ids to phones, replace the output symbols (presumably words), with phones; we use the TransitionModel to work out the phone sequence. More...
 
static double LogAddOrMax (bool viterbi, double a, double b)
 
template<typename LatticeType >
double ComputeLatticeAlphasAndBetas (const LatticeType &lat, bool viterbi, vector< double > *alpha, vector< double > *beta)
 
template double ComputeLatticeAlphasAndBetas (const Lattice &lat, bool viterbi, vector< double > *alpha, vector< double > *beta)
 
template double ComputeLatticeAlphasAndBetas (const CompactLattice &lat, bool viterbi, vector< double > *alpha, vector< double > *beta)
 
void CompactLatticeLimitDepth (int32 max_arcs_per_frame, CompactLattice *clat)
 This function limits the depth of the lattice, per frame: that means, it does not allow more than a specified number of arcs active on any given frame. More...
 
void TopSortCompactLatticeIfNeeded (CompactLattice *clat)
 Topologically sort the compact lattice if not already topologically sorted. More...
 
void TopSortLatticeIfNeeded (Lattice *clat)
 Topologically sort the lattice if not already topologically sorted. More...
 
BaseFloat CompactLatticeDepth (const CompactLattice &clat, int32 *num_frames)
 Returns the depth of the lattice, defined as the average number of arcs crossing any given frame. More...
 
void CompactLatticeDepthPerFrame (const CompactLattice &clat, std::vector< int32 > *depth_per_frame)
 This function returns, for each frame, the number of arcs crossing that frame. More...
 
void ConvertCompactLatticeToPhones (const TransitionModel &trans_model, CompactLattice *clat)
 Given a lattice, and a transition model to map pdf-ids to phones, replace the sequences of transition-ids with sequences of phones. More...
 
bool LatticeBoost (const TransitionModel &trans, const std::vector< int32 > &alignment, const std::vector< int32 > &silence_phones, BaseFloat b, BaseFloat max_silence_error, Lattice *lat)
 Boosts LM probabilities by b * [number of frame errors]; equivalently, adds -b*[number of frame errors] to the graph-component of the cost of each arc/path. More...
 
BaseFloat LatticeForwardBackwardMpeVariants (const TransitionModel &trans, const std::vector< int32 > &silence_phones, const Lattice &lat, const std::vector< int32 > &num_ali, std::string criterion, bool one_silence_class, Posterior *post)
 This function implements either the MPFE (minimum phone frame error) or SMBR (state-level minimum bayes risk) forward-backward, depending on whether "criterion" is "mpfe" or "smbr". More...
 
bool CompactLatticeToWordAlignment (const CompactLattice &clat, std::vector< int32 > *words, std::vector< int32 > *begin_times, std::vector< int32 > *lengths)
 This function takes a CompactLattice that should only contain a single linear sequence (e.g. More...
 
bool CompactLatticeToWordProns (const TransitionModel &tmodel, const CompactLattice &clat, std::vector< int32 > *words, std::vector< int32 > *begin_times, std::vector< int32 > *lengths, std::vector< std::vector< int32 > > *prons, std::vector< std::vector< int32 > > *phone_lengths)
 This function takes a CompactLattice that should only contain a single linear sequence (e.g. More...
 
void CompactLatticeShortestPath (const CompactLattice &clat, CompactLattice *shortest_path)
 A form of the shortest-path/best-path algorithm that's specially coded for CompactLattice. More...
 
void AddWordInsPenToCompactLattice (BaseFloat word_ins_penalty, CompactLattice *clat)
 This function add the word insertion penalty to graph score of each word in the compact lattice. More...
 
bool RescoreCompactLatticeInternal (const TransitionModel *tmodel, BaseFloat speedup_factor, DecodableInterface *decodable, CompactLattice *clat)
 RescoreCompactLatticeInternal is the internal code for both RescoreCompactLattice and RescoreCompatLatticeSpeedup. More...
 
bool RescoreCompactLatticeSpeedup (const TransitionModel &tmodel, BaseFloat speedup_factor, DecodableInterface *decodable, CompactLattice *clat)
 This function is like RescoreCompactLattice, but it is modified to avoid computing probabilities on most frames where all the pdf-ids are the same. More...
 
bool RescoreCompactLattice (DecodableInterface *decodable, CompactLattice *clat)
 This function *adds* the negated scores obtained from the Decodable object, to the acoustic scores on the arcs. More...
 
bool RescoreLattice (DecodableInterface *decodable, Lattice *lat)
 This function *adds* the negated scores obtained from the Decodable object, to the acoustic scores on the arcs. More...
 
BaseFloat LatticeForwardBackwardMmi (const TransitionModel &trans, const Lattice &lat, const std::vector< int32 > &num_ali, bool drop_frames, bool convert_to_pdf_ids, bool cancel, Posterior *arc_post)
 This function can be used to compute posteriors for MMI, with a positive contribution for the numerator and a negative one for the denominator. More...
 
int32 LongestSentenceLength (const Lattice &lat)
 This function returns the number of words in the longest sentence in a CompactLattice (i.e. More...
 
int32 LongestSentenceLength (const CompactLattice &lat)
 This function returns the number of words in the longest sentence in a CompactLattice, i.e. More...
 
void ComposeCompactLatticeDeterministic (const CompactLattice &clat, fst::DeterministicOnDemandFst< fst::StdArc > *det_fst, CompactLattice *composed_clat)
 This function Composes a CompactLattice format lattice with a DeterministicOnDemandFst<fst::StdFst> format fst, and outputs another CompactLattice format lattice. More...
 
void ComputeAcousticScoresMap (const Lattice &lat, unordered_map< std::pair< int32, int32 >, std::pair< BaseFloat, int32 >, PairHasher< int32 > > *acoustic_scores)
 This function computes the mapping from the pair (frame-index, transition-id) to the pair (sum-of-acoustic-scores, num-of-occurences) over all occurences of the transition-id in that frame. More...
 
void ReplaceAcousticScoresFromMap (const unordered_map< std::pair< int32, int32 >, std::pair< BaseFloat, int32 >, PairHasher< int32 > > &acoustic_scores, Lattice *lat)
 This function restores acoustic scores computed using the function ComputeAcousticScoresMap into the lattice. More...
 
int32 LatticeStateTimes (const Lattice &lat, std::vector< int32 > *times)
 This function iterates over the states of a topologically sorted lattice and counts the time instance corresponding to each state. More...
 
int32 CompactLatticeStateTimes (const CompactLattice &clat, std::vector< int32 > *times)
 As LatticeStateTimes, but in the CompactLattice format. More...
 
bool ComputeCompactLatticeAlphas (const CompactLattice &lat, std::vector< double > *alpha)
 
bool ComputeCompactLatticeBetas (const CompactLattice &lat, std::vector< double > *beta)
 
template<typename LatticeType >
double ComputeLatticeAlphasAndBetas (const LatticeType &lat, bool viterbi, std::vector< double > *alpha, std::vector< double > *beta)
 
void LatticeActivePhones (const Lattice &lat, const TransitionModel &trans, const std::vector< int32 > &sil_phones, std::vector< std::set< int32 > > *active_phones)
 Given a lattice, and a transition model to map pdf-ids to phones, outputs for each frame the set of phones active on that frame. More...
 
template<class LatticeType >
bool PruneLattice (BaseFloat beam, LatticeType *lat)
 Prunes a lattice or compact lattice. More...
 
CompactLatticeRandDeterministicCompactLattice ()
 
void TestMinimizeCompactLattice ()
 
bool PhoneAlignLattice (const CompactLattice &lat, const TransitionModel &tmodel, const PhoneAlignLatticeOptions &opts, CompactLattice *lat_out)
 Outputs a lattice in which the arcs correspond exactly to sequences of phones, so the boundaries between the arcs correspond to the boundaries between phones If remove-epsilon == false and replace-output-symbols == false, but an arc may have >1 phone on it, but the boundaries will still correspond with the boundaries between phones. More...
 
void TestPushCompactLatticeStrings ()
 
void TestPushCompactLatticeWeights ()
 
void GenerateLexicon (const std::vector< int32 > &phones, bool allow_zero_words, bool allow_empty_word, bool allow_multiple_prons, std::vector< std::vector< int32 > > *lexicon)
 
static void PrintLexicon (const std::vector< std::vector< int32 > > &lexicon)
 
static void PrintWordsAndPhones (const std::vector< int32 > &words, const std::vector< int32 > &phones)
 
void GenerateWordAndPhoneSequence (std::vector< std::vector< int32 > > &lexicon, std::vector< int32 > *phone_seq, std::vector< int32 > *word_seq)
 
void GenerateCompactLatticeRandomly (const std::vector< int32 > &alignment, const std::vector< int32 > &words, CompactLattice *clat)
 
void TestWordAlignLatticeLexicon ()
 
static bool IsPlausibleWord (const WordAlignLatticeLexiconInfo &lexicon_info, const TransitionModel &tmodel, int32 word_id, const std::vector< int32 > &transition_ids)
 
static void MapSymbols (const WordAlignLatticeLexiconInfo &lexicon_info, CompactLattice *lat)
 Testing code; map word symbols in the lattice "lat" using the equivalence-classes obtained from the lexicon, using the function EquivalenceClassOf in the lexicon_info object. More...
 
static bool TestWordAlignedLattice (const WordAlignLatticeLexiconInfo &lexicon_info, const TransitionModel &tmodel, CompactLattice clat, CompactLattice aligned_clat, bool allow_duplicate_paths)
 
bool WordAlignLatticeLexicon (const CompactLattice &lat, const TransitionModel &tmodel, const WordAlignLatticeLexiconInfo &lexicon_info, const WordAlignLatticeLexiconOpts &opts, CompactLattice *lat_out)
 Align lattice so that each arc has the transition-ids on it that correspond to the word that is on that arc. More...
 
bool ReadLexiconForWordAlign (std::istream &is, std::vector< std::vector< int32 > > *lexicon)
 Read the lexicon in the special format required for word alignment. More...
 
void TestWordAlignedLatticeLexicon (const CompactLattice &lat, const TransitionModel &tmodel, const std::vector< std::vector< int32 > > &lexicon, const CompactLattice &aligned_lat, bool allow_duplicate_paths)
 This function is designed to crash if something went wrong with the word-alignment of the lattice. More...
 
static bool IsPlausibleWord (const WordBoundaryInfo &info, const TransitionModel &tmodel, const std::vector< int32 > &transition_ids)
 
bool WordAlignLattice (const CompactLattice &lat, const TransitionModel &tmodel, const WordBoundaryInfo &info, int32 max_states, CompactLattice *lat_out)
 Align lattice so that each arc has the transition-ids on it that correspond to the word that is on that arc. More...
 
void TestWordAlignedLattice (const CompactLattice &lat, const TransitionModel &tmodel, const WordBoundaryInfo &info, const CompactLattice &aligned_lat)
 You should only test a lattice if WordAlignLattice returned true (i.e. More...
 
void RegisterCuAllocatorOptions (OptionsItf *po)
 
template<typename T >
std::ostream & operator<< (std::ostream &out, const CuArray< T > &vec)
 Print the vector to stream. More...
 
template<class T >
void AssertEqual (const std::vector< T > &vec1, const std::vector< T > &vec2)
 
template<class T >
static void UnitTestCuArray ()
 
template<typename Real >
static bool ApproxEqual (const CuBlockMatrix< Real > &A, const CuBlockMatrix< Real > &B, float tol=0.001)
 
template<class Real >
static void UnitTestCuBlockMatrixIO ()
 
template<class Real >
static void UnitTestCuBlockMatrixAddMatBlock ()
 
template<class Real >
static void UnitTestCuBlockMatrixAddMatMat ()
 
template<typename Real >
void CuBlockMatrixUnitTest ()
 
template<typename Real >
std::ostream & operator<< (std::ostream &out, const CuBlockMatrix< Real > &mat)
 Print the matrix to stream. More...
 
template std::ostream & operator<< (std::ostream &out, const CuBlockMatrix< float > &mat)
 
template std::ostream & operator<< (std::ostream &out, const CuBlockMatrix< double > &mat)
 
void CuCompressedMatrixTestSign ()
 
void CuCompressedMatrixTestNonnegative ()
 
void CuCompressedMatrixTestSymmetric ()
 
CuCompressedMatrixBaseNewCuCompressedMatrix (CuCompressedMatrixType t, BaseFloat range, bool truncate=true)
 This function allocates a new CuCompressedMatrix with type determined by t, and with the 'range' and 'truncate' parameters provided to the constructor of class CuCompressedMatrix. More...
 
template<typename Real >
void TestCuMatrixResize (int32 size_multiple)
 
template<typename Real >
void CudaMatrixResizeTest ()
 
void SynchronizeGpu ()
 The function SynchronizeGpu(), which for convenience is defined whether or not we have compiled for CUDA, is intended to be called in places where threads need to be synchronized. More...
 
template<typename Real >
static void UnitTestCuMathRandomize ()
 
template<typename Real >
static void UnitTestEnsureNonzero ()
 
template<typename Real >
static void UnitTestCuMathCopy ()
 
template<typename Real >