Skript Context-Dependent System Training

[FeatureSet fs] setDesc   @/home/islpra0/IslData/featDesc
            fs  setAccess @/home/islpra0/IslData/featAccess

[CodebookSet cbs fs]                read ../step8/codebookSet
[DistribSet  dss cbs]               read ../step10/distribSet
[PhonesSet ps]                      read ../step2/phonesSet
[Tags tags]                         read ../step2/tags
Tree dst ps:PHONES ps tags dss
     dst.ptreeSet                   read ../step10/ptreeSet
     dst                            read ../step10/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
[Dictionary diction ps:PHONES tags]    read ../step4/convertedDict

fs FMatrix LDAMatrix
fs:LDAMatrix.data bload ../step5/ldaMatrix

[DBase db] open ../step1/db.dat ../step1/db.idx -mode r
AModelSet amo tpt ROOT
HMM hmm diction amo
Path path

cbs load ../step9/codebookWeights.3

cbs createAccus
dss createAccus

proc forcedAlignment {utt {method viterbi}} {
  set uttInfo [db get \$utt]
  makeArray arr \$uttInfo
  hmm make \$arr(TEXT) -optWord SIL
    if { \$method != "labels" } {
        set score [path \$method hmm -eval \$uttInfo]
    } else {
        set score [path bload ../step4/labels/\$utt -hmm hmm]
        fs eval \$uttInfo
  }
  return \$score
}

foreach epoch {1 2} {

  cbs clearAccus
  dss clearAccus

  foreach utt [db] {

    puts  "\$epoch:\$utt [forcedAlignment \$utt labels]"

  sns accu path
  }
  sns update

  cbs save codebookWeights.\$epoch
  dss save  distribWeights.\$epoch
}

exit