ONNX export of the CMGAN generator (Cao et al., MIT)
for the cmgan denoise engine in
audiosronnx.
CMGAN is a conformer-based metric GAN: a dense encoder feeds four two-stage conformer
blocks attending along time and frequency in turn, and two decoders emit a magnitude mask
plus a complex residual, so it corrects phase rather than reusing the noisy phase.
Only the generator is exported; the discriminator supplies the metric-GAN training loss
and has no inference role.
File
Rate
Size
Params
cmgan.onnx
16 kHz
7.8 MB
1.83 M
Reproduces the upstream pipeline to correlation 1.00000000 (max abs err 2.0e-06).
Measured behaviour
CMGAN optimises PESQ, not waveform fidelity, and the two diverge. On speech at 11 dB
input SNR it gains +0.76 PESQ while losing 1.5 dB SNR — it makes audio sound better and
match the reference waveform less. Engines trained on an SNR-shaped objective gain on both.
Choose it when perceptual quality is the target and waveform fidelity is not.
Export note
TSCNet.forward derives the noisy phase via torch.angle(torch.complex(re, im)), and
torch.complex has no ONNX operator. The export rewrites it as the identical
torch.atan2(im, re) — bit-for-bit equal to the original.