SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2004.10076 · 2020

Tensor Networks for Medical Image Classification

arXiv · PDF · Open in the Atlas

Code that ran

5 of 6 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 4 have no contract verdict; 1 failure of our instrument; 1 no recorded run), measured 2026-11-21; 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/2004.10076.json · badge: /api/ran/2004.10076.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
raghavian/loTeNet_pytorch canonical (classifier label)
classifier basis: census
5 ran · 1 no recorded run
FunctionStatusWhere it lives
computeAuc Ran
ran on a synthesized input
raghavian/loTeNet_pytorch/utils/tools.py
code served (permissive licence) · get_code("0fd950194adc0d89")
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 float, 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 numpy as np
from sklearn.metrics import auc, roc_curve

# Create binary classification targets and predictions
# target: binary labels (0 or 1)
# preds: probability predictions (values between 0 and 1)

np.random.seed(0)

# Create a small dataset with 10 samples
target = np.array([0, 0, 1, 1, 0, 1, 0, 1, 1, 0])
preds = np.array([0.1, 0.2, 0.8, 0.9, 0.15, 0.85, 0.25, 0.75, 0.95, 0.05])

ARGS = {
    "target": target,
    "preds": preds
}
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 float, 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
init_tensor Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
raghavian/loTeNet_pytorch/utils/utils.py
pointer only (licence: MIT); the stored copy get_code serves, from raghavian/mltn, is pointer only (licence: NONE) · get_code("6c3d5f290d49a6cf")
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 raghavian/mltn, 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.

makeBatchAdj Ran
ran on a synthesized input
raghavian/loTeNet_pytorch/utils/tools.py
code served (permissive licence) · get_code("bf0045b98375f6cd")
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. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Create a small sparse adjacency matrix
# The function calls: adj._nnz(), adj.shape, adj._indices(), adj._values()
# So we need a sparse tensor with these methods

indices = torch.LongTensor([[0, 1, 2], [1, 2, 0]])  # 3 edges
values = torch.FloatTensor([0.5, 0.7, 0.3])
sparse_adj = torch.sparse.FloatTensor(indices, values, (4, 4))

bSize = 2

ARGS = {
    "adj": sparse_adj,
    "bSize": bSize
}
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, shape (8, 8) — shape (8, 8) as a later run recorded it
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
onehot Ran
ran on a synthesized input
raghavian/loTeNet_pytorch/utils/utils.py
code served (permissive licence) · get_code("d22a951c7ff816cf")
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 (4, 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)

# Create a small batch of labels
# labels should be a sequence/list of integers in range [0, max_value-1]
labels = [0, 2, 1, 3]

# max_value should be an integer larger than any label value
max_value = 4

ARGS = {
    "labels": labels,
    "max_value": max_value,
}
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 (4, 4) — shape (4, 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
wCELoss Ran
ran on a synthesized input
raghavian/loTeNet_pytorch/utils/tools.py
code served (permissive licence) · get_code("1953fe5129520e37")
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 as nn

torch.manual_seed(0)

# The function expects:
# - prediction: a tensor of predicted probabilities (shape: batch_size x num_classes or similar)
# - target: a tensor of ground truth labels/targets (same shape as prediction)
# Both tensors are used with:
#   - torch.log() operations
#   - clamp_min(0.001) and clamp_max(0.999) operations
#   - arithmetic operations with scalars and each other
#   - torch.mean() on the result

# Create small batch tensors with distinct dimensions
batch_size = 2
num_features = 4

# Prediction tensor: should be probabilities in (0, 1) range
prediction = torch.sigmoid(torch.randn(batch_size, num_features))

# Target tensor: should be binary (0 or 1) or probabilities
target = torch.bernoulli(torch.full((batch_size, num_features), 0.5))

ARGS = {
    "prediction": prediction,
    "target": target
}
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
svd_flex Not yet run
unverified (harvested, no recorded run)
raghavian/loTeNet_pytorch/utils/utils.py
pointer only (licence: MIT); the stored copy get_code serves, from raghavian/mltn, is pointer only (licence: NONE) · get_code("144c7ce7d4014523")
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 raghavian/mltn, 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 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 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, 2 later) and 3 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
init_tensor 2 other papers
1 dated earlier, 1 later
1605.05775 (2016-05)
Supervised Learning with Quantum-Inspired Tensor Networks
2011.06982 (2020-11)
Multi-layered tensor networks for image classification
svd_flex 2 other papers
1 dated earlier, 1 later
1605.05775 (2016-05)
Supervised Learning with Quantum-Inspired Tensor Networks
2011.06982 (2020-11)
Multi-layered tensor networks for image classification
onehot 1 other paper
1 dated earlier
1605.05775 (2016-05)
Supervised Learning with Quantum-Inspired Tensor Networks

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

Repositories linked to this paper

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

Abstract

With the increasing adoption of machine learning tools like neural networks across several domains, interesting connections and comparisons to concepts from other domains are coming to light. In this work, we focus on the class of Tensor Networks, which has been a work horse for physicists in the last two decades to analyse quantum many-body systems. Building on the recent interest in tensor networks for machine learning, we extend the Matrix Product State tensor networks (which can be interpreted as linear classifiers operating in exponentially high dimensional spaces) to be useful in medical image analysis tasks. We focus on classification problems as a first step where we motivate the use of tensor networks and propose adaptions for 2D images using classical image domain concepts such as local orderlessness of images. With the proposed locally orderless tensor network model (LoTeNet), we show that tensor networks are capable of attaining performance that is comparable to state-of-the-art deep learning methods. We evaluate the model on two publicly available medical imaging datasets and show performance improvements with fewer model hyperparameters and lesser computational resources compared to relevant baseline methods.

For agents

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

get_harvested_code_for_paper("2004.10076")
get_code_for_paper("2004.10076")
have("2004.10076")

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

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

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

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

Connect an agent — have() is free.