Skript New Codebooks

[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 ../step5/ldaMatrix

cbs load ../step3/codebookWeights

[DBase db] open ../step1/db.dat ../step1/db.idx -mode r

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

SampleSet sms fs LDA 32
foreach ds [dss:] { sms add \$ds ; sms map [dss index \$ds] -class \$ds }

set fp [open ../step5/ldaCounts] ; makeArray counts [read \$fp] ; close \$fp
foreach class [sms:] {
sms:\$class configure -maxCount 500 -modulus [expr 1+(\$counts(\$class))/500]
}

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
sms accu path
}

sms flush

CodebookSet cbs2 fs
FMatrix smp
FVector cnt

foreach cb [cbs:] {
puts \$cb
cbs2 add \$cb LDA [cbs:\$cb configure -refN] 32 [cbs:\$cb configure -type]

if [catch {smp bload \$cb} msg] {

     puts "ERROR: \$msg"

  } else {

 

smp resize [smp configure -m] [expr [smp configure -n]-1]
cbs2:\$cb.mat neuralGas smp -maxIter 5 -tempS 0 -counts cnt

  }
}

cbs2 write codebookSet
cbs2 save  codebookWeights
dss  save  distribWeights