Configuration class for Linear module.
More...
|
| LinearConfig (size_t input_features, size_t output_features) |
| Constructor with required parameters.
|
|
size_t | getInputFeatures () const |
|
size_t | getOutputFeatures () const |
|
bool | hasBias () const |
|
void | validate () const |
| Validate configuration parameters.
|
|
LinearConfig & | withBias (bool has_bias) |
| Configure whether the linear layer uses bias.
|
|
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.
|
|
Configuration class for Linear module.
Provides a type-safe fluent interface for configuring Linear modules.
◆ LinearConfig()
Mila::Dnn::LinearConfig::LinearConfig |
( |
size_t |
input_features, |
|
|
size_t |
output_features |
|
) |
| |
|
inline |
Constructor with required parameters.
- Parameters
-
input_features | The number of input features |
output_features | The number of output features |
◆ getInputFeatures()
size_t Mila::Dnn::LinearConfig::getInputFeatures |
( |
| ) |
const |
|
inline |
◆ getOutputFeatures()
size_t Mila::Dnn::LinearConfig::getOutputFeatures |
( |
| ) |
const |
|
inline |
◆ hasBias()
bool Mila::Dnn::LinearConfig::hasBias |
( |
| ) |
const |
|
inline |
◆ validate()
void Mila::Dnn::LinearConfig::validate |
( |
| ) |
const |
|
inlinevirtual |
Validate configuration parameters.
- Exceptions
-
std::invalid_argument | If validation fails |
Reimplemented from Mila::Dnn::ComponentConfig.
◆ withBias()
LinearConfig & Mila::Dnn::LinearConfig::withBias |
( |
bool |
has_bias | ) |
|
|
inline |
Configure whether the linear layer uses bias.
- Parameters
-
has_bias | Whether to include bias term |
- Returns
- LinearConfig& Reference to this for method chaining
◆ has_bias_
bool Mila::Dnn::LinearConfig::has_bias_ = true |
|
private |
◆ input_features_
size_t Mila::Dnn::LinearConfig::input_features_ |
|
private |
◆ output_features_
size_t Mila::Dnn::LinearConfig::output_features_ |
|
private |
The documentation for this class was generated from the following file: