DepthwiseConv1DLayer<T>
Layers · AiDotNet.NeuralNetworks.Layers
A depthwise 1-D convolution over [B, C, T] feature/waveform data: each input channel is
convolved with its own temporal filter (no cross-channel mixing), producing
C * multiplier output channels.
Inheritance: LayerBase<T> → DepthwiseConv1DLayer<T>
Implements: IShapeContract
How It Works
This is the time half of the 1-D time-channel separable convolution used by NVIDIA
QuartzNet / Citrinet (Majumdar et al., 2021). A full TCSConv is this depthwise-temporal layer
followed by a pointwise (1×1) Conv1DLayer that mixes channels — factorizing a
dense 1-D convolution into far fewer parameters while preserving the receptive field.
Built on the tape-aware DepthwiseConv1D engine primitive, so the
gradient flows through the recorded op with no hand-written backward. The kernel width is
C (channels are known at construction), so weights are allocated eagerly — avoiding the
lazy-init/Clone-via-SetParameters disagreement that afflicts input-inferred layers.
Constructors
| Constructor | Summary |
|---|---|
DepthwiseConv1DLayer(int channels, int kernelSize, int multiplier, int stride, int? padding, IActivationFunction<T> activation, IInitializationStrategy<T> initializationStrategy) |
Constructs a depthwise 1-D convolution. |
Properties
| Property | Summary |
|---|---|
bool SupportsTraining { get; } |
Methods
| Method | Summary |
|---|---|
Dictionary<string, string> GetParameterRoles() |
Returns parameter roles for per-role optimizer configuration (e.g., weight decay exemption for biases). |
IReadOnlyList<OutputAxisContract> OutputAxesFor(int inputRank) |
|
IReadOnlyList<Tensor<T>> GetTrainableParameters() |
Returns all trainable parameter tensors marked with [TrainableParameter]. |
void ResetState() |
|
void SetTrainableParameters(IReadOnlyList<Tensor<T>> parameters) |
Replaces trainable parameter tensors (e.g., with ParameterBuffer views). |
void ZeroGrad() |
Clears all gradient fields discovered by convention ({paramName}Gradient). |