nnet-limit-rank.h
Go to the documentation of this file.
1 // nnet2/nnet-limit-rank.h
2 
3 // Copyright 2012 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_NNET_LIMIT_RANK_H_
21 #define KALDI_NNET2_NNET_LIMIT_RANK_H_
22 
23 #include "nnet2/nnet-nnet.h"
24 #include "util/table-types.h"
25 #include "util/kaldi-semaphore.h"
26 #include "util/kaldi-thread.h"
27 #include "nnet2/nnet-update.h"
28 
29 namespace kaldi {
30 namespace nnet2 {
31 
35 
36  NnetLimitRankOpts(): num_threads(1), parameter_proportion(0.75) { }
37 
38  void Register(OptionsItf *opts) {
39  opts->Register("num-threads", &num_threads, "Number of threads used for "
40  "rank-limiting operation; note, will never use more than "
41  "#layers.");
42  opts->Register("parameter-proportion", &parameter_proportion, "Proportion of "
43  "dimension of each transform to limit the rank to.");
44  }
45 };
46 
47 
52 void LimitRankParallel(const NnetLimitRankOpts &opts,
53  Nnet *nnet);
54 
55 
57 
58 
59 } // namespace nnet2
60 } // namespace kaldi
61 
62 #endif // KALDI_NNET2_NNET_LIMIT_RANK_H_
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
Definition: chain.dox:20
void Register(OptionsItf *opts)
void LimitRankParallel(const NnetLimitRankOpts &opts, Nnet *nnet)
This function limits the rank of each affine transform in the neural net, by zeroing out the smallest...
kaldi::int32 int32
virtual void Register(const std::string &name, bool *ptr, const std::string &doc)=0
This header provides functionality for sample-by-sample stochastic gradient descent and gradient comp...