summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0d62760)
raw | patch | inline | side by side (parent: 0d62760)
author | Kirill Katsnelson <kkm@pobox.com> | |
Wed, 28 Jun 2017 00:33:51 +0000 (17:33 -0700) | ||
committer | Daniel Povey <dpovey@gmail.com> | |
Wed, 28 Jun 2017 00:33:51 +0000 (20:33 -0400) |
Fix Perl warninig "Unescaped left brace in regex is deprecated." This use
has been deprecated in Perl 5.22, and would become an erorr in 5.26.
http://search.cpan.org/dist/perl-5.22.0/pod/perldelta.pod#A_literal_%22{%22_should_now_be_escaped_in_a_pattern
https://unix.stackexchange.com/a/238708/103076
The use of [{] vs. \{ is probably the most backward-compatible.
has been deprecated in Perl 5.22, and would become an erorr in 5.26.
http://search.cpan.org/dist/perl-5.22.0/pod/perldelta.pod#A_literal_%22{%22_should_now_be_escaped_in_a_pattern
https://unix.stackexchange.com/a/238708/103076
The use of [{] vs. \{ is probably the most backward-compatible.
egs/wsj/s5/steps/nnet3/get_saturation.pl | patch | blob | history |
index 5c59d9e5520946276d00b6c4faa6f8c7763d8124..d99a88325176cf10b05960b9bb4612b1616fc47f 100755 (executable)
# An example of a line like this is right at the bottom of this program, it's extremely long.
my $ok = 1;
foreach my $sigmoid_name ( ("i_t", "f_t", "o_t") ) {
- if (m/${sigmoid_name}_sigmoid={[^}]+deriv-avg=[^}]+mean=([^,]+),/) {
+ if (m/${sigmoid_name}_sigmoid=[{][^}]+deriv-avg=[^}]+mean=([^,]+),/) {
$num_nonlinearities += 1;
my $this_saturation = 1.0 - ($1 / 0.25);
$total_saturation += $this_saturation;
}
}
foreach my $tanh_name ( ("c_t", "m_t") ) {
- if (m/${tanh_name}_tanh={[^}]+deriv-avg=[^}]+mean=([^,]+),/) {
+ if (m/${tanh_name}_tanh=[{][^}]+deriv-avg=[^}]+mean=([^,]+),/) {
$num_nonlinearities += 1;
my $this_saturation = 1.0 - ($1 / 1.0);
$total_saturation += $this_saturation;