AcousticConditionEncoderLayer<T>

Layers · AiDotNet.NeuralNetworks.Layers

AdaSpeech’s acoustic condition encoder: two blocks of Conv1D → ReLU → LayerNorm → Dropout, then either a mean pooling over time (one vector per utterance) or a linear projection per position (one vector per phoneme).

Inheritance: LayerBase<T> → AcousticConditionEncoderLayer<T>

Implements: IShapeContract

For Beginners

This network listens to a stretch of speech and summarizes it — either as one vector for the whole utterance (its recording conditions and speaking style) or as a small vector per phoneme (its accent, pitch and emphasis).

How It Works

AdaSpeech (Chen et al. 2021, §2.1, Fig. 2, §3) uses three networks of this shape:

Input is [time, channels] or [batch, time, channels]. Output is [filters] / [batch, filters] with pooling, or [time', outputSize] / [batch, time', outputSize] without, where time' is the convolved length (equal to time at stride 1). The convolutions pad by (kernel − 1) / 2.

Constructors

Constructor Summary
AcousticConditionEncoderLayer(int inputChannels, int filterSize, int kernelSize, int stride, int outputSize, bool meanPool, double dropoutRate) Creates an acoustic condition encoder.

Properties

Property Summary
bool MeanPool { get; } Whether the encoder pools the sequence to one vector.
bool SupportsTraining { get; }
int OutputSize { get; } Width of each output vector.

Methods

Method Summary
IReadOnlyList<ILayer<T>> GetSubLayers()
IReadOnlyList<OutputAxisContract> OutputAxesFor(int inputRank)
void ResetState()