Modelresearch
WaveNet
Also called dilated causal convolution vocoder.
An autoregressive model of raw audio that predicts each mu-law quantized sample from the past with stacks of dilated causal convolutions.
WaveNet is a probability model of raw audio. It treats a waveform as a sequence of samples and predicts each sample from all the samples before it, like a causal language model over a vocabulary of 256 amplitude levels. The network is a deep stack of causal convolutions, which see only the past, with dilations that double from layer to layer, so the receptive field grows exponentially with depth at a linear cost. To make speech from text, the model is conditioned on features from a text-to-speech front end. In the original paper these were linguistic features and a pitch contour; in Tacotron 2 they are mel spectrogram frames, and WaveNet is used as a vocoder. Its listening scores were well above those of the parametric and concatenative systems of its time. Its weak point is speed, because generation makes one sample at a time.
The machine
Sizes: samples at 16 kHz, layers, residual channels, kernel size , and output levels. Shapes are channels by time for one utterance.
Factorization. For a waveform and a conditioning input ,
Mu-law quantization. Each sample is compressed and then quantized to 256 levels:
This gives fine steps near 0, where most speech samples lie, and coarse steps for loud samples. The output for each is a softmax over the 256 levels, trained with the cross-entropy loss.
Dilated causal convolution. A causal convolution with kernel size and dilation computes
so output depends only on inputs at or before . The dilations double, , and this block of 10 layers is repeated. A stack of layers with dilations has the receptive field
Gated residual layer. Layer maps its input of shape to
where is the dilated causal convolution and the logistic function. A convolution of is added to to give the input of the next layer (the residual path), and another convolution of goes to the skip path. The sum of all skip outputs goes through ReLU, convolutions and the softmax, giving shape .
Conditioning. A global input , such as a speaker embedding, enters every layer as . A local input, such as linguistic features or mel frames at a lower rate, is first upsampled to the sample rate by transposed convolutions, , and enters as and with convolutions.
Standing assumptions. A fixed sample rate, a fixed quantization, and a fixed receptive field: the model sees no sample older than steps, except through the conditioning input.
What it counts
The model gives the probability of a whole waveform as the product of the softmax outputs. In training all outputs come from one parallel pass over the true waveform. In generation, each sample is drawn from the softmax and fed back as input.
- Receptive field. One block with dilations and has samples, 64 ms at 16 kHz. Three blocks give samples. A plain causal stack of the same depth would see only samples. The text-to-speech models of the paper had a receptive field of 240 ms.
- Mu-law check values. , and . With the level , these fall in levels 239, 157 and 32 of 0 to 255. Since , exactly, so half of the levels cover .
- Cost of generation. Each sample needs one pass through all layers, and the passes are sequential: 16000 passes per second of audio at 16 kHz. With caching of the past activations of each layer, a pass costs , so one second costs and no step can start before the one before it ends.
- Cost of training. All outputs of a training clip are computed in one pass in , in parallel over time, because the true past samples are known.
Relation to other models
- Causal language models have the same factorization over tokens. WaveNet uses convolutions in place of attention or recurrence, and its tokens are amplitude levels.
- PixelCNN (van den Oord and colleagues 2016) is the image model that WaveNet adapts: masked convolutions and the same gated unit.
- Tacotron 2 uses a WaveNet as its vocoder, conditioned on mel frames, with a mixture of 10 logistic distributions in place of the 256-way softmax, for 16-bit samples at 24 kHz.
- HiFi-GAN and other GAN vocoders make all samples in one parallel pass. In the HiFi-GAN paper, a WaveNet vocoder runs at 0.003 times real time on a GPU, against more than 100 times for HiFi-GAN V1.
- Unit selection and HMM-based synthesis were the baselines it replaced. The parametric baseline used a vocoder based on the source-filter model; WaveNet learns the waveform with no such model.
Known results in the model
- Naturalness (measurement). In blind tests with 100 held-out sentences, each rated by 8 crowd-sourced subjects on a 1 to 5 scale, WaveNet conditioned on linguistic features and log F0 had a mean opinion score of 4.21 ± 0.081 in North American English, against 3.67 ± 0.098 for an LSTM parametric system, 3.86 ± 0.137 for an HMM-driven concatenative system and 4.55 ± 0.075 for 16-bit natural speech. In Mandarin Chinese the scores were 4.08 ± 0.085 for WaveNet, 3.79 ± 0.084 for the parametric system and 3.47 ± 0.108 for the concatenative one. The training data was 24.6 hours of English and 34.8 hours of Mandarin, each from one professional female speaker.
- Exponential receptive field (theorem). With doubling dilations, the receptive field of layers of kernel size 2 is samples within one block, by the formula for above, while the number of weights grows linearly in .
- Sequential sampling (theorem). Exact sampling from the factorization needs sample before the distribution of sample is known, so it takes dependent steps whatever the hardware. Parallel vocoders avoid this by changing the model, not the sampling.
- Conditioning matters (measurement). Without text conditioning, WaveNet trained on many speakers produced speech-like babble with no words but with a consistent voice for each speaker identity.
References
- van den Oord et al. 2016, Section 2 (dilated causal convolutions, the softmax over mu-law values, the gated activation, residual and skip connections, and conditioning), Section 3.2 (the text-to-speech experiments) and Table 1 (MOS)
- Jonathan Shen, Ruoming Pang, Ron J. Weiss and colleagues, Natural TTS synthesis by conditioning WaveNet on mel spectrogram predictions, ICASSP 2018, Section 2.3 (WaveNet as a vocoder on mel spectrograms, with a mixture of logistics output)
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Visual | V0 none |
|
| Writing | W4 complete |
|
Tag 0NFQNJ Edit this page History Report an error Markdown