Skip to content

Commit

Permalink
Merge branch 'master' into deepbliscore/vnext
Browse files Browse the repository at this point in the history
Conflicts:
	CNTK.sln
  • Loading branch information
Alexey Reznichenko committed Apr 15, 2016
2 parents 7ec5724 + 85de3fc commit 242be1c
Show file tree
Hide file tree
Showing 80 changed files with 13,537 additions and 913 deletions.
59 changes: 55 additions & 4 deletions CNTK.sln
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CIFAR-10", "CIFAR-10", "{77
Examples\Image\Miscellaneous\CIFAR-10\CifarConverter.py = Examples\Image\Miscellaneous\CIFAR-10\CifarConverter.py
Examples\Image\Miscellaneous\CIFAR-10\labelsmap.txt = Examples\Image\Miscellaneous\CIFAR-10\labelsmap.txt
Examples\Image\Miscellaneous\CIFAR-10\Macros.ndl = Examples\Image\Miscellaneous\CIFAR-10\Macros.ndl
Examples\Image\Miscellaneous\CIFAR-10\readme.txt = Examples\Image\Miscellaneous\CIFAR-10\readme.txt
Examples\Image\Miscellaneous\CIFAR-10\README.md = Examples\Image\Miscellaneous\CIFAR-10\README.md
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ImageNet", "ImageNet", "{EF710C5A-E616-442A-889D-C997D39AF2E1}"
Expand Down Expand Up @@ -907,10 +907,53 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Text", "Text", "{8656B71D-E24C-4AC2-8BE4-C07B415A3E15}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SequenceClassification", "SequenceClassification", "{E53E63A0-FAA9-4416-9AD1-08A8FB87FEE1}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Miscellaneous", "Miscellaneous", "{8629430A-821E-43BA-AEC5-8B2CF31A2A7A}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CIFAR-10", "CIFAR-10", "{0141526B-F257-4574-8CBE-99634726FFCE}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "01_Convolution", "01_Convolution", "{58286327-6742-44C4-A34E-D2583419E55E}"
ProjectSection(SolutionItems) = preProject
Tests\EndToEndTests\Examples\Image\Miscellaneous\CIFAR-10\01_Convolution\baseline.linux.cpu.txt = Tests\EndToEndTests\Examples\Image\Miscellaneous\CIFAR-10\01_Convolution\baseline.linux.cpu.txt
Tests\EndToEndTests\Examples\Image\Miscellaneous\CIFAR-10\01_Convolution\baseline.linux.gpu.txt = Tests\EndToEndTests\Examples\Image\Miscellaneous\CIFAR-10\01_Convolution\baseline.linux.gpu.txt
Tests\EndToEndTests\Examples\Image\Miscellaneous\CIFAR-10\01_Convolution\baseline.windows.txt = Tests\EndToEndTests\Examples\Image\Miscellaneous\CIFAR-10\01_Convolution\baseline.windows.txt
Tests\EndToEndTests\Examples\Image\Miscellaneous\CIFAR-10\01_Convolution\run-test = Tests\EndToEndTests\Examples\Image\Miscellaneous\CIFAR-10\01_Convolution\run-test
Tests\EndToEndTests\Examples\Image\Miscellaneous\CIFAR-10\01_Convolution\testcases.yml = Tests\EndToEndTests\Examples\Image\Miscellaneous\CIFAR-10\01_Convolution\testcases.yml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "02_BatchNormConv", "02_BatchNormConv", "{AB9207B9-B134-4C57-B7ED-F3DCF7B0DC5F}"
ProjectSection(SolutionItems) = preProject
Tests\EndToEndTests\Examples\Image\Miscellaneous\CIFAR-10\02_BatchNormConv\baseline.linux.gpu.txt = Tests\EndToEndTests\Examples\Image\Miscellaneous\CIFAR-10\02_BatchNormConv\baseline.linux.gpu.txt
Tests\EndToEndTests\Examples\Image\Miscellaneous\CIFAR-10\02_BatchNormConv\baseline.windows.txt = Tests\EndToEndTests\Examples\Image\Miscellaneous\CIFAR-10\02_BatchNormConv\baseline.windows.txt
Tests\EndToEndTests\Examples\Image\Miscellaneous\CIFAR-10\02_BatchNormConv\run-test = Tests\EndToEndTests\Examples\Image\Miscellaneous\CIFAR-10\02_BatchNormConv\run-test
Tests\EndToEndTests\Examples\Image\Miscellaneous\CIFAR-10\02_BatchNormConv\testcases.yml = Tests\EndToEndTests\Examples\Image\Miscellaneous\CIFAR-10\02_BatchNormConv\testcases.yml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "03_ResNet", "03_ResNet", "{12FB912C-43F8-40FE-BD7F-B52F589A1EBC}"
ProjectSection(SolutionItems) = preProject
Tests\EndToEndTests\Examples\Image\Miscellaneous\CIFAR-10\03_ResNet\baseline.linux.gpu.txt = Tests\EndToEndTests\Examples\Image\Miscellaneous\CIFAR-10\03_ResNet\baseline.linux.gpu.txt
Tests\EndToEndTests\Examples\Image\Miscellaneous\CIFAR-10\03_ResNet\baseline.windows.txt = Tests\EndToEndTests\Examples\Image\Miscellaneous\CIFAR-10\03_ResNet\baseline.windows.txt
Tests\EndToEndTests\Examples\Image\Miscellaneous\CIFAR-10\03_ResNet\run-test = Tests\EndToEndTests\Examples\Image\Miscellaneous\CIFAR-10\03_ResNet\run-test
Tests\EndToEndTests\Examples\Image\Miscellaneous\CIFAR-10\03_ResNet\testcases.yml = Tests\EndToEndTests\Examples\Image\Miscellaneous\CIFAR-10\03_ResNet\testcases.yml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "04_ResNet", "04_ResNet", "{2BFE4D88-6F32-4701-887A-1DE3D7626DBB}"
ProjectSection(SolutionItems) = preProject
Tests\EndToEndTests\Examples\Image\Miscellaneous\CIFAR-10\04_ResNet_56\baseline.linux.gpu.txt = Tests\EndToEndTests\Examples\Image\Miscellaneous\CIFAR-10\04_ResNet_56\baseline.linux.gpu.txt
Tests\EndToEndTests\Examples\Image\Miscellaneous\CIFAR-10\04_ResNet_56\baseline.windows.txt = Tests\EndToEndTests\Examples\Image\Miscellaneous\CIFAR-10\04_ResNet_56\baseline.windows.txt
Tests\EndToEndTests\Examples\Image\Miscellaneous\CIFAR-10\04_ResNet_56\run-test = Tests\EndToEndTests\Examples\Image\Miscellaneous\CIFAR-10\04_ResNet_56\run-test
Tests\EndToEndTests\Examples\Image\Miscellaneous\CIFAR-10\04_ResNet_56\testcases.yml = Tests\EndToEndTests\Examples\Image\Miscellaneous\CIFAR-10\04_ResNet_56\testcases.yml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Config", "Config", "{EC780385-7580-4D15-914B-1D878A295CBC}"
ProjectSection(SolutionItems) = preProject
Tests\EndToEndTests\Text\SequenceClassification\Config\seqcla.cntk = Tests\EndToEndTests\Text\SequenceClassification\Config\seqcla.cntk
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Data", "Data", "{D11F76CC-DB6D-4CB4-B3B7-AB139DE2F5FA}"
ProjectSection(SolutionItems) = preProject
Tests\EndToEndTests\Text\SequenceClassification\embeddingmatrix.txt = Tests\EndToEndTests\Text\SequenceClassification\embeddingmatrix.txt
Tests\EndToEndTests\Text\SequenceClassification\seqcla.cntk = Tests\EndToEndTests\Text\SequenceClassification\seqcla.cntk
Tests\EndToEndTests\Text\SequenceClassification\Train.txt = Tests\EndToEndTests\Text\SequenceClassification\Train.txt
Tests\EndToEndTests\Text\SequenceClassification\Data\embeddingmatrix.txt = Tests\EndToEndTests\Text\SequenceClassification\Data\embeddingmatrix.txt
Tests\EndToEndTests\Text\SequenceClassification\Data\Train.txt = Tests\EndToEndTests\Text\SequenceClassification\Data\Train.txt
EndProjectSection
EndProject
Global
Expand Down Expand Up @@ -1256,5 +1299,13 @@ Global
{CDA96AA3-3252-4978-A0BF-2ACD670823CB} = {6F19321A-65E7-4829-B00C-3886CD6C6EDE}
{8656B71D-E24C-4AC2-8BE4-C07B415A3E15} = {6E565B48-1923-49CE-9787-9BBB9D96F4C5}
{E53E63A0-FAA9-4416-9AD1-08A8FB87FEE1} = {8656B71D-E24C-4AC2-8BE4-C07B415A3E15}
{8629430A-821E-43BA-AEC5-8B2CF31A2A7A} = {FC7E7EC7-6E6A-4518-81C6-DA60451C657A}
{0141526B-F257-4574-8CBE-99634726FFCE} = {8629430A-821E-43BA-AEC5-8B2CF31A2A7A}
{58286327-6742-44C4-A34E-D2583419E55E} = {0141526B-F257-4574-8CBE-99634726FFCE}
{AB9207B9-B134-4C57-B7ED-F3DCF7B0DC5F} = {0141526B-F257-4574-8CBE-99634726FFCE}
{12FB912C-43F8-40FE-BD7F-B52F589A1EBC} = {0141526B-F257-4574-8CBE-99634726FFCE}
{2BFE4D88-6F32-4701-887A-1DE3D7626DBB} = {0141526B-F257-4574-8CBE-99634726FFCE}
{EC780385-7580-4D15-914B-1D878A295CBC} = {E53E63A0-FAA9-4416-9AD1-08A8FB87FEE1}
{D11F76CC-DB6D-4CB4-B3B7-AB139DE2F5FA} = {E53E63A0-FAA9-4416-9AD1-08A8FB87FEE1}
EndGlobalSection
EndGlobal
4 changes: 4 additions & 0 deletions Examples/Image/Miscellaneous/CIFAR-10/01_Conv.cntk
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ imageLayout = "cudnn"
# override the above as follows when running on CPU:
# deviceId = -1

# If set to true, always initialize the network on CPU, making initialization consistent across CPU and GPU targets (for testing).
initOnCPUOnly=true

prefetch = "true"

command = Train:Test
Expand Down Expand Up @@ -44,6 +47,7 @@ Train = [
readerType = "UCIFastReader"
file = "$DataDir$/Train.txt"
randomize = "auto"
# Setting minibatchMode="full" is a temporary fix to prevent an exception until the reader is migrated to the new reader.
minibatchMode="full"
features = [
dim = 3072
Expand Down
3 changes: 3 additions & 0 deletions Examples/Image/Miscellaneous/CIFAR-10/02_BatchNormConv.cntk
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ imageLayout = "cudnn"
# override the above as follows when running on CPU:
# deviceId = -1

# If set to true, always initialize the network on CPU, making initialization consistent across CPU and GPU targets (for testing).
initOnCPUOnly=true

prefetch = "true"

command = Train:Test
Expand Down
11 changes: 7 additions & 4 deletions Examples/Image/Miscellaneous/CIFAR-10/03_ResNet.cntk
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ imageLayout = "cudnn"
# override the above as follows when running on CPU:
# deviceId = -1

# If set to true, always initialize the network on CPU, making initialization consistent across CPU and GPU targets (for testing).
initOnCPUOnly=true

prefetch = "true"
parallelTrain = "false"

Expand Down Expand Up @@ -56,7 +59,7 @@ Train = [

reader = [
readerType = "ImageReader"
file = "$DataDir$/train_map.txt"
file = "$DataDir$/cifar-10-batches-py/train_map.txt"
randomize = "auto"
features = [
width = 32
Expand All @@ -66,7 +69,7 @@ Train = [
cropRatio = 0.8
jitterType = "uniRatio"
interpolations = "linear"
meanFile = "$ConfigDir$/CIFAR-10_mean.xml"
meanFile = "$DataDir$/cifar-10-batches-py/CIFAR-10_mean.xml"
]
labels = [
labelDim = 10
Expand All @@ -82,7 +85,7 @@ Test = [

reader = [
readerType = "ImageReader"
file = "$DataDir$/test_map.txt"
file = "$DataDir$/cifar-10-batches-py/test_map.txt"
randomize = "none"
features = [
width = 32
Expand All @@ -92,7 +95,7 @@ Test = [
cropRatio = 1
jitterType = "uniRatio"
interpolations = "linear"
meanFile = "$ConfigDir$/CIFAR-10_mean.xml"
meanFile = "$DataDir$/cifar-10-batches-py/CIFAR-10_mean.xml"
]
labels = [
labelDim = 10
Expand Down
11 changes: 7 additions & 4 deletions Examples/Image/Miscellaneous/CIFAR-10/04_ResNet_56.cntk
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ imageLayout = "cudnn"
# override the above as follows when running on CPU:
# deviceId = -1

# If set to true, always initialize the network on CPU, making initialization consistent across CPU and GPU targets (for testing).
initOnCPUOnly=true

prefetch="true"
parallelTrain="false"

Expand Down Expand Up @@ -57,7 +60,7 @@ Train=[

reader=[
readerType="ImageReader"
file="$DataDir$/train_map.txt"
file="$DataDir$/cifar-10-batches-py/train_map.txt"
randomize="auto"
features=[
width=32
Expand All @@ -67,7 +70,7 @@ Train=[
cropRatio=0.8
jitterType="uniRatio"
interpolations="linear"
meanFile="$ConfigDir$/CIFAR-10_mean.xml"
meanFile="$DataDir$/cifar-10-batches-py/CIFAR-10_mean.xml"
]
labels=[
labelDim=10
Expand All @@ -83,7 +86,7 @@ Test=[

reader=[
readerType="ImageReader"
file="$DataDir$/test_map.txt"
file="$DataDir$/cifar-10-batches-py/test_map.txt"
randomize="none"
features=[
width=32
Expand All @@ -93,7 +96,7 @@ Test=[
cropRatio=1
jitterType="uniRatio"
interpolations="linear"
meanFile="$ConfigDir$/CIFAR-10_mean.xml"
meanFile="$DataDir$/cifar-10-batches-py/CIFAR-10_mean.xml"
]
labels=[
labelDim=10
Expand Down
9 changes: 9 additions & 0 deletions Source/CNTK/BrainScript/CNTKCoreLib/CNTK.core.bs
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,12 @@ SBFF(in, rows, cols) = [ Eh = Sigmoid(BFF(in, rows, cols).z) ]
MeanVarNorm(feat) = PerDimMeanVarNormalization(feat, Mean(feat), InvStdDev(feat))
LogPrior(labels) = Log(Mean(labels))
Embedding (embeddingDim, input, inputDim=input.dim, initFrom='fromFile'/*|gaussian|uniform*/, embeddingPath = '', sparseInput = false, learningRateWeight = 0.0) = [
embedding = Transpose (LearnableParameter (inputDim, embeddingDim, learningRateMultiplier = learningRateWeight, init = initFrom, initFromFilePath = embeddingPath))
lookup = if sparseInput then embedding * input
else GatherPacked (input, embedding)
].lookup

##############################################################################
# the more specific standard things are in a namespace called 'BS'
# You can create shorthands for accessing these, e.g. saying B = BS.Boolean.
Expand Down Expand Up @@ -249,6 +255,9 @@ Sequences = [
selected = Loop._IsWithin (DelayFn, N, x)
out = Gather (selected, x)
].out
# Last and TakeRight
Last(x) = TakeRight(1, x)
TakeRight (N, x) = _Take (FutureValue, N, x)
Skip (N, x) = if N > 0 then _Skip (PastValue, N, x) else x
_Skip (DelayFn, N, x) = [ // TODO: merge with _Take
selected = Loop._IsWithin (DelayFn, N, x)
Expand Down
3 changes: 3 additions & 0 deletions Source/Readers/ReaderLib/BlockRandomizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ BlockRandomizer::BlockRandomizer(
// Start a new epoch.
void BlockRandomizer::StartEpoch(const EpochConfiguration& config)
{
m_lastSeenChunkId = SIZE_MAX;

m_config = config;
if (config.m_totalEpochSizeInSamples == requestDataSize)
{
Expand Down Expand Up @@ -134,6 +136,7 @@ Sequences BlockRandomizer::GetNextSequences(size_t sampleCount)
}
}

m_sequenceRandomizer->ReleaseChunks();
return result;
}

Expand Down
Loading

0 comments on commit 242be1c

Please sign in to comment.