train-nnet.h
Go to the documentation of this file.
1 // nnet2/train-nnet.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_TRAIN_NNET_H_
21 #define KALDI_NNET2_TRAIN_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 
30 
34 
35  NnetSimpleTrainerConfig(): minibatch_size(500),
36  minibatches_per_phase(50) { }
37 
38  void Register (OptionsItf *opts) {
39  opts->Register("minibatch-size", &minibatch_size,
40  "Number of samples per minibatch of training data.");
41  opts->Register("minibatches-per-phase", &minibatches_per_phase,
42  "Number of minibatches to wait before printing training-set "
43  "objective.");
44  }
45 };
46 
47 
55 int64 TrainNnetSimple(const NnetSimpleTrainerConfig &config,
56  Nnet *nnet,
58  double *tot_weight = NULL,
59  double *tot_logprob = NULL);
60 
61 } // namespace nnet2
62 } // namespace kaldi
63 
64 #endif
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
Definition: chain.dox:20
void Register(OptionsItf *opts)
Definition: train-nnet.h:38
kaldi::int32 int32
virtual void Register(const std::string &name, bool *ptr, const std::string &doc)=0
int64 TrainNnetSimple(const NnetSimpleTrainerConfig &config, Nnet *nnet, SequentialNnetExampleReader *reader, double *tot_weight_ptr, double *tot_logprob_ptr)
Train on all the examples it can read from the reader.
Definition: train-nnet.cc:147
A templated class for reading objects sequentially from an archive or script file; see The Table conc...
Definition: kaldi-table.h:287
This header provides functionality for sample-by-sample stochastic gradient descent and gradient comp...