SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2503.19331 · NeurIPS · 2025

ChA-MAEViT: Unifying Channel-Aware Masked Autoencoders and Multi-Channel Vision Transformers for Improved Cross-Channel Learning

Bryan Plummer, Chau Pham, Juan Caicedo

arXiv · PDF · Open in the Atlas

Code that ran

12 of 16 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (6 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 7 have no contract verdict; 5 failures of our instrument; 4 no recorded run), measured 2026-11-22; 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/2503.19331.json · badge: /api/ran/2503.19331.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
chaudatascience/cha_mae_vit community
Papers with Code archive
12 ran · 4 no recorded run
FunctionStatusWhere it lives
Attention Ran
ran on a synthesized input · constructed an object; no result was computed
chaudatascience/cha_mae_vit/models/cha_mae_vit.py
code served (permissive licence) · get_code("f52cc7c3cf1e75b2")
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, Attention: 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)

def exists(val):
    return val is not None

class Attention(nn.Module):

    def __init__(self, dim, num_heads=8, qkv_bias=False, qk_scale=None, attn_drop=0.0, proj_drop=0.0):
        super().__init__()
        self.num_heads = num_heads
        head_dim = dim // num_heads
        self.scale = qk_scale or head_dim ** (-0.5)
        self.qkv = nn.Linear(dim, dim * 3, bias=qkv_bias)
        self.attn_drop = nn.Dropout(attn_drop)
        self.proj = nn.Linear(dim, dim)
        self.proj_drop = nn.Dropout(proj_drop)

    def forward(self, x, mask=None):
        B, N, C = x.shape
        qkv = self.qkv(x).reshape(B, N, 3, self.num_heads, C // self.num_heads).permute(2, 0, 3, 1, 4)
        q, k, v = (qkv[0], qkv[1], qkv[2])
        sim = q @ k.transpose(-2, -1) * self.scale
        if exists(mask):
            mask_value = -torch.finfo(sim.dtype).max
            sim = sim.masked_fill(~mask, mask_value)
        sim = sim - sim.amax(dim=-1, keepdim=True).detach()
        attn = sim.softmax(dim=-1)
        attn = self.attn_drop(attn)
        x = (attn @ v).transpose(1, 2).reshape(B, N, C)
        x = self.proj(x)
        x = self.proj_drop(x)
        return (x, attn)

# Create a small input tensor: batch=2, sequence_length=3, dim=4
x = torch.randn(2, 3, 4)

# Optional mask: shape (batch, num_heads, seq_len, seq_len)
# For num_heads=8, dim=4, head_dim=0.5 which won't work, so use dim=8 for num_heads=8
x = torch.randn(2, 3, 8)
mask = torch.ones(2, 8, 3, 3, dtype=torch.bool)

ARGS = {
    'dim': 8,
    'num_heads': 8,
    'qkv_bias': False,
    'qk_scale': None,
    'attn_drop': 0.0,
    'proj_drop': 0.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 Attention — 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 Attention 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
DropPath Ran
ran on a synthesized input · constructed an object; no result was computed
chaudatascience/cha_mae_vit/models/cha_mae_vit.py
code served (permissive licence) · get_code("4d93211cfa9bdffc")
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, DropPath: 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)

# DropPath.__init__ takes drop_prob parameter
# The forward method calls drop_path(x, self.drop_prob, self.training)
# where x is a tensor that gets passed through

# Create a small test tensor (batch_size=2, channels=4, spatial_dims could vary)
# Using shape (2, 4) for simplicity - batch of 2, feature dim of 4
test_input = torch.randn(2, 4)

# Arguments for DropPath
ARGS = {
    "drop_prob": 0.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 DropPath — 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 DropPath 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
FourierLoss Ran
ran on a synthesized input · constructed an object; no result was computed
chaudatascience/cha_mae_vit/models/cha_mae_vit.py
code served (permissive licence) · get_code("2c08d4163d35c3c0")
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, FourierLoss: 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)

class FourierLoss(nn.Module):

    def __init__(self, use_l1_loss: bool=True) -> None:
        """
        Recursion Pharmaceuticals 2024
        Fourier transform loss is only sound when using L1 or L2 loss to compare the frequency domains
        between the images / their radial histograms.

        We will always set `reduction="none"` and enforce that the computation of any reductions from the
        output of this loss be managed by the model under question.
        """
        super().__init__()
        self.loss = nn.L1Loss(reduction='none') if use_l1_loss else nn.MSELoss(reduction='none')

    def forward(self, input: torch.Tensor, target: torch.Tensor, num_channels: int) -> torch.Tensor:
        flattened_images = len(input.shape) == len(target.shape) == 3
        if flattened_images:
            B, H_W, C = input.shape
            H_W = H_W // num_channels
            four_d_shape = (B, -1, int(H_W ** 0.5), int(H_W ** 0.5))
            input = input.view(*four_d_shape)
            target = target.view(*four_d_shape)
        else:
            B, C, h, w = input.shape
            H_W = h * w
        if len(input.shape) != len(target.shape) != 4:
            raise ValueError(f'Invalid input shape: got {input.shape} and {target.shape}.')
        fft_reconstructed = torch.fft.fft2(input)
        fft_original = torch.fft.fft2(target)
        magnitude_reconstructed = torch.abs(fft_reconstructed)
        magnitude_original = torch.abs(fft_original)
        loss_tensor: torch.Tensor = self.loss(magnitude_reconstructed, magnitude_original)
        if flattened_images:
            loss_tensor = loss_tensor.reshape(B, -1, C)
        return loss_tensor


# Setup for forward pass with 4D input (B, C, H, W)
batch_size = 2
channels = 3
height = 4
width = 4

input_tensor = torch.randn(batch_size, channels, height, width)
target_tensor = torch.randn(batch_size, channels, height, width)

ARGS = {
    'use_l1_loss': True
}

# Create instance and test forward pass
fourier_loss = FourierLoss(**ARGS)
output = fourier_loss(input_tensor, target_tensor, num_channels=channels)
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 FourierLoss — 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 FourierLoss 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
LayerScale Ran
ran on a synthesized input · constructed an object; no result was computed
chaudatascience/cha_mae_vit/models/cha_mae_vit.py
code served (permissive licence) · get_code("dadddc177deadf88")
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, LayerScale: 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)

ARGS = {
    'dim': 4,
    'init_values': 1e-05,
    'inplace': False
}
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 LayerScale — 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 LayerScale 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
MAB Ran
ran on a synthesized input · constructed an object; no result was computed
chaudatascience/cha_mae_vit/models/cha_mae_vit.py
code served (permissive licence) · get_code("ca81184e1a038ae8")
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, MAB: 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 einops import rearrange, repeat
import torch.nn.functional as F
import math

torch.manual_seed(0)

class MAB(nn.Module):

    def __init__(self, dim_Q: int, dim_K: int, dim_V: int, num_heads: int, ln=False):
        super().__init__()
        self.dim_V = dim_V
        self.num_heads = num_heads
        self.fc_q = nn.Linear(dim_Q, dim_V)
        self.fc_k = nn.Linear(dim_K, dim_V)
        self.fc_v = nn.Linear(dim_K, dim_V)
        if ln:
            self.ln0 = nn.LayerNorm(dim_V)
            self.ln1 = nn.LayerNorm(dim_V)
        self.fc_o = nn.Linear(dim_V, dim_V)

    def forward(self, Q, X):
        """
        Q: shape (t,d)
        X: shape (b,l,d')
        Output: shape (b,t,d')
        """
        Q = repeat(Q, 't d -> b t d', b=X.shape[0])
        Q = self.fc_q(Q)
        K, V = (self.fc_k(X), self.fc_v(X))
        dim_split = self.dim_V // self.num_heads
        Q_ = torch.cat(Q.split(dim_split, 2), 1)
        K_ = torch.cat(K.split(dim_split, 2), 1)
        V_ = torch.cat(V.split(dim_split, 2), 1)
        A = torch.softmax(Q_.bmm(K_.transpose(1, 2)) / math.sqrt(self.dim_V), 2)
        O = torch.cat((Q_ + A.bmm(V_)).split(Q.size(1), 1), 2)
        O = O if getattr(self, 'ln0', None) is None else self.ln0(O)
        O = O + F.relu(self.fc_o(O))
        O = O if getattr(self, 'ln1', None) is None else self.ln1(O)
        return O

# Construct arguments for MAB
ARGS = {
    'dim_Q': 4,
    'dim_K': 5,
    'dim_V': 8,
    'num_heads': 2,
    'ln': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
einops, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type MAB — 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 MAB 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
MemEffAttentionV2 Ran
ran on a synthesized input
chaudatascience/cha_mae_vit/models/cha_mae_vit.py
code served (permissive licence) · get_code("0519949718350286")
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
from einops import rearrange, repeat
import torch.nn.functional as F
from torch.nn.attention import SDPBackend, sdpa_kernel

def exists(val):
    return val is not None

class Attention(nn.Module):

    def __init__(self, dim, num_heads=8, qkv_bias=False, qk_scale=None, attn_drop=0.0, proj_drop=0.0):
        super().__init__()
        self.num_heads = num_heads
        head_dim = dim // num_heads
        self.scale = qk_scale or head_dim ** (-0.5)
        self.qkv = nn.Linear(dim, dim * 3, bias=qkv_bias)
        self.attn_drop = nn.Dropout(attn_drop)
        self.proj = nn.Linear(dim, dim)
        self.proj_drop = nn.Dropout(proj_drop)

    def forward(self, x, mask=None):
        B, N, C = x.shape
        qkv = self.qkv(x).reshape(B, N, 3, self.num_heads, C // self.num_heads).permute(2, 0, 3, 1, 4)
        q, k, v = (qkv[0], qkv[1], qkv[2])
        sim = q @ k.transpose(-2, -1) * self.scale
        if exists(mask):
            mask_value = -torch.finfo(sim.dtype).max
            sim = sim.masked_fill(~mask, mask_value)
        sim = sim - sim.amax(dim=-1, keepdim=True).detach()
        attn = sim.softmax(dim=-1)
        attn = self.attn_drop(attn)
        x = (attn @ v).transpose(1, 2).reshape(B, N, C)
        x = self.proj(x)
        x = self.proj_drop(x)
        return (x, attn)

class MemEffAttentionV2(Attention):

    def forward(self, x, mask=None):
        B, N, C = x.shape
        q, k, v = rearrange(self.qkv(x), 'b n (l h d) -> l b h n d', l=3, h=self.num_heads, d=C // self.num_heads)
        with sdpa_kernel([SDPBackend.FLASH_ATTENTION, SDPBackend.EFFICIENT_ATTENTION, SDPBackend.MATH]):
            x = F.scaled_dot_product_attention(q, k, v, attn_mask=mask)
        x = rearrange(x, 'b h n d -> b n (h d)')
        x = self.proj(x)
        x = self.proj_drop(x)
        return (x, None)

INIT_ARGS = {
    'dim': 8,
    'num_heads': 2,
    'qkv_bias': False,
    'qk_scale': None,
    'attn_drop': 0.0,
    'proj_drop': 0.0,
}

ARGS = {
    'x': torch.randn(2, 5, 8),
    'mask': None,
}

if __name__ == '__main__':
    model = MemEffAttentionV2(**INIT_ARGS)
    output, attn = model(**ARGS)
    print(f"Output shape: {output.shape}")
    print(f"Attention: {attn}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
einops, 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)
PatchEmbedPerChannel Ran
ran on a synthesized input · constructed an object; no result was computed
chaudatascience/cha_mae_vit/models/cha_mae_vit.py
code served (permissive licence) · get_code("f6cefe6ba63d87f4")
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, PatchEmbedPerChannel: 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
import math

torch.manual_seed(0)

# Create a PatchEmbedPerChannel instance for testing
model = nn.Module()

# Define ARGS dict with all parameters for PatchEmbedPerChannel.__init__
ARGS = {
    'img_size': (224, 224),
    'patch_size': 16,
    'max_in_channels': 3,
    'embed_dim': 768,
    'use_channel_tokens': True,
    'channel_tokens_init': 'orthogonal'
}

# Now create an instance to test the forward method
patch_embed = nn.Module()

# For forward method testing, we need:
# - x: a Tensor
# - channel_ids_list: list[list[int]] | None
# - valid_channel_masks: Optional[Tensor]

# Create test input tensor for forward
# Shape: (batch_size, channels, height, width)
batch_size = 2
channels = 3
height = 224
width = 224
x = torch.randn(batch_size, channels, height, width)

# Test case 1: REGULAR_CASE (both None)
channel_ids_list_regular = None
valid_channel_masks_regular = None

# Test case 2: SAME_SUBSET_CHANNELS_FOR_ALL_IMG (channel_ids_list provided, masks None)
channel_ids_list_subset = [[0, 1], [0, 1]]
valid_channel_masks_subset = None

# Test case 3: DIFFERENT_CHANNELS_FOR_EACH_IMG (both provided)
channel_ids_list_diff = [[0, 1], [1, 2]]
valid_channel_masks_diff = torch.tensor([[True, True, False], [True, True, False]], dtype=torch.bool)

# Store arguments for the forward method - using the REGULAR_CASE as default
forward_x = x
forward_channel_ids_list = channel_ids_list_regular
forward_valid_channel_masks = valid_channel_masks_regular

# Final ARGS dict includes init parameters and can reference forward test data
ARGS = {
    'img_size': (224, 224),
    'patch_size': 16,
    'max_in_channels': 3,
    'embed_dim': 768,
    'use_channel_tokens': True,
    'channel_tokens_init': 'orthogonal'
}
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 PatchEmbedPerChannel — 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 PatchEmbedPerChannel 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_proxy_loss Ran
ran; our contract draft was wrong, not the code
chaudatascience/cha_mae_vit/models/cha_mae_vit.py
code served (permissive licence) · get_code("fb7b61cc6dba0670")
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
import torch.nn.functional as F

torch.manual_seed(0)

num_classes = 3
dim = 4
num_imgs = 2

proxies = torch.randn(num_classes, dim)
img_emb = torch.randn(num_imgs, dim)
gt_imgs = torch.tensor([0, 1])
scale = nn.Parameter(torch.tensor(1.0))

ARGS = {
    "proxies": proxies,
    "img_emb": img_emb,
    "gt_imgs": gt_imgs,
    "scale": scale,
}
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
maybe_flatten_images Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
chaudatascience/cha_mae_vit/models/cha_mae_vit.py
code served (permissive licence) · get_code("d2d59e7a9a1b0c98")
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, 48) 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 einops import rearrange, repeat

torch.manual_seed(0)

# Create a 4D image tensor (N, C, H, W)
# N=2 (batch size), C=3 (channels), H=8 (height), W=8 (width)
img = torch.randn(2, 3, 8, 8)

# patch_size must divide H and W evenly
patch_size = 4

# channel_agnostic can be True or False
channel_agnostic = False

ARGS = {
    "img": img,
    "patch_size": patch_size,
    "channel_agnostic": channel_agnostic,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
einops, 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, 48) — shape (2, 4, 48) 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
ortho_proj_loss_fn_v2 Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
chaudatascience/cha_mae_vit/models/cha_mae_vit.py
code served (permissive licence) · get_code("62ec9cace7925686")
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)

# Construct small tensors for the function
batch_size = 2
num_tokens = 5
feature_dim = 4

# features: shape (b, num_tokens, d)
features = torch.randn(batch_size, num_tokens, feature_dim)

# labels: shape (num_tokens,) - assign labels so we have some positive and negative pairs
labels = torch.tensor([0, 0, 1, 1, 2])

# gamma_s and gamma_d: scalar hyperparameters
gamma_s = 0.5
gamma_d = 0.3

# reverse_pos_pairs: boolean flag
reverse_pos_pairs = False

# use_square: boolean flag
use_square = True

# patch_mask: shape (b, num_tokens), optional mask for visible patches
patch_mask = torch.ones(batch_size, num_tokens).bool()

ARGS = {
    "features": features,
    "labels": labels,
    "gamma_s": gamma_s,
    "gamma_d": gamma_d,
    "reverse_pos_pairs": reverse_pos_pairs,
    "use_square": use_square,
    "patch_mask": patch_mask,
}
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
pairwise_distance_v2 Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
chaudatascience/cha_mae_vit/models/cha_mae_vit.py
code served (permissive licence) · get_code("922f4bf4c1f8faa4")
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

torch.manual_seed(0)

# Create small tensors for the function
# proxies: shape (num_proxies, embedding_dim) - let's use (3, 4)
proxies = torch.randn(3, 4)

# x: shape (batch_size, embedding_dim) - let's use (2, 4)
x = torch.randn(2, 4)

# squared: boolean flag
squared = False

ARGS = {
    "proxies": proxies,
    "x": x,
    "squared": squared,
}
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
trunc_normal_ Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
chaudatascience/cha_mae_vit/models/cha_mae_vit.py
code served (permissive licence) · get_code("fabe0899316ffaa5")
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 2, dtype family float, shape (2, 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
import math

torch.manual_seed(0)

# Create a small tensor to be initialized
tensor = torch.empty(2, 4)

# Define arguments for trunc_normal_
ARGS = {
    'tensor': tensor,
    'mean': 0.0,
    'std': 1.0,
    'a': -2.0,
    'b': 2.0
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
Block Not yet run
unverified (harvested, no recorded run)
chaudatascience/cha_mae_vit/models/cha_mae_vit.py
code served (permissive licence) · get_code("46297c90ff2f0ed7")
How it ran

no invocation recorded.

ChAMAEViT Not yet run
unverified (harvested, no recorded run)
chaudatascience/cha_mae_vit/models/cha_mae_vit.py
code served (permissive licence) · get_code("e3ff5832339c1afa")
How it ran

no invocation recorded.

ChAMAEViTDecoder Not yet run
unverified (harvested, no recorded run)
chaudatascience/cha_mae_vit/models/cha_mae_vit.py
code served (permissive licence) · get_code("ae881416a26c08eb")
How it ran

no invocation recorded.

MemEffAttention Not yet run
unverified (harvested, no recorded run)
chaudatascience/cha_mae_vit/models/cha_mae_vit.py
code served (permissive licence) · get_code("80fb55fa0569e3d0")
How it ran

no invocation recorded.

Also present in other papers' code

Of 16 samples lifted from this paper's linked repositories, 16 carry a function identity and 0 do not. Of the 16 distinct functions with an identity, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 2 the same month, 3 later) and 13 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
trunc_normal_
brick of this paper's assembly: helper
160 other papers
138 dated earlier, 2 the same month, 18 later, 2 same year, order not determinable · 36 only as an assembly brick
1911.10194 (2019-11)
Panoptic-DeepLab: A Simple, Strong, and Fast Baseline for Bottom-Up Panoptic Segmentation
2005.10242 (2020-05)
Understanding Contrastive Representation Learning through Alignment and Uniformity on the Hypersphere
2007.12911 (2020-07)
Tighter risk certificates for neural networks
and 157 more not named here
DropPath
brick of this paper's assembly: helper
47 other papers
39 dated earlier, 4 the same month, 4 later · 33 only as an assembly brick
2003.12039 (2020-03)
RAFT: Recurrent All-Pairs Field Transforms for Optical Flow
2010.11929 (2020-10)
An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
2105.14432 (2021-05)
TransMatcher: Deep Image Matching Through Transformers for Generalizable Person Re-identification
and 44 more not named here
LayerScale
brick of this paper's assembly: helper
3 other papers
2 dated earlier, 1 later
2010.11929 (2020-10)
An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
2304.07193 (2023-04)
DINOv2: Learning Robust Visual Features without Supervision
2511.07222 (2025-11)
Omni-View: Unlocking How Generation Facilitates Understanding in Unified 3D Model based on Multiview images

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

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

Abstract

Prior work using Masked Autoencoders (MAEs) typically relies on random patch masking based on the assumption that images have significant redundancies across different channels, allowing for the reconstruction of masked content using crosschannel correlations. However, this assumption does not hold in Multi-Channel Imaging (MCI), where channels may provide complementary information with minimal feature overlap. Thus, these MAEs primarily learn local structures within individual channels from patch reconstruction, failing to fully leverage crosschannel interactions and limiting their MCI effectiveness. In this paper, we present ChA-MAEViT, an MAE-based method that enhances feature learning across MCI channels via four key strategies: (1) dynamic channel-patch masking, which compels the model to reconstruct missing channels in addition to masked patches, thereby enhancing cross-channel dependencies and improving robustness to varying channel configurations; (2) memory tokens, which serve as long-term memory aids to promote information sharing across channels, addressing the challenges of reconstructing structurally diverse channels; (3) hybrid token fusion module, which merges fine-grained patch tokens with a global class token to capture richer representations; and (4) Channel-Aware Decoder, a lightweight decoder utilizes channel tokens to effectively reconstruct image patches. Experiments on satellite and microscopy datasets, CHAMMI, JUMP-CP, and So2Sat, show that ChA-MAEViT significantly outperforms state-of-the-art MCI-ViTs by 3.0-21.5%, highlighting the importance of cross-channel interactions in MCI. Our code is publicly available at https://github.com/chaudatascience/cha_mae_vit. Prior MCI-Masked Autoencoder (MAE) models (e.g., [1,15]) demonstrated promise in capturing local spatial structures by learning to reconstruct randomly masked patches in multi-channel images. These approaches assume that images exhibit significant redundancy across channels, enabling the reconstruction of masked patches using unmasked patches from similar channels. While this assumption works well for natural images, where color channels typically show strong correlations, it 39th Conference on Neural Information Processing Systems (NeurIPS 2025).

For agents

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

get_harvested_code_for_paper("2503.19331")
get_code_for_paper("2503.19331")
have("2503.19331")

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

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

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

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

Connect an agent — have() is free.