nnet-update-parallel.h
Go to the documentation of this file.
1 // nnet2/nnet-update-parallel.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_UPDATE_PARALLEL_H_
21 #define KALDI_NNET2_NNET_UPDATE_PARALLEL_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 "itf/options-itf.h"
28 #include "nnet2/nnet-update.h"
29 
30 namespace kaldi {
31 namespace nnet2 {
32 
33 
48 double DoBackpropParallel(const Nnet &nnet,
49  int32 minibatch_size,
50  SequentialNnetExampleReader *example_reader,
51  double *tot_weight,
52  Nnet *nnet_to_update);
53 
54 
57 double DoBackpropParallel(const Nnet &nnet,
58  int32 minibatch_size,
59  int32 num_threads,
60  const std::vector<NnetExample> &examples,
61  double *num_frames,
62  Nnet *nnet_to_update);
63 
64 
65 
72  const Nnet &nnet,
73  int32 minibatch_size,
74  int32 num_threads,
75  const std::vector<NnetExample> &examples,
76  double *num_frames) {
77  return DoBackpropParallel(nnet, minibatch_size, num_threads,
78  examples, num_frames, NULL);
79 }
80 
81 
82 
83 
84 
85 } // namespace nnet2
86 } // namespace kaldi
87 
88 #endif // KALDI_NNET2_NNET_UPDATE_PARALLEL_H_
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
Definition: chain.dox:20
SequentialTableReader< KaldiObjectHolder< NnetExample > > SequentialNnetExampleReader
Definition: nnet-example.h:93
kaldi::int32 int32
double ComputeNnetObjfParallel(const Nnet &nnet, int32 minibatch_size, int32 num_threads, const std::vector< NnetExample > &examples, double *num_frames)
This is basically to clarify the fact that DoBackpropParallel will also work with nnet_to_update == N...
This header provides functionality for sample-by-sample stochastic gradient descent and gradient comp...
double DoBackpropParallel(const Nnet &nnet, int32 minibatch_size, SequentialNnetExampleReader *examples_reader, double *tot_weight, Nnet *nnet_to_update)
This function is similar to "DoBackprop" in nnet-update.h This function computes the objective functi...