Mila
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

 SoftmaxConfig ()=default
 Default constructor.
 
int64_t getAxis () const
 Get the configured axis value.
 
void validate () const
 Validate configuration parameters.
 
SoftmaxConfigwithAxis (int64_t axis)
 Set the axis along which to apply the softmax operation.
 
- Public Member Functions inherited from Mila::Dnn::ComponentConfig
virtual ~ComponentConfig ()=default
 Virtual destructor to support proper polymorphic destruction.
 
const std::string & getName () const
 Gets the configured component name.
 
ComputePrecision::Policy getPrecision () const
 Gets the configured precision policy.
 
bool isTraining () const
 Gets the configured training mode.
 
template<typename Self >
auto & withName (this Self &&self, std::string name)
 Sets the name of the component with fluent interface.
 
template<typename Self >
auto & withPrecision (this Self &&self, ComputePrecision::Policy policy)
 Sets the compute precision policy with fluent interface.
 
template<typename Self >
auto & withTraining (this Self &&self, bool is_training)
 Sets the training mode with fluent interface.
 

Private Attributes

int64_t axis_ = -1
 

Additional Inherited Members

- Protected Attributes inherited from Mila::Dnn::ComponentConfig
bool is_training_ = false
 Training mode flag, defaults to false (inference mode)
 
std::string name_ = "unnamed"
 Component name, defaults to "unnamed" if not explicitly set.
 
ComputePrecision::Policy precision_ = ComputePrecision::Policy::Auto
 Precision policy for computation, defaults to Auto.
 

Detailed Description

Configuration class for Softmax module.

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

Constructor & Destructor Documentation

◆ SoftmaxConfig()

Mila::Dnn::SoftmaxConfig::SoftmaxConfig ( )
default

Default constructor.

Member Function Documentation

◆ getAxis()

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

Get the configured axis value.

Returns
int64_t The axis along which softmax will be computed
Here is the caller graph for this function:

◆ validate()

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

Validate configuration parameters.

Exceptions
std::invalid_argumentIf validation fails

Reimplemented from Mila::Dnn::ComponentConfig.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ withAxis()

SoftmaxConfig & Mila::Dnn::SoftmaxConfig::withAxis ( int64_t  axis)
inline

Set the axis along which to apply the softmax operation.

Parameters
axisDimension for softmax computation (default: -1 for last dimension)
Returns
SoftmaxConfig& Reference to this 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: