Skip to content

Commit

Permalink
Fix progress when epochsize is 0 and fix the git hash built into the exe
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbasoglu committed Feb 1, 2016
1 parent a8e8076 commit 31a2125
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,7 @@ clean:
@echo $(SEPARATOR)
@rm -rf $(OBJDIR)
@rm -rf $(ALL)
@rm -rf $(SOURCEDIR)/CNTK/buildinfo.h
@echo finished cleaning up the project
buildall : $(ALL)
Expand Down
7 changes: 5 additions & 2 deletions Source/SGDLib/SGD.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SGD.cpp -- implements SGD with all bells and whistles, parallelization, randomizatiom, etc.
// SGD.cpp -- implements SGD with all bells and whistles, parallelization, randomization, etc.

#define _CRT_SECURE_NO_WARNINGS // "secure" CRT not available on all platforms --add this at the top of all CPP files that give "function or variable may be unsafe" warnings

Expand Down Expand Up @@ -41,7 +41,7 @@ void SGD<ElemType>::Train(function<ComputationNetworkPtr(DEVICEID_TYPE)> createN
IDataReader<ElemType>* validationSetDataReader,
const bool makeMode)
{
// determine which epoch to start with, including recoveing a checkpoint if any and 'makeMode' enabled
// determine which epoch to start with, including recovering a checkpoint if any and 'makeMode' enabled
int startEpoch = DetermineStartEpoch(makeMode);
if (startEpoch == m_maxEpochs)
{
Expand Down Expand Up @@ -151,6 +151,7 @@ void SGD<ElemType>::TrainOrAdaptModel(int startEpoch, ComputationNetworkPtr net,
set<ComputationNodeBasePtr> criteriaLogged; // set to make sure we don't double-log criteria
for (const auto& node : criterionNodes)
criteriaLogged.insert(node);

for (const auto& node : originalEvaluationNodes)
if (criteriaLogged.insert(node).second)
evaluationNodes.push_back(node);
Expand Down Expand Up @@ -1103,6 +1104,8 @@ size_t SGD<ElemType>::TrainOneEpoch(ComputationNetworkPtr net,
}
else
{
wasProgressPrinted = ProgressTracing::TraceProgressPercentage(epochNumber, 0.0, false);

string formatString = "%s Epoch[%2d of %d]-Minibatch[%4d-%4d]: SamplesSeen = %d; TrainLossPerSample = " +
GeneratePaddedFloatOrExpFormat(11, 8, trainLossPerSample) + "; ";
SGDTrace(stderr, formatString.c_str(),
Expand Down

0 comments on commit 31a2125

Please sign in to comment.