SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2206.08545 · 2022

NU-Wave 2: A General Neural Audio Upsampling Model for Various Sampling Rates

arXiv · PDF · Open in the Atlas

Code that ran

13 of 18 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (6 of them constructed an object rather than computing a result; 2 honoured the contract we drafted, 0 violated it and 9 have no contract verdict; 2 failures of our instrument; 5 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2206.08545.json · badge: /api/ran/2206.08545.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
mindslab-ai/nuwave canonical (classifier label)
classifier basis not recorded on the link
1 ran · 0 no recorded run
mindslab-ai/nuwave2 alias (classifier label)
classifier basis: classifier_2025
6 ran · 3 no recorded run
rishikksh20/NU-Wave2-pytorch reimplementation (classifier label)
classifier basis: classifier_2025
4 ran · 1 no recorded run
maum-ai/nuwave predecessor (classifier label)
classifier basis: classifier_2025
2 ran · 1 no recorded run
FunctionStatusWhere it lives
BSFT Ran
ran on a synthesized input · constructed an object; no result was computed
mindslab-ai/nuwave2/model.py
code served (permissive licence) · get_code("3354a1b502b848d4")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, BSFT: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
import torch.nn.functional as F

torch.manual_seed(0)

# Define the function and class as provided
def Conv1d(*args, **kwargs):
    layer = nn.Conv1d(*args, **kwargs)
    nn.init.kaiming_normal_(layer.weight)
    return layer

silu = F.silu

class BSFT(nn.Module):

    def __init__(self, nhidden, out_channels):
        super().__init__()
        self.mlp_shared = nn.Conv1d(2, nhidden, kernel_size=3, padding=1)
        self.mlp_gamma = Conv1d(nhidden, out_channels, kernel_size=3, padding=1)
        self.mlp_beta = Conv1d(nhidden, out_channels, kernel_size=3, padding=1)

    def forward(self, x, band):
        actv = silu(self.mlp_shared(band))
        gamma = self.mlp_gamma(actv).unsqueeze(-1)
        beta = self.mlp_beta(actv).unsqueeze(-1)
        out = x * (1 + gamma) + beta
        return out

# Create valid arguments for BSFT initialization
ARGS = {
    'nhidden': 8,
    'out_channels': 3
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type BSFT — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a BSFT output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
Conv1d Ran
ran; our contract draft was wrong, not the code · constructed an object; no result was computed
mindslab-ai/nuwave2/model.py
code served (permissive licence) · get_code("2109126c17b0f297")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, Conv1d: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Conv1d signature:
# Conv1d(in_channels, out_channels, kernel_size, stride=1, padding=0, 
#        dilation=1, groups=1, bias=True, padding_mode='zeros', device=None, dtype=None)

ARGS = {
    'in_channels': 3,
    'out_channels': 4,
    'kernel_size': 5,
    'stride': 1,
    'padding': 0,
    'dilation': 1,
    'groups': 1,
    'bias': True,
    'padding_mode': 'zeros',
    'device': None,
    'dtype': None,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Conv1d — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Conv1d output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
Conv2d Ran
ran; our contract draft was wrong, not the code · constructed an object; no result was computed
mindslab-ai/nuwave2/model.py
code served (permissive licence) · get_code("f3aede0f86dce25f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, Conv2d: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

ARGS = {
    'in_channels': 3,
    'out_channels': 4,
    'kernel_size': 3,
    'stride': 1,
    'padding': 1,
    'dilation': 1,
    'groups': 1,
    'bias': True,
    'padding_mode': 'zeros',
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Conv2d — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Conv2d output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
DiffusionEmbedding Ran
ran on a synthesized input · constructed an object; no result was computed
mindslab-ai/nuwave2/model.py
code served (permissive licence) · get_code("daa1ce0045d6e8f9")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, DiffusionEmbedding: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
from math import sqrt, log

torch.manual_seed(0)

class DPMConfig:
    def __init__(self):
        self.pos_emb_channels = 8
        self.pos_emb_scale = 1.0

class ArchConfig:
    def __init__(self):
        self.pos_emb_dim = 16

class HParams:
    def __init__(self):
        self.dpm = DPMConfig()
        self.arch = ArchConfig()

hparams = HParams()

noise_level = torch.randn(2, 1)

ARGS = {
    "hparams": hparams,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DiffusionEmbedding — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a DiffusionEmbedding output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
DiffusionEmbedding Ran
ran on a synthesized input
maum-ai/nuwave/model.py
code served (permissive licence) · get_code("2c33ff18a8323072")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 2, dtype family float, shape (2, 6) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
import torch.nn.functional as F

Linear = nn.Linear
silu = F.silu

class DiffusionEmbedding(nn.Module):

    def __init__(self, hparam):
        super().__init__()
        self.n_channels = hparam.ddpm.pos_emb_channels
        self.scale = hparam.ddpm.pos_emb_scale
        self.out_channels = hparam.arch.pos_emb_dim
        half_dim = self.n_channels // 2
        exponents = torch.arange(half_dim, dtype=torch.float32) / float(half_dim)
        exponents = 0.0001 ** exponents
        self.register_buffer('exponents', exponents)
        self.projection1 = Linear(self.n_channels, self.out_channels)
        self.projection2 = Linear(self.out_channels, self.out_channels)

    def forward(self, noise_level):
        x = self.scale * noise_level * self.exponents.unsqueeze(0)
        x = torch.cat([x.sin(), x.cos()], dim=-1)
        x = self.projection1(x)
        x = silu(x)
        x = self.projection2(x)
        x = silu(x)
        return x


class SimpleConfig:
    def __init__(self):
        self.ddpm = type('obj', (object,), {
            'pos_emb_channels': 8,
            'pos_emb_scale': 1.0
        })()
        self.arch = type('obj', (object,), {
            'pos_emb_dim': 6
        })()


INIT_ARGS = {
    'hparam': SimpleConfig()
}

ARGS = {
    'noise_level': torch.randn(2, 1)
}

if __name__ == '__main__':
    model = DiffusionEmbedding(**INIT_ARGS)
    output = model(**ARGS)
    print(output.shape)
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 6) — shape (2, 6) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
FourierUnit Ran
ran on a synthesized input · constructed an object; no result was computed
mindslab-ai/nuwave2/model.py
code served (permissive licence) · get_code("9a9ebaea33ca45d4")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, FourierUnit: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
import torch.nn.functional as F

torch.manual_seed(0)

# Small input tensor: batch=2, channels=3, length=512
x = torch.randn(2, 3, 512)

# Band tensor for BSFT: batch=2, channels=2, time_steps=some_value
# The band needs to match dimensions after STFT processing
# After STFT with n_fft=1024, hop_length=256, we get time_steps = (512 + 1024 - 1) // 256 + 1 = 7
# BSFT expects input with 2 channels (as seen in Conv1d(2, nhidden, ...))
band = torch.randn(2, 2, 7)

# Parameters for FourierUnit
in_channels = 3
out_channels = 4
bsft_channels = 8
filter_length = 1024
hop_length = 256
win_length = 1024
sampling_rate = 48000

ARGS = {
    'in_channels': in_channels,
    'out_channels': out_channels,
    'bsft_channels': bsft_channels,
    'filter_length': filter_length,
    'hop_length': hop_length,
    'win_length': win_length,
    'sampling_rate': sampling_rate,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type FourierUnit — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a FourierUnit output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
NUWave Ran
ran on a synthesized input
rishikksh20/NU-Wave2-pytorch/model.py
code served (permissive licence) · get_code("7ce178bec79a2b6f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 3, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

class Params:
    def __init__(self):
        self.input_channels = 1
        self.residual_channels = 8
        self.output_channels = 1
        self.residual_layers = 4
        self.dilation_cycle_length = 3

params = Params()

INIT_ARGS = {
    "params": params
}

batch_size = 2
audio_length = 16
lr_audio_length = audio_length // 2

audio = torch.randn(batch_size, audio_length)
lr_audio = torch.randn(batch_size, lr_audio_length)
noise_scale = torch.randn(batch_size)

ARGS = {
    "audio": audio,
    "lr_audio": lr_audio,
    "noise_scale": noise_scale
}
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 3, dtype family float — no output shape is stated: observe_signature.py could not observe it (import:OSError)
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
PositionalEncoding Ran
ran on a synthesized input
rishikksh20/NU-Wave2-pytorch/model.py
code served (permissive licence) · get_code("078a37135b02e3e5")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 2, dtype family float, shape (2, 8) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

GAMMA = 1 // 16
LINEAR_SCALE = 50000

class PositionalEncoding(nn.Module):

    def __init__(self, n_channels):
        super(PositionalEncoding, self).__init__()
        self.n_channels = n_channels

    def forward(self, noise_level):
        if len(noise_level.shape) > 1:
            noise_level = noise_level.squeeze(-1)
        half_dim = self.n_channels // 2
        exponents = torch.arange(half_dim, dtype=torch.float32).to(noise_level) / float(half_dim)
        exponents = 10 ** (-(exponents * GAMMA))
        exponents = LINEAR_SCALE * noise_level.unsqueeze(1) * exponents.unsqueeze(0)
        return torch.cat([exponents.sin(), exponents.cos()], dim=-1)


INIT_ARGS = {
    'n_channels': 8
}

ARGS = {
    'noise_level': torch.randn(2)
}

if __name__ == '__main__':
    model = PositionalEncoding(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Output shape: {output.shape}")
    print(f"Output: {output}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 8) — shape (2, 8) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
ResidualBlock Ran
ran on a synthesized input
maum-ai/nuwave/model.py
code served (permissive licence) · get_code("6f6591c01b24cb00")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
from math import sqrt

def Conv1d(*args, **kwargs):
    layer = nn.Conv1d(*args, **kwargs)
    nn.init.kaiming_normal_(layer.weight)
    return layer

Linear = nn.Linear

class ResidualBlock(nn.Module):

    def __init__(self, residual_channels, dilation, pos_emb_dim):
        super().__init__()
        self.dilated_conv = Conv1d(residual_channels, 2 * residual_channels, 3, padding=dilation, dilation=dilation)
        self.diffusion_projection = Linear(pos_emb_dim, residual_channels)
        self.output_projection = Conv1d(residual_channels, 2 * residual_channels, 1)
        self.low_projection = Conv1d(residual_channels, 2 * residual_channels, 3, padding=dilation, dilation=dilation)

    def forward(self, x, x_low, noise_level):
        noise_level = self.diffusion_projection(noise_level).unsqueeze(-1)
        y = x + noise_level
        y = self.dilated_conv(y)
        y += self.low_projection(x_low)
        gate, filter = torch.chunk(y, 2, dim=1)
        y = torch.sigmoid(gate) * torch.tanh(filter)
        y = self.output_projection(y)
        residual, skip = torch.chunk(y, 2, dim=1)
        return ((x + residual) / sqrt(2.0), skip)


INIT_ARGS = {
    'residual_channels': 4,
    'dilation': 2,
    'pos_emb_dim': 8,
}

ARGS = {
    'x': torch.randn(2, 4, 16),
    'x_low': torch.randn(2, 4, 16),
    'noise_level': torch.randn(2, 8),
}

if __name__ == '__main__':
    block = ResidualBlock(**INIT_ARGS)
    residual_out, skip_out = block(**ARGS)
    print(f"Residual output shape: {residual_out.shape}")
    print(f"Skip output shape: {skip_out.shape}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
ResidualBlock Ran
ran on a synthesized input
rishikksh20/NU-Wave2-pytorch/model.py
code served (permissive licence) · get_code("aca7a68289a844b1")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
from math import sqrt

def Conv1d(*args, **kwargs):
    layer = nn.Conv1d(*args, **kwargs)
    nn.init.kaiming_normal_(layer.weight)
    return layer

Linear = nn.Linear

class ResidualBlock(nn.Module):

    def __init__(self, residual_channels, dilation):
        super().__init__()
        self.dilated_conv = Conv1d(residual_channels, 2 * residual_channels, 3, padding=dilation, dilation=dilation)
        self.diffusion_projection = Linear(512, residual_channels)
        self.conditioner_projection = Conv1d(residual_channels, 2 * residual_channels, 3, padding=dilation, dilation=dilation)
        self.output_projection = Conv1d(residual_channels, 2 * residual_channels, 1)

    def forward(self, x, conditioner, noise_scale):
        noise_scale = self.diffusion_projection(noise_scale).unsqueeze(-1)
        conditioner = self.conditioner_projection(conditioner)
        y = x + noise_scale
        y = self.dilated_conv(y) + conditioner
        gate, filter = torch.chunk(y, 2, dim=1)
        y = torch.sigmoid(gate) * torch.tanh(filter)
        y = self.output_projection(y)
        residual, skip = torch.chunk(y, 2, dim=1)
        return ((x + residual) / sqrt(2.0), skip)


INIT_ARGS = {
    'residual_channels': 4,
    'dilation': 2,
}

ARGS = {
    'x': torch.randn(2, 4, 8),
    'conditioner': torch.randn(2, 4, 8),
    'noise_scale': torch.randn(2, 512),
}

if __name__ == '__main__':
    model = ResidualBlock(**INIT_ARGS)
    output = model(**ARGS)
    print("Output shapes:", [o.shape for o in output])
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
SpectralTransform Ran
ran on a synthesized input · constructed an object; no result was computed
mindslab-ai/nuwave2/model.py
code served (permissive licence) · get_code("8fb6ca0db41b032a")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, SpectralTransform: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
import torch.nn.functional as F

torch.manual_seed(0)

# Define the supporting functions and classes from the code
def Conv1d(*args, **kwargs):
    layer = nn.Conv1d(*args, **kwargs)
    nn.init.kaiming_normal_(layer.weight)
    return layer

def Conv2d(*args, **kwargs):
    layer = nn.Conv2d(*args, **kwargs)
    nn.init.kaiming_normal_(layer.weight)
    return layer

relu = F.relu
silu = F.silu

class BSFT(nn.Module):
    def __init__(self, nhidden, out_channels):
        super().__init__()
        self.mlp_shared = nn.Conv1d(2, nhidden, kernel_size=3, padding=1)
        self.mlp_gamma = Conv1d(nhidden, out_channels, kernel_size=3, padding=1)
        self.mlp_beta = Conv1d(nhidden, out_channels, kernel_size=3, padding=1)

    def forward(self, x, band):
        actv = silu(self.mlp_shared(band))
        gamma = self.mlp_gamma(actv).unsqueeze(-1)
        beta = self.mlp_beta(actv).unsqueeze(-1)
        out = x * (1 + gamma) + beta
        return out

class FourierUnit(nn.Module):
    def __init__(self, in_channels, out_channels, bsft_channels, filter_length=1024, hop_length=256, win_length=1024, sampling_rate=48000):
        super(FourierUnit, self).__init__()
        self.sampling_rate = sampling_rate
        self.n_fft = filter_length
        self.hop_size = hop_length
        self.win_size = win_length
        hann_window = torch.hann_window(win_length)
        self.register_buffer('hann_window', hann_window)
        self.conv_layer = Conv2d(in_channels=in_channels * 2, out_channels=out_channels * 2, kernel_size=1, padding=0, bias=False)
        self.bsft = BSFT(bsft_channels, out_channels * 2)

    def forward(self, x, band):
        batch = x.shape[0]
        x = x.view(-1, x.size()[-1])
        ffted = torch.stft(x, self.n_fft, hop_length=self.hop_size, win_length=self.win_size, window=self.hann_window, center=True, normalized=True, onesided=True, return_complex=False)
        ffted = ffted.permute(0, 3, 1, 2).contiguous()
        ffted = ffted.view((batch, -1) + ffted.size()[2:])
        ffted = relu(self.bsft(ffted, band))
        ffted = self.conv_layer(ffted)
        ffted = ffted.view((-1, 2) + ffted.size()[2:]).permute(0, 2, 3, 1).contiguous()
        output = torch.istft(ffted, self.n_fft, hop_length=self.hop_size, win_length=self.win_size, window=self.hann_window, center=True, normalized=True, onesided=True)
        output = output.view(batch, -1, x.size()[-1])
        return output

class SpectralTransform(nn.Module):
    def __init__(self, in_channels, out_channels, bsft_channels, **audio_kwargs):
        super(SpectralTransform, self).__init__()
        self.conv1 = Conv1d(in_channels, out_channels // 2, kernel_size=1, bias=False)
        self.fu = FourierUnit(out_channels // 2, out_channels // 2, bsft_channels, **audio_kwargs)
        self.conv2 = Conv1d(out_channels // 2, out_channels, kernel_size=1, bias=False)

    def forward(self, x, band):
        x = silu(self.conv1(x))
        output = self.fu(x, band)
        output = self.conv2(x + output)
        return output

# Create sample input tensors
# x: (batch=2, in_channels=8, length=2048) - audio-like input
x = torch.randn(2, 8, 2048)
# band: (batch=2, 2, freq_bins) - band information for BSFT
band = torch.randn(2, 2, 256)

ARGS = {
    'in_channels': 8,
    'out_channels': 16,
    'bsft_channels': 4,
    'filter_length': 1024,
    'hop_length': 256,
    'win_length': 1024,
    'sampling_rate': 48000
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type SpectralTransform — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a SpectralTransform output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
lognorm Ran
ran, honoured the contract we drafted
mindslab-ai/nuwave/lightning_model.py
code served (permissive licence) · get_code("75b15c31859cc5da")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned Tensor, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# The function lognorm takes two parameters: pred and target
# Both are used with:
# - .abs() method
# - .mean(dim=-1) method
# - .clamp(min=1e-20) method
# - .log() method
# - .mean() method
# So both must be tensors with at least 2 dimensions (since mean(dim=-1) is called)

# Create small tensors: batch size 2, last dimension 4
pred = torch.randn(2, 4)
target = torch.randn(2, 4)

ARGS = {
    "pred": pred,
    "target": target,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
silu Ran
ran, honoured the contract we drafted
rishikksh20/NU-Wave2-pytorch/model.py
code served (permissive licence) · get_code("d9caeeced554450f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned Tensor, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# The function silu takes a single parameter 'x' which is a tensor
# It applies the SiLU activation: x * sigmoid(x)
# We need to provide a small tensor as input

x = torch.randn(2, 4)

ARGS = {
    "x": x
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
DiffusionEmbedding Not yet run
unverified (harvested, no recorded run)
rishikksh20/NU-Wave2-pytorch/model.py
code served (permissive licence) · get_code("816f7b789ef8c328")
How it ran

no invocation recorded.

FFC Not yet run
unverified (harvested, no recorded run)
mindslab-ai/nuwave2/model.py
code served (permissive licence) · get_code("aea8c2dc5e778a5a")
How it ran

no invocation recorded.

NuWave Not yet run
unverified (harvested, no recorded run)
maum-ai/nuwave/model.py
code served (permissive licence) · get_code("220987ed85906065")
How it ran

no invocation recorded.

NuWave2 Not yet run
unverified (harvested, no recorded run)
mindslab-ai/nuwave2/model.py
code served (permissive licence) · get_code("1b16187bfba310a6")
How it ran

no invocation recorded.

ResidualBlock Not yet run
unverified (harvested, no recorded run)
mindslab-ai/nuwave2/model.py
code served (permissive licence) · get_code("bdd9e43c2e01afe3")
How it ran

no invocation recorded.

Also present in other papers' code

Of 18 samples lifted from this paper's linked repositories, 18 carry a function identity and 0 do not. Of the 18 distinct functions with an identity, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 2 later) and 15 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
silu
brick of this paper's assembly: helper
6 other papers
4 dated earlier, 2 later · 3 only as an assembly brick
2006.11239 (2020-06)
Denoising Diffusion Probabilistic Models
2104.02321 (2021-04)
NU-Wave: A Diffusion Probabilistic Model for Neural Audio Upsampling
2107.00630 (2021-07)
Variational Diffusion Models
and 3 more not named here
Conv1d
brick of this paper's assembly: helper
5 other papers
3 dated earlier, 2 later · 5 only as an assembly brick
2006.11239 (2020-06)
Denoising Diffusion Probabilistic Models
2107.00630 (2021-07)
Variational Diffusion Models
2205.14807 (2022-05)
BinauralGrad: A Two-Stage Conditional Diffusion Probabilistic Model for Binaural Audio Synthesis
and 2 more not named here
lognorm 1 other paper
1 dated earlier
2104.02321 (2021-04)
NU-Wave: A Diffusion Probabilistic Model for Neural Audio Upsampling

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Conventionally, audio super-resolution models fixed the initial and the target sampling rates, which necessitate the model to be trained for each pair of sampling rates. We introduce NU-Wave 2, a diffusion model for neural audio upsampling that enables the generation of 48 kHz audio signals from inputs of various sampling rates with a single model. Based on the architecture of NU-Wave, NU-Wave 2 uses short-time Fourier convolution (STFC) to generate harmonics to resolve the main failure modes of NU-Wave, and incorporates bandwidth spectral feature transform (BSFT) to condition the bandwidths of inputs in the frequency domain. We experimentally demonstrate that NU-Wave 2 produces high-resolution audio regardless of the sampling rate of input while requiring fewer parameters than other models. The official code and the audio samples are available at https://mindslab-ai.github.io/nuwave2.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2206.08545")
get_code_for_paper("2206.08545")
have("2206.08545")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2206.08545.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2206.08545.svg)](https://syntology.ai/paper/2206.08545)

Connect an agent — have() is free.