Index of /~anoop/distrib/consist
Name Last modified Size Description
Parent Directory -
cfg.1 10-Jan-2011 20:38 180
cfg.2 10-Jan-2011 20:38 284
cfg.3 10-Jan-2011 20:38 176
cfg.4 10-Jan-2011 20:38 147
cfg.5 10-Jan-2011 20:38 147
cfg.6 10-Jan-2011 20:38 374
cm_simple.pl 10-Jan-2011 20:38 1.9K
consist.tar.gz 10-Jan-2011 20:38 3.3K
conv.pl 10-Jan-2011 20:38 850
create_matrices.pl 10-Jan-2011 20:38 2.4K
mmult.c 10-Jan-2011 20:38 1.9K
plot.mat 10-Jan-2011 20:38 173
tag.6 10-Jan-2011 20:38 223
creates a stochastic expectation matrix in MATLAB syntax from input
probabilistic CFGs.
the output can be directly read into MATLAB.
Here's how:
cat cfg.1 | create_matrices.pl > out.m
In matlab:
>> out
To see if a PCFG is consistent:
A = Q * C
eig(A)
If the eigenvalues are less than 1, the PCFG is consistent.
To get a simple output which is easier to read into a C program for
computing eigenvalues:
cat cfg.1 | cm_simple.pl
This creates 'row.out' containing matrix Q and 'col.out' containing
transpose of matrix C.
mmult.c contains code for matrix multiplication of the Q and C matrices
stored in this format.
----
Anoop Sarkar
<anoop at seas.upenn.edu>