Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Facebookresearch Audiocraft DiffusionSolver

From Leeroopedia
Knowledge Sources
Domains Diffusion, Training
Last Updated 2026-02-14 01:00 GMT

Overview

Concrete tool for training Multi-Band Diffusion models that enhance audio quality by learning to denoise individual frequency bands.

Description

DiffusionSolver extends StandardSolver to implement the training loop for diffusion-based audio enhancement models. It trains a U-Net score model conditioned on codec latent embeddings, using MSE or L1 loss normalized by a reference loss. The solver includes RVM (Relative Volume Mel) evaluation and sample generation with spectral EQ matching.

Usage

Use this solver when training Multi-Band Diffusion models for converting codec tokens to high-fidelity audio.

Code Reference

Source Location

Signature

class DiffusionSolver(StandardSolver):
    def __init__(self, cfg: DictConfig): ...
    def run_step(self, idx: int, batch: torch.Tensor, metrics: dict): ...
    def evaluate(self) -> dict: ...
    def regenerate(self, wav: torch.Tensor, step_list=None) -> torch.Tensor: ...

Import

from audiocraft.solvers.diffusion import DiffusionSolver

I/O Contract

Inputs

Name Type Required Description
batch torch.Tensor Yes Audio batch [B, C, T]
cfg DictConfig Yes Hydra configuration

Outputs

Name Type Description
metrics dict Training metrics including loss, normed_loss
regenerated torch.Tensor Denoised audio (from regenerate)

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment