SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2209.14734 · ICLR · 2023

DiGress: Discrete Denoising diffusion for graph generation

Clément Vignac, Igor Krawczuk, Antoine Siraudin

arXiv · PDF · Open in the Atlas

Code that ran

15 of 25 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (10 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 10 have no contract verdict; 5 failures of our instrument; 10 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/2209.14734.json · badge: /api/ran/2209.14734.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
xinyangATK/GraphBetaDiffusion community
Papers with Code archive
10 ran · 5 no recorded run
lingxiaoshawn/pard community
Papers with Code archive
5 ran · 1 no recorded run
cvignac/digress marked official in Papers with Code
Papers with Code archive
0 ran · 4 no recorded run
FunctionStatusWhere it lives
CrossEntropyMetric Ran
ran on a synthesized input · constructed an object; no result was computed
xinyangATK/GraphBetaDiffusion/src/diffusion_model_discrete.py
code served (permissive licence) · get_code("f4e42e3306130e06")
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, CrossEntropyMetric: 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.functional as F
from torch import Tensor
from torchmetrics import Metric

torch.manual_seed(0)

class CrossEntropyMetric(Metric):

    def __init__(self):
        super().__init__()
        self.add_state('total_ce', default=torch.tensor(0.0), dist_reduce_fx='sum')
        self.add_state('total_samples', default=torch.tensor(0.0), dist_reduce_fx='sum')

    def update(self, preds: Tensor, target: Tensor) -> None:
        """ Update state with predictions and targets.
            preds: Predictions from model   (bs * n, d) or (bs * n * n, d)
            target: Ground truth values     (bs * n, d) or (bs * n * n, d). """
        target = torch.argmax(target, dim=-1)
        output = F.cross_entropy(preds, target, reduction='sum')
        self.total_ce += output
        self.total_samples += preds.size(0)

    def compute(self):
        return self.total_ce / self.total_samples


# Construct test data
# preds: logits of shape (batch_size, num_classes)
batch_size = 2
num_classes = 4
preds = torch.randn(batch_size, num_classes)

# target: one-hot encoded of shape (batch_size, num_classes)
target = torch.zeros(batch_size, num_classes)
target[0, 1] = 1.0
target[1, 2] = 1.0

ARGS = {}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, torchmetrics — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type CrossEntropyMetric — 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 CrossEntropyMetric 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
DiscreteUniformTransition Ran
ran on a synthesized input · constructed an object; no result was computed
xinyangATK/GraphBetaDiffusion/src/diffusion_model_discrete.py
code served (permissive licence) · get_code("551ec09673d49e88")
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, DiscreteUniformTransition: 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

# Create a simple PlaceHolder class since it's used in the return statements
class PlaceHolder:
    def __init__(self, X, E, y):
        self.X = X
        self.E = E
        self.y = y

# Mock the utils module
class utils:
    PlaceHolder = PlaceHolder

# Set random seed for reproducibility
torch.manual_seed(0)

# Define arguments for DiscreteUniformTransition
ARGS = {
    'x_classes': 4,
    'e_classes': 3,
    'y_classes': 5
}
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 DiscreteUniformTransition — 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 DiscreteUniformTransition 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
Etoy Ran
ran on a synthesized input · constructed an object; no result was computed
xinyangATK/GraphBetaDiffusion/src/diffusion_model_discrete.py
code served (permissive licence) · get_code("7e3fab9a98573ff0")
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, Etoy: 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)

class Etoy(nn.Module):

    def __init__(self, d, dy):
        """ Map edge features to global features. """
        super().__init__()
        self.lin = nn.Linear(4 * d, dy)

    def forward(self, E):
        """ E: bs, n, n, de
            Features relative to the diagonal of E could potentially be added.
        """
        m = E.mean(dim=(1, 2))
        mi = E.min(dim=2)[0].min(dim=1)[0]
        ma = E.max(dim=2)[0].max(dim=1)[0]
        std = torch.std(E, dim=(1, 2))
        z = torch.hstack((m, mi, ma, std))
        out = self.lin(z)
        return out


# Set up arguments for Etoy.__init__
d = 4  # edge feature dimension
dy = 3  # output feature dimension

ARGS = {
    "d": d,
    "dy": dy
}
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 Etoy — 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 Etoy 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
MarginalUniformTransition Ran
ran on a synthesized input · constructed an object; no result was computed
xinyangATK/GraphBetaDiffusion/src/diffusion_model_discrete.py
code served (permissive licence) · get_code("9ce4bfced7e6004c")
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, MarginalUniformTransition: 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

torch.manual_seed(0)

# Create small marginal distributions for X and E
x_marginals = torch.tensor([0.3, 0.3, 0.2, 0.2])  # 4 classes for X
e_marginals = torch.tensor([0.5, 0.3, 0.2])       # 3 classes for E
y_classes = 2                                       # 2 classes for y

ARGS = {
    'x_marginals': x_marginals,
    'e_marginals': e_marginals,
    'y_classes': y_classes,
}
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 MarginalUniformTransition — 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 MarginalUniformTransition 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
NLL Ran
ran on a synthesized input · constructed an object; no result was computed
xinyangATK/GraphBetaDiffusion/src/diffusion_model_discrete.py
code served (permissive licence) · get_code("a7e50774a4e4f675")
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, NLL: 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
from torchmetrics import Metric

torch.manual_seed(0)

class NLL(Metric):

    def __init__(self):
        super().__init__()
        self.add_state('total_nll', default=torch.tensor(0.0), dist_reduce_fx='sum')
        self.add_state('total_samples', default=torch.tensor(0.0), dist_reduce_fx='sum')

    def update(self, batch_nll) -> None:
        self.total_nll += torch.sum(batch_nll)
        self.total_samples += batch_nll.numel()

    def compute(self):
        return self.total_nll / self.total_samples


ARGS = {}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, torchmetrics — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type NLL — 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 NLL 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
NodeEdgeBlock Ran
ran on a synthesized input · constructed an object; no result was computed
xinyangATK/GraphBetaDiffusion/src/diffusion_model_discrete.py
code served (permissive licence) · get_code("e9400f315259c7be")
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, NodeEdgeBlock: 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 math

torch.manual_seed(0)

# Create a minimal diffusion_utils module with the assert function
class diffusion_utils:
    @staticmethod
    def assert_correctly_masked(tensor, mask):
        pass

# Inject it into the module namespace so NodeEdgeBlock can use it
import sys
current_module = sys.modules[__name__]
current_module.diffusion_utils = diffusion_utils

# Define dimensions
dx = 8      # node feature dimension
de = 6      # edge feature dimension
dy = 4      # global feature dimension
n_head = 2  # number of attention heads
bs = 2      # batch size
n = 3       # number of nodes

# Create tensors
X = torch.randn(bs, n, dx)
E = torch.randn(bs, n, n, de)
y = torch.randn(bs, dy)
node_mask = torch.ones(bs, n)

ARGS = {
    'dx': dx,
    'de': de,
    'dy': dy,
    'n_head': n_head,
}
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 NodeEdgeBlock — 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 NodeEdgeBlock 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
SumExceptBatchKL Ran
ran on a synthesized input · constructed an object; no result was computed
xinyangATK/GraphBetaDiffusion/src/diffusion_model_discrete.py
code served (permissive licence) · get_code("295f1f304ea8e1f4")
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, SumExceptBatchKL: 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.functional as F
from torchmetrics import Metric

torch.manual_seed(0)

class SumExceptBatchKL(Metric):

    def __init__(self):
        super().__init__()
        self.add_state('total_value', default=torch.tensor(0.0), dist_reduce_fx='sum')
        self.add_state('total_samples', default=torch.tensor(0.0), dist_reduce_fx='sum')

    def update(self, p, q) -> None:
        self.total_value += F.kl_div(q, p, reduction='sum')
        self.total_samples += p.size(0)

    def compute(self):
        return self.total_value / self.total_samples


# Create valid tensors for p and q
# p should be a probability distribution (target)
# q should be log probabilities (input to kl_div)
# Both need batch dimension and feature dimension

p = torch.softmax(torch.randn(2, 4), dim=1)  # batch_size=2, features=4, probabilities
q = F.log_softmax(torch.randn(2, 4), dim=1)  # batch_size=2, features=4, log probabilities

# Instantiate the metric
metric = SumExceptBatchKL()

# Update the metric with sample data
metric.update(p, q)

# Compute the result
result = metric.compute()

ARGS = {
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, torchmetrics — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type SumExceptBatchKL — 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 SumExceptBatchKL 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
SumExceptBatchMetric Ran
ran on a synthesized input · constructed an object; no result was computed
xinyangATK/GraphBetaDiffusion/src/diffusion_model_discrete.py
code served (permissive licence) · get_code("5a0e207d75121664")
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, SumExceptBatchMetric: 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
from torchmetrics import Metric

torch.manual_seed(0)

class SumExceptBatchMetric(Metric):

    def __init__(self):
        super().__init__()
        self.add_state('total_value', default=torch.tensor(0.0), dist_reduce_fx='sum')
        self.add_state('total_samples', default=torch.tensor(0.0), dist_reduce_fx='sum')

    def update(self, values) -> None:
        self.total_value += torch.sum(values)
        self.total_samples += values.shape[0]

    def compute(self):
        return self.total_value / self.total_samples


# Create metric instance and test it with sample data
metric = SumExceptBatchMetric()

# Test the metric with a small tensor (batch_size=2, features=4)
test_values = torch.randn(2, 4)
metric.update(test_values)
result = metric.compute()

# Define ARGS - this metric's __init__ takes no parameters
ARGS = {}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, torchmetrics — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type SumExceptBatchMetric — 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 SumExceptBatchMetric 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
TrainLossDiscrete Ran
ran on a synthesized input · constructed an object; no result was computed
xinyangATK/GraphBetaDiffusion/src/diffusion_model_discrete.py
code served (permissive licence) · get_code("0eeeb63ec7b09fb3")
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, TrainLossDiscrete: 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
from torch import Tensor

torch.manual_seed(0)

# Create sample tensors with distinct sizes for different dimensions
batch_size = 2
num_nodes = 3
dx = 4  # node feature dimension
de = 5  # edge feature dimension
dy = 6  # output dimension

# Create predictions and targets
masked_pred_X = torch.randn(batch_size, num_nodes, dx)
masked_pred_E = torch.randn(batch_size, num_nodes, num_nodes, de)
pred_y = torch.randn(batch_size, dy)

# Create true values - need to be one-hot or categorical for cross entropy
true_X = torch.zeros(batch_size, num_nodes, dx)
true_X[0, 0, :] = torch.randn(dx)  # Some non-zero values to pass masking
true_X[1, 1, :] = torch.randn(dx)

true_E = torch.zeros(batch_size, num_nodes, num_nodes, de)
true_E[0, 0, 1, :] = torch.randn(de)  # Some non-zero values to pass masking
true_E[1, 1, 2, :] = torch.randn(de)

true_y = torch.zeros(batch_size, dy)
true_y[0, 0] = 1.0
true_y[1, 2] = 1.0

# Lambda train parameter - list of two floats for weighting edge and y losses
lambda_train = [0.5, 0.3]

ARGS = {
    'lambda_train': lambda_train,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, torchmetrics, wandb — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type TrainLossDiscrete — 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 TrainLossDiscrete 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
Xtoy Ran
ran on a synthesized input · constructed an object; no result was computed
xinyangATK/GraphBetaDiffusion/src/diffusion_model_discrete.py
code served (permissive licence) · get_code("d7bb782f9e70779e")
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, Xtoy: 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)

# Xtoy constructor parameters: dx, dy
# From the forward method:
# - X has shape (bs, n, dx)
# - lin layer takes input of size 4*dx and outputs dy
# So we need to pick dx and dy values

dx = 4
dy = 3

ARGS = {
    "dx": dx,
    "dy": dy,
}
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 Xtoy — 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 Xtoy 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
index_last_dim Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
lingxiaoshawn/pard/pard/diffusion.py
code served (permissive licence) · get_code("cd574a170c2b72b8")
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 3, dtype family float, shape (2, 3, 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)

# x: (B, N1, ..., Nk, C) - a multi-dimensional tensor with last dimension C
# idx: (B, N1, ..., Nk) - indices into the last dimension of x, with idx.max() < C

# Create a small example:
# B=2 (batch), N1=3, N2=4 (spatial dims), C=5 (channels)
B, N1, N2, C = 2, 3, 4, 5

# x has shape (2, 3, 4, 5)
x = torch.randn(B, N1, N2, C)

# idx has shape (2, 3, 4) with values in range [0, C)
idx = torch.randint(0, C, (B, N1, N2))

ARGS = {
    "x": x,
    "idx": idx,
}
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 3, dtype family float, shape (2, 3, 4) — shape (2, 3, 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
noise_schedule Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
lingxiaoshawn/pard/pard/diffusion.py
code served (permissive licence) · get_code("01627b4b65b502c9")
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 tuple, ndim 2, 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 math

torch.manual_seed(0)

# Test case 1: cosine schedule with N > 0
t_step_1 = torch.tensor([0, 250, 500, 1000], dtype=torch.long)
s_step_1 = torch.tensor([0, 100, 200, 300], dtype=torch.long)

# Test case 2: linear schedule with different parameters
t_step_2 = torch.tensor([10, 50, 100], dtype=torch.long)
s_step_2 = None

# Test case 3: exponential schedule
t_step_3 = torch.tensor([0, 100, 500], dtype=torch.long)
s_step_3 = torch.tensor([0, 50], dtype=torch.long)

# Using test case 1 as the primary setup
ARGS = {
    't_step': torch.tensor([0, 250, 500, 1000], dtype=torch.long),
    's_step': torch.tensor([0, 100, 200, 300], dtype=torch.long),
    'schedule_type': 'cosine',
    'N': 1000,
    'Tmax': 1.0,
    'a': None,
    'b': None,
    'min_alphabar': 1e-10,
    'max_beta': 100.0
}
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 tuple, ndim 2, dtype family float — a tuple output has no array shape of its own; none is stated
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
sample_bernoulli Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
lingxiaoshawn/pard/pard/diffusion.py
code served (permissive licence) · get_code("0d129fbf2733355c")
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. 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, 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)

# Analyze the function:
# - prob: a tensor with shape[0] == x_shape[0], used in comparison with u
# - x_shape: a tuple/list defining shape for torch.rand
# - device: string, default 'cuda'

# The function samples from a Bernoulli distribution
# prob should be a tensor with batch size matching x_shape[0]
# x_shape should be a tuple like (batch_size, ...)

batch_size = 2
feature_dim = 4

# Create prob tensor: shape (batch_size, feature_dim)
prob = torch.rand(batch_size, feature_dim)

# Create x_shape: tuple with batch_size as first dimension
x_shape = (batch_size, feature_dim)

# device parameter - use CPU
device = 'cpu'

ARGS = {
    'prob': prob,
    'x_shape': x_shape,
    'device': device
}
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
sample_categorical Ran
ran; our contract draft was wrong, not the code
lingxiaoshawn/pard/pard/diffusion.py
code served (permissive licence) · get_code("9d8f3764aca720ec")
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 3, dtype family int, shape (2, 3, 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)

# prob should be a tensor of shape (B x N1 x ... x Nk x Num_class)
# The function flattens all dims except the last one, then uses multinomial sampling
# Let's create a simple case: batch=2, spatial dims (3, 4), num_classes=5
prob = torch.rand(2, 3, 4, 5)
# Normalize to make valid probabilities (sum to 1 along last dim)
prob = prob / prob.sum(dim=-1, keepdim=True)

ARGS = {
    "prob": prob
}
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 3, dtype family int, shape (2, 3, 4) — shape (2, 3, 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
set_last_dim Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
lingxiaoshawn/pard/pard/diffusion.py
code served (permissive licence) · get_code("ea18929480741b1e")
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 4, dtype family float, shape (2, 3, 4, 5) 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)

# Create a tensor x with shape (B, N1, N2, C) = (2, 3, 4, 5)
# where B=2 (batch), N1=3, N2=4 (spatial dims), C=5 (last dim/channels)
x = torch.randn(2, 3, 4, 5)

# Create an index tensor with shape (B, N1, N2) = (2, 3, 4)
# with values < C (i.e., < 5)
idx = torch.randint(0, 5, (2, 3, 4))

# Create a value tensor with shape (B, N1, N2) = (2, 3, 4)
value = torch.randn(2, 3, 4)

# Test with inplace_add=False (default)
inplace_add = False

ARGS = {
    "x": x,
    "idx": idx,
    "value": value,
    "inplace_add": inplace_add,
}
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 4, dtype family float, shape (2, 3, 4, 5) — shape (2, 3, 4, 5) 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
DiscreteDenoisingDiffusion Not yet run
unverified (harvested, no recorded run)
xinyangATK/GraphBetaDiffusion/src/diffusion_model_discrete.py
code served (permissive licence) · get_code("2e0a2b9a6b44de63")
How it ran

no invocation recorded.

DiscreteDenoisingDiffusion Not yet run
unverified (harvested, no recorded run)
cvignac/digress/src/diffusion_model_discrete.py
code served (permissive licence) · get_code("f9e50edf64cad6ca")
How it ran

no invocation recorded.

DiscreteDiffusion Not yet run
unverified (harvested, no recorded run)
lingxiaoshawn/pard/pard/diffusion.py
code served (permissive licence) · get_code("ae40c21213aba78e")
How it ran

no invocation recorded.

GraphTransformer Not yet run
unverified (harvested, no recorded run)
xinyangATK/GraphBetaDiffusion/src/diffusion_model_discrete.py
code served (permissive licence) · get_code("19aa05716c3273ce")
How it ran

no invocation recorded.

GraphTransformer Not yet run
unverified (harvested, no recorded run)
cvignac/digress/src/diffusion_model_discrete.py
code served (permissive licence) · get_code("02efa89bd5962590")
How it ran

no invocation recorded.

NodeEdgeBlock Not yet run
unverified (harvested, no recorded run)
cvignac/digress/src/diffusion_model_discrete.py
code served (permissive licence) · get_code("3913b8a35ac72188")
How it ran

no invocation recorded.

PredefinedNoiseScheduleDiscrete Not yet run
unverified (harvested, no recorded run)
xinyangATK/GraphBetaDiffusion/src/diffusion_model_discrete.py
code served (permissive licence) · get_code("354be05e0f965a4b")
How it ran

no invocation recorded.

XEyTransformerLayer Not yet run
unverified (harvested, no recorded run)
xinyangATK/GraphBetaDiffusion/src/diffusion_model_discrete.py
code served (permissive licence) · get_code("a8bf4eb62fe3ecd9")
How it ran

no invocation recorded.

XEyTransformerLayer Not yet run
unverified (harvested, no recorded run)
cvignac/digress/src/diffusion_model_discrete.py
code served (permissive licence) · get_code("52d0bb0f479c428c")
How it ran

no invocation recorded.

masked_softmax Not yet run
unverified (harvested, no recorded run)
xinyangATK/GraphBetaDiffusion/src/diffusion_model_discrete.py
code served (permissive licence) · get_code("1717b7476aced94e")
How it ran

no invocation recorded.

Also present in other papers' code

Of 25 samples lifted from this paper's linked repositories, 25 carry a function identity and 0 do not. Of the 24 distinct functions with an identity, 6 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 4 later) and 18 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
masked_softmax
brick of this paper's assembly: helper
3 other papers
3 later
2402.16302 (2024-02)
Graph Diffusion Policy Optimization
2405.11416 (2024-05)
Discrete-state Continuous-time Diffusion for Graph Generation
2406.17341 (2024-06)
Generative Modelling of Structurally Constrained Graphs
XEyTransformerLayer
brick of this paper's assembly: helper
2 other papers
2 later
2403.16883 (2024-03)
GLAD: Improving Latent Graph Generative Modeling with Simple Quantization
2605.07048 (2026-05)
Unlocking High-Fidelity Molecular Generation from Mass Spectra via Dual-Stream Line Graph Diffusion
Etoy
brick of this paper's assembly: helper
1 other paper
1 later · 1 only as an assembly brick
2403.16883 (2024-03)
GLAD: Improving Latent Graph Generative Modeling with Simple Quantization
Xtoy
brick of this paper's assembly: helper
1 other paper
1 later · 1 only as an assembly brick
2403.16883 (2024-03)
GLAD: Improving Latent Graph Generative Modeling with Simple Quantization
index_last_dim
brick of this paper's assembly: helper
1 other paper
1 dated earlier
2205.14987 (2022-05)
A Continuous Time Framework for Discrete Denoising Models
set_last_dim
brick of this paper's assembly: helper
1 other paper
1 dated earlier
2205.14987 (2022-05)
A Continuous Time Framework for Discrete Denoising Models

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

This work introduces DiGress, a discrete denoising diffusion model for generating graphs with categorical node and edge attributes. Our model utilizes a discrete diffusion process that progressively edits graphs with noise, through the process of adding or removing edges and changing the categories. A graph transformer network is trained to revert this process, simplifying the problem of distribution learning over graphs into a sequence of node and edge classification tasks. We further improve sample quality by introducing a Markovian noise model that preserves the marginal distribution of node and edge types during diffusion, and by incorporating auxiliary graph-theoretic features. A procedure for conditioning the generation on graph-level features is also proposed. DiGress achieves state-of-theart performance on molecular and non-molecular datasets, with up to 3x validity improvement on a planar graph dataset. It is also the first model to scale to the large GuacaMol dataset containing 1.3M drug-like molecules without the use of molecule-specific representations.

For agents

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

get_harvested_code_for_paper("2209.14734")
get_code_for_paper("2209.14734")
have("2209.14734")

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

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

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

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

Connect an agent — have() is free.