20 #ifndef KALDI_NNET3_NNET_COMPILE_H_ 21 #define KALDI_NNET3_NNET_COMPILE_H_ 52 Compiler(
const std::vector<const ComputationRequest*> &request,
110 StepInfo(): node_index(-1), value(0), deriv(0), segment(0),
111 precomputed_indexes_index(0) { }
119 void ComputeStepDependencies(
const std::vector<int32> &this_step,
121 unordered_set<int32> *dep_steps);
132 void ComputeDerivNeeded(
const std::vector<std::vector<int32> > &steps,
133 const std::vector<int32> &step_to_segment,
134 std::vector<bool> *deriv_needed);
140 void CreateStepInfo(
const std::vector<bool> &deriv_needed,
141 const std::vector<int32> &step_to_segment,
142 std::vector<std::vector<int32> > *by_step,
175 void AllocateMatrices(
const std::vector<int32> &whole_submatrices,
180 void SetUpPrecomputedIndexes(
const std::vector<int32> &step_to_segment,
197 bool IsInputStep(
int32 step)
const;
202 void CompileForwardDescriptor(
205 void CompileForwardSumDescriptor(
216 void ComputeInputLocationsList(
218 std::vector<std::vector<std::pair<int32, int32> > > *input_locations)
274 const std::vector<std::vector<std::pair<int32,int32> > > &input_locations_list,
276 std::vector<std::vector<std::pair<int32,int32> > > > >
277 *split_locations_lists)
const;
282 void ComputeValueSubmatLocationsList(
283 const std::vector<std::vector<std::pair<int32, int32> > > &input_locations_list,
284 std::vector<std::vector<std::pair<int32, int32> > > *submat_locations_list)
295 void ComputeDerivSubmatLocationsList(
296 const std::vector<std::vector<std::pair<int32, int32> > > &input_locations_list,
297 std::vector<std::vector<std::pair<int32, int32> > > *submat_locations_list)
317 void CompileForwardFromSubmatLocationsList(
318 int32 value_submatrix_index,
320 const std::vector<std::vector<std::pair<int32, int32> > > &submat_locations,
341 void CompileForwardFromSubmatLocations(
342 int32 value_submatrix_index,
344 const std::vector<std::pair<int32, int32> > &submat_locations,
353 void CompileForwardFromIndexes(
354 int32 value_submatrix_index,
355 int32 input_submatrix_index,
357 const std::vector<int32> &indexes,
376 void CompileBackwardDescriptor(
380 void CompileBackwardSumDescriptor(
385 void CompileBackwardFromSubmatLocationsList(
386 int32 deriv_submatrix_index,
388 const std::vector<std::vector<std::pair<int32, int32> > >&submat_locations,
392 void CompileBackwardFromSubmatLocations(
393 int32 deriv_submatrix_index,
395 const std::vector<std::pair<int32, int32> > &submat_locations,
400 void CompileBackwardFromIndexes(
401 int32 deriv_submatrix_index,
402 int32 input_deriv_submatrix_index,
404 const std::vector<int32> &indexes,
415 void DeallocateMatrices(
const std::vector<int32> &whole_submatrices,
416 const std::vector<int32> &step_to_segment,
422 void AddCommands(
const std::vector<bool> &deriv_needed,
423 const std::vector<int32> &step_to_segment,
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
std::vector< Index > output_indexes
int32 precomputed_indexes_index
std::vector< std::vector< std::vector< std::pair< int32, int32 > > > > input_locations_list
The two main classes defined in this header are struct ComputationRequest, which basically defines a ...
This is an abstract base-class.
std::vector< int32 > value_parts
std::vector< int32 > output_cindex_ids
std::vector< int32 > deriv_parts
std::vector< StepInfo > steps_
std::vector< const ComputationRequest * > requests_
This class creates an initial version of the NnetComputation, without any optimization or sharing of ...
std::vector< std::pair< int32, int32 > > cindex_id_to_location_
This maps each cindex_id to its location.
The first step in compilation is to turn the ComputationSpecification into a ComputationGraph, where for each Cindex we have a list of other Cindexes that it depends on.