GatedConvolutionBlockLayer<T>
Layers · AiDotNet.NeuralNetworks.Layers
Deep Voice 3’s convolution block: dropout, a 1-D convolution to twice the channels, a gated linear unit, and an optional residual connection scaled by √0.5.
Inheritance: LayerBase<T> → GatedConvolutionBlockLayer<T>
Implements: IShapeContract
For Beginners
A convolution whose output decides, channel by channel, how much of itself to let through, which keeps deep stacks of convolutions trainable.
How It Works
Ping et al. 2018, §3.3, Fig. 2: “a 1-D convolution filter, a gated-linear unit as a learnable nonlinearity, a residual
connection to the input, and a scaling factor of √0.5”; the convolution output of 2c channels splits into the
input half and the gate half, a ⊙ σ(b). Causal convolutions pad k − 1 steps on the left, non-causal ones
(k − 1)/2 on both sides; dropout is applied to the input. Weights follow the convolutional sequence-to-sequence
initialization the paper cites (Gehring et al. 2017; reference implementation r9y9/deepvoice3_pytorch): weight
normalization with directions drawn from N(0, std_mul (1 − p) / (k · c_in)).
Input and output are [time, channels] or [batch, time, channels].
Constructors
| Constructor | Summary |
|---|---|
GatedConvolutionBlockLayer(int inChannels, int outChannels, int kernelSize, int dilation, bool causal, double dropoutRate, bool residual, double stdMultiplier) |
Creates the block. |
Properties
| Property | Summary |
|---|---|
bool SupportsTraining { get; } |
Methods
| Method | Summary |
|---|---|
IReadOnlyList<ILayer<T>> GetSubLayers() |
|
IReadOnlyList<OutputAxisContract> OutputAxesFor(int inputRank) |
|
void ResetState() |