SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2110.04361 · NeurIPS · 2021

SubTab: Subsetting Features of Tabular Data for Self-Supervised Representation Learning

Talip Uçar, Ehsan Hajiramezanali, Lindsay Edwards

arXiv · PDF · Open in the Atlas

Code that ran

8 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; 0 honoured the contract we drafted, 0 violated it and 5 have no contract verdict; 3 failures of our instrument; 6 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/2110.04361.json · badge: /api/ran/2110.04361.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
astrazeneca/subtab community
Papers with Code archive
8 ran · 6 no recorded run
FunctionStatusWhere it lives
AEWrapper Ran
ran on a synthesized input
astrazeneca/subtab/src/model.py
code served (permissive licence) · get_code("5b90987c92924f76")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) 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 as nn
import numpy as np

# Configuration for AEWrapper
options = {
    'dims': [12, 8, 6],  # [input_dim, hidden_dim, latent_dim]
    'n_subsets': 3,
    'overlap': 0.5,
    'isBatchNorm': True,
    'isDropout': True,
    'dropout_rate': 0.1,
    'shallow_architecture': False,
    'reconstruction': True,
    'reconstruct_subset': False,
    'p_norm': 2,
    'normalize': True
}

INIT_ARGS = {
    'options': options
}

# Create input tensor
# Input dimension should match dims[0] adjusted for n_subsets and overlap
# For encoder: n_column_subset = 12 / 3 = 4, n_overlap = int(0.5 * 4) = 2
# So encoder expects input of size 4 + 2 = 6
batch_size = 2
input_dim = 6

x = torch.randn(batch_size, input_dim)

ARGS = {
    'x': x
}
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
Decoder Ran
ran on a synthesized input
astrazeneca/subtab/src/model.py
code served (permissive licence) · get_code("4290c69ab232cb69")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 2, dtype family float, shape (2, 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
from torch import nn
import copy

class HiddenLayers(nn.Module):

    def __init__(self, options):
        """Class to add hidden layers to networks

        Args:
            options (dict): Configuration dictionary.
        """
        super(HiddenLayers, self).__init__()
        self.layers = nn.ModuleList()
        dims = options['dims']
        for i in range(1, len(dims) - 1):
            self.layers.append(nn.Linear(dims[i - 1], dims[i]))
            if options['isBatchNorm']:
                self.layers.append(nn.BatchNorm1d(dims[i]))
            self.layers.append(nn.LeakyReLU(inplace=False))
            if options['isDropout']:
                self.layers.append(nn.Dropout(options['dropout_rate']))

    def forward(self, x):
        for layer in self.layers:
            x = layer(x)
        return x

class Decoder(nn.Module):

    def __init__(self, options):
        """Decoder model

        Args:
            options (dict): Configuration dictionary.
        """
        super(Decoder, self).__init__()
        self.options = copy.deepcopy(options)
        if self.options['reconstruction'] and self.options['reconstruct_subset']:
            n_column_subset = int(self.options['dims'][0] / self.options['n_subsets'])
            self.options['dims'][0] = n_column_subset
        self.options['dims'] = self.options['dims'][::-1]
        self.hidden_layers = HiddenLayers(self.options)
        self.logits = nn.Linear(self.options['dims'][-2], self.options['dims'][-1])

    def forward(self, h):
        h = self.hidden_layers(h)
        logits = self.logits(h)
        return logits


INIT_ARGS = {
    'options': {
        'dims': [8, 6, 4, 2],
        'isBatchNorm': True,
        'isDropout': True,
        'dropout_rate': 0.2,
        'reconstruction': False,
        'reconstruct_subset': False,
        'n_subsets': 1
    }
}

ARGS = {
    'h': torch.randn(2, 2)
}

if __name__ == '__main__':
    decoder = Decoder(**INIT_ARGS)
    output = decoder(**ARGS)
    print(f"Output shape: {output.shape}")
    print(f"Output: {output}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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, 8) — shape (2, 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
HiddenLayers Ran
ran on a synthesized input
astrazeneca/subtab/src/model.py
code served (permissive licence) · get_code("f9c1d00bc03fe90b")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 2, dtype family float, shape (2, 6) 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
from torch import nn

class HiddenLayers(nn.Module):

    def __init__(self, options):
        """Class to add hidden layers to networks

        Args:
            options (dict): Configuration dictionary.
        """
        super(HiddenLayers, self).__init__()
        self.layers = nn.ModuleList()
        dims = options['dims']
        for i in range(1, len(dims) - 1):
            self.layers.append(nn.Linear(dims[i - 1], dims[i]))
            if options['isBatchNorm']:
                self.layers.append(nn.BatchNorm1d(dims[i]))
            self.layers.append(nn.LeakyReLU(inplace=False))
            if options['isDropout']:
                self.layers.append(nn.Dropout(options['dropout_rate']))

    def forward(self, x):
        for layer in self.layers:
            x = layer(x)
        return x


INIT_ARGS = {
    'options': {
        'dims': [4, 8, 6, 3],
        'isBatchNorm': True,
        'isDropout': True,
        'dropout_rate': 0.2
    }
}

ARGS = {
    'x': torch.randn(2, 4)
}

if __name__ == '__main__':
    model = HiddenLayers(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Output shape: {output.shape}")
    print(f"Output: {output}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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, 6) — shape (2, 6) 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
JointLoss Ran
ran on a synthesized input
astrazeneca/subtab/src/model.py
code served (permissive licence) · get_code("cab34653b11a7a35")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) 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.

import torch as th
import numpy as np

# INIT_ARGS for JointLoss.__init__(options)
INIT_ARGS = {
    'options': {
        'batch_size': 4,
        'tau': 0.5,
        'device': 'cpu',
        'cosine_similarity': True,
        'reconstruction': True,
        'contrastive_loss': True,
        'distance_loss': True
    }
}

# ARGS for JointLoss.forward(representation, xrecon, xorig)
batch_size = INIT_ARGS['options']['batch_size']
feature_dim = 8
recon_dim = 12

ARGS = {
    'representation': th.randn(2 * batch_size, feature_dim),  # 2N x feature_dim for contrastive pairs
    'xrecon': th.randn(batch_size, recon_dim),  # reconstructed data
    'xorig': th.randn(batch_size, recon_dim)    # original data
}
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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, 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
ShallowDecoder Ran
ran on a synthesized input
astrazeneca/subtab/src/model.py
code served (permissive licence) · get_code("554c1d99a88fdd09")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 2, dtype family float, shape (2, 5) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
from torch import nn
import copy

class ShallowDecoder(nn.Module):

    def __init__(self, options):
        """Decoder model

        Args:
            options (dict): Configuration dictionary.
        """
        super(ShallowDecoder, self).__init__()
        self.options = copy.deepcopy(options)
        input_dim, output_dim = (self.options['dims'][-1], self.options['dims'][0])
        self.first_layer = nn.Linear(input_dim, output_dim)

    def forward(self, z):
        logits = self.first_layer(z)
        return logits


INIT_ARGS = {
    'options': {
        'dims': [5, 8, 4]
    }
}

ARGS = {
    'z': torch.randn(2, 4)
}

if __name__ == '__main__':
    decoder = ShallowDecoder(**INIT_ARGS)
    output = decoder(**ARGS)
    print(f"Output shape: {output.shape}")
    print(f"Output: {output}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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, 5) — shape (2, 5) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
getBCELoss Ran
ran; our contract draft was wrong, not the code
astrazeneca/subtab/src/model.py
code served (permissive licence) · get_code("2bdeb39039c93a3d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned Tensor, ndim 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 small tensors for prediction and label
# prediction and label should be FloatTensors with same shape
# Binary cross entropy expects values in [0, 1] for both
batch_size = 2
num_classes = 4

prediction = torch.rand(batch_size, num_classes)  # Random values in [0, 1]
label = torch.randint(0, 2, (batch_size, num_classes)).float()  # Binary labels

ARGS = {
    "prediction": prediction,
    "label": label,
}
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 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
getMSEloss Ran
ran; our contract draft was wrong, not the code
astrazeneca/subtab/src/model.py
code served (permissive licence) · get_code("09fed834262af135")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned Tensor, ndim 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 as th

th.manual_seed(0)

# Create small reconstruction and target tensors
# batch_size=2, feature_dim=4
recon = th.randn(2, 4)
target = th.randn(2, 4)

ARGS = {
    "recon": recon,
    "target": target,
}
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 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
make_dir Ran
ran; our contract draft was wrong, not the code
astrazeneca/subtab/src/model.py
code served (permissive licence) · get_code("3db6e3509f24bd86")
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 str. 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 os
import tempfile

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

ARGS = {
    "directory_path": temp_base_dir,
    "new_folder_name": "test_folder"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
Encoder Not yet run
unverified (harvested, no recorded run)
astrazeneca/subtab/src/model.py
code served (permissive licence) · get_code("3f96c139857b7bea")
How it ran

no invocation recorded.

ShallowEncoder Not yet run
unverified (harvested, no recorded run)
astrazeneca/subtab/src/model.py
code served (permissive licence) · get_code("87817fa6ec5de3d7")
How it ran

no invocation recorded.

SubTab Not yet run
unverified (harvested, no recorded run)
astrazeneca/subtab/src/model.py
code served (permissive licence) · get_code("b031dcb2b35f1532")
How it ran

no invocation recorded.

save_loss_plot Not yet run
unverified (harvested, no recorded run)
astrazeneca/subtab/src/model.py
code served (permissive licence) · get_code("b0d4c04ba0dd70cd")
How it ran

no invocation recorded.

set_dirs Not yet run
unverified (harvested, no recorded run)
astrazeneca/subtab/src/model.py
code served (permissive licence) · get_code("7c738f83b5ac31e8")
How it ran

no invocation recorded.

set_seed Not yet run
unverified (harvested, no recorded run)
astrazeneca/subtab/src/model.py
code served (permissive licence) · get_code("f2b720e37ee0c903")
How it ran

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

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

Self-supervised learning has been shown to be very effective in learning useful representations, and yet much of the success is achieved in data types such as images, audio, and text. The success is mainly enabled by taking advantage of spatial, temporal, or semantic structure in the data through augmentation. However, such structure may not exist in tabular datasets commonly used in fields such as healthcare, making it difficult to design an effective augmentation method, and hindering a similar progress in tabular data setting. In this paper, we introduce a new framework, Subsetting features of Tabular data (SubTab), that turns the task of learning from tabular data into a multi-view representation learning problem by dividing the input features to multiple subsets. We argue that reconstructing the data from the subset of its features rather than its corrupted version in an autoencoder setting can better capture its underlying latent representation. In this framework, the joint representation can be expressed as the aggregate of latent variables of the subsets at test time, which we refer to as collaborative inference. Our experiments show that the SubTab achieves the state of the art (SOTA) performance of 98.31% on MNIST in tabular setting, on par with CNN-based SOTA models, and surpasses existing baselines on three other real-world datasets by a significant margin.

For agents

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

get_harvested_code_for_paper("2110.04361")
get_code_for_paper("2110.04361")
have("2110.04361")

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

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

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

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

Connect an agent — have() is free.