20 #ifndef KALDI_NNET3_DECODABLE_SIMPLE_LOOPED_H_ 21 #define KALDI_NNET3_DECODABLE_SIMPLE_LOOPED_H_ 55 extra_left_context_initial(0),
56 frame_subsampling_factor(1),
59 debug_computation(false) { }
63 frame_subsampling_factor > 0 && frames_per_chunk > 0 &&
64 acoustic_scale > 0.0);
68 opts->
Register(
"extra-left-context-initial", &extra_left_context_initial,
69 "Extra left context to use at the first frame of an utterance (note: " 70 "this will just consist of repeats of the first frame, and should not " 71 "usually be necessary.");
72 opts->
Register(
"frame-subsampling-factor", &frame_subsampling_factor,
73 "Required if the frame-rate of the output (e.g. in 'chain' " 74 "models) is less than the frame-rate of the original " 76 opts->
Register(
"acoustic-scale", &acoustic_scale,
77 "Scaling factor for acoustic log-likelihoods");
78 opts->
Register(
"frames-per-chunk", &frames_per_chunk,
79 "Number of frames in each chunk that is separately evaluated " 80 "by the neural net. Measured before any subsampling, if the " 81 "--frame-subsampling-factor options is used (i.e. counts " 82 "input frames. This is only advisory (may be rounded up " 84 opts->
Register(
"debug-computation", &debug_computation,
"If true, turn on " 85 "debug for the actual computation (very verbose!)");
89 optimize_config.
Register(&optimization_opts);
93 compute_config.
Register(&compute_opts);
188 int32 online_ivector_period = 1);
202 void GetOutputForFrame(
int32 subsampled_frame,
209 KALDI_ASSERT(subsampled_frame >= current_log_post_subsampled_offset_ &&
210 "Frames must be accessed in order.");
211 while (subsampled_frame >= current_log_post_subsampled_offset_ +
212 current_log_post_.NumRows())
214 return current_log_post_(subsampled_frame -
215 current_log_post_subsampled_offset_,
229 void GetCurrentIvector(
int32 input_frame,
233 int32 GetIvectorDim()
const;
302 int32 online_ivector_period = 1);
308 return decodable_nnet_.NumFrames();
315 return (frame == NumFramesReady() - 1);
329 #endif // KALDI_NNET3_DECODABLE_SIMPLE_LOOPED_H_
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
void Register(OptionsItf *opts)
NnetComputation computation
const VectorBase< BaseFloat > * ivector_
int32 frame_subsampling_factor
DecodableInterface provides a link between the (acoustic-modeling and feature-processing) code and th...
Base class which provides matrix operations not involving resizing or allocation. ...
virtual int32 NumFramesReady() const
The call NumFramesReady() will return the number of frames currently available for this decodable obj...
const MatrixBase< BaseFloat > * online_ivector_feats_
int32 online_ivector_period_
int32 frames_right_context
NnetSimpleLoopedComputationOptions()
int32 extra_left_context_initial
int32 current_log_post_subsampled_offset_
#define KALDI_DISALLOW_COPY_AND_ASSIGN(type)
virtual int32 NumIndices() const
Returns the number of states in the acoustic model (they will be indexed one-based, i.e.
const MatrixBase< BaseFloat > & feats_
virtual void Register(const std::string &name, bool *ptr, const std::string &doc)=0
const NnetSimpleLoopedComputationOptions & opts
int32 num_chunks_computed_
The class ParseOptions is for parsing command-line options; see Parsing command-line options for more...
const TransitionModel & trans_model_
NnetOptimizeOptions optimize_config
int32 frames_left_context
Matrix< BaseFloat > current_log_post_
void Register(OptionsItf *opts)
DecodableNnetSimpleLooped decodable_nnet_
A class representing a vector.
class NnetComputer is responsible for executing the computation described in the "computation" object...
#define KALDI_ASSERT(cond)
ComputationRequest request3
BaseFloat GetOutput(int32 subsampled_frame, int32 pdf_id)
Provides a vector abstraction class.
virtual bool IsLastFrame(int32 frame) const
Returns true if this is the last frame.
NnetComputeOptions compute_config
When you instantiate class DecodableNnetSimpleLooped, you should give it a const reference to this cl...
CuVector< BaseFloat > log_priors
void Register(OptionsItf *opts)
int32 num_subsampled_frames_
const DecodableNnetSimpleLoopedInfo & info_