#include <am-nnet.h>
Public Member Functions | |
AmNnet () | |
AmNnet (const AmNnet &other) | |
AmNnet (const Nnet &nnet) | |
void | Init (std::istream &config_is) |
Initialize the neural network based acoustic model from a config file. More... | |
void | Init (const Nnet &nnet) |
Initialize from a neural network that's already been set up. More... | |
int32 | NumPdfs () const |
void | Write (std::ostream &os, bool binary) const |
void | Read (std::istream &is, bool binary) |
const Nnet & | GetNnet () const |
Nnet & | GetNnet () |
void | SetPriors (const VectorBase< BaseFloat > &priors) |
const VectorBase< BaseFloat > & | Priors () const |
std::string | Info () const |
void | ResizeOutputLayer (int32 new_num_pdfs) |
This function is used when doing transfer learning to a new system. More... | |
Private Member Functions | |
const AmNnet & | operator= (const AmNnet &other) |
Private Attributes | |
Nnet | nnet_ |
Vector< BaseFloat > | priors_ |
|
inline |
Definition at line 61 of file am-nnet.h.
References AmNnet::nnet_.
Referenced by NnetDiscriminativeUpdater::Backprop(), DecodableNnet2Online::ComputeForFrame(), DecodableAmNnet::DecodableAmNnet(), NnetDiscriminativeUpdater::GetInputFeatures(), NnetDiscriminativeUpdater::LatticeComputations(), main(), kaldi::nnet2::NnetDiscriminativeUpdateParallel(), NnetDiscriminativeUpdater::NnetDiscriminativeUpdater(), NnetDiscriminativeUpdater::Propagate(), and SingleUtteranceNnet2DecoderThreaded::RunNnetEvaluationInternal().
|
inline |
std::string Info | ( | ) | const |
Definition at line 57 of file am-nnet.cc.
References Nnet::Info(), AmNnet::nnet_, and AmNnet::priors_.
Referenced by main(), and AmNnet::Priors().
void Init | ( | std::istream & | config_is | ) |
Initialize the neural network based acoustic model from a config file.
At this point the priors won't be initialized; you'd have to do SetPriors for that.
Definition at line 26 of file am-nnet.cc.
References Nnet::Init(), and AmNnet::nnet_.
Referenced by AmNnet::AmNnet(), and main().
void Init | ( | const Nnet & | nnet | ) |
Initialize from a neural network that's already been set up.
Again, the priors will be empty at this point.
Definition at line 67 of file am-nnet.cc.
References KALDI_WARN, AmNnet::nnet_, Nnet::OutputDim(), and AmNnet::priors_.
|
inline |
Definition at line 55 of file am-nnet.h.
References AmNnet::nnet_, Nnet::OutputDim(), AmNnet::Read(), and AmNnet::Write().
Referenced by main(), kaldi::nnet2::SetPriors(), and AmNnet::SetPriors().
Referenced by AmNnet::Priors().
|
inline |
Definition at line 67 of file am-nnet.h.
References AmNnet::Info(), AmNnet::operator=(), AmNnet::priors_, and AmNnet::ResizeOutputLayer().
Referenced by DecodableAmNnet::DecodableAmNnet(), DecodableNnet2Online::DecodableNnet2Online(), NnetDiscriminativeUpdater::LatticeComputations(), main(), and SingleUtteranceNnet2DecoderThreaded::RunNnetEvaluationInternal().
void Read | ( | std::istream & | is, |
bool | binary | ||
) |
Definition at line 39 of file am-nnet.cc.
References AmNnet::nnet_, AmNnet::priors_, and Nnet::Read().
Referenced by main(), AmNnet::NumPdfs(), and kaldi::nnet2::UnitTestAmNnet().
void ResizeOutputLayer | ( | int32 | new_num_pdfs | ) |
This function is used when doing transfer learning to a new system.
It will set the priors to be all the same.
Definition at line 76 of file am-nnet.cc.
References AmNnet::nnet_, AmNnet::priors_, and Nnet::ResizeOutputLayer().
Referenced by main(), and AmNnet::Priors().
void SetPriors | ( | const VectorBase< BaseFloat > & | priors | ) |
Definition at line 44 of file am-nnet.cc.
References KALDI_ERR, KALDI_WARN, kaldi::kCopyData, AmNnet::NumPdfs(), and AmNnet::priors_.
Referenced by AmNnet::GetNnet(), main(), kaldi::nnet2::SetPriors(), kaldi::nnet2::UnitTestAmNnet(), and kaldi::nnet2::UnitTestNnetDecodable().
void Write | ( | std::ostream & | os, |
bool | binary | ||
) | const |
Definition at line 31 of file am-nnet.cc.
References AmNnet::nnet_, AmNnet::priors_, and Nnet::Write().
Referenced by main(), AmNnet::NumPdfs(), and kaldi::nnet2::UnitTestAmNnet().
|
private |
Definition at line 77 of file am-nnet.h.
Referenced by AmNnet::GetNnet(), AmNnet::Info(), AmNnet::Init(), AmNnet::NumPdfs(), AmNnet::Read(), AmNnet::ResizeOutputLayer(), and AmNnet::Write().
Definition at line 78 of file am-nnet.h.
Referenced by AmNnet::Info(), AmNnet::Init(), AmNnet::Priors(), AmNnet::Read(), AmNnet::ResizeOutputLayer(), AmNnet::SetPriors(), and AmNnet::Write().