зеркало из https://github.com/mozilla/kaldi.git
kaldi ver seems to work (2x slower)
git-svn-id: https://svn.code.sf.net/p/kaldi/code/trunk@399 5e6a8d80-dfce-4ca6-a32a-6e07a63d50c8
This commit is contained in:
Родитель
4923e08754
Коммит
74a37cbfef
|
@ -4,7 +4,7 @@ all:
|
|||
EXTRA_CXXFLAGS = -Wno-sign-compare
|
||||
include ../kaldi.mk
|
||||
|
||||
BINFILES = rnn-rescore rnn-rescore-kaldi
|
||||
BINFILES = rnn-rescore
|
||||
|
||||
OBJFILES =
|
||||
|
||||
|
|
|
@ -169,7 +169,7 @@ class RNN{
|
|||
// (*hOut)(i)=1.0/(1.0-FAST_EXP((*hOut)(i)));
|
||||
hOut->ApplyExp();hOut->Add(1.0);hOut->InvertElements();
|
||||
|
||||
KALDI_LOG<<(*hOut)(112);
|
||||
//KALDI_LOG<<(*hOut)(112);
|
||||
|
||||
|
||||
if (IsOOV(w)) {
|
||||
|
@ -197,7 +197,7 @@ class RNN{
|
|||
y_part.AddMatVec(1.0,W2_part,kTrans,*hOut,0.0);
|
||||
for (int32 i=0;i<y_part.Dim();i++) ysum+=(y_part(i)=FAST_EXP(y_part(i)));
|
||||
|
||||
KALDI_LOG << -log(y_(w)*cl_(int2class_[w])/clsum/ysum);
|
||||
//KALDI_LOG << -log(y_(w)*cl_(int2class_[w])/clsum/ysum);
|
||||
return -log(y_(w)*cl_(int2class_[w])/clsum/ysum);
|
||||
}
|
||||
|
||||
|
|
|
@ -197,7 +197,7 @@ class RNN{
|
|||
// activate hidden layer (sigmoid) and determine updated s(t)
|
||||
*hOut=VectorXr(VectorXr(h_ac.array().exp()+1.0).array().inverse());
|
||||
|
||||
KALDI_LOG<<(*hOut)(112);
|
||||
// KALDI_LOG<<(*hOut)(112);
|
||||
|
||||
if (IsIV(w)){
|
||||
// evaluate classes: c(t)=W*s(t) + activation class layer (softmax)
|
||||
|
@ -210,7 +210,7 @@ class RNN{
|
|||
// activate class part of the word layer (softmax)
|
||||
y_.segment(b,n).noalias()=VectorXr((W2_.middleRows(b,n)*(*hOut)).array().exp());
|
||||
ivcnt_++;
|
||||
KALDI_LOG<<-log(y_(w)*cl_(int2class_[w])/cl_.sum()/y_.segment(b,n).sum());
|
||||
// KALDI_LOG<<-log(y_(w)*cl_(int2class_[w])/cl_.sum()/y_.segment(b,n).sum());
|
||||
return -log(y_(w)*cl_(int2class_[w])/cl_.sum()/y_.segment(b,n).sum());
|
||||
} else { oovcnt_++; return OOVPenalty(); };
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче