SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2006.07794 · 2020

PatchUp: A Feature-Space Block-Level Regularization Technique for Convolutional Neural Networks

arXiv · PDF · Open in the Atlas

Code that ran

7 of 12 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; 2 honoured the contract we drafted, 0 violated it and 3 have no contract verdict; 2 failures of our instrument; 5 no recorded run), measured 2026-11-22; 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/2006.07794.json · badge: /api/ran/2006.07794.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
chandar-lab/PatchUp canonical (classifier label)
classifier basis: census
7 ran · 5 no recorded run
FunctionStatusWhere it lives
binary_cross_entropy Ran
ran on a synthesized input
chandar-lab/PatchUp/utility/utils.py
code served (permissive licence) · get_code("8bede3a7d258b49a")
How it ran

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

import torch
import torch.nn.functional as F

torch.manual_seed(0)

# Create small tensors for binary cross entropy
# inputs should be probabilities or logits (batch_size, num_classes or binary output)
# target should be binary labels (same shape as inputs)
batch_size = 2
num_features = 4

inputs = torch.rand(batch_size, num_features)  # Probabilities in [0, 1]
target = torch.randint(0, 2, (batch_size, num_features)).float()  # Binary labels

# Optional weight tensor (one weight per sample or per feature)
weight = torch.ones(batch_size, num_features)

ARGS = {
    'inputs': inputs,
    'target': target,
    'weight': weight,
    'reduction': 'mean',
    'smooth_eps': 0.1,
    'from_logits': 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 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
conv3x3 Ran
ran; our contract draft was wrong, not the code
chandar-lab/PatchUp/models/wide_resnet.py
pointer only (licence: MIT); the stored copy get_code serves, from DaikiTanak/manifold_mixup, is pointer only (licence: NONE) · get_code("00e569acd6b45ef0")
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 DaikiTanak/manifold_mixup, 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.

convert_secs2time Ran
ran, honoured the contract we drafted
chandar-lab/PatchUp/utility/utils.py
code served (permissive licence) · get_code("09b3d0b3ea772a30")
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 1, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

# The function convert_secs2time takes epoch_time as input
# and performs arithmetic operations on it to convert seconds to hours, minutes, seconds
# It expects a numeric value (int or float)

ARGS = {
    'epoch_time': 3661  # 1 hour, 1 minute, 1 second in seconds
}
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, ndim 1, dtype family int — 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
experiment_name Ran
ran on a synthesized input
chandar-lab/PatchUp/utility/activation_study.py
code served (permissive licence) · get_code("1b35b976b81f76e1")
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 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 torch

torch.manual_seed(0)

ARGS = {
    'dataset': 'cifar10',
    'arch': 'resnet18'
}
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 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
get_activation_sum Ran
ran on a synthesized input
chandar-lab/PatchUp/utility/activation_study.py
code served (permissive licence) · get_code("359f374c174621ef")
How it ran

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

import torch
import torch.nn as nn

torch.manual_seed(0)

# Create a simple activation object with a 'features' attribute
class Activation:
    def __init__(self, features):
        self.features = features

# Create activation list with tiny tensors
# batch_size=2, num_features=4
activation_1 = Activation(torch.randn(2, 4))
activation_2 = Activation(torch.randn(2, 4))
activation_3 = Activation(torch.randn(2, 4))

activation_lst = [activation_1, activation_2, activation_3]

ARGS = {
    "activation_lst": activation_lst
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 2, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_lambda Ran
ran, honoured the contract we drafted
chandar-lab/PatchUp/modules/mixup.py
code served (permissive licence) · get_code("c24f9f03625f499d")
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

np.random.seed(0)

ARGS = {
    "alpha": 1.0
}
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 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
mixup_process Ran
ran; our contract draft was wrong, not the code
chandar-lab/PatchUp/modules/mixup.py
code served (permissive licence) · get_code("5e868dde8eee2c83")
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

torch.manual_seed(0)
np.random.seed(0)

# Create a small batch of outputs (samples or hidden representations)
# Batch size: 2, Feature dimension: 4
out = torch.randn(2, 4)

# Create re-weighted target (one-hot or interpolated targets)
# Batch size: 2, Number of classes: 3
target_reweighted = torch.randn(2, 3)

# Mixing coefficient (lambda parameter)
lam = 0.5

ARGS = {
    "out": out,
    "target_reweighted": target_reweighted,
    "lam": lam
}
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
get_activation_magnitude Not yet run
unverified (harvested, no recorded run)
chandar-lab/PatchUp/utility/activation_study.py
code served (permissive licence) · get_code("af8fbd6571e5b330")
How it ran

no invocation recorded.

load_data Not yet run
unverified (harvested, no recorded run)
chandar-lab/PatchUp/data_loader.py
code served (permissive licence) · get_code("0416c720d09e7630")
How it ran

no invocation recorded.

load_data_subset Not yet run
unverified (harvested, no recorded run)
chandar-lab/PatchUp/data_loader.py
code served (permissive licence) · get_code("764bff217286b7dd")
How it ran

no invocation recorded.

per_image_standardization Not yet run
unverified (harvested, no recorded run)
chandar-lab/PatchUp/data_loader.py
code served (permissive licence) · get_code("b39b1c9f2e503e7a")
How it ran

no invocation recorded.

to_one_hot Not yet run
unverified (harvested, no recorded run)
chandar-lab/PatchUp/utility/utils.py
code served (permissive licence) · get_code("b7759e06a641aece")
How it ran

no invocation recorded.

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 12 distinct functions with an identity, 4 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 1 the same month, 4 later) and 8 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
conv3x3 74 other papers
17 dated earlier, 1 the same month, 56 later · 5 only as an assembly brick
1605.07146 (2016-05)
Wide Residual Networks
1707.01629 (2017-07)
Dual Path Networks
1802.05668 (2018-02)
Model compression via distillation and quantization
and 71 more not named here
convert_secs2time 3 other papers
1 dated earlier, 2 later
1811.09310 (2018-11)
Parametric Noise Injection: Trainable Randomness to Improve Deep Neural Network Robustness against Adversarial Attack
2008.05369 (2020-08)
Anomaly localization by modeling perceptual features
2311.13613 (2023-11)
Spanning Training Progress: Temporal Dual-Depth Scoring (TDDS) for Enhanced Dataset Pruning
get_lambda 2 other papers
2 later
2506.24125 (2025-06)
FADRM: Fast and Accurate Data Residual Matching for Dataset Distillation
2606.18209 (2026-06)
Rethinking Dataset Distillation for Classification: Do Distilled Sets Outperform Coresets?
mixup_process 1 other paper
1 later
136850478 (2022 (year only))
Unbiased Manifold Augmentation for Coarse Class Subdivision

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

Large capacity deep learning models are often prone to a high generalization gap when trained with a limited amount of labeled training data. A recent class of methods to address this problem uses various ways to construct a new training sample by mixing a pair (or more) of training samples. We propose PatchUp, a hidden state block-level regularization technique for Convolutional Neural Networks (CNNs), that is applied on selected contiguous blocks of feature maps from a random pair of samples. Our approach improves the robustness of CNN models against the manifold intrusion problem that may occur in other state-of-the-art mixing approaches. Moreover, since we are mixing the contiguous block of features in the hidden space, which has more dimensions than the input space, we obtain more diverse samples for training towards different dimensions. Our experiments on CIFAR10/100, SVHN, Tiny-ImageNet, and ImageNet using ResNet architectures including PreActResnet18/34, WRN-28-10, ResNet101/152 models show that PatchUp improves upon, or equals, the performance of current state-of-the-art regularizers for CNNs. We also show that PatchUp can provide a better generalization to deformed samples and is more robust against adversarial attacks.

For agents

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

get_harvested_code_for_paper("2006.07794")
get_code_for_paper("2006.07794")
have("2006.07794")

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

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

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

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

Connect an agent — have() is free.