21 #ifndef KALDI_ONLINE2_ONLINE_NNET2_DECODING_THREADED_H_ 22 #define KALDI_ONLINE2_ONLINE_NNET2_DECODING_THREADED_H_ 154 acoustic_scale = 0.1;
155 max_buffered_features = 100;
156 feature_batch_size = 2;
157 nnet_batch_size = 32;
158 max_loglikes_copy = 20;
159 decode_batch_size = 2;
166 opts->
Register(
"acoustic-scale", &acoustic_scale,
"Scale used on acoustics " 168 opts->
Register(
"max-buffered-features", &max_buffered_features,
"Obscure " 169 "setting, affects multi-threaded decoding.");
170 opts->
Register(
"feature-batch-size", &max_buffered_features,
"Obscure " 171 "setting, affects multi-threaded decoding.");
172 opts->
Register(
"nnet-batch-size", &nnet_batch_size,
"Maximum batch size " 173 "(in frames) used when evaluating neural net likelihoods");
174 opts->
Register(
"max-loglikes-copy", &max_loglikes_copy,
"Obscure " 175 "setting, affects multi-threaded decoding.");
176 opts->
Register(
"decode-batch-sie", &decode_batch_size,
"Obscure " 177 "setting, affects multi-threaded decoding.");
201 const fst::Fst<fst::StdArc> &
fst,
216 int32 NumWaveformPiecesPending();
222 void InputFinished();
230 void TerminateDecoding();
242 void FinalizeDecoding();
249 int32 NumFramesReceivedApprox()
const;
255 int32 NumFramesDecoded()
const;
269 void GetLattice(
bool end_of_utterance,
282 void GetBestPath(
bool end_of_utterance,
317 void AbortAllThreads(
bool error);
321 void WaitForAllThreads();
330 bool RunNnetEvaluationInternal();
339 bool FeatureComputation(
int32 num_frames_output);
346 bool RunDecoderSearchInternal();
423 std::thread threads_[2];
443 #endif // KALDI_ONLINE2_ONLINE_NNET2_DECODING_THREADED_H_ KALDI_DISALLOW_COPY_AND_ASSIGN(ThreadSynchronizer)
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
const nnet2::AmNnet & am_nnet_
OnlineSilenceWeighting silence_weighting_
LatticeFasterDecoderConfig decoder_opts
ThreadSynchronizer waveform_synchronizer_
int32 num_frames_decoded_
std::deque< Vector< BaseFloat > *> input_waveform_
You will instantiate this class when you want to decode a single utterance using the online-decoding ...
Semaphore producer_semaphore_
For an extended explanation of the framework of which grammar-fsts are a part, please see Support for...
OnlineNnet2DecodingThreadedConfig()
OnlineNnet2FeaturePipeline feature_pipeline_
std::mutex decoder_mutex_
const TransitionModel & tmodel_
bool EndpointDetected(const OnlineEndpointConfig &config, int32 num_frames_decoded, int32 trailing_silence_frames, BaseFloat frame_shift_in_seconds, BaseFloat final_relative_cost)
This function returns true if this set of endpointing rules thinks we should terminate decoding...
std::mutex feature_pipeline_mutex_
int32 max_buffered_features
This decodable class returns log-likes stored in a matrix; it supports repeatedly writing to the matr...
This file contains a different version of the feature-extraction pipeline in online-feature-pipeline...
This class is responsible for storing configuration variables, objects and options for OnlineNnet2Fea...
virtual void Register(const std::string &name, bool *ptr, const std::string &doc)=0
bool UnlockFailure(ThreadType t)
ThreadSynchronizer decodable_synchronizer_
class ThreadSynchronizer acts to guard an arbitrary type of buffer between a producing and a consumin...
std::deque< Vector< BaseFloat > *> processed_waveform_
OnlineNnet2DecodingThreadedConfig config_
Struct OnlineCmvnState stores the state of CMVN adaptation between utterances (but not the state of t...
bool UnlockSuccess(ThreadType t)
fst::VectorFst< LatticeArc > Lattice
std::mutex silence_weighting_mutex_
int64 num_samples_received_
LatticeFasterOnlineDecoder decoder_
void Register(OptionsItf *opts)
fst::VectorFst< CompactLatticeArc > CompactLattice
DecodableMatrixMappedOffset decodable_
Matrix for CUDA computing.
A class representing a vector.
OnlineNnet2FeaturePipeline is a class that's responsible for putting together the various parts of th...
int64 num_samples_discarded_
Provides a vector abstraction class.
Semaphore consumer_semaphore_
void Register(OptionsItf *opts)