Skip to content

Commit

Permalink
Fix the boundary setting when framemode = true in HTKMLFReader.
Browse files Browse the repository at this point in the history
  • Loading branch information
yzhang87 committed Jul 16, 2015
1 parent e639279 commit 0e65b1f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
21 changes: 8 additions & 13 deletions DataReader/HTKMLFReader/HTKMLFReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ namespace Microsoft { namespace MSR { namespace CNTK {
size_t iFeat, iLabel;
iFeat = iLabel = 0;
vector<wstring> statelistpaths;
bool framemode = true;
vector<size_t> numContextLeft;
vector<size_t> numContextRight;

Expand Down Expand Up @@ -253,14 +252,7 @@ namespace Microsoft { namespace MSR { namespace CNTK {
}
}

if (readerConfig.Exists("frameMode"))
{
const std::string& framemodeString = readerConfig("frameMode");
if (framemodeString == "false")
{
framemode = false;
}
}
m_framemode = readerConfig("frameMode", "true");

int verbosity = readerConfig("verbosity","2");

Expand Down Expand Up @@ -383,9 +375,9 @@ namespace Microsoft { namespace MSR { namespace CNTK {
m_lattices = new msra::dbn::latticesource(latticetocs, modelsymmap);

// now get the frame source. This has better randomization and doesn't create temp files
m_frameSource = new msra::dbn::minibatchutterancesourcemulti(infilesmulti, labelsmulti, m_featDims, m_labelDims, numContextLeft, numContextRight, randomize, *m_lattices, m_latticeMap, framemode);
m_frameSource = new msra::dbn::minibatchutterancesourcemulti(infilesmulti, labelsmulti, m_featDims, m_labelDims, numContextLeft, numContextRight, randomize, *m_lattices, m_latticeMap, m_framemode);
m_frameSource->setverbosity(verbosity);
//m_frameSource = new msra::dbn::minibatchutterancesource(infilesmulti[0], labelsmulti[0], m_featDims[0], m_labelDims[0], numContextLeft[0], numContextRight[0], randomize, *m_lattices, m_latticeMap, framemode);
//m_frameSource = new msra::dbn::minibatchutterancesource(infilesmulti[0], labelsmulti[0], m_featDims[0], m_labelDims[0], numContextLeft[0], numContextRight[0], randomize, *m_lattices, m_latticeMap, m_framemode);

}
else if (!_stricmp(readMethod.c_str(),"rollingWindow"))
Expand Down Expand Up @@ -1590,8 +1582,11 @@ namespace Microsoft { namespace MSR { namespace CNTK {
template<class ElemType>
void HTKMLFReader<ElemType>::SetSentenceSegBatch(Matrix<ElemType> &sentenceBegin, vector<MinibatchPackingFlag>& minibatchPackingFlag)
{
sentenceBegin.SetValue(m_sentenceBegin);
minibatchPackingFlag = m_minibatchPackingFlag;
if (!m_framemode)
{
sentenceBegin.SetValue(m_sentenceBegin);
minibatchPackingFlag = m_minibatchPackingFlag;
}
}


Expand Down
1 change: 1 addition & 0 deletions DataReader/HTKMLFReader/HTKMLFReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class HTKMLFReader : public IDataReader<ElemType>
vector<bool> m_sentenceEnd;
bool m_readAhead;
bool m_truncated;
bool m_framemode;
vector<size_t> m_processedFrame;
intargvector m_numberOfuttsPerMinibatchForAllEpochs;
size_t m_numberOfuttsPerMinibatch;
Expand Down

0 comments on commit 0e65b1f

Please sign in to comment.