Skript LDA Matrix

[FeatureSet fs] setDesc   @/home/islpra0/IslData/featDesc
                  fs  setAccess @/home/islpra0/IslData/featAccess
[CodebookSet cbs fs] read ../step2/codebookSet
[DistribSet dss cbs] read ../step2/distribSet
[PhonesSet ps] read ../step2/phonesSet
[Tags tags] read ../step2/tags
[Tree dst ps:PHONES ps tags dss] read ../step2/distribTree

SenoneSet sns [DistribStream str dss dst]

[TmSet tms] read ../step2/transitionModels
[TopoSet tps sns tms] read ../step2/topologies
[Tree tpt ps:PHONES ps tags tps] read ../step2/topologyTree

fs FMatrix LDAMatrix
fs:LDAMatrix.data bload ../IslData/ldaISLci.bmat

RewriteSet rws ; rws add GARBAGE-m +-m

cbs configure -rewriteSet rws

cbs load ../step3/codebookWeights
[DBase db] open ../step1/db.dat ../step1/db.idx -mode r

[Dictionary diction ps:PHONES tags] read ../step4/convertedDict
HMM hmm diction [AModelSet amo tpt ROOT]
Path path

LDA lda fs FEAT+ 143
foreach ds [dss:] { lda add \$ds ; lda map [dss index \$ds] -class \$ds }

foreach utt [db] {

  puts \$utt
  set uttInfo [db get \$utt]
  makeArray arr \$uttInfo
  fs eval \$uttInfo
  hmm make \$arr(TEXT) -optWord SIL
  path bload ../step4/labels/\$utt
  path map hmm -senoneSet sns -stream 0
  lda accu path
}

lda update 

DMatrix A 
DMatrix K 
A simdiag K lda.matrixT lda.matrixW 
[FMatrix B] DMatrix A 

B bsave ldaMatrix 

set fp [open ldaCounts w] 
foreach cl [lda:] { puts \$fp "{ \$cl [lda:\$cl.mean configure -count] }" } 
close \$fp

exit