swh:1:snp:f50ab94432af916b5fb8b4ad831e8dddded77084
Raw File
Tip revision: 3f3a164530f857f386c27cdad33fdd410ebede94 authored by Mark Hillebrand on 12 September 2017, 11:18:10 UTC
Tests/Install/linux/prep-run-test.sh: bump Jupyter TO to 2700
Tip revision: 3f3a164
HTKMLFWriter.h
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.md file in the project root for full license information.
//
// HTKMLFReader.h - Include file for the MTK and MLF format of features and samples
//
#pragma once
#include "DataWriter.h"
#include "ScriptableObjects.h"
#include <map>
#include <vector>

namespace Microsoft { namespace MSR { namespace CNTK {

template <class ElemType>
class HTKMLFWriter : public IDataWriter
{
private:
    std::vector<size_t> outputDims;
    std::vector<std::vector<std::wstring>> outputFiles;

    std::vector<size_t> udims;
    std::map<std::wstring, size_t> outputNameToIdMap;
    std::map<std::wstring, size_t> outputNameToDimMap;
    std::map<std::wstring, size_t> outputNameToTypeMap;
    unsigned int sampPeriod;
    size_t outputFileIndex;
    void Save(std::wstring& outputFile, Matrix<ElemType>& outputData);
    ElemType* m_tempArray;
    size_t m_tempArraySize;

    enum OutputTypes
    {
        outputReal,
        outputCategory,
    };

public:
    template <class ConfigRecordType>
    void InitFromConfig(const ConfigRecordType& writerConfig);
    virtual void Init(const ConfigParameters& config)
    {
        InitFromConfig(config);
    }
    virtual void Init(const ScriptableObjects::IConfigRecord& config)
    {
        InitFromConfig(config);
    }
    virtual void Destroy();
    virtual void GetSections(std::map<std::wstring, SectionType, nocase_compare>& sections);
    virtual bool SaveData(size_t recordStart, const std::map<std::wstring, void*, nocase_compare>& matrices, size_t numRecords, size_t datasetSize, size_t byteVariableSized);
    virtual void SaveMapping(std::wstring saveId, const std::map<LabelIdType, LabelType>& labelMapping);
    virtual bool SupportMultiUtterances() const { return false; };
};
} } }
back to top