SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2301.08227 · 2023

Diffusion-based Conditional ECG Generation with Structured State Space Models

arXiv · PDF · Open in the Atlas

Code that ran

12 of 14 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 2 honoured the contract we drafted, 0 violated it and 3 have no contract verdict; 7 failures of our instrument; 2 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-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/2301.08227.json · badge: /api/ran/2301.08227.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
ai4healthuol/sssd-ecg canonical (classifier label)
classifier basis not recorded on the link
12 ran · 2 no recorded run
FunctionStatusWhere it lives
swish Ran
ran; our contract draft was wrong, not the code
ai4healthuol/sssd-ecg/src/sssd/models/SSSD_ECG.py
code served (permissive licence) · get_code("0f786c407fb1ee4c")
How it ran

Ran in Syntology's jail 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 comparison behind this sample's level is a different run: the peer-agreement lane ran it again on the host, not in the jail (report dated 2026-09-04T22:33:52Z). 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 swish takes a single parameter 'x' which is used with:
# - torch.sigmoid(x) - requires a tensor
# - x * ... - requires a tensor that supports multiplication
# So x should be a tensor

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
Activation Ran
ran; our contract draft was wrong, not the code
ai4healthuol/sssd-ecg/src/sssd/models/S4Model.py
code served (permissive licence) · get_code("89b10a8b26bbb7ed")
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 ReLU. 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)

# The function takes two parameters: activation and dim
# activation: a string or None specifying which activation function to use
# dim: an integer specifying the dimension for GLU (default -1)

ARGS = {
    'activation': 'relu',
    'dim': -1
}
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 ReLU — a ReLU output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ReLU 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
find_max_epoch Ran
ran, honoured the contract we drafted
ai4healthuol/sssd-ecg/src/sssd/utils/util.py
code served (permissive licence) · get_code("745f173f5a730552")
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 int, ndim 0, dtype family int, 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 os
import tempfile
import shutil

# Create a temporary directory with test checkpoint files
temp_dir = tempfile.mkdtemp()

# Create some valid checkpoint files
open(os.path.join(temp_dir, "100000.pkl"), 'w').close()
open(os.path.join(temp_dir, "50000.pkl"), 'w').close()
open(os.path.join(temp_dir, "200000.pkl"), 'w').close()

# Create some invalid files that should be ignored
open(os.path.join(temp_dir, "readme.txt"), 'w').close()
open(os.path.join(temp_dir, "notanumber.pkl"), 'w').close()
open(os.path.join(temp_dir, "123"), 'w').close()  # no .pkl extension, too short

ARGS = {
    "path": temp_dir
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, 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
flatten Ran
ran, honoured the contract we drafted
ai4healthuol/sssd-ecg/src/sssd/utils/util.py
code served (permissive licence) · get_code("c711b513a9afe00d")
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 list, ndim 1, dtype family int; 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

torch.manual_seed(0)

# The flatten function takes a list of lists/tuples and flattens it
# It iterates through each element y in v, then through each x in y
# So v should be a list of lists or tuples

ARGS = {
    "v": [
        [1, 2, 3],
        [4, 5],
        [6, 7, 8, 9]
    ]
}
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 list, ndim 1, dtype family int — a list 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
generate_four_leads Ran
ran on a synthesized input
ai4healthuol/sssd-ecg/src/sssd/inference.py
code served (permissive licence) · get_code("7b4d8ff01c1c340c")
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 Tensor, ndim 3, dtype family float, shape (2, 12, 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 expects a tensor with shape (batch_size, num_leads, num_samples)
# It indexes specific lead positions: 0, 1:7, 7
# So we need at least 8 leads (indices 0-7)
# Let's use batch_size=2, num_leads=8, num_samples=4

tensor = torch.randn(2, 8, 4)

ARGS = {
    "tensor": tensor
}
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 Tensor, ndim 3, dtype family float, shape (2, 12, 4) — shape (2, 12, 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
get_available_channels Ran
ran on a synthesized input
ai4healthuol/sssd-ecg/src/ptb_xl/clinical_ts/ecg_utils.py
code served (permissive licence) · get_code("e0e92b77185b9c56")
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 list, ndim 1, dtype family int; 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 numpy as np

# Construct arguments for get_available_channels
channel_labels = ["ch_a", "ch_b", "ch_c"]
channel_stoi = {"ch_a": 0, "ch_b": 1, "ch_c": 2, "ch_d": 3}

ARGS = {
    "channel_labels": channel_labels,
    "channel_stoi": channel_stoi,
}
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 list, ndim 1, dtype family int — a list 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
get_filename_out Ran
ran on a synthesized input
ai4healthuol/sssd-ecg/src/ptb_xl/clinical_ts/ecg_utils.py
code served (permissive licence) · get_code("2bb5c59ccfefe256")
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 1, 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.

from pathlib import Path
import tempfile

# Create a temporary directory for testing
temp_dir = tempfile.mkdtemp()

# Test case 1: filename_in without target_folder
filename_in_1 = Path('/some/path/data/train/file1.txt')

# Test case 2: filename_in with target_folder and 'train' in parts
target_folder_1 = Path(temp_dir) / 'output'

# Test case 3: filename_in with 'eval' in parts
filename_in_2 = Path('/some/path/data/eval/file2.txt')

# Test case 4: filename_in with 'valid' in parts
filename_in_3 = Path('/some/path/data/valid/file3.txt')

# Test case 5: filename_in with 'dev_test' in parts
filename_in_4 = Path('/some/path/data/dev_test/file4.txt')

# Test case 6: filename_in with 'valtest' in parts
filename_in_5 = Path('/some/path/data/valtest/file5.txt')

# Create ARGS with the most common use case
ARGS = {
    'filename_in': filename_in_1,
    'target_folder': target_folder_1,
    'suffix': '_processed'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, 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
get_initializer Ran
ran; our contract draft was wrong, not the code
ai4healthuol/sssd-ecg/src/sssd/models/S4Model.py
pointer only (licence: MIT); the stored copy get_code serves, from ctlllll/sgconv, is pointer only (licence: NONE) · get_code("49d9214ec79a8edb")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from ctlllll/sgconv, and GitHub detected no licence in that repository 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.

get_logger Ran
ran; our contract draft was wrong, not the code
ai4healthuol/sssd-ecg/src/sssd/models/S4Model.py
code served (permissive licence) · get_code("61139ec62260b411")
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 Logger. 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 logging
from pytorch_lightning.utilities import rank_zero_only

# Construct arguments for get_logger function
ARGS = {
    "name": "test_logger",
    "level": logging.DEBUG
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pytorch_lightning — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Logger — a Logger output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Logger 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
std_normal Ran
ran; our contract draft was wrong, not the code
ai4healthuol/sssd-ecg/src/sssd/utils/util.py
code served (permissive licence) · get_code("d3d2b2f127241f47")
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 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)

# The function std_normal takes a 'size' parameter
# It uses torch.normal(0, 1, size=size).cuda()
# So 'size' should be a tuple or torch.Size representing tensor dimensions

ARGS = {
    "size": (2, 4)
}
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 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
stratified_subsets Ran
ran; our contract draft was wrong, not the code
ai4healthuol/sssd-ecg/src/ptb_xl/clinical_ts/stratify.py
pointer only (licence: MIT); the stored copy get_code serves, from ai4healthuol/cardiodiag, is pointer only (licence: NONE) · get_code("3a626a74af8a198b")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from ai4healthuol/cardiodiag, and GitHub detected no licence in that repository 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.

stratify_batched Ran
ran; our contract draft was wrong, not the code
ai4healthuol/sssd-ecg/src/ptb_xl/clinical_ts/stratify.py
pointer only (licence: MIT); the stored copy get_code serves, from ai4healthuol/cardiodiag, is pointer only (licence: NONE) · get_code("9405c50464b7385f")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from ai4healthuol/cardiodiag, and GitHub detected no licence in that repository 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.

calc_gradient_penalty Not yet run
unverified (harvested, no recorded run)
ai4healthuol/sssd-ecg/src/baselines/utils/utils.py
code served (permissive licence) · get_code("08bc532c558ef11c")
How it ran

no invocation recorded.

split_stratified Not yet run
unverified (harvested, no recorded run)
ai4healthuol/sssd-ecg/src/ptb_xl/clinical_ts/stratify.py
pointer only (licence: MIT); the stored copy get_code serves, from ai4healthuol/cardiodiag, is pointer only (licence: NONE) · get_code("e740a0f4139a1c0f")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from ai4healthuol/cardiodiag, and GitHub detected no licence in that repository 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.

Also present in other papers' code

Of 14 samples lifted from this paper's linked repositories, 14 carry a function identity and 0 do not. Of the 14 distinct functions with an identity, 10 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 1 the same month, 10 later) and 4 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
swish 206 other papers
128 dated earlier, 2 the same month, 76 later · 44 only as an assembly brick
1408.5882 (2014-08)
Convolutional Neural Networks for Sentence Classification
1805.12114 (2018-05)
Deep Reinforcement Learning in a Handful of Trials using Probabilistic Dynamics Models
1809.01357 (2018-09)
Zero Shot Learning for Code Education: Rubric Sampling with Deep Learning Inference
and 203 more not named here
Activation 15 other papers
11 dated earlier, 4 later · 2 only as an assembly brick
1312.5602 (2013-12)
Playing Atari with Deep Reinforcement Learning
2008.07669 (2020-08)
HiPPO: Recurrent Memory with Optimal Polynomial Projections
2009.09761 (2020-09)
DiffWave: A Versatile Diffusion Model for Audio Synthesis
and 12 more not named here
get_logger 15 other papers
7 dated earlier, 8 later · 3 only as an assembly brick
2009.09761 (2020-09)
DiffWave: A Versatile Diffusion Model for Audio Synthesis
2111.00396 (2021-11)
Efficiently Modeling Long Sequences with Structured State Spaces
2204.01692 (2022-04)
Long Movie Clip Classification with State-Space Video Models
and 12 more not named here
get_initializer 10 other papers
8 dated earlier, 2 later · 1 only as an assembly brick
2008.07669 (2020-08)
HiPPO: Recurrent Memory with Optimal Polynomial Projections
2111.00396 (2021-11)
Efficiently Modeling Long Sequences with Structured State Spaces
2202.09729 (2022-02)
It's Raw! Audio Generation with State-Space Models
and 7 more not named here
find_max_epoch 1 other paper
1 later
2401.03006 (2024-01)
The Rise of Diffusion Models in Time-Series Forecasting
flatten 1 other paper
1 later
2401.03006 (2024-01)
The Rise of Diffusion Models in Time-Series Forecasting
split_stratified 1 other paper
1 later
2412.07737 (2024-12)
Explainable machine learning for neoplasms diagnosis via electrocardiograms: an externally validated study
std_normal 1 other paper
1 later
2401.03006 (2024-01)
The Rise of Diffusion Models in Time-Series Forecasting
stratified_subsets 1 other paper
1 later
2412.07737 (2024-12)
Explainable machine learning for neoplasms diagnosis via electrocardiograms: an externally validated study
stratify_batched 1 other paper
1 later
2412.07737 (2024-12)
Explainable machine learning for neoplasms diagnosis via electrocardiograms: an externally validated study

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

Synthetic data generation is a promising solution to address privacy issues with the distribution of sensitive health data. Recently, diffusion models have set new standards for generative models for different data modalities. Also very recently, structured state space models emerged as a powerful modeling paradigm to capture long-term dependencies in time series. We put forward SSSD-ECG, as the combination of these two technologies, for the generation of synthetic 12-lead electrocardiograms conditioned on more than 70 ECG statements. Due to a lack of reliable baselines, we also propose conditional variants of two state-of-the-art unconditional generative models. We thoroughly evaluate the quality of the generated samples, by evaluating pretrained classifiers on the generated data and by evaluating the performance of a classifier trained only on synthetic data, where SSSD-ECG clearly outperforms its GAN-based competitors. We demonstrate the soundness of our approach through further experiments, including conditional class interpolation and a clinical Turing test demonstrating the high quality of the SSSD-ECG samples across a wide range of conditions.

For agents

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

get_harvested_code_for_paper("2301.08227")
get_code_for_paper("2301.08227")
have("2301.08227")

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

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

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

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

Connect an agent — have() is free.