Class EncoderDecoder

Inheritance Relationships

Base Types

Derived Types

Class Documentation

class EncoderDecoder : public marian::IEncoderDecoder, public marian::LayerBase

Subclassed by marian::Amun, marian::Nematus

Public Types

typedef data::Corpus dataset_type

Public Functions

EncoderDecoder(Ptr<ExpressionGraph> graph, Ptr<Options> options)
virtual Ptr<Options> getOptions()
std::vector<Ptr<EncoderBase>> &getEncoders()
void push_back(Ptr<EncoderBase> encoder)
std::vector<Ptr<DecoderBase>> &getDecoders()
void push_back(Ptr<DecoderBase> decoder)
void load(Ptr<ExpressionGraph> graph, const std::vector<io::Item> &items, bool markedReloaded = true)
void load(Ptr<ExpressionGraph> graph, const std::string &name, bool markedReloaded = true)
void mmap(Ptr<ExpressionGraph> graph, const void *ptr, bool markedReloaded = true)
void save(Ptr<ExpressionGraph> graph, const std::string &name, bool saveTranslatorConfig = false)
void clear(Ptr<ExpressionGraph> graph)
template<typename T>
T opt(const std::string &key)
template<typename T>
T opt(const std::string &key, const T &def)
template<typename T>
void set(std::string key, T value)
virtual void setShortlistGenerator(Ptr<const data::ShortlistGenerator> shortlistGenerator)
virtual Ptr<data::Shortlist> getShortlist()
virtual data::SoftAlignment getAlignment()
Ptr<DecoderState> startState(Ptr<ExpressionGraph> graph, Ptr<data::CorpusBatch> batch)
Ptr<DecoderState> step(Ptr<ExpressionGraph> graph, Ptr<DecoderState> state, const std::vector<IndexType> &hypIndices, const Words &words, const std::vector<IndexType> &batchIndices, int beamSize)
Ptr<DecoderState> stepAll(Ptr<ExpressionGraph> graph, Ptr<data::CorpusBatch> batch, bool clearGraph = true)
Logits build(Ptr<ExpressionGraph> graph, Ptr<data::CorpusBatch> batch, bool clearGraph = true)
Logits build(Ptr<ExpressionGraph> graph, Ptr<data::Batch> batch, bool clearGraph = true)

Protected Functions

Config::YamlNode getModelParameters()
std::string getModelParametersAsString()
void createDecoderConfig(const std::string &name)

Protected Attributes

Ptr<const data::ShortlistGenerator> shortlistGenerator_
const std::string prefix_
const bool inference_ = {false}
std::vector<Ptr<EncoderBase>> encoders_
std::vector<Ptr<DecoderBase>> decoders_
std::set<std::string> modelFeatures_