Struct TransformerEncoderOptions¶
Defined in File transformercoder.h
Page Contents
Struct Documentation¶
-
struct TransformerEncoderOptions¶
Options for the
TransformerEncoder
Example:
TransformerEncoderLayer encoderLayer(TransformerEncoderLayerOptions(512, 8).dropout(0.1)); auto options = TransformerEncoderOptions(encoderLayer, 6).norm(LayerNorm(LayerNormOptions({2})));
Public Functions
-
TransformerEncoderOptions(TransformerEncoderLayer encoder_layer, int64_t num_layers)¶
-
TransformerEncoderOptions(const TransformerEncoderLayerOptions &encoder_layer_options, int64_t num_layers)¶
-
inline auto encoder_layer(const TransformerEncoderLayer &new_encoder_layer) -> decltype(*this)¶
transformer Encoder Layer
-
inline auto encoder_layer(TransformerEncoderLayer &&new_encoder_layer) -> decltype(*this)¶
-
inline const TransformerEncoderLayer &encoder_layer() const noexcept¶
-
inline TransformerEncoderLayer &encoder_layer() noexcept¶
-
inline auto num_layers(const int64_t &new_num_layers) -> decltype(*this)¶
number of encoder layers
-
inline auto num_layers(int64_t &&new_num_layers) -> decltype(*this)¶
-
inline const int64_t &num_layers() const noexcept¶
-
inline int64_t &num_layers() noexcept¶
-
TransformerEncoderOptions(TransformerEncoderLayer encoder_layer, int64_t num_layers)¶