Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into guoguo/linuxBuildFix
Browse files Browse the repository at this point in the history
  • Loading branch information
yzhang87 committed Oct 2, 2015
2 parents 07910db + 86c2836 commit 520105d
Show file tree
Hide file tree
Showing 44 changed files with 12,510 additions and 1,477 deletions.
2 changes: 1 addition & 1 deletion BrainScript/BrainScriptEvaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1164,7 +1164,7 @@ namespace Microsoft { namespace MSR { namespace BS {
// Like in an [] expression, we do not evaluate at this point, but pass in a lambda to compute on-demand.
let & args = argsExpr->args;
if (args.size() != lambda->GetNumParams())
Fail(wstrprintf(L"function expects %d parameters, %d were provided", (int)lambda->GetNumParams(), (int)args.size()), argsExpr->location);
Fail(wstrprintf(L"function expects %d positional parameters, %d were provided", (int)lambda->GetNumParams(), (int)args.size()), argsExpr->location);
vector<ConfigValuePtr> argVals(args.size());
//bool onlyOneArg = args.size() == 1 && argsExpr->namedArgs.empty();
for (size_t i = 0; i < args.size(); i++) // positional arguments
Expand Down
28 changes: 22 additions & 6 deletions CNTK.sln
Original file line number Diff line number Diff line change
Expand Up @@ -195,14 +195,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Data", "Data", "{5F733BBA-F
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "LSTM", "LSTM", "{19EE975B-232D-49F0-94C7-6F1C6424FB53}"
ProjectSection(SolutionItems) = preProject
Tests\Speech\LSTM\baseline.cpu.txt = Tests\Speech\LSTM\baseline.cpu.txt
Tests\Speech\LSTM\baseline.gpu.txt = Tests\Speech\LSTM\baseline.gpu.txt
Tests\Speech\LSTM\baseline.windows.cpu.txt = Tests\Speech\LSTM\baseline.windows.cpu.txt
Tests\Speech\LSTM\baseline.windows.gpu.txt = Tests\Speech\LSTM\baseline.windows.gpu.txt
Tests\Speech\LSTM\cntk.config = Tests\Speech\LSTM\cntk.config
Tests\Speech\LSTM\lstmp-3layer_WithSelfStab.ndl = Tests\Speech\LSTM\lstmp-3layer_WithSelfStab.ndl
Tests\Speech\LSTM\run-test = Tests\Speech\LSTM\run-test
Tests\Speech\LSTM\testcases.yml = Tests\Speech\LSTM\testcases.yml
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ParseConfig", "MachineLearning\ParseConfig\ParseConfig.vcxproj", "{7C4E77C9-6B17-4B02-82C1-DB62EEE2635B}"
Expand Down Expand Up @@ -334,6 +328,26 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Kaldi2Reader", "Kaldi2Reade
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SequenceTraining", "MachineLearning\SequenceTraining\SequenceTraining.vcxproj", "{EAD17188-072C-4726-B840-A769C36DAD1B}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Truncated", "Truncated", "{88F85A64-105D-4CDA-8199-B7A312FC8A27}"
ProjectSection(SolutionItems) = preProject
Tests\Speech\LSTM\Truncated\baseline.cpu.txt = Tests\Speech\LSTM\Truncated\baseline.cpu.txt
Tests\Speech\LSTM\Truncated\baseline.gpu.txt = Tests\Speech\LSTM\Truncated\baseline.gpu.txt
Tests\Speech\LSTM\Truncated\baseline.windows.cpu.txt = Tests\Speech\LSTM\Truncated\baseline.windows.cpu.txt
Tests\Speech\LSTM\Truncated\baseline.windows.gpu.txt = Tests\Speech\LSTM\Truncated\baseline.windows.gpu.txt
Tests\Speech\LSTM\Truncated\run-test = Tests\Speech\LSTM\Truncated\run-test
Tests\Speech\LSTM\Truncated\testcases.yml = Tests\Speech\LSTM\Truncated\testcases.yml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "FullUtterance", "FullUtterance", "{8241108A-7824-4FF2-BECA-7521A9D89DCF}"
ProjectSection(SolutionItems) = preProject
Tests\Speech\LSTM\FullUtterance\baseline.cpu.txt = Tests\Speech\LSTM\FullUtterance\baseline.cpu.txt
Tests\Speech\LSTM\FullUtterance\baseline.gpu.txt = Tests\Speech\LSTM\FullUtterance\baseline.gpu.txt
Tests\Speech\LSTM\FullUtterance\baseline.windows.cpu.txt = Tests\Speech\LSTM\FullUtterance\baseline.windows.cpu.txt
Tests\Speech\LSTM\FullUtterance\baseline.windows.gpu.txt = Tests\Speech\LSTM\FullUtterance\baseline.windows.gpu.txt
Tests\Speech\LSTM\FullUtterance\run-test = Tests\Speech\LSTM\FullUtterance\run-test
Tests\Speech\LSTM\FullUtterance\testcases.yml = Tests\Speech\LSTM\FullUtterance\testcases.yml
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Expand Down Expand Up @@ -503,5 +517,7 @@ Global
{3E9C89B1-C045-4F42-92B2-F9FFFFC2DBD4} = {39E42C4B-A078-4CA4-9D92-B883D8129601}
{C70E1572-20FF-496C-A0A9-10AA6755A07C} = {39E42C4B-A078-4CA4-9D92-B883D8129601}
{EAD17188-072C-4726-B840-A769C36DAD1B} = {DD043083-71A4-409A-AA91-F9C548DCF7EC}
{88F85A64-105D-4CDA-8199-B7A312FC8A27} = {19EE975B-232D-49F0-94C7-6F1C6424FB53}
{8241108A-7824-4FF2-BECA-7521A9D89DCF} = {19EE975B-232D-49F0-94C7-6F1C6424FB53}
EndGlobalSection
EndGlobal
5 changes: 4 additions & 1 deletion DataReader/UCIFastReader/UCIFastReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,10 @@ bool UCIFastReader<ElemType>::GetMinibatch(std::map<std::wstring, Matrix<ElemTyp
}
}
}
}
}

// create the respective MBLayout
m_pMBLayout->Init(1, actualmbsize, false/*means it is not sequential*/);

// if we are writing out to the caching writer, do it now
if (m_cachingWriter)
Expand Down
7 changes: 4 additions & 3 deletions DataReader/UCIFastReader/UCIFastReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,12 @@ class UCIFastReader : public IDataReader<ElemType>

bool m_endReached;
int m_traceLevel;

// feature and label data are parallel arrays
std::vector<ElemType> m_featureData;
std::vector<LabelIdType> m_labelIdData;
std::vector<LabelType> m_labelData;
MBLayoutPtr m_pMBLayout;

// map is from ElemType to LabelType
// For UCI, we really only need an int for label data, but we have to transmit in Matrix, so use ElemType instead
Expand Down Expand Up @@ -106,13 +107,13 @@ class UCIFastReader : public IDataReader<ElemType>
public:
virtual void Init(const ConfigParameters& config);
virtual void Destroy();
UCIFastReader() { m_featuresBuffer=NULL; m_labelsBuffer=NULL; m_labelsIdBuffer=NULL; }
UCIFastReader() { m_featuresBuffer=NULL; m_labelsBuffer=NULL; m_labelsIdBuffer=NULL; m_pMBLayout=make_shared<MBLayout>(); }
virtual ~UCIFastReader();
virtual void StartMinibatchLoop(size_t mbSize, size_t epoch, size_t requestedEpochSamples=requestDataSize);
virtual bool GetMinibatch(std::map<std::wstring, Matrix<ElemType>*>& matrices);

size_t GetNumParallelSequences() { return mBlgSize; }
void CopyMBLayoutTo(MBLayoutPtr){};
void CopyMBLayoutTo(MBLayoutPtr pMBLayout) { pMBLayout->CopyFrom(m_pMBLayout); };
virtual const std::map<LabelIdType, LabelType>& GetLabelMapping(const std::wstring& sectionName);
virtual void SetLabelMapping(const std::wstring& sectionName, const std::map<LabelIdType, LabelType>& labelMapping);
virtual bool GetData(const std::wstring& sectionName, size_t numRecords, void* data, size_t& dataBufferSize, size_t recordStart=0);
Expand Down
1 change: 1 addition & 0 deletions MachineLearning/CNTK/NDLUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ namespace Microsoft { namespace MSR { namespace CNTK {
// make sure to clear the caches so we pick up the new nodes
m_net->ClearCaches();
// validate the network
//m_net->SetFakeMBLayoutForValidation(); // fake an MB layout to match the initial values of Input
if (dumpFileName != L"")
m_net->DumpAllNodesToFile(false, dumpFileName, false);
m_net->ValidateNetwork(!fullValidate);
Expand Down
6 changes: 3 additions & 3 deletions MachineLearning/CNTK/SimpleNetworkBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1739,7 +1739,7 @@ namespace Microsoft { namespace MSR { namespace CNTK {
input = output;
}

size_t idim = input->FunctionValues().GetNumRows();
size_t idim = input->GetNumRows();
assert(m_lookupTabelOrderSizes.size() == m_streamSizes.size());

e = builder.CreateLearnableParameter(msra::strfun::wstrprintf(L"Embedding%d", idx), m_layerSizes[1], idim / m_lookupTabelOrderSizes[idx]);
Expand Down Expand Up @@ -2060,7 +2060,7 @@ namespace Microsoft { namespace MSR { namespace CNTK {
input = output;
}

size_t idim = input->FunctionValues().GetNumRows();
size_t idim = input->GetNumRows();
assert(m_lookupTabelOrderSizes.size() == m_streamSizes.size());

e = builder.CreateLearnableParameter(msra::strfun::wstrprintf(L"Embedding%d", idx), m_layerSizes[1], idim / m_lookupTabelOrderSizes[idx]);
Expand Down Expand Up @@ -2433,7 +2433,7 @@ namespace Microsoft { namespace MSR { namespace CNTK {
else
std::runtime_error("Output layer size must be specified when converting pretrained network, use outputLayerSize=");

size_t penultimateSize = input->FunctionValues().GetNumRows();
size_t penultimateSize = input->GetNumRows();

wstring nameOfW = msra::strfun::wstrprintf(L"W%d", i);
wstring nameOfB = msra::strfun::wstrprintf(L"B%d", i);
Expand Down
Loading

0 comments on commit 520105d

Please sign in to comment.