SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2608.23347 · 2026

Test-Time Adaptation for ECG Classification via SQI-Gated Self-Training and Beat-Rhythm Consistency

Yefeng Zheng, Haolin Wang, Yafei Ou, Jiale Zhou, Training Stage, Wenhan Jiang, Zhipeng Deng

arXiv · PDF · Open in the Atlas

Code that ran

15 of 19 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (2 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 1 violated it and 2 have no contract verdict; 11 failures of our instrument; 4 no recorded run), measured 2026-11-23; 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/2608.23347.json · badge: /api/ran/2608.23347.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
Vincent-Wenhan/BeatRhythm-TTA community
Papers with Code archive
15 ran · 4 no recorded run
FunctionStatusWhere it lives
Adapter Ran
ran on a synthesized input · constructed an object; no result was computed
Vincent-Wenhan/BeatRhythm-TTA/src/method/beatrhythmtta.py
code served (permissive licence) · get_code("c0af846e96ca4517")
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, Adapter: 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 typing import Any

torch.manual_seed(0)

# Minimal model that the Adapter can use
class DummyModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.fc = nn.Linear(4, 3)
    
    def forward(self, x: torch.Tensor) -> torch.Tensor:
        return self.fc(x)

# Minimal config class
class DummyConfig:
    def __init__(self):
        self.learning_rate = 0.001
        self.batch_size = 2

# Create instances
model = DummyModel()
cfg = DummyConfig()
device = torch.device('cpu')

ARGS = {
    'model': model,
    'cfg': cfg,
    'device': device,
}
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 Adapter — 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 Adapter 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
OutputHook Ran
ran on a synthesized input · constructed an object; no result was computed
Vincent-Wenhan/BeatRhythm-TTA/src/method/beatrhythmtta.py
code served (permissive licence) · get_code("4f9c8246f0d92fdc")
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, OutputHook: 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)

# Create a minimal nn.Module to use with OutputHook
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

# Instantiate the model
model = SimpleModel()

# Define the arguments dict
ARGS = {
    'module': model
}
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 OutputHook — 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 OutputHook 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
_aggregate_sample_sqi_from_beats Ran
ran; our contract draft was wrong, not the code
Vincent-Wenhan/BeatRhythm-TTA/src/method/beatrhythmtta.py
code served (permissive licence) · get_code("e9d6a42d11559450")
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 1, dtype family float, shape (2,) 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)

# Construct beat_w: a 1D tensor of beat weights
# Total of 5 beats across batches
beat_w = torch.tensor([0.8, 0.9, 0.7, 0.85, 0.75], dtype=torch.float32)

# Construct counts: how many beats per batch sample
# 2 samples: first has 2 beats, second has 3 beats
counts = torch.tensor([2, 3], dtype=torch.long)

# mode: aggregation method
mode = 'mean'

ARGS = {
    'beat_w': beat_w,
    'counts': counts,
    'mode': mode,
}
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 1, dtype family float, shape (2,) — shape (2,) 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
_augment_time_aligned Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
Vincent-Wenhan/BeatRhythm-TTA/src/method/beatrhythmtta.py
code served (permissive licence) · get_code("cc7d4ce406f2e230")
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, 4, 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

torch.manual_seed(0)

# Construct a small 3D tensor (B, C, T)
# B=2 (batch), C=4 (channels), T=8 (time steps)
x = torch.randn(2, 4, 8)

ARGS = {
    "x": x,
    "noise_std": 0.1,
    "gain_std": 0.05,
    "mask_ratio": 0.2,
    "mask_num": 1,
}
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, 4, 8) — shape (2, 4, 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: none by the harness; any seed is in the setup block
_beat_sqi_from_raw Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
Vincent-Wenhan/BeatRhythm-TTA/src/method/beatrhythmtta.py
code served (permissive licence) · get_code("23352225e22a2766")
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. 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

torch.manual_seed(0)

# Construct x: (B=2, C=4, T=500) - batch of 2, 4 channels, 500 time samples
x = torch.randn(2, 4, 500)

# Construct r_list: list of beat indices for each sample in batch
# r_list[0] has 5 beat positions, r_list[1] has 3 beat positions
r_list = [
    torch.tensor([50, 150, 250, 350, 450], dtype=torch.long),
    torch.tensor([75, 225, 400], dtype=torch.long)
]

# eps parameter
eps = 1e-06

ARGS = {
    "x": x,
    "r_list": r_list,
    "eps": eps
}
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 — 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: none by the harness; any seed is in the setup block
_cos_loss Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
Vincent-Wenhan/BeatRhythm-TTA/src/method/beatrhythmtta.py
code served (permissive licence) · get_code("1469877e1da868a1")
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 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
import torch.nn.functional as F

torch.manual_seed(0)

# Create two small tensors with shape (N, D) where N=2, D=4
a = torch.randn(2, 4)
b = torch.randn(2, 4)

ARGS = {
    "a": a,
    "b": b,
    "stopgrad": True
}
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 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
_cos_loss_vec Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
Vincent-Wenhan/BeatRhythm-TTA/src/method/beatrhythmtta.py
code served (permissive licence) · get_code("1e42a7bd01e89218")
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 1, dtype family float, shape (2,) 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.functional as F

torch.manual_seed(0)

# Create two tensors of shape (N, D) where N=2 (batch size) and D=4 (dimension)
a = torch.randn(2, 4)
b = torch.randn(2, 4)

# stopgrad is a boolean parameter
stopgrad = True

ARGS = {
    "a": a,
    "b": b,
    "stopgrad": stopgrad,
}
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 1, dtype family float, shape (2,) — shape (2,) 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_module_by_name Ran
ran; our contract draft was wrong, not the code
Vincent-Wenhan/BeatRhythm-TTA/src/method/beatrhythmtta.py
code served (permissive licence) · get_code("81577d17c0818df4")
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 Linear. 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)

# Build a model with nested structure that supports both attribute access and indexing
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.layer1 = nn.Linear(4, 3)
        self.layer2 = nn.Sequential(
            nn.Linear(3, 2),
            nn.ReLU(),
            nn.Linear(2, 1)
        )

model = SimpleModel()

# Test case 1: Access via attribute name (e.g., "layer1")
# This would return model.layer1, which is an nn.Linear module

# Test case 2: Access via nested attribute (e.g., "layer2.0")
# This would return model.layer2[0], which is an nn.Linear module

# The function uses:
# - model: an nn.Module instance
# - name: a string with parts separated by '.' where parts can be either:
#   - attribute names (accessed via getattr)
#   - digit strings (accessed via indexing with int())

# We'll use a name that accesses layer2.0 (the first layer in the Sequential)
ARGS = {
    "model": model,
    "name": "layer2.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 Linear — a Linear output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Linear 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
_map_rpeaks_sample_to_feat Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
Vincent-Wenhan/BeatRhythm-TTA/src/method/beatrhythmtta.py
code served (permissive licence) · get_code("499349346847f746")
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 1, dtype family int, 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 torch

torch.manual_seed(0)

# r is a 1D tensor of R-peak indices
# T_in is the input sequence length
# T_feat is the feature sequence length

r = torch.tensor([10, 25, 50, 75], dtype=torch.long)
T_in = 100
T_feat = 50

ARGS = {
    "r": r,
    "T_in": T_in,
    "T_feat": T_feat,
}
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 1, dtype family int, 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
_pool_beats Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
Vincent-Wenhan/BeatRhythm-TTA/src/method/beatrhythmtta.py
code served (permissive licence) · get_code("029a9cac897dd0c7")
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 (5, 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)

# feat: (B, D, Tf) tensor
# B=2 (batch size), D=4 (feature dimension), Tf=10 (time frames)
feat = torch.randn(2, 4, 10)

# r_list_feat: List of beat position indices for each batch element
# First batch element has 3 beats, second has 2 beats
r_list_feat = [
    torch.tensor([1, 4, 8]),      # Beat positions for batch 0
    torch.tensor([2, 7])           # Beat positions for batch 1
]

# w_feat: window width (half-width around beat)
w_feat = 2

ARGS = {
    "feat": feat,
    "r_list_feat": r_list_feat,
    "w_feat": w_feat,
}
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 (5, 4) — shape (5, 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
as_2class_if_binary Ran
ran, honoured the contract we drafted
Vincent-Wenhan/BeatRhythm-TTA/src/method/beatrhythmtta.py
code served (permissive licence) · get_code("3bafcfe99aa8c684")
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, 2) 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 (B,1) shaped tensor for the binary case
logits = torch.randn(2, 1)

ARGS = {
    "logits": logits
}
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, 2) — shape (2, 2) 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
bn_affine_params_only Ran
ran; our contract draft was wrong, not the code
Vincent-Wenhan/BeatRhythm-TTA/src/method/beatrhythmtta.py
code served (permissive licence) · get_code("ca63893288e88e89")
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. 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)

# Create a small model with BatchNorm layers
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.conv1 = nn.Conv2d(3, 16, kernel_size=3)
        self.bn1 = nn.BatchNorm2d(16)
        self.linear1 = nn.Linear(16, 8)
        self.bn2 = nn.BatchNorm1d(8)
        self.linear2 = nn.Linear(8, 2)
        
    def forward(self, x):
        x = self.conv1(x)
        x = self.bn1(x)
        x = x.view(x.size(0), -1)
        x = self.linear1(x)
        x = self.bn2(x)
        x = self.linear2(x)
        return x

model = SimpleModel()

ARGS = {
    "model": model
}
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 — a list 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: none by the harness; any seed is in the setup block
bn_modules Ran
ran; our contract draft was wrong, not the code
Vincent-Wenhan/BeatRhythm-TTA/src/method/beatrhythmtta.py
code served (permissive licence) · get_code("62a7126295af3df9")
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 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

torch.manual_seed(0)

# Build a model with various BatchNorm layers mixed with other layers
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.conv1 = nn.Conv2d(3, 16, 3)
        self.bn1 = nn.BatchNorm2d(16)
        self.fc1 = nn.Linear(16, 32)
        self.bn2 = nn.BatchNorm1d(32)
        self.bn3 = nn.BatchNorm3d(8)
        self.relu = nn.ReLU()
        
model = SimpleModel()

ARGS = {
    "model": model
}
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 float — 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
forward Ran
ran; our contract draft was wrong, not the code
Vincent-Wenhan/BeatRhythm-TTA/src/method/beatrhythmtta.py
code served (permissive licence) · get_code("95c7d423e5761bc9")
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, 3) 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

torch.manual_seed(0)

# Create a simple model
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

# Instantiate the model
model = SimpleModel()

# Create a small input tensor (batch_size=2, input_dim=4)
x = torch.randn(2, 4)

ARGS = {
    "model": model,
    "x": x
}
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, 3) — shape (2, 3) 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
is_multilabel Ran
ran, violated the contract we drafted
Vincent-Wenhan/BeatRhythm-TTA/src/method/beatrhythmtta.py
code served (permissive licence) · get_code("90ab2183d1b2985c")
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 bool, 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
import torch.nn as nn

# The function tries to access cfg.task.is_multilabel
# We need to create a config object with a task that has is_multilabel attribute

class Task:
    def __init__(self, is_multilabel=False):
        self.is_multilabel = is_multilabel

class Config:
    def __init__(self, task=None):
        self.task = task

# Create test configurations
cfg_with_multilabel_true = Config(task=Task(is_multilabel=True))
cfg_with_multilabel_false = Config(task=Task(is_multilabel=False))
cfg_with_none_task = Config(task=None)
cfg_with_no_task = Config()

ARGS = {
    "cfg": cfg_with_multilabel_true
}
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 bool, 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
BeatRhythmTTA Not yet run
unverified (harvested, no recorded run)
Vincent-Wenhan/BeatRhythm-TTA/src/method/beatrhythmtta.py
code served (permissive licence) · get_code("c2e98b521fef27fa")
How it ran

no invocation recorded.

disable_dropout Not yet run
unverified (harvested, no recorded run)
Vincent-Wenhan/BeatRhythm-TTA/src/method/beatrhythmtta.py
code served (permissive licence) · get_code("7e9b5e32fb471ada")
How it ran

no invocation recorded.

set_bn_eval_only Not yet run
unverified (harvested, no recorded run)
Vincent-Wenhan/BeatRhythm-TTA/src/method/beatrhythmtta.py
code served (permissive licence) · get_code("93f5aab7ab70e133")
How it ran

no invocation recorded.

set_bn_train_only Not yet run
unverified (harvested, no recorded run)
Vincent-Wenhan/BeatRhythm-TTA/src/method/beatrhythmtta.py
code served (permissive licence) · get_code("95f74d4e6881a050")
How it ran

no invocation recorded.

Also present in other papers' code

Of 19 samples lifted from this paper's linked repositories, 19 carry a function identity and 0 do not. Of the 19 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 19 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.

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

Deep learning models for electrocardiogram (ECG) classification often suffer from significant performance degradation when deployed in unseen domains due to shifts in acquisition devices and patient populations. Test-time adaptation (TTA) offers a practical solution by adapting models using only unlabeled data at inference time. However, existing TTA methods often underperform on ECG tasks, since naive online updates ignore the hierarchical beat-rhythm structure of cardiac cycles and are vulnerable to signal artifacts, which leads to unstable adaptation and model drift. We propose BeatRhythm-TTA, an ECG-tailored TTA framework that explicitly accounts for ECG's noisy observations and structured beat-rhythm semantics under domain shift. First, to handle pervasive ECG artifacts, we introduce a Signal Quality Index (SQI)gated adaptation scheme that selectively filters out low-quality signals to prevent harmful updates. Second, to leverage ECG's beat-rhythm semantics, we enforce dual-level consistency so the model preserves beat morphology and rhythm dynamics while adapting to shifted acquisition conditions. Extensive experiments on multi-label ECG diagnosis across three adaptation protocols, using PTB-XL as the source domain and CPSC2018/Georgia as two target domains, demonstrate the effectiveness of our method, yielding an average +2.70% relative improvement in Macro-F1 over the best competing method. The code is available at https://github.com/Vincent-Wenhan/BeatRhythm-TTA.

For agents

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

get_harvested_code_for_paper("2608.23347")
get_code_for_paper("2608.23347")
have("2608.23347")

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

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

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

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

Connect an agent — have() is free.