summaryrefslogtreecommitdiff
path: root/training/crf/baum_welch_example/random_init.pl
diff options
context:
space:
mode:
authorPatrick Simianer <simianer@cl.uni-heidelberg.de>2013-02-18 18:31:23 +0100
committerPatrick Simianer <simianer@cl.uni-heidelberg.de>2013-02-18 18:31:23 +0100
commit12f2eab0e7dc7167af47cddf8ef88968656277da (patch)
tree28953cc5de058908056b319222afc60d1efb6660 /training/crf/baum_welch_example/random_init.pl
parentf051e98fb35c4ce69e489ef6550840bd6cd617fd (diff)
parent95c364f2cb002241c4a62bedb1c5ef6f1e9a7f22 (diff)
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'training/crf/baum_welch_example/random_init.pl')
-rwxr-xr-xtraining/crf/baum_welch_example/random_init.pl9
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";
+}