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

Public Member Functions

 CausalConv1dConfig (dim_t channels, dim_t kernel_width)
 Construct a depthwise causal 1-D convolution configuration.
void fromMetadata (const SerializationMetadata &meta) override
 Populate configuration from provided metadata.
dim_t getChannels () const noexcept
dim_t getKernelWidth () const noexcept
dim_t getStateRows () const noexcept
 Retained input rows = kernel_width - 1. The convolution's whole memory.
bool hasBias () const noexcept
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.
template<typename Self>
decltype(auto) withBias (this Self &&self, bool has_bias)
 Enable or disable a learnable per-channel bias.
Public Member Functions inherited from Mila::Dnn::ComponentConfig
virtual ~ComponentConfig ()=default
 Virtual destructor for polymorphic base.

Constructor & Destructor Documentation

◆ CausalConv1dConfig()

Mila::Dnn::CausalConv1dConfig::CausalConv1dConfig ( dim_t channels,
dim_t kernel_width )
inline

Construct a depthwise causal 1-D convolution configuration.

Parameters
channelsChannel count. Depthwise, so this is both in and out channels and the group count – there is no cross-channel mixing.
kernel_widthFilter taps. The convolution looks back kernel_width - 1 positions, which is also the retained state depth.

Member Function Documentation

◆ fromMetadata()

void Mila::Dnn::CausalConv1dConfig::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::CausalConv1dConfig::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::CausalConv1dConfig::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::CausalConv1dConfig::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.

◆ withBias()

template<typename Self>
decltype(auto) Mila::Dnn::CausalConv1dConfig::withBias ( this Self && self,
bool has_bias )
inline

Enable or disable a learnable per-channel bias.

Default: false.


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