diff options
author | Chris Dyer <cdyer@allegro.clab.cs.cmu.edu> | 2013-02-11 21:14:10 -0500 |
---|---|---|
committer | Chris Dyer <cdyer@allegro.clab.cs.cmu.edu> | 2013-02-11 21:14:10 -0500 |
commit | d0a7c74b5d5e8aaf53d3241e09f1bda75bf0e1cc (patch) | |
tree | 7535ceae66478e67819b9545565ee16143a8f6e0 /training/crf/baum_welch_example/random_init.pl | |
parent | 06d8ec4c0dc2bbf3c8066d3a284a04290ff6a169 (diff) |
Baum Welch training for HMMs
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"; +} |