widen-nnet.h
Go to the documentation of this file.
1 // nnet2/widen-nnet.h
2 
3 // Copyright 2013 Johns Hopkins University (author: Daniel Povey)
4 
5 // See ../../COPYING for clarification regarding multiple authors
6 //
7 // Licensed under the Apache License, Version 2.0 (the "License");
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
10 //
11 // http://www.apache.org/licenses/LICENSE-2.0
12 //
13 // THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 // KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
15 // WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
16 // MERCHANTABLITY OR NON-INFRINGEMENT.
17 // See the Apache 2 License for the specific language governing permissions and
18 // limitations under the License.
19 
20 #ifndef KALDI_NNET2_WIDEN_NNET_H_
21 #define KALDI_NNET2_WIDEN_NNET_H_
22 
23 #include "nnet2/nnet-update.h"
24 #include "nnet2/nnet-compute.h"
25 #include "itf/options-itf.h"
26 
27 namespace kaldi {
28 namespace nnet2 {
29 
37 
38  NnetWidenConfig(): hidden_layer_dim(-1),
39  param_stddev_factor(1.0),
40  bias_stddev(0.5) { }
41 
42  void Register(OptionsItf *opts) {
43  opts->Register("hidden-layer-dim", &hidden_layer_dim, "[required option]: "
44  "target dimension of hidden layers");
45  opts->Register("param-stddev-factor", &param_stddev_factor, "Factor in "
46  "standard deviation of linear parameters of new part of "
47  "transform (multiply by 1/sqrt of input-dim)");
48  opts->Register("bias-stddev", &bias_stddev, "Standard deviation of added "
49  "bias parameters");
50  }
51 };
52 
57 void WidenNnet(const NnetWidenConfig &widen_config,
58  Nnet *nnet);
59 
60 
61 
62 } // namespace nnet2
63 } // namespace kaldi
64 
65 #endif
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
Definition: chain.dox:20
kaldi::int32 int32
virtual void Register(const std::string &name, bool *ptr, const std::string &doc)=0
void Register(OptionsItf *opts)
Definition: widen-nnet.h:42
Configuration class that controls neural net "widening", which means increasing the dimension of the ...
Definition: widen-nnet.h:33
This header provides functionality for sample-by-sample stochastic gradient descent and gradient comp...
void WidenNnet(const NnetWidenConfig &widen_config, Nnet *nnet)
This function widens a neural network by increasing the hidden-layer dimensions to the target...
Definition: widen-nnet.cc:62