|
Mila 0.13.48
Deep Neural Network Library
|
Configuration class for GELU module. More...


Public Member Functions | |
| void | fromMetadata (const SerializationMetadata &meta) override |
| Populate configuration from provided metadata. | |
| ApproximationMethod | getApproximationMethod () const |
| Get the configured approximation method. | |
| SerializationMetadata | toMetadata () const override |
| Convert configuration into framework 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> | |
| Self && | withApproximationMethod (this Self &&self, ApproximationMethod method) |
| Configure the approximation method for GELU computation. | |
| Public Member Functions inherited from Mila::Dnn::ComponentConfig | |
| virtual | ~ComponentConfig ()=default |
| Virtual destructor for polymorphic base. | |
Private Attributes | |
| ApproximationMethod | approximation_method_ = ApproximationMethod::Tanh |
Configuration class for GELU module.
Provides a type-safe fluent interface for configuring GELU modules.
|
inlineoverridevirtual |
Populate configuration from provided metadata.
Missing keys are ignored leaving defaults intact. Unknown approximation method strings result in std::invalid_argument.
| meta | Metadata to read configuration values from. |
Implements Mila::Dnn::ComponentConfig.

|
inline |
Get the configured approximation method.

|
inlineoverridevirtual |
Convert configuration into framework metadata.
Includes base fields (precision) and GELU-specific options.
Implements Mila::Dnn::ComponentConfig.

|
inlineoverridevirtual |
Produce a short, human-readable summary of this configuration.
Suitable for logging and debugging.
Implements Mila::Dnn::ComponentConfig.

|
inlineoverridevirtual |
Validate configuration parameters.
Implementations must throw std::invalid_argument on invalid configuration.
Implements Mila::Dnn::ComponentConfig.

|
inline |
Configure the approximation method for GELU computation.
Note: Currently, only the Tanh approximation method is supported.
| Self | Deduction of the concrete config type via C++23 explicit object parameter |
| method | The approximation method to use |

|
private |