GroupedConv1DLayer<T>
Layers · AiDotNet.NeuralNetworks.Layers
A grouped 1-D convolution (PyTorch Conv1d(groups = g)): the channels are split into g groups and each output
group sees only its input group.
Inheritance: LayerBase<T> → GroupedConv1DLayer<T>
Implements: IShapeContract
For Beginners
Splits the channels into independent bundles and convolves each bundle separately, which is cheaper than mixing every channel with every other.
How It Works
The kernel is [out, in / g, 1, k] with a bias per output channel, initialized as PyTorch does:
U(−1/√fan_in, 1/√fan_in) with fan_in = (in / g) · k. Each group runs its own convolution over its slice of the
channels, so the parameter count is a g-th of a full convolution’s. Input and output are [batch, channels, time].
Constructors
| Constructor | Summary |
|---|---|
GroupedConv1DLayer(int inChannels, int outChannels, int kernelSize, int groups, int padding, int dilation) |
Creates the layer. |
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). |