Class PoolerBase

Inheritance Relationships

Base Type

Derived Types

Class Documentation

class PoolerBase : public marian::LayerBase

Simple base class for Poolers to be used in EncoderPooler framework A pooler takes a encoder state (contextual word embeddings) and produces a single sentence embedding.

Subclassed by marian::MaxPooler, marian::SimPooler, marian::SlicePooler

Public Functions

PoolerBase(Ptr<ExpressionGraph> graph, Ptr<Options> options)
virtual ~PoolerBase()
virtual std::vector<Expr> apply(Ptr<ExpressionGraph>, Ptr<data::CorpusBatch>, const std::vector<Ptr<EncoderState>>&) = 0
template<typename T>
T opt(const std::string &key) const
virtual void clear() = 0

Protected Attributes

const std::string prefix_ = {"pooler"}
const bool inference_ = {false}
const size_t batchIndex_ = {0}