From d0a7c74b5d5e8aaf53d3241e09f1bda75bf0e1cc 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