Skip to content

Commit

Permalink
mini checkin
Browse files Browse the repository at this point in the history
  • Loading branch information
frankseide committed Feb 28, 2016
1 parent d55374d commit 570b6a8
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
12 changes: 8 additions & 4 deletions Examples/Text/PennTreebank/Config/rnn.cntk
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ confVocabSize = 10000
confClassSize = 50

trainFile = "ptb.train.txt"
validFile = "ptb.valid.txt"
validFile = "ptb.valid.txt-2"
testFile = "ptb.test.txt"

#######################################
Expand Down Expand Up @@ -65,7 +65,7 @@ train = [

SimpleNetworkBuilder = [
trainingCriterion = "classCrossEntropyWithSoftmax"
evalCriterion = "classCrossEntropyWithSoftmax"
evalCriterion = "classCrossEntropyWithSoftmax"
nodeType = "sigmoid"
initValueScale = 6.0
layerSizes = "$confVocabSize$:150:200:10000"
Expand All @@ -85,8 +85,7 @@ train = [
momentumPerMB = 0
gradientClippingWithTruncation = true
clippingThresholdPerSample = 15.0
maxEpochs = 16
unroll = false
maxEpochs = 16 # BUGBUG: this seems to be ignored?
numMBsToShowResult = 100
gradUpdateType = "none"
loadBestModel = true
Expand All @@ -111,6 +110,8 @@ train = [
readerType = "LMSequenceReader"
randomize = "none" # BUGBUG: This is currently ignored
nbruttsineachrecurrentiter = 10 # note: real-life configurations would use something much larger
#nbruttsineachrecurrentiter = 0 # means fill up the minibatch with as many parallel sequences as fit
#cacheBlockSize = 2000000 # just load it all

# word class info
wordclass = "$ModelDir$/vocab.txt"
Expand Down Expand Up @@ -218,6 +219,8 @@ train = [
# reader to use
readerType = "LMSequenceReader"
randomize = "none"
nbruttsineachrecurrentiter = 0 # 0 means fill up the minibatch with as many parallel sequences as fit
cacheBlockSize = 2000000 # just load it all

# word class info
wordclass = "$ModelDir$/vocab.txt"
Expand Down Expand Up @@ -347,6 +350,7 @@ test = [
# reader to use
readerType = "LMSequenceReader"
randomize = "none"
nbruttsineachrecurrentiter = 2 # means fill up the minibatch with as many parallel sequences as fit

# word class info
wordclass = "$ModelDir$/vocab.txt"
Expand Down
2 changes: 1 addition & 1 deletion Source/ActionsLib/OtherActions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ void DoWriteWordAndClassInfo(const ConfigParameters& config)
#if 1
std::unordered_map<string, double> v_count;
#else
// for unknown reasons, this gives a very different result (PPL of 500 instead of 190)
// TODO: For unknown reasons, this gives a very different result (PPL of 500 instead of 190). Should be tracked down.
std::map<string, double> v_count;
v_count[beginSequence] = 0; // get these into the table upfront into position 0 (and 1 if different)
v_count[endSequence] = 0;
Expand Down
4 changes: 3 additions & 1 deletion Source/Math/CPUMatrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3603,14 +3603,16 @@ struct PrintRange
begin = 0;
skipBegin = (size_t)(-last);
skipEnd = (size_t)(total + first);
if (skipEnd <= skipBegin)
skipBegin = skipEnd = total;
end = total;
}
else // if other combinations are ever of interest then implement them here
LogicError("Print: Bounds must be either both positive or both negative.");
}
};

// use negative ranges to print corners, e.g. specify first=-3, last=-3 which will print the first 3 and last 3 rows/cols
// use negative ranges to print corners, e.g. Print("name", -3, -3, -3, -3) will print the first 3 and last 3 rows/cols
template <class ElemType>
void CPUMatrix<ElemType>::Print(const char* matrixName, ptrdiff_t rowFirst, ptrdiff_t rowLast, ptrdiff_t colFirst, ptrdiff_t colLast) const
{
Expand Down
6 changes: 1 addition & 5 deletions Source/Readers/LMSequenceReader/SequenceReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1673,14 +1673,12 @@ void BatchSequenceReader<ElemType>::StartMinibatchLoop(size_t mbSize, size_t epo
template <class ElemType>
size_t BatchSequenceReader<ElemType>::DetermineSequencesToProcess()
{
if (mNumRead == 0) // no data loaded or input file empty (?)
if (mNumRead == 0) // no data loaded (either this is the first call, or the input file empty)
return 0;

// lazily create the mProcessed[] array
if (mProcessed.size() == 0)
{
mProcessed.resize(mNumRead, false);
}

// lazily check if we are done
// We are done if mToProcess[] contains a sequence for which mProcessed[] is set (...which likely applies to all?).
Expand All @@ -1701,9 +1699,7 @@ size_t BatchSequenceReader<ElemType>::DetermineSequencesToProcess()
}
}
if (allDone) // if we are done
{
mToProcess.clear();
}
}

// if we still have unfinished sequences then just return their length
Expand Down

0 comments on commit 570b6a8

Please sign in to comment.