nnet-functions.h
Go to the documentation of this file.
1 // nnet2/nnet-functions.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_FUNCTIONS_H_
21 #define KALDI_NNET2_NNET_FUNCTIONS_H_
22 
23 #include "base/kaldi-common.h"
24 #include "util/kaldi-io.h"
25 #include "matrix/matrix-lib.h"
26 #include "nnet2/nnet-component.h"
27 #include "nnet2/nnet-nnet.h"
28 
29 #include <iostream>
30 #include <sstream>
31 #include <vector>
32 
33 
34 namespace kaldi {
35 namespace nnet2 {
36 
37 // Here we declare various functions for manipulating the neural net,
38 // such as adding new hidden layers; we'll add things like "mixing up"
39 // to here.
40 
41 
44 int32 IndexOfSoftmaxLayer(const Nnet &nnet);
45 
51 void InsertComponents(const Nnet &src_nnet,
52  int32 c,
53  Nnet *dest_nnet);
54 
59 void ReplaceLastComponents(const Nnet &src_nnet,
60  int32 num_to_remove,
61  Nnet *dest_nnet);
62 
63 
64 
65 } // namespace nnet2
66 } // namespace kaldi
67 
68 #endif
69 
70 
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
Definition: chain.dox:20
int32 IndexOfSoftmaxLayer(const Nnet &nnet)
If "nnet" has exactly one softmax layer, this function will return its index; otherwise it will retur...
kaldi::int32 int32
void ReplaceLastComponents(const Nnet &src_nnet, int32 num_to_remove, Nnet *dest_nnet)
Removes the last "num_to_remove" components and adds the components from "src_nnet".
void InsertComponents(const Nnet &src_nnet, int32 c_to_insert, Nnet *dest_nnet)
Inserts the components of one neural network into a particular place in the other one...