21 #ifndef KALDI_NNET3_NNET_DISCRIMINATIVE_EXAMPLE_H_ 22 #define KALDI_NNET3_NNET_DISCRIMINATIVE_EXAMPLE_H_ 90 void Write(std::ostream &os,
bool binary)
const;
92 void Read(std::istream &is,
bool binary);
112 std::vector<NnetDiscriminativeSupervision>
outputs;
114 void Write(std::ostream &os,
bool binary)
const;
116 void Read(std::istream &is,
bool binary);
153 return (*
this)(*a, *b);
170 std::vector<NnetDiscriminativeExample> *input,
177 const std::vector<const NnetDiscriminativeSupervision*> &inputs,
196 const std::vector<std::string> &exclude_names,
208 bool need_model_derivative,
209 bool store_component_stats,
210 bool use_xent_regularization,
211 bool use_xent_derivative,
231 NnetDiscriminativeExampleWriter *writer);
254 void WriteMinibatch(std::vector<NnetDiscriminativeExample> *egs);
264 std::vector<NnetDiscriminativeExample*>,
274 #endif // KALDI_NNET3_NNET_DISCRIMINATIVE_EXAMPLE_H_
void ShiftDiscriminativeExampleTimes(int32 frame_shift, const std::vector< std::string > &exclude_names, NnetDiscriminativeExample *eg)
Shifts the time-index t of everything in the input of "eg" by adding "t_offset" to all "t" values– b...
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
This class is responsible for storing, and displaying in log messages, statistics about how examples ...
NnetDiscriminativeExampleWriter * writer_
This class is responsible for arranging examples in groups that have the same strucure (i...
static void MergeSupervision(const std::vector< const NnetChainSupervision *> &inputs, NnetChainSupervision *output)
~DiscriminativeExampleMerger()
A templated class for writing objects to an archive or script file; see The Table concept...
This hashing object hashes just the structural aspects of the NnetExample without looking at the valu...
The two main classes defined in this header are struct ComputationRequest, which basically defines a ...
Allows random access to a collection of objects in an archive or script file; see The Table concept...
int32 GetDiscriminativeNnetExampleSize(const NnetDiscriminativeExample &a)
This function returns the 'size' of a discriminative example as defined for purposes of merging egs...
NnetDiscriminativeSupervision()
void Write(std::ostream &os, bool binary) const
A templated class for reading objects sequentially from an archive or script file; see The Table conc...
void Swap(NnetDiscriminativeSupervision *other)
TableWriter< KaldiObjectHolder< NnetDiscriminativeExample > > NnetDiscriminativeExampleWriter
ExampleMergingStats stats_
NnetDiscriminativeExample()
std::vector< Index > indexes
A class representing a vector.
Vector< BaseFloat > deriv_weights
std::vector< NnetIo > inputs
'inputs' contains the input to the network– normally just it has just one element called "input"...
std::vector< NnetDiscriminativeSupervision > outputs
'outputs' contains the sequence output supervision.
void MergeDiscriminativeExamples(bool compress, std::vector< NnetDiscriminativeExample > *input, NnetDiscriminativeExample *output)
void GetDiscriminativeComputationRequest(const Nnet &nnet, const NnetDiscriminativeExample &eg, bool need_model_derivative, bool store_component_stats, bool use_xent_regularization, bool use_xent_derivative, ComputationRequest *request)
This function takes a NnetDiscriminativeExample and produces a ComputationRequest.
bool operator==(const NnetDiscriminativeSupervision &other) const
RandomAccessTableReader< KaldiObjectHolder< NnetDiscriminativeExample > > RandomAccessNnetDiscriminativeExampleReader
unordered_map< NnetDiscriminativeExample *, std::vector< NnetDiscriminativeExample * >, NnetDiscriminativeExampleStructureHasher, NnetDiscriminativeExampleStructureCompare > MapType
This comparator object compares just the structural aspects of the NnetDiscriminativeExample without ...
const ExampleMergingConfig & config_
Provides a vector abstraction class.
discriminative::DiscriminativeSupervision supervision
NnetDiscriminativeExample is like NnetExample, but specialized for sequence training.
void Read(std::istream &is, bool binary)
SequentialTableReader< KaldiObjectHolder< NnetDiscriminativeExample > > SequentialNnetDiscriminativeExampleReader