|
Mila
Deep Neural Network Library
|
Configuration class for Residual connection component. More...
Public Member Functions | |
| void | fromMetadata (const SerializationMetadata &meta) override |
| Populate configuration from serialization metadata. | |
| ConnectionType | getConnectionType () const noexcept |
| Get the configured connection type. | |
| float | getScalingFactor () const noexcept |
| Get the configured scaling factor. | |
| SerializationMetadata | toMetadata () const override |
| Convert configuration to serialization metadata. | |
| std::string | toString () const override |
| Produce a brief human-readable summary of the configuration. | |
| void | validate () const override |
| Validate configuration parameters. | |
| template<typename Self> | |
| decltype(auto) | withConnectionType (this Self &&self, ConnectionType ct) |
| Set the connection type. | |
| template<typename Self> | |
| decltype(auto) | withScalingFactor (this Self &&self, float factor) |
| Set the scaling factor applied to the residual branch. | |
| Public Member Functions inherited from Mila::Dnn::ComponentConfig | |
| virtual | ~ComponentConfig ()=default |
| Virtual destructor for polymorphic base. | |
Configuration class for Residual connection component.
ResidualConfig is a lightweight, fluent configuration object consumed by Residual components and by compute-backend factories.
|
inlineoverridevirtual |
Populate configuration from serialization metadata.
Reads available fields from the provided metadata and updates the configuration object accordingly.
Implements Mila::Dnn::ComponentConfig.
|
inlinenoexcept |
Get the configured connection type.
|
inlinenoexcept |
Get the configured scaling factor.
|
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 brief human-readable summary of the configuration.
Implements Mila::Dnn::ComponentConfig.
|
inlineoverridevirtual |
Validate configuration parameters.
Called by callers to ensure the configuration represents a valid, constructible component. Implementations must throw std::invalid_argument (or a derived exception) when validation fails.
| std::invalid_argument | If the configuration is invalid. |
Implements Mila::Dnn::ComponentConfig.
|
inline |
Set the connection type.
Currently only Addition is supported.
|
inline |
Set the scaling factor applied to the residual branch.
| factor | Scaling factor (positive) |