From ec3d8418c9e6fe2a7c5f1f3fafdd28e3658c3905 Mon Sep 17 00:00:00 2001 From: Chris Dyer Date: Mon, 11 Feb 2013 21:14:10 -0500 Subject: Baum Welch training for HMMs --- training/crf/baum_welch_example/random_init.pl | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100755 training/crf/baum_welch_example/random_init.pl (limited to 'training/crf/baum_welch_example/random_init.pl') 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"; +} -- cgit v1.2.3