Skip to content

Commit

Permalink
(logging)
Browse files Browse the repository at this point in the history
  • Loading branch information
frankseide committed Feb 18, 2016
1 parent dea77ac commit 6ece710
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Source/SGDLib/SGD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,9 @@ void SGD<ElemType>::TrainOrAdaptModel(int startEpoch, ComputationNetworkPtr net,
if ((g_mpi == nullptr) || g_mpi->IsMainNode())
{
SaveCheckPointInfo(i, totalSamplesSeen, learnRatePerSample, smoothedGradients, prevCriterion, chosenMinibatchSize);
net->Save(GetModelNameForEpoch(i));
auto modelName = GetModelNameForEpoch(i);
fprintf(stderr, "SGD: Saving checkpoint model '%ls'\n", modelName.c_str());
net->Save(modelName);
if (!m_keepCheckPointFiles)
{
// delete previous checkpoint file to save space
Expand Down Expand Up @@ -1069,7 +1071,11 @@ size_t SGD<ElemType>::TrainOneEpoch(ComputationNetworkPtr net,
totalTimeInMBs += timer.ElapsedSeconds();
numSamplesLastMBs += useModelAveraging ? int(actualMBSize) : int(aggregateNumSamplesWithLabel);

if (numMBsRun % m_numMBsToShowResult == 0)
if (
#if 0 // output the first few to see if everything started right
numMBsRun <= 3 ||
#endif
numMBsRun % m_numMBsToShowResult == 0)
{
// get the epoch Values updated
if (!useGradientAggregation)
Expand Down

0 comments on commit 6ece710

Please sign in to comment.