nnet-compute.h
Go to the documentation of this file.
1 // nnet2/nnet-compute.h
2 
3 // Copyright 2012 Johns Hopkins University (author: Daniel Povey)
4 // Copyright 2015 David Snyder
5 
6 // See ../../COPYING for clarification regarding multiple authors
7 //
8 // Licensed under the Apache License, Version 2.0 (the "License");
9 // you may not use this file except in compliance with the License.
10 // You may obtain a copy of the License at
11 //
12 // http://www.apache.org/licenses/LICENSE-2.0
13 //
14 // THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 // KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
16 // WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
17 // MERCHANTABLITY OR NON-INFRINGEMENT.
18 // See the Apache 2 License for the specific language governing permissions and
19 // limitations under the License.
20 
21 #ifndef KALDI_NNET2_NNET_COMPUTE_H_
22 #define KALDI_NNET2_NNET_COMPUTE_H_
23 
24 #include "nnet2/nnet-nnet.h"
25 
26 namespace kaldi {
27 namespace nnet2 {
28 
29 /* This header provides functionality for doing forward computation and
30  backpropagation for whole chunks of features, e.g. whole utterances. The
31  code in nnet-update.h is designed for sample-by-sample computation.
32 */
33 
34 
45 void NnetComputation(const Nnet &nnet,
46  const CuMatrixBase<BaseFloat> &input, // features
47  bool pad_input,
48  CuMatrixBase<BaseFloat> *output); // posteriors.
58 void NnetComputationChunked(const Nnet &nnet,
59  const CuMatrixBase<BaseFloat> &input, // features
60  int32 chunk_size,
61  CuMatrixBase<BaseFloat> *output); // posteriors.
62 
73 BaseFloat NnetGradientComputation(const Nnet &nnet,
74  const MatrixBase<BaseFloat> &input,
75  bool pad_input,
76  BaseFloat utterance_weight,
77  const std::vector<int32> &labels,
78  Nnet *nnet_to_update);
79 
80 
81 
82 } // namespace nnet2
83 } // namespace kaldi
84 
85 #endif // KALDI_NNET2_NNET_COMPUTE_H_
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
Definition: chain.dox:20
kaldi::int32 int32
void NnetComputationChunked(const Nnet &nnet, const CuMatrixBase< BaseFloat > &input, int32 chunk_size, CuMatrixBase< BaseFloat > *output)
Does the basic neural net computation, on a sequence of data (e.g.
void NnetComputation(const Nnet &nnet, const CuMatrixBase< BaseFloat > &input, bool pad_input, CuMatrixBase< BaseFloat > *output)
Does the basic neural net computation, on a sequence of data (e.g.
float BaseFloat
Definition: kaldi-types.h:29
BaseFloat NnetGradientComputation(const Nnet &nnet, const CuMatrixBase< BaseFloat > &input, bool pad_input, const Posterior &pdf_post, Nnet *nnet_to_update)