Mila
Deep Neural Network Library
Loading...
Searching...
No Matches
Mila::Dnn::GatedDeltaRuleConfig Class Referenceexport
Inheritance diagram for Mila::Dnn::GatedDeltaRuleConfig:
Mila::Dnn::ComponentConfig

Public Member Functions

 GatedDeltaRuleConfig (dim_t num_key_heads, dim_t num_value_heads, dim_t head_key_dim, dim_t head_value_dim)
void fromMetadata (const SerializationMetadata &meta) override
 Populate configuration from provided metadata.
dim_t getHeadGroupSize () const noexcept
 Value heads served by each key head (27B: 3).
dim_t getHeadKeyDim () const noexcept
dim_t getHeadValueDim () const noexcept
dim_t getKeyWidth () const noexcept
 Width of the q and k projections: num_key_heads * head_key_dim.
dim_t getNumKeyHeads () const noexcept
dim_t getNumValueHeads () const noexcept
dim_t getStateElementsPerBatch () const noexcept
 Carried state elements per batch item: heads * head_key_dim * head_value_dim.
dim_t getValueWidth () const noexcept
 Width of the v projection and of the output: num_value_heads * head_value_dim.
SerializationMetadata toMetadata () const override
 Convert configuration into a SerializationMetadata object.
std::string toString () const override
 Produce a short, human-readable summary of the configuration.
void validate () const override
 Validate configuration parameters.
Public Member Functions inherited from Mila::Dnn::ComponentConfig
virtual ~ComponentConfig ()=default
 Virtual destructor for polymorphic base.

Member Function Documentation

◆ fromMetadata()

void Mila::Dnn::GatedDeltaRuleConfig::fromMetadata ( const SerializationMetadata & meta)
inlineoverridevirtual

Populate configuration from provided metadata.

Implementations should read available keys and leave missing keys at their current/default values to preserve forward/backward compatibility.

Parameters
metaMetadata to read configuration values from.

Implements Mila::Dnn::ComponentConfig.

◆ toMetadata()

SerializationMetadata Mila::Dnn::GatedDeltaRuleConfig::toMetadata ( ) const
inlineoverridevirtual

Convert configuration into a SerializationMetadata object.

Implementations should include any fields required to fully reconstruct the configuration via fromMetadata.

Returns
SerializationMetadata Metadata representation of the config.

Implements Mila::Dnn::ComponentConfig.

◆ toString()

std::string Mila::Dnn::GatedDeltaRuleConfig::toString ( ) const
inlineoverridevirtual

Produce a short, human-readable summary of the configuration.

Implementations should return a compact, single-line description suitable for logging and debugging.

Returns
std::string Human-readable summary of the configuration.

Implements Mila::Dnn::ComponentConfig.

◆ validate()

void Mila::Dnn::GatedDeltaRuleConfig::validate ( ) const
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.

Exceptions
std::invalid_argumentIf the configuration is invalid.

Implements Mila::Dnn::ComponentConfig.


The documentation for this class was generated from the following file: