|
Mila
Deep Neural Network Library
|
Configuration class for the Learned Positional Encoder. More...
Public Member Functions | |
| void | fromMetadata (const SerializationMetadata &meta) override |
| Populate configuration from serialization metadata. | |
| dim_t | getEmbeddingDim () const |
| Get the configured embedding dimension. | |
| dim_t | getMaxSequenceLength () const |
| Get the configured maximum sequence length. | |
| dim_t | getVocabularyLength () const |
| Get the configured vocabulary length. | |
| SerializationMetadata | toMetadata () const override |
| Convert configuration to serialization metadata. | |
| std::string | toString () const override |
| Produce a short, human-readable summary of this configuration. | |
| void | validate () const override |
| Validate configuration parameters. | |
| template<typename Self> | |
| decltype(auto) | withEmbeddingDim (this Self &&self, dim_t embedding_dim) |
| C++23-style fluent setter for embedding dimension. | |
| template<typename Self> | |
| decltype(auto) | withMaxSequenceLength (this Self &&self, dim_t max_seq_len) |
| C++23-style fluent setter for maximum sequence length. | |
| template<typename Self> | |
| decltype(auto) | withVocabularyLength (this Self &&self, dim_t vocab_len) |
| C++23-style fluent setter for vocabulary length. | |
| Public Member Functions inherited from Mila::Dnn::ComponentConfig | |
| virtual | ~ComponentConfig ()=default |
| Virtual destructor for polymorphic base. | |
Configuration class for the Learned Positional Encoder.
Provides a type-safe fluent interface for configuring Encoder.
|
inlineoverridevirtual |
Populate configuration from serialization metadata.
Reads available fields from the provided metadata and updates the configuration object accordingly.
Implements Mila::Dnn::ComponentConfig.
|
inline |
Get the configured embedding dimension.
|
inline |
Get the configured maximum sequence length.
|
inline |
Get the configured vocabulary length.
|
inlineoverridevirtual |
Convert configuration to serialization metadata.
Produces a SerializationMetadata object containing the configuration fields suitable for writing into an archive by the caller.
Implements Mila::Dnn::ComponentConfig.
|
inlineoverridevirtual |
Produce a short, human-readable summary of this configuration.
Overrides ComponentConfig::toString() to include Encoder-specific fields.
Implements Mila::Dnn::ComponentConfig.
|
inlineoverridevirtual |
Validate configuration parameters.
| std::invalid_argument | If validation fails |
Implements Mila::Dnn::ComponentConfig.