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 NoiseSchedule

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

Overview

Concrete tool for implementing the noise schedule, forward diffusion process, and reverse denoising sampling for DDPM-based audio diffusion models.

Description

NoiseSchedule implements the full diffusion pipeline including forward noising (adding noise according to a beta schedule), training item generation (creating noisy input/target pairs), and reverse sampling (iterative denoising). It supports both linear and cosine beta schedules, optional noise floor, and sub-sampled step generation for faster inference.

Usage

Import this class when building or training diffusion-based audio generation models within the Multi-Band Diffusion framework.

Code Reference

Source Location

Signature

class NoiseSchedule(nn.Module):
    def __init__(self, beta_t0=1e-4, beta_t1=0.02, num_steps=1000, variance="beta",
                 clip=20, rescale=1, device='cuda', beta_schedule='linear',
                 n_bands=None, sample_processor=None, noise_floor=0, **kwargs): ...

    def get_training_item(self, x: torch.Tensor, tensor_step: bool = False): ...
    def generate(self, model, initial, condition=None, return_list=False): ...
    def generate_subsampled(self, model, initial, step_list=None, condition=None, ...): ...

Import

from audiocraft.modules.diffusion_schedule import NoiseSchedule

I/O Contract

Inputs

Name Type Required Description
x torch.Tensor Yes Clean audio for forward noising [B, C, T]
model nn.Module Yes Score/denoising model (for generation)
initial torch.Tensor Yes Initial noise for reverse process [B, C, T]
condition torch.Tensor No Conditioning signal

Outputs

Name Type Description
training_item tuple (noisy_input, target, step) for training
generated torch.Tensor Denoised audio [B, C, T]

Related Pages

Page Connections

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