Mila 0.13.48
Deep Neural Network Library
Loading...
Searching...
No Matches
Mila::Dnn::Optimizers::AdamWConfig Class Referenceexport

Configuration for AdamW optimizer. More...

Inheritance diagram for Mila::Dnn::Optimizers::AdamWConfig:
Collaboration diagram for Mila::Dnn::Optimizers::AdamWConfig:

Public Member Functions

void fromMetadata (const SerializationMetadata &meta) override
 Populate configuration from provided metadata.
float getBeta1 () const noexcept
float getBeta2 () const noexcept
float getEpsilon () const noexcept
float getLearningRate () const noexcept
float getWeightDecay () const noexcept
SerializationMetadata toMetadata () const override
 Convert configuration into SerializationMetadata.
std::string toString () const override
 Produce a short, human-readable summary of the configuration.
void validate () const override
 Validate configuration parameters.
template<typename Self>
decltype(auto) withBeta1 (this Self &&self, float beta1) noexcept
template<typename Self>
decltype(auto) withBeta2 (this Self &&self, float beta2) noexcept
template<typename Self>
decltype(auto) withEpsilon (this Self &&self, float epsilon) noexcept
template<typename Self>
decltype(auto) withLearningRate (this Self &&self, float learning_rate) noexcept
template<typename Self>
decltype(auto) withWeightDecay (this Self &&self, float weight_decay) noexcept
Public Member Functions inherited from Mila::Dnn::ComponentConfig
virtual ~ComponentConfig ()=default
 Virtual destructor for polymorphic base.

Private Attributes

float beta1_ { 0.9f }
float beta2_ { 0.999f }
float epsilon_ { 1e-8f }
float learning_rate_ { 0.001f }
float weight_decay_ { 0.01f }

Detailed Description

Configuration for AdamW optimizer.

Encapsulates hyperparameters for AdamW and provides fluent setters, validation and conversion to/from the framework's metadata abstraction.

Member Function Documentation

◆ fromMetadata()

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

Populate configuration from provided metadata.

Missing keys are ignored; type-safe try-get helpers are used so incorrect/missing entries don't throw but simply leave defaults intact.

Implements Mila::Dnn::ComponentConfig.

Here is the call graph for this function:

◆ getBeta1()

float Mila::Dnn::Optimizers::AdamWConfig::getBeta1 ( ) const
inlinenoexcept

◆ getBeta2()

float Mila::Dnn::Optimizers::AdamWConfig::getBeta2 ( ) const
inlinenoexcept

◆ getEpsilon()

float Mila::Dnn::Optimizers::AdamWConfig::getEpsilon ( ) const
inlinenoexcept

◆ getLearningRate()

float Mila::Dnn::Optimizers::AdamWConfig::getLearningRate ( ) const
inlinenoexcept

◆ getWeightDecay()

float Mila::Dnn::Optimizers::AdamWConfig::getWeightDecay ( ) const
inlinenoexcept

◆ toMetadata()

SerializationMetadata Mila::Dnn::Optimizers::AdamWConfig::toMetadata ( ) const
inlineoverridevirtual

Convert configuration into SerializationMetadata.

Keys produced:

  • "learning_rate" : double
  • "beta1" : double
  • "beta2" : double
  • "epsilon" : double
  • "weight_decay" : double

Implements Mila::Dnn::ComponentConfig.

Here is the call graph for this function:

◆ toString()

std::string Mila::Dnn::Optimizers::AdamWConfig::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::Optimizers::AdamWConfig::validate ( ) const
inlineoverridevirtual

Validate configuration parameters.

Throws std::invalid_argument on invalid parameters.

Implements Mila::Dnn::ComponentConfig.

Here is the caller graph for this function:

◆ withBeta1()

template<typename Self>
decltype(auto) Mila::Dnn::Optimizers::AdamWConfig::withBeta1 ( this Self && self,
float beta1 )
inlinenoexcept

◆ withBeta2()

template<typename Self>
decltype(auto) Mila::Dnn::Optimizers::AdamWConfig::withBeta2 ( this Self && self,
float beta2 )
inlinenoexcept

◆ withEpsilon()

template<typename Self>
decltype(auto) Mila::Dnn::Optimizers::AdamWConfig::withEpsilon ( this Self && self,
float epsilon )
inlinenoexcept

◆ withLearningRate()

template<typename Self>
decltype(auto) Mila::Dnn::Optimizers::AdamWConfig::withLearningRate ( this Self && self,
float learning_rate )
inlinenoexcept

◆ withWeightDecay()

template<typename Self>
decltype(auto) Mila::Dnn::Optimizers::AdamWConfig::withWeightDecay ( this Self && self,
float weight_decay )
inlinenoexcept

Member Data Documentation

◆ beta1_

float Mila::Dnn::Optimizers::AdamWConfig::beta1_ { 0.9f }
private

◆ beta2_

float Mila::Dnn::Optimizers::AdamWConfig::beta2_ { 0.999f }
private

◆ epsilon_

float Mila::Dnn::Optimizers::AdamWConfig::epsilon_ { 1e-8f }
private

◆ learning_rate_

float Mila::Dnn::Optimizers::AdamWConfig::learning_rate_ { 0.001f }
private

◆ weight_decay_

float Mila::Dnn::Optimizers::AdamWConfig::weight_decay_ { 0.01f }
private

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