Added some performance counters to HTKMLFReader
This commit is contained in:
Родитель
e70bb0fe40
Коммит
e4f6a266ab
|
@ -25,6 +25,7 @@
|
|||
#include "DataReader.h"
|
||||
#include "commandArgUtil.h"
|
||||
#include "HTKMLFReader.h"
|
||||
#include "TimerUtility.h"
|
||||
#ifdef LEAKDETECT
|
||||
#include <vld.h> // for memory leak detection
|
||||
#endif
|
||||
|
@ -323,7 +324,7 @@ namespace Microsoft { namespace MSR { namespace CNTK {
|
|||
LogicError("nbrUttsInEachRecurrentIter cannot be more than 1 in frame mode reading.");
|
||||
}
|
||||
|
||||
int verbosity = readerConfig("verbosity","2");
|
||||
m_verbosity = readerConfig("verbosity","2");
|
||||
|
||||
// determine if we partial minibatches are desired
|
||||
std::string minibatchMode(readerConfig("minibatchMode","Partial"));
|
||||
|
@ -467,7 +468,7 @@ namespace Microsoft { namespace MSR { namespace CNTK {
|
|||
|
||||
// now get the frame source. This has better randomization and doesn't create temp files
|
||||
m_frameSource.reset(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->setverbosity(m_verbosity);
|
||||
}
|
||||
else if (!_stricmp(readMethod.c_str(),"rollingWindow"))
|
||||
{
|
||||
|
@ -540,7 +541,7 @@ namespace Microsoft { namespace MSR { namespace CNTK {
|
|||
int addEnergy = 0;
|
||||
|
||||
m_frameSource.reset(new msra::dbn::minibatchframesourcemulti(infilesmulti, labelsmulti, m_featDims, m_labelDims, numContextLeft, numContextRight, randomize, pagePaths, mayhavenoframe, addEnergy));
|
||||
m_frameSource->setverbosity(verbosity);
|
||||
m_frameSource->setverbosity(m_verbosity);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -915,11 +916,14 @@ namespace Microsoft { namespace MSR { namespace CNTK {
|
|||
{
|
||||
if (m_nameToTypeMap.find(iter->first)==m_nameToTypeMap.end())
|
||||
RuntimeError("minibatch requested for input node %ls not found in reader - cannot generate input\n", iter->first.c_str());
|
||||
|
||||
}
|
||||
m_checkDictionaryKeys=false;
|
||||
}
|
||||
|
||||
Timer aggregateTimer;
|
||||
if (m_verbosity > 2)
|
||||
aggregateTimer.Start();
|
||||
|
||||
do
|
||||
{
|
||||
if (!m_truncated) // frame mode or whole utterances
|
||||
|
@ -1291,6 +1295,13 @@ namespace Microsoft { namespace MSR { namespace CNTK {
|
|||
}
|
||||
while(skip); // keep going if we didn't get the right size minibatch
|
||||
|
||||
if (m_verbosity > 2)
|
||||
{
|
||||
aggregateTimer.Stop();
|
||||
double totalMBReadTime = aggregateTimer.ElapsedSeconds();
|
||||
fprintf(stderr, "Total Minibatch read time = %.8g\n", totalMBReadTime);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1487,6 +1498,7 @@ namespace Microsoft { namespace MSR { namespace CNTK {
|
|||
m_numFramesToProcess[i] = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
size_t numOfFea = m_featuresBufferMultiIO.size();
|
||||
size_t numOfLabel = m_labelsBufferMultiIO.size();
|
||||
|
||||
|
@ -1614,7 +1626,19 @@ namespace Microsoft { namespace MSR { namespace CNTK {
|
|||
|
||||
m_processedFrame[i] = 0;
|
||||
|
||||
Timer mbIterAdvancementTimer;
|
||||
if (m_verbosity > 2)
|
||||
mbIterAdvancementTimer.Start();
|
||||
|
||||
(*m_mbiter)++;
|
||||
|
||||
if (m_verbosity > 2)
|
||||
{
|
||||
mbIterAdvancementTimer.Stop();
|
||||
double advancementTime = mbIterAdvancementTimer.ElapsedSeconds();
|
||||
fprintf(stderr, "Time to advance mbiter = %.8g\n", advancementTime);
|
||||
}
|
||||
|
||||
if (!(*m_mbiter))
|
||||
m_noData = true;
|
||||
|
||||
|
|
|
@ -89,6 +89,8 @@ private:
|
|||
|
||||
std::vector<std::vector<std::vector<ElemType>>>m_labelToTargetMapMultiIO;
|
||||
|
||||
int m_verbosity;
|
||||
|
||||
void PrepareForTrainingOrTesting(const ConfigParameters& config);
|
||||
void PrepareForWriting(const ConfigParameters& config);
|
||||
|
||||
|
|
|
@ -118,6 +118,9 @@
|
|||
<ClInclude Include="utterancesourcemulti.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\Common\TimerUtility.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="DataReader.cpp" />
|
||||
<ClCompile Include="DataWriter.cpp" />
|
||||
<ClCompile Include="dllmain.cpp">
|
||||
|
|
|
@ -14,6 +14,9 @@
|
|||
<Filter>Duplicates to remove</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="DataReader.cpp" />
|
||||
<ClCompile Include="..\..\Common\TimerUtility.cpp">
|
||||
<Filter>Common</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="biggrowablevectors.h" />
|
||||
|
|
Загрузка…
Ссылка в новой задаче