Skip to content

Commit

Permalink
[scripts] Fix to get_saturation.pl, to regex bug introduced around Ja…
Browse files Browse the repository at this point in the history
…n 1 2018. Affects shrinkage of recurrent nnets. (kaldi-asr#2371)
  • Loading branch information
danpovey committed Apr 19, 2018
1 parent 4abdb5b commit 5a48ad4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions egs/wsj/s5/steps/nnet3/get_saturation.pl
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@
# deriv-avg=[percentiles(0,1,2,5 10,20,50,80,90
# 95,98,99,100)=(0.0001,0.003,0.004,0.03 0.12,0.18,0.22,0.24,0.25
# 0.25,0.25,0.25,0.25), mean=0.198, stddev=0.0591]
if (m/deriv-avg=.+mean=([^,]+),/) {
if (m/deriv-avg=[^m]+mean=([^,]+),/) {
$num_nonlinearities += 1;
my $this_saturation = 1.0 - ($1 / 0.25);
$total_saturation += $this_saturation;
} else {
print STDERR "$0: could not make sense of line (no deriv-avg?): $_";
}
} elsif (m/type=TanhComponent/) {
if (m/deriv-avg=.+mean=([^,]+),/) {
if (m/deriv-avg=[^m]+mean=([^,]+),/) {
$num_nonlinearities += 1;
my $this_saturation = 1.0 - ($1 / 1.0);
$total_saturation += $this_saturation;
Expand Down

0 comments on commit 5a48ad4

Please sign in to comment.