SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2105.05537 · 2021

Swin-Unet: Unet-like Pure Transformer for Medical Image Segmentation

arXiv · PDF · Open in the Atlas

Code that ran

17 of 18 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; 0 honoured the contract we drafted, 0 violated it and 14 have no contract verdict; 3 failures of our instrument; 1 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2105.05537.json · badge: /api/ran/2105.05537.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
L-A-Sandhu/Swin-Unet- community (classifier label)
classifier basis not recorded on the link
9 ran · 0 no recorded run
Arnukk/CASPIAN community (classifier label)
classifier basis not recorded on the link
8 ran · 1 no recorded run
FunctionStatusWhere it lives
bce_loss_fn Ran
ran on a synthesized input
L-A-Sandhu/Swin-Unet-/src/swin_transformer/AUC_LOSS.py
code served (permissive licence) · get_code("dda41d1bd5f7d32e")
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 BCELoss. 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 tensorflow as tf

# Define the function and classes from the provided code
def _smooth_labels(y_true, label_smoothing):
    if label_smoothing == 0:
        return y_true
    num_classes = tf.shape(y_true)[-1]
    return y_true * (1.0 - label_smoothing) + label_smoothing / tf.cast(num_classes, y_true.dtype)

@tf.keras.utils.register_keras_serializable(package='SwinUNet')
class BCELoss(tf.keras.losses.Loss):

    def __init__(self, label_smoothing=0.0, name='bce_loss'):
        super().__init__(name=name)
        self.label_smoothing = label_smoothing

    def call(self, y_true, y_pred):
        y_true = _smooth_labels(y_true, self.label_smoothing)
        eps = tf.keras.backend.epsilon()
        y_pred = tf.clip_by_value(y_pred, eps, 1.0 - eps)
        bce = -(y_true * tf.math.log(y_pred) + (1.0 - y_true) * tf.math.log(1.0 - y_pred))
        return tf.reduce_mean(bce)

    def get_config(self):
        cfg = super().get_config()
        cfg.update({'label_smoothing': self.label_smoothing})
        return cfg

    @classmethod
    def from_config(cls, config):
        _skip = {'reduction', 'fn'}
        return cls(**{k: v for k, v in config.items() if k not in _skip})

def bce_loss_fn(label_smoothing=0.0):
    return BCELoss(label_smoothing=label_smoothing)

# Setup arguments for bce_loss_fn
ARGS = {
    'label_smoothing': 0.1
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type BCELoss — a BCELoss output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a BCELoss 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
clear_ds Ran
ran on a synthesized input
Arnukk/CASPIAN/utils.py
code served (permissive licence) · get_code("f4820de6705b381d")
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 4, 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 tensorflow as tf
import numpy as np

# Create small TensorFlow tensors for the function
x = tf.constant([[1.0, 2.0, 3.0, 4.0], [5.0, 6.0, 7.0, 8.0]], dtype=tf.float32)  # shape (2, 4)
y = tf.constant([[0.5, 1.5, 2.5, 3.5], [4.5, 5.5, 6.5, 7.5]], dtype=tf.float32)  # shape (2, 4)
yf = tf.constant([[0.1], [0.2]], dtype=tf.float32)  # shape (2, 1)

# f is not used in the function body, so we can pass a placeholder
f = None

# Define ARGS dictionary with all parameters
ARGS = {
    'f': f,
    'x': x,
    'y': y,
    'yf': yf,
    'one_d': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 4, 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
compute_binary_metrics Ran
ran on a synthesized input
L-A-Sandhu/Swin-Unet-/src/swin_transformer/metrics.py
code served (permissive licence) · get_code("d5165a7134b3051a")
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 dict. 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 numpy as np

# Set random seed for reproducibility
np.random.seed(0)

# Create binary classification test data
# y_true: ground truth binary labels
y_true = np.array([0, 1, 1, 0, 1, 0, 1, 1, 0, 0])

# y_pred: predicted binary labels
y_pred = np.array([0, 1, 1, 0, 1, 1, 1, 0, 0, 0])

# y_prob: predicted probabilities for the positive class
y_prob = np.array([0.1, 0.9, 0.8, 0.2, 0.85, 0.6, 0.95, 0.4, 0.15, 0.05])

ARGS = {
    'y_true': y_true,
    'y_pred': y_pred,
    'y_prob': y_prob,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
compute_multiclass_metrics Ran
ran on a synthesized input
L-A-Sandhu/Swin-Unet-/src/swin_transformer/metrics.py
code served (permissive licence) · get_code("14ef6380261ac759")
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 dict. 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 numpy as np
from sklearn.metrics import accuracy_score, precision_score, recall_score, f1_score, confusion_matrix, roc_auc_score, average_precision_score, roc_curve, precision_recall_curve, matthews_corrcoef, balanced_accuracy_score, jaccard_score, cohen_kappa_score, classification_report

# Set random seed for reproducibility
np.random.seed(0)

# Create small sample multiclass classification data
# y_true: true labels (0, 1, or 2)
# y_pred: predicted labels (0, 1, or 2)
# num_classes: number of classes

y_true = np.array([0, 1, 2, 0, 1, 2, 0, 1, 2, 0])
y_pred = np.array([0, 1, 2, 0, 2, 2, 1, 1, 2, 0])
num_classes = 3

ARGS = {
    'y_true': y_true,
    'y_pred': y_pred,
    'num_classes': num_classes
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
dice_loss_fn Ran
ran on a synthesized input
L-A-Sandhu/Swin-Unet-/src/swin_transformer/AUC_LOSS.py
code served (permissive licence) · get_code("9c8302514c4e7b35")
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 DiceLoss. 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 tensorflow as tf

# Define the DiceLoss class
@tf.keras.utils.register_keras_serializable(package='SwinUNet')
class DiceLoss(tf.keras.losses.Loss):

    def __init__(self, smooth=1.0, name='dice_loss'):
        super().__init__(name=name)
        self.smooth = smooth

    def call(self, y_true, y_pred):
        y_true_f = tf.cast(tf.reshape(y_true, [-1]), tf.float32)
        y_pred_f = tf.reshape(y_pred, [-1])
        inter = tf.reduce_sum(y_true_f * y_pred_f)
        union = tf.reduce_sum(y_true_f) + tf.reduce_sum(y_pred_f)
        return 1.0 - (2.0 * inter + self.smooth) / (union + self.smooth)

    def get_config(self):
        cfg = super().get_config()
        cfg.update({'smooth': self.smooth})
        return cfg

    @classmethod
    def from_config(cls, config):
        return cls(**{k: v for k, v in config.items() if k in ('smooth', 'name')})

def dice_loss_fn(smooth=1.0):
    return DiceLoss(smooth=smooth)

# Setup valid arguments for dice_loss_fn
ARGS = {
    'smooth': 1.0
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DiceLoss — a DiceLoss output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DiceLoss 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
drop_path_ Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
Arnukk/CASPIAN/models/keras_vision_transformer/util_layers.py
code served (permissive licence) · get_code("4bbaba82e75c9aff")
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 EagerTensor, ndim 4, dtype family float, shape (2, 4, 3, 1) 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 tensorflow as tf
import numpy as np

# Create a small tensor input
# Shape: (batch_size=2, height=4, width=3, channels=1)
inputs = tf.constant(np.random.randn(2, 4, 3, 1).astype(np.float32))

# Drop probability
drop_prob = 0.5

# Training flag
is_training = True

ARGS = {
    "inputs": inputs,
    "drop_prob": drop_prob,
    "is_training": is_training,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, ndim 4, dtype family float, shape (2, 4, 3, 1) — shape (2, 4, 3, 1) 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
dummy_loader Ran
ran on a synthesized input
L-A-Sandhu/Swin-Unet-/src/keras_swin_unet/utils.py
code served (permissive licence) · get_code("db4d0a3eecb8e0db")
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 tempfile
import os

# We need to create a temporary Keras model file for the dummy_loader function
# The function will load it and extract weights

try:
    import keras
except ImportError:
    import tensorflow.keras as keras

# Create a temporary directory and a simple Keras model
temp_dir = tempfile.mkdtemp()
model_path = os.path.join(temp_dir, "test_model.h5")

# Build and save a minimal Keras model
model = keras.Sequential([
    keras.layers.Dense(3, input_shape=(4,)),
    keras.layers.Dense(2)
])

# Compile is set to False in dummy_loader, so we don't need to compile
model.save(model_path)

ARGS = {
    "model_path": model_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
keras, tensorflow — 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
find_scenario Ran
ran on a synthesized input
Arnukk/CASPIAN/utils.py
code served (permissive licence) · get_code("4a0971f8b14ed3d9")
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 function. 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 tensorflow as tf

def find_scenario(scenario):
    def find(f, x, y, yf):
        return tf.equal(f, scenario)
    return find

ARGS = {
    "scenario": tf.constant(1, dtype=tf.int32)
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
focal_loss Ran
ran on a synthesized input
L-A-Sandhu/Swin-Unet-/src/swin_transformer/AUC_LOSS.py
code served (permissive licence) · get_code("dc39ed696312e230")
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 FocalLoss. 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 tensorflow as tf
import numpy as np

# Set seeds for reproducibility
tf.random.set_seed(0)
np.random.seed(0)

# Create minimal valid arguments for focal_loss function
# The function signature is: focal_loss(alpha=0.25, gamma=2.0, label_smoothing=0.0)

ARGS = {
    'alpha': 0.25,
    'gamma': 2.0,
    'label_smoothing': 0.0
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type FocalLoss — a FocalLoss output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a FocalLoss 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
image_to_array Ran
ran on a synthesized input
Arnukk/CASPIAN/models/keras_vision_transformer/utils.py
code served (permissive licence) · get_code("49481c5cc405f648")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 4, dtype family float, shape (2, 16, 16, 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 numpy as np
from PIL import Image
import tempfile
import os

# Create temporary test images
temp_dir = tempfile.mkdtemp()

# Create a simple 32x32 RGB image and save it
img1 = Image.new('RGB', (32, 32), color=(255, 0, 0))
img1_path = os.path.join(temp_dir, 'test1.png')
img1.save(img1_path)

# Create another simple 32x32 RGB image and save it
img2 = Image.new('RGB', (32, 32), color=(0, 255, 0))
img2_path = os.path.join(temp_dir, 'test2.png')
img2.save(img2_path)

# Create a grayscale image for testing channel=1
img_gray = Image.new('L', (32, 32), color=128)
img_gray_path = os.path.join(temp_dir, 'test_gray.png')
img_gray.save(img_gray_path)

filenames = [img1_path, img2_path]
size = 16
channel = 3

ARGS = {
    'filenames': filenames,
    'size': size,
    'channel': channel
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 4, dtype family float, shape (2, 16, 16, 3) — shape (2, 16, 16, 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
image_to_array Ran
ran on a synthesized input
L-A-Sandhu/Swin-Unet-/src/keras_swin_unet/utils.py
code served (permissive licence) · get_code("8e18cbe83a5ae888")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 4, dtype family float, shape (2, 8, 8, 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 numpy as np
from PIL import Image
import tempfile
import os

# Create temporary directory and small test images
tmpdir = tempfile.mkdtemp()

# Create a small RGB test image (3 channel)
rgb_img = Image.new('RGB', (10, 10), color=(255, 0, 0))
rgb_path = os.path.join(tmpdir, 'test_rgb.png')
rgb_img.save(rgb_path)

# Create a small grayscale test image (1 channel)
gray_img = Image.new('L', (10, 10), color=128)
gray_path = os.path.join(tmpdir, 'test_gray.png')
gray_img.save(gray_path)

# Setup arguments for the function
filenames = [rgb_path, gray_path]
size = 8
channel = 3

ARGS = {
    'filenames': filenames,
    'size': size,
    'channel': channel
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 4, dtype family float, shape (2, 8, 8, 3) — shape (2, 8, 8, 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
rmv_aug Ran
ran on a synthesized input
Arnukk/CASPIAN/utils.py
code served (permissive licence) · get_code("17e354bf251f8085")
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 tensorflow as tf

# The function checks if a string f matches the pattern '.*rnd.*'
# It returns True if f does NOT match this pattern

# f: a string to be checked against regex pattern
# x: parameter not used in function body
# y: parameter not used in function body
# yf: parameter not used in function body

ARGS = {
    "f": "test_file.txt",
    "x": None,
    "y": None,
    "yf": None
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tensorflow — 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
shuffle_ind Ran
ran on a synthesized input
Arnukk/CASPIAN/models/keras_vision_transformer/utils.py
code served (permissive licence) · get_code("8802de1b1b8688a8")
How it ran

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

import numpy as np

# The function shuffle_ind takes a single parameter L which is an int
# representing the largest index. It generates a numpy array of shuffled indices.

L = 10

ARGS = {
    "L": L
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family int, shape (10,) — shape (10,) 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
shuffle_ind Ran
ran on a synthesized input
L-A-Sandhu/Swin-Unet-/src/keras_swin_unet/utils.py
code served (permissive licence) · get_code("000032b4e43a1534")
How it ran

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

import numpy as np

# Set random seed for reproducibility
np.random.seed(42)

# The function shuffle_ind takes a single parameter L (an int)
# and returns a shuffled array of indices from 0 to L-1

L = 10

ARGS = {
    "L": L
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family int, shape (10,) — shape (10,) 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
split_dataset Ran
ran on a synthesized input
L-A-Sandhu/Swin-Unet-/src/swin_transformer/split_data.py
code served (permissive licence) · get_code("17f6210c3a9f9f5b")
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 numpy as np

# Create a simple list of IDs for testing
ids = [5, 2, 8, 1, 9, 3, 7, 4, 6, 0]

ARGS = {
    "ids": ids,
    "train_frac": 0.7,
    "val_frac": 0.1,
    "test_frac": 0.2,
}
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 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
window_partition Ran
ran; our contract draft was wrong, not the code
Arnukk/CASPIAN/models/keras_vision_transformer/swin_layers.py
code served (permissive licence) · get_code("dd1296fb557f6f49")
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 EagerTensor, ndim 4, dtype family float, shape (12, 4, 4, 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 tensorflow as tf

# Create a small test tensor with shape (batch, height, width, channels)
# Using distinct sizes: batch=2, H=8, W=12, C=3
batch_size = 2
height = 8
width = 12
channels = 3
window_size = 4

# Create a random tensor with the required shape
x = tf.random.normal(shape=(batch_size, height, width, channels))

ARGS = {
    "x": x,
    "window_size": window_size,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, ndim 4, dtype family float, shape (12, 4, 4, 3) — shape (12, 4, 4, 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
window_reverse Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
Arnukk/CASPIAN/models/keras_vision_transformer/swin_layers.py
code served (permissive licence) · get_code("24a9365e0448ac64")
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 EagerTensor, ndim 4, dtype family float, shape (2, 8, 8, 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 tensorflow as tf
import numpy as np

# Set seed for reproducibility
tf.random.set_seed(0)
np.random.seed(0)

# Parameters
window_size = 4
H = 8
W = 8
C = 3
batch_size = 2
patch_num_H = H // window_size  # 2
patch_num_W = W // window_size  # 2

# Create windows tensor
# Shape should be (batch_size * patch_num_H * patch_num_W, window_size, window_size, C)
# = (2 * 2 * 2, 4, 4, 3) = (8, 4, 4, 3)
windows = tf.random.normal(
    shape=(batch_size * patch_num_H * patch_num_W, window_size, window_size, C),
    dtype=tf.float32
)

ARGS = {
    "windows": windows,
    "window_size": window_size,
    "H": H,
    "W": W,
    "C": C,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, ndim 4, dtype family float, shape (2, 8, 8, 3) — shape (2, 8, 8, 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
dummy_loader Not yet run
unverified (harvested, no recorded run)
Arnukk/CASPIAN/models/keras_vision_transformer/utils.py
code served (permissive licence) · get_code("f4c0270069e690f7")
How it ran

no invocation recorded.

Also present in other papers' code

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

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

FunctionAlso present inEarliest-datedOthers named
drop_path_ 1 other paper
1 dated earlier
2103.14030 (2021-03)
Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
window_partition 1 other paper
1 dated earlier
2103.14030 (2021-03)
Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
window_reverse 1 other paper
1 dated earlier
2103.14030 (2021-03)
Swin Transformer: Hierarchical Vision Transformer using Shifted Windows

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

In the past few years, convolutional neural networks (CNNs) have achieved milestones in medical image analysis. Especially, the deep neural networks based on U-shaped architecture and skip-connections have been widely applied in a variety of medical image tasks. However, although CNN has achieved excellent performance, it cannot learn global and long-range semantic information interaction well due to the locality of the convolution operation. In this paper, we propose Swin-Unet, which is an Unet-like pure Transformer for medical image segmentation. The tokenized image patches are fed into the Transformer-based U-shaped Encoder-Decoder architecture with skip-connections for local-global semantic feature learning. Specifically, we use hierarchical Swin Transformer with shifted windows as the encoder to extract context features. And a symmetric Swin Transformer-based decoder with patch expanding layer is designed to perform the up-sampling operation to restore the spatial resolution of the feature maps. Under the direct down-sampling and up-sampling of the inputs and outputs by 4x, experiments on multi-organ and cardiac segmentation tasks demonstrate that the pure Transformer-based U-shaped Encoder-Decoder network outperforms those methods with full-convolution or the combination of transformer and convolution. The codes and trained models will be publicly available at https://github.com/HuCaoFighting/Swin-Unet.

For agents

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

get_harvested_code_for_paper("2105.05537")
get_code_for_paper("2105.05537")
have("2105.05537")

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

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

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

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

Connect an agent — have() is free.