swh:1:snp:f50ab94432af916b5fb8b4ad831e8dddded77084
Raw File
Tip revision: 727f34851f6b8a54a937701b00b43689c2c90a09 authored by Ratan Rai Sur on 22 May 2017, 23:07:05 UTC
linux side
Tip revision: 727f348
Transformer.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 "DataDeserializer.h"

namespace Microsoft { namespace MSR { namespace CNTK {

class Transformer;
typedef std::shared_ptr<Transformer> TransformerPtr;

// Defines a data transformation interface.
// Transformers are responsible for doing custom transformation of sequences.
// For example for images, there could be scale, crop, or median transformation.
class Transformer
{
public:
    // Starts a new epoch. Some transformers have to change their configuration
    // based on the epoch.
    virtual void StartEpoch(const EpochConfiguration &config) = 0;

    // Transformers are applied on a particular input stream - this method should describe
    // how inputStream is transformed to the output stream (return value)
    virtual StreamDescription Transform(const StreamDescription& inputStream) = 0;

    // This method should describe how input sequences is transformed to the output sequence.
    virtual SequenceDataPtr Transform(SequenceDataPtr inputSequence) = 0;

    virtual ~Transformer()
    {
    }
};

}}}
back to top