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

Configuration class for Softmax module. More...

Inheritance diagram for Mila::Dnn::SoftmaxConfig:
Collaboration diagram for Mila::Dnn::SoftmaxConfig:

Public Member Functions

void fromMetadata (const SerializationMetadata &meta)
 Deserialize configuration from SerializationMetadata.
int64_t getAxis () const noexcept
 Get the configured axis value.
SerializationMetadata toMetadata () const
 Serialize this configuration to SerializationMetadata.
std::string toString () const override
 Get a string representation of the configuration.
void validate () const override
 Validate configuration parameters.
template<typename Self>
Self && withAxis (this Self &&self, int64_t axis)
 fluent setter for the axis along which to apply softmax.
Public Member Functions inherited from Mila::Dnn::ComponentConfig
virtual ~ComponentConfig ()=default
 Virtual destructor for polymorphic base.

Private Attributes

int64_t axis_ = -1

Detailed Description

Configuration class for Softmax module.

Provides a type-safe fluent interface for configuring Softmax modules.

Examples
/__w/Mila/Mila/Mila/Src/Dnn/Components/Normalization/Softmax.ixx.

Member Function Documentation

◆ fromMetadata()

void Mila::Dnn::SoftmaxConfig::fromMetadata ( const SerializationMetadata & meta)
inlinevirtual

Deserialize configuration from SerializationMetadata.

Missing keys leave fields at their current values.

Parameters
metaSerializationMetadata containing configuration parameters

Implements Mila::Dnn::ComponentConfig.

Here is the call graph for this function:

◆ getAxis()

int64_t Mila::Dnn::SoftmaxConfig::getAxis ( ) const
inlinenoexcept

Get the configured axis value.

Returns
int64_t The axis along which softmax will be computed
Examples
/__w/Mila/Mila/Mila/Src/Dnn/Components/Normalization/Softmax.ixx.

◆ toMetadata()

SerializationMetadata Mila::Dnn::SoftmaxConfig::toMetadata ( ) const
inlinevirtual

Serialize this configuration to SerializationMetadata.

Returns
SerializationMetadata containing configuration parameters

Implements Mila::Dnn::ComponentConfig.

Here is the call graph for this function:

◆ toString()

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

Get a string representation of the configuration.

Returns
std::string Human-readable representation

Implements Mila::Dnn::ComponentConfig.

◆ validate()

void Mila::Dnn::SoftmaxConfig::validate ( ) const
inlineoverridevirtual

Validate configuration parameters.

Exceptions
std::invalid_argumentIf validation fails

Implements Mila::Dnn::ComponentConfig.

Examples
/__w/Mila/Mila/Mila/Src/Dnn/Components/Normalization/Softmax.ixx.

◆ withAxis()

template<typename Self>
Self && Mila::Dnn::SoftmaxConfig::withAxis ( this Self && self,
int64_t axis )
inline

fluent setter for the axis along which to apply softmax.

Parameters
axisDimension for softmax computation (default: -1 for last dimension)
Returns
Self&& for method chaining

Member Data Documentation

◆ axis_

int64_t Mila::Dnn::SoftmaxConfig::axis_ = -1
private

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