MaxChangeStats Struct Reference

#include <nnet-utils.h>

Collaboration diagram for MaxChangeStats:

Public Member Functions

 MaxChangeStats (const Nnet &nnet)
 
void Print (const Nnet &nnet) const
 

Public Attributes

int32 num_max_change_global_applied
 
int32 num_minibatches_processed
 
std::vector< int32num_max_change_per_component_applied
 

Detailed Description

Definition at line 540 of file nnet-utils.h.

Constructor & Destructor Documentation

◆ MaxChangeStats()

MaxChangeStats ( const Nnet nnet)
inline

Definition at line 545 of file nnet-utils.h.

References fst::Print().

545  :
std::vector< int32 > num_max_change_per_component_applied
Definition: nnet-utils.h:543
int32 NumUpdatableComponents(const Nnet &dest)
Returns the number of updatable components in the nnet.
Definition: nnet-utils.cc:422

Member Function Documentation

◆ Print()

void Print ( const Nnet nnet) const

Definition at line 2284 of file nnet-utils.cc.

References Nnet::GetComponent(), Nnet::GetComponentName(), rnnlm::i, KALDI_ERR, KALDI_LOG, kaldi::nnet3::kUpdatableComponent, Nnet::NumComponents(), and Component::Properties().

Referenced by NnetChainTrainer::PrintTotalStats(), and NnetTrainer::PrintTotalStats().

2284  {
2285  int32 i = 0;
2286  for (int32 c = 0; c < nnet.NumComponents(); c++) {
2287  const Component *comp = nnet.GetComponent(c);
2288  if (comp->Properties() & kUpdatableComponent) {
2289  const UpdatableComponent *uc = dynamic_cast<const UpdatableComponent*>(
2290  comp);
2291  if (uc == NULL)
2292  KALDI_ERR << "Updatable component does not inherit from class "
2293  << "UpdatableComponent; change this code.";
2295  KALDI_LOG << "For " << nnet.GetComponentName(c)
2296  << ", per-component max-change was enforced "
2297  << ((100.0 * num_max_change_per_component_applied[i]) /
2299  << " \% of the time.";
2300  i++;
2301  }
2302  }
2304  KALDI_LOG << "The global max-change was enforced "
2305  << ((100.0 * num_max_change_global_applied) /
2307  << " \% of the time.";
2308 }
std::vector< int32 > num_max_change_per_component_applied
Definition: nnet-utils.h:543
kaldi::int32 int32
#define KALDI_ERR
Definition: kaldi-error.h:147
#define KALDI_LOG
Definition: kaldi-error.h:153

Member Data Documentation

◆ num_max_change_global_applied

int32 num_max_change_global_applied

Definition at line 541 of file nnet-utils.h.

Referenced by kaldi::nnet3::UpdateNnetWithMaxChange().

◆ num_max_change_per_component_applied

std::vector<int32> num_max_change_per_component_applied

Definition at line 543 of file nnet-utils.h.

Referenced by kaldi::nnet3::UpdateNnetWithMaxChange().

◆ num_minibatches_processed

int32 num_minibatches_processed

Definition at line 542 of file nnet-utils.h.

Referenced by kaldi::nnet3::UpdateNnetWithMaxChange().


The documentation for this struct was generated from the following files: