@@ -300,6 +300,15 @@ void SetNnetAsGradient(Nnet *nnet) {
300300 }
301301}
302302
303+ void SetRequireDirectInput (bool b, Nnet *nnet) {
304+ for (int32 c = 0 ; c < nnet->NumComponents (); c++) {
305+ Component *comp = nnet->GetComponent (c);
306+ if (dynamic_cast <StatisticsPoolingComponent*>(comp) != NULL )
307+ dynamic_cast <StatisticsPoolingComponent*>(comp)->SetRequireDirectInput (b);
308+ }
309+ }
310+
311+
303312void ScaleNnet (BaseFloat scale, Nnet *nnet) {
304313 if (scale == 1.0 ) return ;
305314 else {
@@ -724,7 +733,7 @@ class SvdApplier {
724733 << " components to FixedAffineComponent." ;
725734 }
726735
727- // This function finds the minimum index of
736+ // This function finds the minimum index of
728737 // the Descending order sorted [input_vector],
729738 // over a range of indices from [lower] to [upper] index,
730739 // for which the sum of elements upto the found min. index is greater
@@ -743,7 +752,7 @@ class SvdApplier {
743752 }
744753 return (i+1 );
745754 }
746-
755+
747756// Here we perform SVD based refactorig of an input Affine component.
748757// After applying SVD , we sort the Singularity values in descending order,
749758// and take the subset of values which contribute to energy_threshold times
@@ -777,7 +786,7 @@ class SvdApplier {
777786 if (energy_threshold_ > 0 ) {
778787 BaseFloat min_singular_sum = energy_threshold_ * s2_sum_orig;
779788 bottleneck_dim_ = GetReducedDimension (s2, 0 , s2.Dim ()-1 , min_singular_sum);
780- }
789+ }
781790 SubVector<BaseFloat> this_part (s2, 0 , bottleneck_dim_);
782791 BaseFloat s2_sum_reduced = this_part.Sum ();
783792 BaseFloat shrinkage_ratio =
0 commit comments