Skip to content

Commit

Permalink
Fix printouts when doing Adaptive Minibatch sizing
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbasoglu committed Jul 30, 2015
1 parent bc5f69b commit 7451c33
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions MachineLearning/CNTK/SGD.h
Original file line number Diff line number Diff line change
Expand Up @@ -1668,10 +1668,6 @@ class SGD : ComputationNetworkHelper<ElemType>
else if (!std::isnan(epochCriterion) &&
(epochCriterion > (baseCriterion * (ElemType) (1.0 + ((ElemType) m_minibatchSearchCriterionErrorMargin / 100.0)))))
{
fprintf(stderr, "AdaptiveMinibatchSearch: Search successful!!! Chose new minibatchSize of %d. "
"EpochCriterion = %.10g vs BaseCriterion = %.10g\n\n",
(int) lastTriedTrialMinibatchSize, lastTriedTrialEpochCriterion, baseCriterion);

// As soon as we see the Criterion (a measure of error) start to get larger than the
// Criterion we started with, we stop.
// TODO: if this is too sensitive, we can add a margin on the bases of percentage of
Expand All @@ -1682,11 +1678,18 @@ class SGD : ComputationNetworkHelper<ElemType>
{
lastTriedTrialMinibatchSize = trialMinibatchSize;
lastTriedTrialEpochCriterion = epochCriterion;
fprintf(stderr, "AdaptiveMinibatchSearch: Keep searching... "
"EpochCriterion = %.10g vs BaseCriterion = %.10g\n",
epochCriterion, baseCriterion);
if (trialMinibatchSizeFloat * minibatchSizeTuningFactor <= maxMinibatchSize)
{
fprintf(stderr, "AdaptiveMinibatchSearch: Keep searching... "
"EpochCriterion = %.10g vs BaseCriterion = %.10g\n",
epochCriterion, baseCriterion);
}
}
}
fprintf(stderr, "AdaptiveMinibatchSearch: Search successful!!! Chose new minibatchSize of %d. "
"EpochCriterion = %.10g vs BaseCriterion = %.10g\n\n",
(int) lastTriedTrialMinibatchSize, lastTriedTrialEpochCriterion, baseCriterion);


return lastTriedTrialMinibatchSize;
}
Expand Down

0 comments on commit 7451c33

Please sign in to comment.