summaryrefslogtreecommitdiff
path: root/training/crf/baum_welch_example/random_init.pl
diff options
context:
space:
mode:
authorAvneesh Saluja <asaluja@gmail.com>2013-03-28 18:28:16 -0700
committerAvneesh Saluja <asaluja@gmail.com>2013-03-28 18:28:16 -0700
commit5b8253e0e1f1393a509fb9975ba8c1347af758ed (patch)
tree1790470b1d07a0b4973ebce19192e896566ea60b /training/crf/baum_welch_example/random_init.pl
parent2389a5a8a43dda87c355579838559515b0428421 (diff)
parentb203f8c5dc8cff1b9c9c2073832b248fcad0765a (diff)
fixed conflicts
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";
+}