espnet_vocoder_melgan
A feed-forward GAN vocoder that turns mel-spectrograms into waveforms over 100x faster than real time.
Audio and speech · 140 operations Checked
Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.
At a glance
- Task
- Audio and speech
- Parameters
- 4.3M
- Operations
- 140
- Framework
- PyTorch
- Recurrent
- No
- Published
- NeurIPS 2019
- Cited by
- 722 (as of 18 October 2026)
- Authors
- Kundan Kumar, Rithesh Kumar, Thibault de Boissiere and others
- License
- MIT
- Checked
- Passed: the trace was replayed operation by operation and matched the model's own output for this input.
Files
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
Details
- Stable ID
- m4790
- Graph hash
- 7355bd51818fe2e6660c7330e1abdf9bd073aeb9420cacdf3121edafb7b419fd
- Skeleton hash
- e6797e7b48af5296311f055ec8e02181c6a9935b621f688368d6aed91e52053d
- Architecture hash
- b5887fc250893a642425d091d7b914e1698ca4df625c4be0e31e7ddcf6418add
- Diagram SHA-256
- 4843df68b170d136647e2f88b7938301a454150970e1ed73f79951ee1c2c8116
- TorchLens version
- 2.36.0
- Renderer
- graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
- Check
- Forward pass replayed in PyTorch
What it is
MelGAN is a fully convolutional feed-forward generator with a mel-spectrogram as input and a raw waveform as output, trained in a GAN setup. Earlier work had found generating coherent raw audio waveforms with GANs challenging; the paper shows it can be done reliably with a set of architectural changes and simple training techniques. The authors describe it as the first work that successfully trains GANs for raw audio generation without additional distillation or perceptual loss functions.
The generator upsamples the mel input through a stack of transposed convolutional layers, each followed by a stack of residual blocks with dilated convolutions. The 256x upsampling is done in 4 stages of 8x, 8x, 2x and 2x, and each residual stack has three layers with dilation 1, 3 and 9 and kernel-size 3, for a receptive field of 27 timesteps. Unlike traditional GANs, the generator does not use a global noise vector as input, since added noise made little perceptual difference. Weight normalization is used in all layers of the generator, because instance normalization washes away important pitch information, making the audio sound metallic. On the discriminator side, a multi-scale architecture with 3 discriminators of identical structure operates on different audio scales. Each is a window-based discriminator, which learns to classify between distribution of small audio chunks rather than entire audio sequences. The generator is also trained with a feature matching objective that minimizes the L1 distance between the discriminator feature maps of real and synthetic audio. Notably, there is no loss in the raw audio space, because adding L1 loss in audio space introduces audible noise that hurts audio quality.
The payoff is speed: the PyTorch implementation runs at more than 100x faster than realtime on a GTX 1080Ti GPU and more than 2x faster than real-time on CPU, without hardware specific tricks. In listening tests the authors conclude MelGAN is comparable in quality to state-of-the-art high capacity WaveNet-based models such as WaveNet and WaveGlow. It also generalizes to unseen speakers for mel-spectrogram inversion. The member traced here is ESPnet's generator: ESPnet lists MelGAN among the neural vocoders it integrates, alongside Parallel WaveGAN, Multi-band MelGAN, HiFiGAN and StyleMelGAN. The kan-bayashi/ParallelWaveGAN readme notes that if you use MelGAN's generator, the decoding speed will be further faster.
Key idea. MelGAN is, by the authors' account, the first work that successfully trains GANs for raw audio generation without additional distillation or perceptual loss functions. The resulting mel-spectrogram inverter runs at more than 100x faster than realtime on a GTX 1080Ti GPU and more than 2x faster than real-time on CPU.
- melgan
- mel gan
- neural vocoder
- mel-spectrogram inversion
- waveform synthesis
- gan vocoder
- text-to-speech vocoder
- espnet melgan
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
Cite the paper
@misc{kumar2019melgangenerativeadversarialnetworks,
title={MelGAN: Generative Adversarial Networks for Conditional Waveform Synthesis},
author={Kundan Kumar and Rithesh Kumar and Thibault de Boissiere and Lucas Gestin and Wei Zhen Teoh and Jose Sotelo and Alexandre de Brebisson and Yoshua Bengio and Aaron Courville},
year={2019},
eprint={1910.06711},
archivePrefix={arXiv},
primaryClass={eess.AS},
url={https://arxiv.org/abs/1910.06711},
}