WeightNormConv1DLayer<T>
Layers · AiDotNet.NeuralNetworks.Layers
A 1-D convolution whose kernel is weight-normalized: w = g · v / ‖v‖, with the norm taken per output channel.
Inheritance: LayerBase<T> → WeightNormConv1DLayer<T>
Implements: IShapeContract
For Beginners
An ordinary convolution, except each filter’s size and direction are learned separately, which makes training of deep convolution stacks better behaved.
How It Works
Weight normalization (Salimans & Kingma 2016) reparameterizes each output channel’s filter as a direction
v and a length g, which decouples the two in optimization. WaveNet-style networks in flow-based
vocoders and acoustic models use it on every convolution (WaveGlow, and Glow-TTS’s coupling layers, whose reference
implementation wraps each Conv1d in torch.nn.utils.weight_norm). As there, g starts at
‖v‖, so the initial kernel equals v.
Input [batch, inChannels, time]; output [batch, outChannels, time'] with the given padding and
dilation.
Constructors
| Constructor | Summary |
|---|---|
WeightNormConv1DLayer(int inChannels, int outChannels, int kernelSize, int dilation, int padding, double initStandardDeviation) |
Creates the convolution. |
Properties
| Property | Summary |
|---|---|
bool SupportsTraining { get; } |
|
int OutChannels { get; } |
Output channels. |
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 UpdateParameters(T learningRate) |
|
void ZeroGrad() |
Clears all gradient fields discovered by convention ({paramName}Gradient). |