SimpleNetworkBuilder and NDLBuilder no longer derive from IComputationNetBuilder;

steps towards making gcc happy (still stuck with a link error)
This commit is contained in:
Frank Seide 2015-11-24 20:13:46 -08:00
Родитель ed492dd102
Коммит a538f070db
6 изменённых файлов: 24 добавлений и 24 удалений

Просмотреть файл

@ -27,7 +27,6 @@ void DataWriter<ElemType>::InitFromConfig(const ConfigRecordType & /*config*/)
// not implemented, calls the underlying class instead
}
// Destroy - cleanup and remove this class
// NOTE: this destroys the object, and it can't be used past this point
template<class ElemType>
@ -83,8 +82,6 @@ template DataWriter<double>::DataWriter(const ConfigParameters &);
template DataWriter<float >::DataWriter(const ScriptableObjects::IConfigRecord &);
template DataWriter<double>::DataWriter(const ScriptableObjects::IConfigRecord &);
// destructor - cleanup temp files, etc.
template<class ElemType>
DataWriter<ElemType>::~DataWriter()

Просмотреть файл

@ -8,6 +8,8 @@
#include "stdafx.h"
#include "Basics.h"
#include "basetypes.h"
#define DATAREADER_EXPORTS // creating the exports here
#include "DataReader.h"
#include "LUSequenceReader.h"
@ -369,8 +371,8 @@ void BatchLUSequenceReader<ElemType>::InitFromConfig(const ConfigRecordType & re
const ConfigRecordType & labelConfig = readerConfig(m_labelsName[index].c_str(), ConfigRecordType::Record());
m_labelInfo[index].idMax = 0;
m_labelInfo[index].beginSequence = labelConfig(L"beginSequence", L"");
m_labelInfo[index].endSequence = labelConfig(L"endSequence", L"");
m_labelInfo[index].beginSequence = (wstring)labelConfig(L"beginSequence", L"");
m_labelInfo[index].endSequence = (wstring)labelConfig(L"endSequence", L"");
m_labelInfo[index].busewordmap = labelConfig(L"useWordMap", false);
m_labelInfo[index].isproposal = labelConfig(L"isProposal", false);
@ -423,9 +425,7 @@ void BatchLUSequenceReader<ElemType>::InitFromConfig(const ConfigRecordType & re
m_readNextSampleLine = 0;
m_readNextSample = 0;
ConfigArray wContext = readerConfig(L"wordContext", "0");
intargvector wordContext = wContext;
m_wordContext = wordContext;
m_wordContext = readerConfig(L"wordContext", ConfigRecordType::Array(intargvector(vector<int>{ 0 })));
// The input data is a combination of the label Data and extra feature dims together
// m_featureCount = m_featureDim + m_labelInfo[labelInfoIn].dim;
@ -1145,14 +1145,18 @@ template<class ElemType>
template<class ConfigRecordType>
void BatchLUSequenceReader<ElemType>::LoadWordMapping(const ConfigRecordType& readerConfig)
{
mWordMappingFn = readerConfig(L"wordmap", L"");
mWordMappingFn = (wstring)readerConfig(L"wordmap", L"");
wstring si, so;
wstring ss;
vector<wstring> vs;
if (mWordMappingFn != L"")
{
wifstream fp;
#ifdef _WIN32
fp.open(mWordMappingFn.c_str(), wifstream::in);
#else
fp.open(charpath(mWordMappingFn), wifstream::in);
#endif
while (fp.good())
{
@ -1230,13 +1234,13 @@ template<class ElemType>
template<class ConfigRecordType>
void MultiIOBatchLUSequenceReader<ElemType>::InitFromConfig(const ConfigRecordType & readerConfig)
{
ConfigArray ioNames = readerConfig(L"ioNodeNames", "");
vector<wstring> ioNames = readerConfig(L"ioNodeNames", ConfigRecordType::Array(stringargvector()));
if (ioNames.size() > 0)
{
/// newer code that explicitly place multiple streams for inputs
foreach_index(i, ioNames) // inputNames should map to node names
{
ConfigParameters thisIO = readerConfig(ioNames[i]);
const ConfigRecordType & thisIO = readerConfig(ioNames[i]);
BatchLUSequenceReader<ElemType> *thisReader = new BatchLUSequenceReader<ElemType>();
thisReader->Init(thisIO);

Просмотреть файл

@ -360,21 +360,20 @@ void UCIFastReader<ElemType>::InitFromConfig(const ConfigRecordType & readerConf
// determine label type desired
std::wstring labelType;
if (!hasLabels)
labelType = L"None";
labelType = L"none";
else
labelType = configLabels(L"labelType", L"Category");
labelType = (wstring)configLabels(L"labelType", L"category");
//convert to lower case for case insensitive comparison
msra::strfun::tolower_ascii(labelType);
if (labelType == L"category")
if (!_wcsicmp(labelType.c_str(), L"category"))
{
m_labelType = labelCategory;
}
else if (labelType == L"regression")
else if (!_wcsicmp(labelType.c_str(), L"regression"))
{
m_labelType = labelRegression;
}
else if (labelType == L"none")
else if (!_wcsicmp(labelType.c_str(), L"none"))
{
m_labelType = labelNone;
dimLabels = 0; // override for no labels
@ -382,7 +381,7 @@ void UCIFastReader<ElemType>::InitFromConfig(const ConfigRecordType & readerConf
std::wstring file = configFeatures(L"file");
if (m_traceLevel > 0)
fprintf(stderr, "reading uci file %ls\n", file.c_str());
fprintf(stderr, "Reading UCI file %ls\n", file.c_str());
m_parser.ParseInit(file.c_str(), startFeatures, dimFeatures, startLabels, dimLabels);

Просмотреть файл

@ -6,7 +6,6 @@
#pragma once
#include "NetworkDescriptionLanguage.h"
#include "ComputationNetwork.h"
#include "IComputationNetBuilder.h"
#include "IExecutionEngine.h"
#include "Basics.h"
#include <string>
@ -24,7 +23,7 @@ namespace Microsoft { namespace MSR { namespace CNTK {
using namespace Microsoft::MSR;
template<class ElemType>
class NDLBuilder : public IComputationNetBuilder<ElemType>
class NDLBuilder
{
typedef shared_ptr<ComputationNode<ElemType>> ComputationNodePtr;
@ -204,7 +203,7 @@ namespace Microsoft { namespace MSR { namespace CNTK {
ndlUtil.ProcessNDLConfig(config, true);
}
virtual ComputationNetworkPtr BuildNetworkFromDescription(ComputationNetwork* = nullptr) override
virtual ComputationNetworkPtr BuildNetworkFromDescription(ComputationNetwork* = nullptr)
{
if (m_net->GetTotalNumberOfNodes() < 1) //not built yet
{

Просмотреть файл

@ -14,7 +14,6 @@
#include "BestGpu.h"
#include "ComputationNetwork.h"
#include "IComputationNetBuilder.h"
#include "commandArgUtil.h"
// TODO: giving up moving stuff for now, running out of time. The following #includes should not be necessary once the hard-working code in here gets moved to .cpp
@ -74,7 +73,7 @@ namespace Microsoft { namespace MSR { namespace CNTK {
extern EvalCriterion ParseEvalCriterionString(wstring s);
template<class ElemType>
class SimpleNetworkBuilder : public IComputationNetBuilder<ElemType>
class SimpleNetworkBuilder
{
protected:
typedef shared_ptr<ComputationNode<ElemType>> ComputationNodePtr;
@ -248,7 +247,7 @@ namespace Microsoft { namespace MSR { namespace CNTK {
}
ComputationNetworkPtr BuildNetworkFromDescription(ComputationNetwork* encoderNet = nullptr) override;
ComputationNetworkPtr BuildNetworkFromDescription(ComputationNetwork* encoderNet = nullptr);
ComputationNetworkPtr BuildNetworkFromDbnFile(const std::wstring& dbnModelFileName); // support for fseide's Microsoft-internal legacy tool "DBN.exe"

Просмотреть файл

@ -1,3 +1,4 @@
#if 1 // only needed for some unused code in MultiNetworksSGD.h
//
// <copyright file="IComputationNetBuilder.h" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
@ -25,3 +26,4 @@ namespace Microsoft { namespace MSR { namespace CNTK {
};
}}}
#endif