Template Class Transformer¶
Defined in File transformer.h
Inheritance Relationships¶
Base Type¶
public EncoderOrDecoderBase
Class Documentation¶
-
template<class
EncoderOrDecoderBase
>
classTransformer
: public EncoderOrDecoderBase¶ Public Functions
-
Transformer
(Ptr<ExpressionGraph> graph, Ptr<Options> options)¶
-
virtual Expr
addSpecialEmbeddings
(Expr input, int start = 0, Ptr<data::CorpusBatch> = nullptr) const¶
-
Expr
postProcess
(std::string prefix, std::string ops, Expr input, Expr prevInput, float dropProb = 0.0f) const¶
-
Expr
Attention
(std::string, Expr q, Expr k, Expr v, Expr mask = nullptr, bool saveAttentionWeights = false, int dimBeam = 1)¶
-
Expr
MultiHead
(std::string prefix, int dimOut, int dimHeads, Expr q, const Expr &keys, const Expr &values, const Expr &mask, bool cache = false, bool saveAttentionWeights = false)¶
-
Expr
LayerAttention
(std::string prefix, Expr input, Expr keys, Expr values, Expr mask, int dimHeads, bool cache = false, bool saveAttentionWeights = false)¶
-
Expr
DecoderLayerSelfAttention
(rnn::State &decoderLayerState, const rnn::State &prevdecoderLayerState, std::string prefix, Expr input, Expr selfMask, int startPos)¶
Public Static Functions
Protected Functions
-