https://github.com/Microsoft/CNTK
Raw File
Tip revision: d6f33c78bd414e9342b8681834ec54a649039e0f authored by Alexey Reznichenko on 12 October 2016, 12:32:00 UTC
Repro for diverging loss after checkpoining
Tip revision: d6f33c7
HTKMLFReader.h
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.md file in the project root for full license information.
//

#pragma once

#include "ReaderBase.h"
#include "Config.h"

namespace Microsoft { namespace MSR { namespace CNTK {

// The class represents a factory for connecting the packer,
// transformers and HTK and MLF deserializers together.
// TODO: Should be deprecated. Composite reader should be used instead.
class HTKMLFReader : public ReaderBase
{
public:
    HTKMLFReader(const ConfigParameters& parameters);

    // Description of streams that this reader provides.
    std::vector<StreamDescriptionPtr> GetStreamDescriptions() override;

    // Starts a new epoch with the provided configuration.
    void StartEpoch(const EpochConfiguration& config, const std::map<std::wstring, int>& requiredStreams) override;

private:
    enum class PackingMode
    {
        sample,
        sequence,
        truncated
    };

    // All streams this reader provides.
    std::vector<StreamDescriptionPtr> m_streams;

    // TODO: Should be moved outside of the reader.
    PackingMode m_packingMode;

    // Seed for the random generator.
    unsigned int m_seed;

    // Truncation length for BPTT mode.
    size_t m_truncationLength;

    // Parallel sequences, used for legacy configs.
    intargvector m_numParallelSequencesForAllEpochs;
};

}}}
back to top