33 std::vector<std::string> configs;
36 std::istringstream is(configs[0]);
41 int32 left_context, right_context;
43 KALDI_LOG <<
"Left,right-context= " << left_context <<
"," 44 << right_context <<
" for config: " << configs[0];
53 "component name=repeated-affine1 type=RepeatedAffineComponent " 54 "input-dim=100 output-dim=200 num-repeats=20\n" 55 "component name=relu1 type=RectifiedLinearComponent dim=200\n" 56 "component name=block-affine1 type=BlockAffineComponent " 57 "input-dim=200 output-dim=100 num-blocks=10\n" 58 "component name=relu2 type=RectifiedLinearComponent dim=100\n" 59 "component name=repeated-affine2 type=NaturalGradientRepeatedAffineComponent " 60 "input-dim=100 output-dim=200 num-repeats=10\n" 62 "input-node name=input dim=100\n" 63 "component-node name=repeated-affine1 component=repeated-affine1 input=input\n" 64 "component-node name=relu1 component=relu1 input=repeated-affine1\n" 65 "component-node name=block-affine1 component=block-affine1 input=relu1\n" 66 "component-node name=relu2 component=relu2 component=relu2 input=block-affine1\n" 67 "component-node name=repeated-affine2 component=repeated-affine2 input=relu2\n" 68 "output-node name=output input=repeated-affine2\n";
71 std::istringstream is(config);
78 && c->
Type() !=
"NaturalGradientRepeatedAffineComponent");
87 std::vector<std::string> configs;
92 std::istringstream is(configs[0]);
107 using namespace kaldi;
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
void ReadConfig(std::istream &config_file)
Abstract base-class for neural-net components.
void UnitTestConvertRepeatedToBlockAffine()
This file contains various routines that are useful in test code.
CompositeComponent is a component representing a sequence of [simple] components. ...
void ConvertRepeatedToBlockAffine(CompositeComponent *c_component)
This file contains declarations of components that are "simple", meaning they don't care about the in...
void SetVerboseLevel(int32 i)
This should be rarely used, except by programs using Kaldi as library; command-line programs set the ...
void ComputeSimpleNnetContext(const Nnet &nnet, int32 *left_context, int32 *right_context)
ComputeSimpleNnetContext computes the left-context and right-context of a nnet.
void UnitTestConvertRepeatedToBlockAffineComposite()
std::string NnetInfo(const Nnet &nnet)
This function returns various info about the neural net.
void UnitTestNnetContext()
Component * GetComponent(int32 c)
Return component indexed c. Not a copy; not owned by caller.
int32 NumComponents() const
const Component * GetComponent(int32 i) const
Gets the ith component in this component.
virtual std::string Type() const =0
Returns a string such as "SigmoidComponent", describing the type of the object.
int32 NumComponents() const
#define KALDI_ASSERT(cond)
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 GenerateConfigSequenceCompositeBlock(const NnetGenerationOptions &opts, std::vector< std::string > *configs)
Generate a config string with a composite component composed only of block affine, repeated affine, and natural gradient repeated affine components.