SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2209.14687 · ICLR · 2023

Diffusion Posterior Sampling for General Noisy Inverse Problems

Kaist, Jong Ye, Jeongsol Kim, Hyungjin Chung, Michael Mccann, Marc Klasky

arXiv · PDF · Open in the Atlas

Code that ran

6 of 20 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (4 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 1 violated it and 4 have no contract verdict; 1 failure of our instrument; 14 no recorded run); 1 of them was also run on the host, not in the jail, by the peer-agreement lane that set its level, measured 2026-11-23; 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/2209.14687.json · badge: /api/ran/2209.14687.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
DPS2022/diffusion-posterior-sampling canonical (classifier label)
classifier basis: classifier_2025
1 ran · 0 no recorded run
alexdenker/SteerableConditionalDiffusion community
Papers with Code archive
3 ran · 2 no recorded run
francois-rozet/mmps-benchmark community
Papers with Code archive
1 ran · 0 no recorded run
dps2022/diffusion-posterior-sampling community
Papers with Code archive
1 ran · 0 no recorded run
xypeng9903/k-diffusion-inverse-problems community
Papers with Code archive
0 ran · 6 no recorded run
probabilists/azula community
Papers with Code archive
0 ran · 6 no recorded run
FunctionStatusWhere it lives
load_yaml Ran
ran; our contract draft was wrong, not the code
DPS2022/diffusion-posterior-sampling/sample_condition.py
pointer only (licence: NONE) · get_code("00c67a2ab9d4b104")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, DPS2022/diffusion-posterior-sampling when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

ClassifierGuidanceModel Ran
ran on a synthesized input · constructed an object; no result was computed
alexdenker/SteerableConditionalDiffusion/algos/dps.py
code served (permissive licence) · get_code("4fa5dcb295f5cb74")
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, ClassifierGuidanceModel: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 omegaconf import DictConfig
import numpy as np

torch.manual_seed(0)

# Define a minimal diffusion model
class SimpleDiffusion(nn.Module):
    def __init__(self):
        super().__init__()
    
    def forward(self, xt, t, y=None):
        # Output noise prediction, same shape as input
        batch_size = xt.shape[0]
        return torch.randn_like(xt)

# Define a minimal classifier
class SimpleClassifier(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 10)  # 10 classes
    
    def forward(self, x, t):
        # x shape: (batch, 4, 3, 3) or similar
        # Flatten and classify
        batch_size = x.shape[0]
        x_flat = x.view(batch_size, -1)
        return self.linear(x_flat)

# Import Diffusion class from the function definition
def sigmoid(x):
    return 1 / (np.exp(-x) + 1)

class Diffusion:
    def __init__(self, beta_schedule='linear', beta_start=0.0001, beta_end=0.02, num_diffusion_timesteps=1000, given_betas=None):
        if given_betas is None:
            if beta_schedule == 'quad':
                betas = np.linspace(beta_start ** 0.5, beta_end ** 0.5, num_diffusion_timesteps, dtype=np.float64) ** 2
            elif beta_schedule == 'linear':
                betas = np.linspace(beta_start, beta_end, num_diffusion_timesteps, dtype=np.float64)
            elif beta_schedule == 'const':
                betas = beta_end * np.ones(num_diffusion_timesteps, dtype=np.float64)
            elif beta_schedule == 'jsd':
                betas = 1.0 / np.linspace(num_diffusion_timesteps, 1, num_diffusion_timesteps, dtype=np.float64)
            elif beta_schedule == 'sigmoid':
                betas = np.linspace(-6, 6, num_diffusion_timesteps)
                betas = sigmoid(betas) * (beta_end - beta_start) + beta_start
            else:
                raise NotImplementedError(beta_schedule)
            assert betas.shape == (num_diffusion_timesteps,)
            betas = torch.from_numpy(betas)
        else:
            betas = given_betas
        # Modified to work on CPU only
        self.betas = torch.cat([torch.zeros(1), betas], dim=0).float()
        self.alphas = (1 - self.betas).cumprod(dim=0).float()
        self.num_diffusion_timesteps = num_diffusion_timesteps

    def alpha(self, t):
        return self.alphas.index_select(0, t + 1)

    def beta(self, t):
        return self.betas.index_select(0, t + 1)

# Create instances
model = SimpleDiffusion()
classifier = SimpleClassifier()
diffusion = Diffusion(beta_schedule='linear', num_diffusion_timesteps=100)

# Create config with required attributes
cfg = DictConfig({
    'classifier': {
        'classifier_scale': 0.5
    }
})

# Create test batch
batch_size = 2
xt = torch.randn(batch_size, 4, 3, 3)
y = torch.tensor([0, 1])
t = torch.tensor([10, 20])

ARGS = {
    'model': model,
    'classifier': classifier,
    'diffusion': diffusion,
    'cfg': cfg
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, omegaconf, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ClassifierGuidanceModel — 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 ClassifierGuidanceModel 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
Diffusion Ran
ran on a synthesized input · constructed an object; no result was computed
alexdenker/SteerableConditionalDiffusion/algos/dps.py
code served (permissive licence) · get_code("a9220fd383044f44")
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, Diffusion: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 numpy as np

torch.manual_seed(0)

ARGS = {
    'beta_schedule': 'linear',
    'beta_start': 0.0001,
    'beta_end': 0.02,
    'num_diffusion_timesteps': 10,
    'given_betas': None
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Diffusion — 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 Diffusion 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
PosteriorSampling Ran
ran on a synthesized input · constructed an object; no result was computed
francois-rozet/mmps-benchmark/guided_diffusion/condition_methods.py
pointer only (licence: NONE) · get_code("d0db614fb136ab5d")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, francois-rozet/mmps-benchmark when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

PosteriorSampling Ran
ran on a synthesized input · constructed an object; no result was computed
dps2022/diffusion-posterior-sampling/guided_diffusion/condition_methods.py
pointer only (licence: NONE) · get_code("b9ffdab3f5e8e027")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, dps2022/diffusion-posterior-sampling when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

sigmoid Ran
ran, violated the contract we drafted
alexdenker/SteerableConditionalDiffusion/algos/dps.py
code served (permissive licence) · get_code("152398a541d26c5a")
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 ndarray, ndim 1, dtype family float, shape (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 numpy as np

def sigmoid(x):
    return 1 / (np.exp(-x) + 1)

# Create a small numpy array to pass as input
x_input = np.array([0.0, 1.0, -1.0, 2.0])

ARGS = {
    "x": x_input
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (4,) — shape (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
AbstractLinearFunction Not yet run
unverified (harvested, no recorded run)
xypeng9903/k-diffusion-inverse-problems/condition/condition.py
pointer only (licence: NONE) · get_code("5160c8a3bf4b65a0")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, xypeng9903/k-diffusion-inverse-problems when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

ConditionDenoiser Not yet run
unverified (harvested, no recorded run)
xypeng9903/k-diffusion-inverse-problems/condition/condition.py
pointer only (licence: NONE) · get_code("4f88e1d19f72bee6")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, xypeng9903/k-diffusion-inverse-problems when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

DDIM Not yet run
unverified (harvested, no recorded run)
alexdenker/SteerableConditionalDiffusion/algos/dps.py
code served (permissive licence) · get_code("af618e9e9f4a8355")
How it ran

no invocation recorded.

DDPMSampler Not yet run
unverified (harvested, no recorded run)
probabilists/azula/azula/guidance/dps.py
code served (permissive licence) · get_code("d39bd69880b8f2a5")
How it ran

no invocation recorded.

DPS Not yet run
unverified (harvested, no recorded run)
alexdenker/SteerableConditionalDiffusion/algos/dps.py
code served (permissive licence) · get_code("6ef00667e85c2408")
How it ran

no invocation recorded.

DPSSampler Not yet run
unverified (harvested, no recorded run)
probabilists/azula/azula/guidance/dps.py
code served (permissive licence) · get_code("fffb9d4c78ad024a")
How it ran

no invocation recorded.

Denoiser Not yet run
unverified (harvested, no recorded run)
probabilists/azula/azula/guidance/dps.py
code served (permissive licence) · get_code("5a4816ad6f39f305")
How it ran

no invocation recorded.

LazyLikelihoodCovariance Not yet run
unverified (harvested, no recorded run)
xypeng9903/k-diffusion-inverse-problems/condition/condition.py
pointer only (licence: NONE) · get_code("c93a6d8b8374e79a")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, xypeng9903/k-diffusion-inverse-problems when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

LazyOTCovariance Not yet run
unverified (harvested, no recorded run)
xypeng9903/k-diffusion-inverse-problems/condition/condition.py
pointer only (licence: NONE) · get_code("f3df731e53100d01")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, xypeng9903/k-diffusion-inverse-problems when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

LinearFunction Not yet run
unverified (harvested, no recorded run)
xypeng9903/k-diffusion-inverse-problems/condition/condition.py
pointer only (licence: NONE) · get_code("e53b58423f816913")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, xypeng9903/k-diffusion-inverse-problems when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

OrthoTransform Not yet run
unverified (harvested, no recorded run)
xypeng9903/k-diffusion-inverse-problems/condition/condition.py
pointer only (licence: NONE) · get_code("346b2d08b59dea9f")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, xypeng9903/k-diffusion-inverse-problems when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

Posterior Not yet run
unverified (harvested, no recorded run)
probabilists/azula/azula/guidance/dps.py
code served (permissive licence) · get_code("34d5b5a59cb51a07")
How it ran

no invocation recorded.

Sampler Not yet run
unverified (harvested, no recorded run)
probabilists/azula/azula/guidance/dps.py
code served (permissive licence) · get_code("63d1de06f843e96d")
How it ran

no invocation recorded.

Schedule Not yet run
unverified (harvested, no recorded run)
probabilists/azula/azula/guidance/dps.py
code served (permissive licence) · get_code("b6a8741f585dd914")
How it ran

no invocation recorded.

Also present in other papers' code

Of 20 samples lifted from this paper's linked repositories, 20 carry a function identity and 0 do not. Of the 20 distinct functions with an identity, 6 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 0 the same month, 2 later) and 14 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
load_yaml 11 other papers
11 later
2401.08920 (2024-01)
Idempotence and Perceptual Image Compression
2402.16907 (2024-02)
Diffusion Posterior Proximal Sampling for Image Restoration
2403.17042 (2024-03)
Provably Robust Score-Based Diffusion Posterior Sampling for Plug-and-Play Image Reconstruction
and 8 more not named here
Denoiser
brick of this paper's assembly: helper
1 other paper
1 dated earlier
2204.13902 (2022-04)
Fast Sampling of Diffusion Models with Exponential Integrator
Posterior
brick of this paper's assembly: helper
1 other paper
1 dated earlier
2204.13902 (2022-04)
Fast Sampling of Diffusion Models with Exponential Integrator
Sampler
brick of this paper's assembly: helper
1 other paper
1 dated earlier
2204.13902 (2022-04)
Fast Sampling of Diffusion Models with Exponential Integrator
Schedule
brick of this paper's assembly: helper
1 other paper
1 dated earlier
2204.13902 (2022-04)
Fast Sampling of Diffusion Models with Exponential Integrator
sigmoid
brick of this paper's assembly: helper
1 other paper
1 later
2401.02683 (2024-01)
Geometric-Facilitated Denoising Diffusion Model for 3D Molecule Generation

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-23.

Repositories linked to this paper

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

Abstract

Diffusion models have been recently studied as powerful generative inverse problem solvers, owing to their high quality reconstructions and the ease of combining existing iterative solvers. However, most works focus on solving simple linear inverse problems in noiseless settings, which significantly under-represents the complexity of real-world problems. In this work, we extend diffusion solvers to efficiently handle general noisy (non)linear inverse problems via approximation of the posterior sampling. Interestingly, the resulting posterior sampling scheme is a blended version of diffusion sampling with the manifold constrained gradient without a strict measurement consistency projection step, yielding a more desirable generative path in noisy settings compared to the previous studies. Our method demonstrates that diffusion models can incorporate various measurement noise statistics such as Gaussian and Poisson, and also efficiently handle noisy nonlinear inverse problems such as Fourier phase retrieval and non-uniform deblurring. Code is available at https: //github.com/DPS2022/diffusion-posterior-sampling.

For agents

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

get_harvested_code_for_paper("2209.14687")
get_code_for_paper("2209.14687")
have("2209.14687")

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

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

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

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

Connect an agent — have() is free.