32 std::vector<std::string> configs;
35 for (
size_t j = 0;
j < configs.size();
j++) {
36 KALDI_LOG <<
"Input config[" <<
j <<
"] is: " << configs[
j];
37 std::istringstream is(configs[
j]);
42 std::vector<Matrix<BaseFloat> > inputs;
45 request.
Print(std::cerr);
53 std::ostringstream os;
54 computation.
Print(os, nnet);
55 KALDI_LOG <<
"Generated computation is: " << os.str();
68 std::vector<std::string> configs;
71 for (
size_t j = 0;
j < configs.size();
j++) {
72 KALDI_LOG <<
"Input config[" <<
j <<
"] is: " << configs[
j];
73 std::istringstream is(configs[
j]);
78 std::vector<Matrix<BaseFloat> > inputs1, inputs2;
84 request1.
Print(std::cerr);
86 request2.
Print(std::cerr);
88 std::vector<const ComputationRequest*> requests;
92 requests.push_back(&request1);
93 requests.push_back(&request2);
100 request2.
inputs[
i].indexes[
j].x = 1;
110 compiler.CreateComputation(opts, &computation);
112 std::ostringstream os;
113 computation.Print(os, nnet);
114 KALDI_LOG <<
"Generated computation is: " << os.str();
125 std::vector<std::string> configs;
128 for (
size_t j = 0;
j < configs.size();
j++) {
129 KALDI_LOG <<
"Input config[" <<
j <<
"] is: " << configs[
j];
130 std::istringstream is(configs[
j]);
137 extra_left_context_begin =
RandInt(0, 10),
138 extra_right_context =
RandInt(0, 10),
142 ivector_period = chunk_size;
147 KALDI_LOG <<
"Nnet info after modifying ivector period is: " 150 nnet, chunk_size, frame_subsampling_factor,
151 ivector_period, extra_left_context_begin, extra_right_context,
152 num_sequences, &request1, &request2, &request3);
154 KALDI_LOG <<
"Computation request 1 is:";
155 request1.
Print(std::cerr);
156 KALDI_LOG <<
"Computation request 2 is:";
157 request2.
Print(std::cerr);
158 KALDI_LOG <<
"Computation request 3 is:";
159 request3.
Print(std::cerr);
165 request1, request2, request3,
167 KALDI_LOG <<
"Compiled looped computation is ";
168 computation.
Print(std::cerr, nnet);
178 using namespace kaldi;
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
void ModifyNnetIvectorPeriod(int32 ivector_period, Nnet *nnet)
This function modifies the descriptors in the neural network to change the periodicity with which it ...
bool store_component_stats
you should set need_component_stats to true if you need the average-activation and average-derivative...
void ReadConfig(std::istream &config_file)
bool need_model_derivative
if need_model_derivative is true, then we'll be doing either model training or model-derivative compu...
int32 GetChunkSize(const Nnet &nnet, int32 frame_subsampling_factor, int32 advised_chunk_size)
This file contains various routines that are useful in test code.
void Print(std::ostream &os, const Nnet &nnet) const
std::vector< IoSpecification > inputs
std::string Info() const
returns some human-readable information about the network, mostly for debugging purposes.
void SetVerboseLevel(int32 i)
This should be rarely used, except by programs using Kaldi as library; command-line programs set the ...
void UnitTestNnetCompileLooped()
void ComputeExampleComputationRequestSimple(const Nnet &nnet, ComputationRequest *request, std::vector< Matrix< BaseFloat > > *inputs)
This function computes an example computation request, for testing purposes.
void CompileLooped(const Nnet &nnet, const NnetOptimizeOptions &optimize_opts, const ComputationRequest &request1, const ComputationRequest &request2, const ComputationRequest &request3, NnetComputation *computation)
CompileLooped() provides an internal interface for 'looped' computation.
void CreateLoopedComputationRequestSimple(const Nnet &nnet, int32 chunk_size, int32 frame_subsampling_factor, int32 ivector_period, int32 extra_left_context_begin, int32 extra_right_context, int32 num_sequences, ComputationRequest *request1, ComputationRequest *request2, ComputationRequest *request3)
This function is deprecated.
void CreateComputation(const CompilerOptions &opts, NnetComputation *computation)
std::vector< IoSpecification > outputs
void UnitTestNnetCompileMulti()
This class creates an initial version of the NnetComputation, without any optimization or sharing of ...
void UnitTestNnetCompile()
void GenerateConfigSequence(const NnetGenerationOptions &opts, std::vector< std::string > *configs)
Generates a sequence of at least one config files, output as strings, where the first in the sequence...
void Print(std::ostream &os) const
This function is for printing info about the computation request in a human-readable way...
int32 RandInt(int32 min_val, int32 max_val, struct RandomState *state)