Commit 20e3ac15 by xiaotong

make the complete hypotheses

parent 434335e0
......@@ -59,6 +59,7 @@ void T2TStateBundle::MakeStates(int num)
states[i].pid = T2T_PID_EMPTY;
states[i].isEnd = false;
states[i].isStart = false;
states[i].isCompleted = false;
states[i].prob = 0;
states[i].probPath = 0;
states[i].modelScore = 0;
......
......@@ -50,6 +50,9 @@ public:
/* indicates whether the state is the start */
bool isStart;
/* indicates whether the state is completed */
bool isCompleted;
/* probability of every prediction (last state of the path) */
float prob;
......
......@@ -425,11 +425,13 @@ void T2TSearch::Expand(T2TStateBundle * prev, T2TStateBundle * beam)
state.last = NULL;
state.pid = pid;
state.nstep = 0;
state.isCompleted = false;
}
else{
state.last = last;
state.pid = state.last->pid;
state.nstep = last->nstep + 1;
state.isCompleted = last->isCompleted;
CheckNTErrors(offset < prev->stateNum, "Wrong state index!");
}
......@@ -445,6 +447,7 @@ void T2TSearch::Expand(T2TStateBundle * prev, T2TStateBundle * beam)
/* check if it is the end of the sequence */
state.isEnd = IsEnd(state.prediction);
state.isCompleted = (state.isCompleted || state.isEnd);
/* set the ending mark */
endMarkCPU.SetInt(state.isEnd, k);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论