SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2211.12860 · 2022

DETRs with Collaborative Hybrid Assignments Training

arXiv · PDF · Open in the Atlas

Code that ran

4 of 5 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; 0 failures of our instrument; 1 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2211.12860.json · badge: /api/ran/2211.12860.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
anenbergb/Co-DETR-TensorRT community (classifier label)
classifier basis not recorded on the link
4 ran · 1 no recorded run
FunctionStatusWhere it lives
build_MLP Ran
ran on a synthesized input
anenbergb/Co-DETR-TensorRT/codetr/transformer.py
code served (permissive licence) · get_code("fb28f2ba259e8f13")
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 Sequential. 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 = {
    "input_dim": 4,
    "hidden_dim": 8,
    "output_dim": 3,
    "num_layers": 3,
}
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 Sequential — a Sequential output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Sequential output the recorded ndim 1 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_reference_points Ran
ran on a synthesized input
anenbergb/Co-DETR-TensorRT/codetr/transformer.py
code served (permissive licence) · get_code("012e330e87684edc")
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, 84, 2) 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 multi-level feature maps
# Each feature map has shape (bs, embed_dims, h, w)
# Using different spatial dimensions for each level to be realistic
feat_level_0 = torch.randn(2, 4, 8, 8)  # batch=2, embed_dims=4, h=8, w=8
feat_level_1 = torch.randn(2, 4, 4, 4)  # batch=2, embed_dims=4, h=4, w=4
feat_level_2 = torch.randn(2, 4, 2, 2)  # batch=2, embed_dims=4, h=2, w=2

mlvl_feats = [feat_level_0, feat_level_1, feat_level_2]

# Create valid_ratios tensor of shape (bs, num_levels, 2)
# bs=2, num_levels=3, with valid ratios between 0 and 1
valid_ratios = torch.tensor([
    [[1.0, 1.0], [0.9, 0.9], [0.8, 0.8]],  # batch 0
    [[1.0, 1.0], [0.95, 0.95], [0.85, 0.85]]  # batch 1
], dtype=torch.float32)

device = torch.device('cpu')

ARGS = {
    'mlvl_feats': mlvl_feats,
    'valid_ratios': valid_ratios,
    'device': device
}
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 3, dtype family float, shape (2, 84, 2) — shape (2, 84, 2) 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
multi_scale_deformable_attention_pytorch Ran
ran on a synthesized input
anenbergb/Co-DETR-TensorRT/codetr/ops.py
code served (permissive licence) · get_code("5502568acd4c6cdf")
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, 3, 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
import torch.nn.functional as F

torch.manual_seed(0)

# Define dimensions
bs = 2  # batch size
num_queries = 3
num_heads = 4
embed_dims = 8
num_levels = 2
num_points = 5

# Spatial shapes for each level: (H, W)
# Level 0: 4x3, Level 1: 2x2
value_spatial_shapes_list = [(4, 3), (2, 2)]
total_keys = sum(h * w for h, w in value_spatial_shapes_list)  # 4*3 + 2*2 = 16

# value: (bs, num_keys, num_heads, embed_dims//num_heads)
value = torch.randn(bs, total_keys, num_heads, embed_dims // num_heads)

# value_spatial_shapes: (num_levels, 2)
value_spatial_shapes = torch.tensor(value_spatial_shapes_list, dtype=torch.long)

# sampling_locations: (bs, num_queries, num_heads, num_levels, num_points, 2)
# Values should be in [0, 1] range (will be converted to [-1, 1] by the function)
sampling_locations = torch.rand(bs, num_queries, num_heads, num_levels, num_points, 2)

# attention_weights: (bs, num_queries, num_heads, num_levels, num_points)
attention_weights = torch.rand(bs, num_queries, num_heads, num_levels, num_points)

ARGS = {
    "value": value,
    "value_spatial_shapes": value_spatial_shapes,
    "sampling_locations": sampling_locations,
    "attention_weights": attention_weights,
}
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 3, dtype family float, shape (2, 3, 8) — shape (2, 3, 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: none by the harness; any seed is in the setup block
swin_converter Ran
ran on a synthesized input
anenbergb/Co-DETR-TensorRT/codetr/swin.py
code served (permissive licence) · get_code("85e307a3efdf4aa0")
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 OrderedDict. 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
from collections import OrderedDict

torch.manual_seed(0)

# Create a checkpoint dictionary with various key patterns that the function processes
ckpt = OrderedDict()

# Add head keys (should be skipped)
ckpt['head.fc.weight'] = torch.randn(10, 8)
ckpt['head.fc.bias'] = torch.randn(10)

# Add layers with attn patterns
ckpt['layers.0.attn.qkv.weight'] = torch.randn(24, 64)
ckpt['layers.0.attn.proj.bias'] = torch.randn(8)

# Add layers with mlp patterns
ckpt['layers.0.mlp.fc1.weight'] = torch.randn(16, 8)
ckpt['layers.0.mlp.fc1.bias'] = torch.randn(16)
ckpt['layers.0.mlp.fc2.weight'] = torch.randn(8, 16)
ckpt['layers.0.mlp.fc2.bias'] = torch.randn(8)

# Add layers with downsample and reduction (4*in_channel, in_channel shape)
ckpt['layers.0.downsample.reduction.weight'] = torch.randn(16, 4)  # 16 = 4*4
ckpt['layers.0.downsample.norm.weight'] = torch.randn(4)

# Add layers with downsample norm
ckpt['layers.1.downsample.norm.bias'] = torch.randn(8)

# Add other layer keys (pass through)
ckpt['layers.1.norm1.weight'] = torch.randn(8)

# Add patch_embed with proj
ckpt['patch_embed.proj.weight'] = torch.randn(64, 48)
ckpt['patch_embed.proj.bias'] = torch.randn(64)

# Add patch_embed without proj (pass through)
ckpt['patch_embed.norm.weight'] = torch.randn(64)

# Add other keys (pass through)
ckpt['other_key.weight'] = torch.randn(5, 5)

ARGS = {
    'ckpt': ckpt
}
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 OrderedDict — a OrderedDict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a OrderedDict 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
make_encoder_output_proposals Not yet run
unverified (harvested, no recorded run)
anenbergb/Co-DETR-TensorRT/codetr/transformer.py
code served (permissive licence) · get_code("2f3e30980c10ac1c")
How it ran

no invocation recorded.

Also present in other papers' code

Of 5 samples lifted from this paper's linked repositories, 5 carry a function identity and 0 do not. Of the 5 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 5 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

In this paper, we provide the observation that too few queries assigned as positive samples in DETR with one-to-one set matching leads to sparse supervision on the encoder's output which considerably hurt the discriminative feature learning of the encoder and vice visa for attention learning in the decoder. To alleviate this, we present a novel collaborative hybrid assignments training scheme, namely $\mathcal{C}$o-DETR, to learn more efficient and effective DETR-based detectors from versatile label assignment manners. This new training scheme can easily enhance the encoder's learning ability in end-to-end detectors by training the multiple parallel auxiliary heads supervised by one-to-many label assignments such as ATSS and Faster RCNN. In addition, we conduct extra customized positive queries by extracting the positive coordinates from these auxiliary heads to improve the training efficiency of positive samples in the decoder. In inference, these auxiliary heads are discarded and thus our method introduces no additional parameters and computational cost to the original detector while requiring no hand-crafted non-maximum suppression (NMS). We conduct extensive experiments to evaluate the effectiveness of the proposed approach on DETR variants, including DAB-DETR, Deformable-DETR, and DINO-Deformable-DETR. The state-of-the-art DINO-Deformable-DETR with Swin-L can be improved from 58.5% to 59.5% AP on COCO val. Surprisingly, incorporated with ViT-L backbone, we achieve 66.0% AP on COCO test-dev and 67.9% AP on LVIS val, outperforming previous methods by clear margins with much fewer model sizes. Codes are available at \url{https://github.com/Sense-X/Co-DETR}.

For agents

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

get_harvested_code_for_paper("2211.12860")
get_code_for_paper("2211.12860")
have("2211.12860")

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

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

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

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

Connect an agent — have() is free.