SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2203.01305 · CVPR · 2022

DN-DETR: Accelerate DETR Training by Introducing Query DeNoising

Lei Zhang, Hao Zhang, Jian Guo, Shilong Liu, Feng Li, Lionel Ni

arXiv · PDF · Open in the Atlas

Code that ran

17 of 22 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (3 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 1 violated it and 5 have no contract verdict; 11 failures of our instrument; 5 no recorded run); 1 of them was also run on the host, not in the jail, by the peer-agreement lane that set its level, 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/2203.01305.json · badge: /api/ran/2203.01305.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
FengLi-ust/DN-DETR canonical (classifier label)
classifier basis not recorded on the link
6 ran · 2 no recorded run
slongliu/dab-detr canonical (classifier label)
classifier basis not recorded on the link
1 ran · 0 no recorded run
idea-research/maskdino community
Papers with Code archive
6 ran · 1 no recorded run
IDEA-Research/detrex marked official in Papers with Code
Papers with Code archive
4 ran · 0 no recorded run
IDEA-opensource/DAB-DETR community
Papers with Code archive
0 ran · 1 no recorded run
alibaba/EasyCV community
Papers with Code archive
0 ran · 1 no recorded run
FunctionStatusWhere it lives
window_partition Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
FengLi-ust/DN-DETR/models/DN_DAB_DETR/swin_transformer.py
pointer only (licence: Apache-2.0) · get_code("144d10b49baeb8a6")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, FengLi-ust/DN-DETR, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. 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.

GenerateDNQueries Ran
ran on a synthesized input · constructed an object; no result was computed
IDEA-Research/detrex/detrex/layers/denoising.py
code served (permissive licence) · get_code("a33aa40d1ec31a21")
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, GenerateDNQueries: 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 = {
    "num_queries": 300,
    "num_classes": 80,
    "label_embed_dim": 256,
    "denoising_groups": 5,
    "label_noise_prob": 0.2,
    "box_noise_scale": 0.4,
    "with_indicator": 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 GenerateDNQueries — 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 GenerateDNQueries 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
MLP Ran
ran on a synthesized input · constructed an object; no result was computed
idea-research/maskdino/maskdino/modeling/transformer_decoder/dino_decoder.py
code served (permissive licence) · get_code("1a575c1c202174f0")
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, MLP: 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
from torch import 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 MLP — 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 MLP 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
MSDeformAttn Ran
ran on a synthesized input
idea-research/maskdino/maskdino/modeling/transformer_decoder/dino_decoder.py
code served (permissive licence) · get_code("107172bd7583403e")
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 3, 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
from torch import nn
import math

class MSDA:
    @staticmethod
    def ms_deform_attn_forward(value, value_spatial_shapes, value_level_start_index, sampling_locations, attention_weights, im2col_step):
        return ms_deform_attn_core_pytorch(value, value_spatial_shapes, sampling_locations, attention_weights)

    @staticmethod
    def ms_deform_attn_backward(value, value_spatial_shapes, value_level_start_index, sampling_locations, attention_weights, grad_output, im2col_step):
        grad_value = torch.randn_like(value)
        grad_sampling_loc = torch.randn_like(sampling_locations)
        grad_attn_weight = torch.randn_like(attention_weights)
        return grad_value, grad_sampling_loc, grad_attn_weight

INIT_ARGS = {
    'd_model': 4,
    'n_levels': 2,
    'n_heads': 2,
    'n_points': 2
}

# Create dummy inputs matching the expected shapes
N = 2  # batch size
Lq = 3  # query length
L = 6  # total spatial points across levels
M = INIT_ARGS['n_heads']
D = INIT_ARGS['d_model']
P = INIT_ARGS['n_points']
n_levels = INIT_ARGS['n_levels']

# query: (N, Lq, D)
query = torch.randn(N, Lq, D)

# reference_points: (N, Lq, n_levels, 2)
reference_points = torch.rand(N, Lq, n_levels, 2)

# input_flatten: (N, L, D)
input_flatten = torch.randn(N, L, D)

# input_spatial_shapes: (n_levels, 2)
input_spatial_shapes = torch.tensor([[2, 2], [1, 2]], dtype=torch.long)

# input_level_start_index: (n_levels,)
input_level_start_index = torch.tensor([0, 4], dtype=torch.long)

# input_padding_mask: (N, L) - optional
input_padding_mask = torch.zeros(N, L, dtype=torch.bool)

ARGS = {
    'query': query,
    'reference_points': reference_points,
    'input_flatten': input_flatten,
    'input_spatial_shapes': input_spatial_shapes,
    'input_level_start_index': input_level_start_index,
    'input_padding_mask': input_padding_mask
}
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 3, dtype family float — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
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)
MSDeformAttnFunction Ran
ran on a synthesized input · constructed an object; no result was computed
idea-research/maskdino/maskdino/modeling/transformer_decoder/dino_decoder.py
code served (permissive licence) · get_code("7205a619c51dd0ee")
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, MSDeformAttnFunction: 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 unittest.mock import MagicMock

torch.manual_seed(0)

# Create a mock MSDA module since the actual implementation isn't provided
class MockMSDA:
    @staticmethod
    def ms_deform_attn_forward(value, value_spatial_shapes, value_level_start_index, sampling_locations, attention_weights, im2col_step):
        # Mock forward: output shape should match value's batch and feature dims
        batch_size = value.shape[0]
        num_queries = sampling_locations.shape[1]
        embed_dim = value.shape[-1]
        return torch.randn(batch_size, num_queries, embed_dim)
    
    @staticmethod
    def ms_deform_attn_backward(value, value_spatial_shapes, value_level_start_index, sampling_locations, attention_weights, grad_output, im2col_step):
        # Mock backward: return gradients matching input shapes
        grad_value = torch.randn_like(value)
        grad_sampling_loc = torch.randn_like(sampling_locations)
        grad_attn_weight = torch.randn_like(attention_weights)
        return grad_value, grad_sampling_loc, grad_attn_weight

# Replace MSDA in the module namespace
import sys
mock_msda = MockMSDA()
sys.modules['MSDA'] = MagicMock()

# Create mock MSDA object
MSDA = mock_msda

# Define the arguments
value = torch.randn(2, 8, 4)  # (batch_size=2, num_values=8, embed_dim=4)
value_spatial_shapes = torch.tensor([[4, 3], [2, 2]], dtype=torch.long)  # (num_levels=2, 2) - shapes of each level
value_level_start_index = torch.tensor([0, 12], dtype=torch.long)  # (num_levels+1,) - cumulative indices
sampling_locations = torch.randn(2, 16, 4, 2)  # (batch_size=2, num_queries=16, num_heads=4, num_points=2) with last dim = 2 for (x,y)
attention_weights = torch.randn(2, 16, 4, 2)  # (batch_size=2, num_queries=16, num_heads=4, num_points=2)
im2col_step = 64  # integer parameter

ARGS = {
    "value": value,
    "value_spatial_shapes": value_spatial_shapes,
    "value_level_start_index": value_level_start_index,
    "sampling_locations": sampling_locations,
    "attention_weights": attention_weights,
    "im2col_step": im2col_step,
}
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 MSDeformAttnFunction — 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 MSDeformAttnFunction 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_clones Ran
ran; our contract draft was wrong, not the code
idea-research/maskdino/maskdino/modeling/transformer_decoder/dino_decoder.py
code served (permissive licence) · get_code("82ab53eb37ba2bf3")
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 ModuleList. 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 torch import nn
import copy

torch.manual_seed(0)

# Create a simple nn.Module to use as the module parameter
class SimpleModule(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

# Create instances for the arguments
module = SimpleModule()
N = 5
layer_share_false = False
layer_share_true = True

# Define ARGS dict with all parameters
ARGS = {
    "module": module,
    "N": N,
    "layer_share": layer_share_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 ModuleList — a ModuleList output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ModuleList 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
apply_box_noise Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
IDEA-Research/detrex/detrex/layers/denoising.py
code served (permissive licence) · get_code("c8ea5508b3ca2db0")
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, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Create a small tensor of bounding boxes in (x_c, y_c, w, h) format
# Shape: (num_boxes=2, 4)
# Values normalized to be in a reasonable range for boxes (0 to 1)
boxes = torch.tensor([
    [0.5, 0.5, 0.3, 0.4],
    [0.2, 0.7, 0.2, 0.2]
], dtype=torch.float32)

box_noise_scale = 0.4

ARGS = {
    "boxes": boxes,
    "box_noise_scale": box_noise_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 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
apply_label_noise Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
IDEA-Research/detrex/detrex/layers/denoising.py
code served (permissive licence) · get_code("95bd488170c50d24")
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 1, dtype family int, shape (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

torch.manual_seed(0)

# Create a small tensor of classification labels
# Shape: (num_labels,) - using 5 labels as a small example
labels = torch.tensor([0, 1, 2, 3, 4], dtype=torch.long)

# Define arguments for apply_label_noise
ARGS = {
    "labels": labels,
    "label_noise_prob": 0.2,
    "num_classes": 80
}
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 1, dtype family int, shape (5,) — shape (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: none by the harness; any seed is in the setup block
dice_loss Ran
ran, violated the contract we drafted
FengLi-ust/DN-DETR/models/DN_DAB_DETR/segmentation.py
pointer only (licence: Apache-2.0) · get_code("ac8fe530cdad4d8c")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, FengLi-ust/DN-DETR, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. 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.

dn_post_process Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
FengLi-ust/DN-DETR/models/DN_DAB_DETR/dn_components.py
pointer only (licence: Apache-2.0) · get_code("9db6a2fdc3039d38")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, FengLi-ust/DN-DETR, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. 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.

gen_sineembed_for_position Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
idea-research/maskdino/maskdino/modeling/transformer_decoder/dino_decoder.py
code served (permissive licence) · get_code("4c82654ae6131ecc")
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, 256) 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)

# The function expects pos_tensor with shape (batch, num_positions, 2 or 4)
# where the last dimension is either:
# - 2: (x, y) coordinates
# - 4: (y, x, w, h) coordinates

# Create a small pos_tensor with shape (2, 3, 2) for batch_size=2, num_positions=3, coords=2
pos_tensor_2d = torch.randn(2, 3, 2, dtype=torch.float32)

# Also test with 4D coordinates
pos_tensor_4d = torch.randn(2, 3, 4, dtype=torch.float32)

ARGS = {
    "pos_tensor": pos_tensor_2d
}
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, 256) — shape (2, 3, 256) 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
gen_sineembed_for_position Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
FengLi-ust/DN-DETR/models/DN_DAB_DETR/transformer.py
pointer only (licence: Apache-2.0) · get_code("1455637eb5d8b21d")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, FengLi-ust/DN-DETR, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. 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.

gen_sineembed_for_position Ran
ran on a synthesized input
slongliu/dab-detr/models/DAB_DETR/transformer.py
pointer only (licence: Apache-2.0) · get_code("376e5a5c1b978006")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, slongliu/dab-detr, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. 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.

inverse_sigmoid Ran
ran; our contract draft was wrong, not the code
IDEA-Research/detrex/detrex/layers/denoising.py
code served (permissive licence) · get_code("49611009ffc9cf17")
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, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Create a small tensor with values between 0 and 1 (valid sigmoid output range)
x = torch.tensor([[0.1, 0.5, 0.9, 0.3],
                   [0.2, 0.7, 0.4, 0.8]], dtype=torch.float32)

ARGS = {
    'x': x,
    'eps': 0.001
}
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, 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
ms_deform_attn_core_pytorch Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
idea-research/maskdino/maskdino/modeling/transformer_decoder/dino_decoder.py
code served (permissive licence) · get_code("c53ec291fabfc643")
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, 5, 12) 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)

# Dimensions:
# N_ = batch size (2)
# S_ = total spatial positions (12)
# M_ = number of heads (3)
# D_ = feature dimension (4)
# Lq_ = query length (5)
# L_ = number of levels (2)
# P_ = number of sampling points (6)

N_ = 2
S_ = 12
M_ = 3
D_ = 4
Lq_ = 5
L_ = 2
P_ = 6

# value: [N_, S_, M_, D_]
value = torch.randn(N_, S_, M_, D_)

# value_spatial_shapes: list of (H_, W_) tuples for each level
# We need H_*W_ to sum to S_
# Level 0: 3x2=6, Level 1: 2x3=6, total=12
value_spatial_shapes = [(3, 2), (2, 3)]

# sampling_locations: [N_, Lq_, M_, L_, P_, 2]
# The last dimension is (x, y) coordinates
sampling_locations = torch.rand(N_, Lq_, M_, L_, P_, 2) * 0.5 + 0.25

# attention_weights: [N_, Lq_, M_, L_, P_]
attention_weights = torch.rand(N_, Lq_, M_, L_, P_)

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, 5, 12) — shape (2, 5, 12) 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
sigmoid_focal_loss Ran
ran; our contract draft was wrong, not the code
FengLi-ust/DN-DETR/models/DN_DAB_DETR/DABDETR.py
pointer only (licence: Apache-2.0) · get_code("5c0711aada67957e")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, FengLi-ust/DN-DETR, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. 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.

window_reverse Ran
ran; our contract draft was wrong, not the code
FengLi-ust/DN-DETR/models/DN_DAB_DETR/swin_transformer.py
pointer only (licence: Apache-2.0) · get_code("61bf152e6a42a184")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, FengLi-ust/DN-DETR, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. 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.

DABDETR Not yet run
unverified (harvested, no recorded run)
IDEA-opensource/DAB-DETR/models/DAB_DETR/DABDETR.py
code served (permissive licence) · get_code("2f7664c2aea20776")
How it ran

no invocation recorded.

TransformerDecoder Not yet run
unverified (harvested, no recorded run)
idea-research/maskdino/maskdino/modeling/transformer_decoder/dino_decoder.py
code served (permissive licence) · get_code("947c7bd4504c7501")
How it ran

no invocation recorded.

build_swin_transformer Not yet run
unverified (harvested, no recorded run)
FengLi-ust/DN-DETR/models/DN_DAB_DETR/swin_transformer.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from wjj1wjj/Nodule-DETR, is pointer only (licence: NONE) · get_code("ddbe621fd9f33a35")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, FengLi-ust/DN-DETR, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

multi_head_attention_forward Not yet run
unverified (harvested, no recorded run)
FengLi-ust/DN-DETR/models/DN_DAB_DETR/attention.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from wjj1wjj/Nodule-DETR, is pointer only (licence: NONE) · get_code("a82091666b9db8cf")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, FengLi-ust/DN-DETR, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

prepare_for_dn Not yet run
unverified (harvested, no recorded run)
alibaba/EasyCV/easycv/models/detection/detectors/dab_detr/dn_components.py
code served (permissive licence) · get_code("fd0493bda2a2352e")
How it ran

no invocation recorded.

Also present in other papers' code

Of 22 samples lifted from this paper's linked repositories, 22 carry a function identity and 0 do not. Of the 21 distinct functions with an identity, 14 are also present in other papers whose code we hold (9 with at least one paper dated earlier, 7 the same month, 13 later) and 7 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
window_reverse 227 other papers
33 dated earlier, 11 the same month, 181 later, 2 same year, order not determinable · 34 only as an assembly brick
1608.03983 (2016-08)
SGDR: Stochastic Gradient Descent with Warm Restarts
1711.10925 (2017-11)
Deep Image Prior
2003.13678 (2020-03)
Designing Network Design Spaces
and 224 more not named here
window_partition 223 other papers
31 dated earlier, 10 the same month, 180 later, 2 same year, order not determinable · 32 only as an assembly brick
1706.03762 (2017-06)
Attention Is All You Need
1711.10925 (2017-11)
Deep Image Prior
2003.13678 (2020-03)
Designing Network Design Spaces
and 220 more not named here
MLP
brick of this paper's assembly: helper
68 other papers
20 dated earlier, 4 the same month, 44 later · 58 only as an assembly brick
2005.12872 (2020-05)
End-to-End Object Detection with Transformers
2010.04159 (2020-10)
Deformable DETR: Deformable Transformers for End-to-End Object Detection
2101.01909 (2021-01)
Line Segment Detection Using Transformers without Edges
and 65 more not named here
sigmoid_focal_loss 56 other papers
13 dated earlier, 1 the same month, 39 later, 3 same year, order not determinable · 1 only as an assembly brick
2005.12872 (2020-05)
End-to-End Object Detection with Transformers
2010.04159 (2020-10)
Deformable DETR: Deformable Transformers for End-to-End Object Detection
2103.11731 (2021-03)
Meta-DETR: Image-Level Few-Shot Object Detection with Inter-Class Correlation Exploitation
and 53 more not named here
dice_loss 40 other papers
10 dated earlier, 1 the same month, 26 later, 3 same year, order not determinable · 1 only as an assembly brick
2005.12872 (2020-05)
End-to-End Object Detection with Transformers
2010.04159 (2020-10)
Deformable DETR: Deformable Transformers for End-to-End Object Detection
2103.12115 (2021-03)
End-to-End Trainable Multi-Instance Pose Estimation with Transformers
and 37 more not named here
inverse_sigmoid
brick of this paper's assembly: helper
28 other papers
1 dated earlier, 27 later · 10 only as an assembly brick
2201.12329 (2022-01)
DAB-DETR: Dynamic Anchor Boxes are Better Queries for DETR
2209.13306 (2022-09)
Embracing Consistency: A One-Stage Approach for Spatio-Temporal Video Grounding
2212.07855 (2022-12)
QueryPose: Sparse Multi-Person Pose Regression via Spatial-Aware Part-Level Query
and 25 more not named here
multi_head_attention_forward 24 other papers
1 the same month, 23 later
2203.03605 (2022-03)
DINO: DETR with Improved DeNoising Anchor Boxes for End-to-End Object Detection
2206.02777 (2022-06)
Mask DINO: Towards A Unified Transformer-based Framework for Object Detection and Segmentation
2307.02869 (2023-07)
MomentDiff: Generative Video Moment Retrieval from Random to Real
and 21 more not named here
gen_sineembed_for_position
brick of this paper's assembly: helper
7 other papers
1 the same month, 6 later
2203.03605 (2022-03)
DINO: DETR with Improved DeNoising Anchor Boxes for End-to-End Object Detection
2206.02777 (2022-06)
Mask DINO: Towards A Unified Transformer-based Framework for Object Detection and Segmentation
2303.13076 (2023-03)
CORA: Adapting CLIP for Open-Vocabulary Detection with Region Prompting and Anchor Pre-Matching
and 4 more not named here
ms_deform_attn_core_pytorch
brick of this paper's assembly: helper
6 other papers
2 dated earlier, 4 later · 1 only as an assembly brick
2107.14467 (2021-07)
DPT: Deformable Patch-based Transformer for Visual Recognition
2111.14330 (2021-11)
Sparse DETR: Efficient End-to-End Object Detection with Learnable Sparsity
aaai_27844 (2024 (year only))
SRFormer: Text Detection Transformer with Incorporated Segmentation and Regression
and 3 more not named here
dn_post_process 5 other papers
1 dated earlier, 4 later · 1 only as an assembly brick
2201.12329 (2022-01)
DAB-DETR: Dynamic Anchor Boxes are Better Queries for DETR
2206.02777 (2022-06)
Mask DINO: Towards A Unified Transformer-based Framework for Object Detection and Segmentation
2404.01725 (2024-04)
Disentangled Pre-training for Human-Object Interaction Detection
and 2 more not named here
build_swin_transformer 3 other papers
3 later
2206.02777 (2022-06)
Mask DINO: Towards A Unified Transformer-based Framework for Object Detection and Segmentation
Liu_SAP-DETR_Bridging_the_Gap_Between_Salient_Points_and_Queries-Based_Transformer_CVPR_2023_paper (2023 (year only))
SAP-DETR: Bridging the Gap between Salient Points and Queries-Based Transformer Detector for Fast Model Convergency
2601.01908 (2026-01)
Nodule-DETR: A Novel DETR Architecture with Frequency-Channel Attention for Ultrasound Thyroid Nodule Detection
apply_box_noise
brick of this paper's assembly: helper
2 other papers
2 later
2501.06710 (2025-01)
Multi-task Visual Grounding with Coarse-to-Fine Consistency Constraints
2509.04833 (2025-09)
PropVG: End-to-End Proposal-Driven Visual Grounding with Multi-Granularity Discrimination
apply_label_noise
brick of this paper's assembly: helper
2 other papers
2 later
2501.06710 (2025-01)
Multi-task Visual Grounding with Coarse-to-Fine Consistency Constraints
2509.04833 (2025-09)
PropVG: End-to-End Proposal-Driven Visual Grounding with Multi-Granularity Discrimination
_get_clones
brick of this paper's assembly: helper
1 other paper
1 dated earlier
2005.12872 (2020-05)
End-to-End Object Detection with Transformers

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

We present in this paper a novel denoising training method to speedup DETR (DEtection TRansformer) training and offer a deepened understanding of the slow convergence issue of DETR-like methods. We show that the slow convergence results from the instability of bipartite graph matching which causes inconsistent optimization goals in early training stages. To address this issue, except for the Hungarian loss, our method additionally feeds ground-truth bounding boxes with noises into Transformer decoder and trains the model to reconstruct the original boxes, which effectively reduces the bipartite graph matching difficulty and leads to a faster convergence. Our method is universal and can be easily plugged into any DETR-like methods by adding dozens of lines of code to achieve a remarkable improvement. As a result, our DN-DETR results in a remarkable improvement (+1.9AP) under the same setting and achieves the best result (AP 43.4 and 48.6 with 12 and 50 epochs of training respectively) among DETR-like methods with ResNet-50 backbone. Compared with the baseline under the same setting, DN-DETR achieves comparable performance with 50% training epochs. Code is available at https://github.com/FengLi-ust/DN-DETR.

For agents

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

get_harvested_code_for_paper("2203.01305")
get_code_for_paper("2203.01305")
have("2203.01305")

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

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

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

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

Connect an agent — have() is free.