diff options
Diffstat (limited to 'training/crf/baum_welch_example/random_init.pl')
| -rwxr-xr-x | training/crf/baum_welch_example/random_init.pl | 9 | 
1 files changed, 9 insertions, 0 deletions
diff --git a/training/crf/baum_welch_example/random_init.pl b/training/crf/baum_welch_example/random_init.pl new file mode 100755 index 00000000..98467ed1 --- /dev/null +++ b/training/crf/baum_welch_example/random_init.pl @@ -0,0 +1,9 @@ +#!/usr/bin/perl -w +while(<>) { +  chomp; +  my ($a,$b,@d) =split /\s+/; +  die "Bad input" if scalar @d > 0; +  $r = -rand() * rand() - 0.5; +  $r = 0 if $a =~ /^Uni:/; +  print "$a $r\n"; +}  | 
