SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2106.06560 · CVPR · 2021

HR-NAS: Searching Efficient High-Resolution Neural Architectures with Lightweight Transformers

Ping Luo, Peng Wang, Mingyu Ding, Linjie Yang, Zhiwu Lu, Xiaojie Jin, Xiaochen Lian

arXiv · PDF · Open in the Atlas

Code that ran

10 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; 0 honoured the contract we drafted, 0 violated it and 7 have no contract verdict; 3 failures of our instrument; 2 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/2106.06560.json · badge: /api/ran/2106.06560.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
dingmyu/HR-NAS canonical (classifier label)
classifier basis: census
10 ran · 2 no recorded run
FunctionStatusWhere it lives
accuracy Ran
ran on a synthesized input
dingmyu/HR-NAS/mmseg/accuracy.py
code served (permissive licence) · get_code("b62c4cc79bbeaff7")
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 float, shape (1,) 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

torch.manual_seed(0)

# Create small tensors for testing
batch_size = 2
num_classes = 4

# pred: shape (N, num_class, ...)
# For a classification task, pred should be (batch_size, num_classes)
pred = torch.randn(batch_size, num_classes)

# target: shape (N, ...)
# For standard classification, target should be (batch_size,) with class indices
target = torch.tensor([0, 2], dtype=torch.long)

# topk can be int or tuple of ints
topk = 1

# thresh is optional float or None
thresh = None

ARGS = {
    "pred": pred,
    "target": target,
    "topk": topk,
    "thresh": thresh,
}
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 float, shape (1,) — shape (1,) 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
dingmyu/HR-NAS/models/hrnet_base.py
pointer only (licence: MIT); the stored copy get_code serves, from lixiaotong97/DSU, is pointer only (licence: NONE) · get_code("fac5364e2f53c6db")
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 lixiaotong97/DSU, 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.

conv_module_name_filter Ran
ran; our contract draft was wrong, not the code
dingmyu/HR-NAS/utils/model_profiling.py
code served (permissive licence) · get_code("32f1f27f7d19f6ad")
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)

# The function conv_module_name_filter takes a single parameter: name (a string)
# It performs string replacements on the name to shorten it
# No complex objects needed - just a string

ARGS = {
    'name': 'Conv2d(kernel_size=3, stride=1, padding=1, bias=True, groups=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 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
cross_entropy Ran
ran on a synthesized input
dingmyu/HR-NAS/mmseg/loss.py
code served (permissive licence) · get_code("156683f98b5dd1b4")
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 testing
# pred: logits tensor for cross entropy, shape (batch_size, num_classes)
pred = torch.randn(2, 4)

# label: class indices, shape (batch_size,)
label = torch.tensor([0, 2])

# weight: element-wise weights for loss, same shape as loss output
weight = torch.ones(2)

# class_weight: per-class weights for cross entropy
class_weight = torch.tensor([1.0, 1.0, 1.0, 1.0])

# reduction: how to reduce the loss
reduction = 'mean'

# avg_factor: average factor for computing mean
avg_factor = None

# ignore_index: class index to ignore
ignore_index = 255

ARGS = {
    'pred': pred,
    'label': label,
    'weight': weight,
    'class_weight': class_weight,
    'reduction': reduction,
    'avg_factor': avg_factor,
    'ignore_index': ignore_index
}
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
get_active_fn Ran
ran on a synthesized input
dingmyu/HR-NAS/models/mobilenet_base.py
code served (permissive licence) · get_code("f344ad03a3e1b61b")
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 partial. 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 functools
import torch
from torch import nn
from torch.nn import functional as F

torch.manual_seed(0)

class Swish(nn.Module):
    """Swish activation function.

    See: https://arxiv.org/abs/1710.05941
    NOTE: Will consume much more GPU memory compared with inplaced ReLU.
    """

    def forward(self, x):
        return x * torch.sigmoid(x)

class HSwish(object):
    """Hard Swish activation function.

    See: https://arxiv.org/abs/1905.02244
    """

    def forward(self, x):
        return x * F.relu6(x + 3, True).div_(6)

def get_active_fn(name):
    """Select activation function."""
    active_fn = {'nn.ReLU6': functools.partial(nn.ReLU6, inplace=True), 'nn.ReLU': functools.partial(nn.ReLU, inplace=True), 'nn.Swish': Swish, 'nn.HSwish': HSwish}[name]
    return active_fn

ARGS = {
    'name': 'nn.ReLU'
}
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 partial — a partial output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a partial 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_params Ran
ran on a synthesized input
dingmyu/HR-NAS/utils/model_profiling.py
code served (permissive licence) · get_code("e2db4aa1fd031021")
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 int64, ndim 0, dtype family int, 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 numpy as np

torch.manual_seed(0)

# Create a minimal nn.Module with parameters
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear1 = nn.Linear(4, 3)
        self.linear2 = nn.Linear(3, 2)
    
    def forward(self, x):
        return self.linear2(self.linear1(x))

# Instantiate the model
model = SimpleModel()

# The function needs 'self' which is the model instance
# and calls self.parameters() to get all parameters
ARGS = {
    'self': model
}
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 int64, ndim 0, dtype family int, 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
get_points_single Ran
ran on a synthesized input
dingmyu/HR-NAS/models/transformer.py
code served (permissive licence) · get_code("954418d7666daede")
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 ndarray, ndim 3, dtype family float, shape (2, 4, 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 numpy as np

# Analyze the function:
# - size: tuple of (height, width) used for np.arange and meshgrid
# - stride: int used in np.arange and integer division
# - dtype: numpy dtype for the output array

ARGS = {
    "size": (4, 5),  # height=4, width=5 (distinct dimensions)
    "stride": 2,
    "dtype": np.float32,
}
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 ndarray, ndim 3, dtype family float, shape (2, 4, 5) — shape (2, 4, 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
output_network Ran
ran on a synthesized input
dingmyu/HR-NAS/models/mobilenet_base.py
code served (permissive licence) · get_code("39bddff1555b4a0c")
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 dict. 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 SimpleBlock(nn.Module):
    def __init__(self, output_dim, stride, kernel_sizes, channels, expand):
        super().__init__()
        self.output_dim = output_dim
        self.stride = stride
        self.kernel_sizes = kernel_sizes
        self.channels = channels
        self.expand = expand

class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.input_channel = 3
        self.last_channel = 1280
        self.active_fn = 'relu'
        
        self.block1 = SimpleBlock(
            output_dim=16,
            stride=1,
            kernel_sizes=[3],
            channels=[16],
            expand=1
        )
        self.block2 = SimpleBlock(
            output_dim=24,
            stride=2,
            kernel_sizes=[3, 5],
            channels=[24, 24],
            expand=6
        )
    
    def get_named_block_list(self):
        return {
            'block1': self.block1,
            'block2': self.block2
        }

model = SimpleModel()

ARGS = {
    'model': model
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
resize Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
dingmyu/HR-NAS/models/transformer.py
code served (permissive licence) · get_code("e8fbff5c3395ac23")
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 4, dtype family float, shape (2, 3, 8, 10) 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)

# Create a small input tensor for interpolation
# Shape: (batch=2, channels=3, height=4, width=5)
input_tensor = torch.randn(2, 3, 4, 5)

# Define ARGS dict with all parameters
ARGS = {
    'input': input_tensor,
    'size': (8, 10),
    'scale_factor': None,
    'mode': 'nearest',
    'align_corners': None
}
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 4, dtype family float, shape (2, 3, 8, 10) — shape (2, 3, 8, 10) 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
run_forward Ran
ran on a synthesized input
dingmyu/HR-NAS/utils/model_profiling.py
code served (permissive licence) · get_code("17c195449846c9ea")
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 int, ndim 0, dtype family int, shape () as a later run recorded it. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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

torch.manual_seed(0)

# Create a minimal model with a forward method
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

# Instantiate the model
model = SimpleModel()

# Create small input tensors (batch_size=2, dim=4)
input_tensor = torch.randn(2, 4)

# Package input as tuple for unpacking with *input
input_args = (input_tensor,)

ARGS = {
    'self': model,
    'input': input_args,
    'num_forwards': 10
}
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 int, ndim 0, dtype family int, 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
binary_cross_entropy Not yet run
unverified (harvested, no recorded run)
dingmyu/HR-NAS/mmseg/loss.py
code served (permissive licence) · get_code("386bec0c5e132dd1")
How it ran

no invocation recorded.

mask_cross_entropy Not yet run
unverified (harvested, no recorded run)
dingmyu/HR-NAS/mmseg/loss.py
code served (permissive licence) · get_code("13224d835509143a")
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, 5 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 1 the same month, 4 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
conv3x3 686 other papers
312 dated earlier, 12 the same month, 356 later, 6 same year, order not determinable · 31 only as an assembly brick
1406.2661 (2014-06)
Generative Adversarial Networks
1409.0575 (2014-09)
ImageNet Large Scale Visual Recognition Challenge
1412.6572 (2014-12)
Explaining and Harnessing Adversarial Examples
and 683 more not named here
conv_module_name_filter 2 other papers
1 dated earlier, 1 later
2105.07085 (2021-05)
MutualNet: Adaptive ConvNet via Mutual Learning from Different Model Configurations
2310.03337 (2023-10)
Denoising Diffusion Step-aware Models
get_params 2 other papers
1 dated earlier, 1 later
2105.07085 (2021-05)
MutualNet: Adaptive ConvNet via Mutual Learning from Different Model Configurations
2310.03337 (2023-10)
Denoising Diffusion Step-aware Models
accuracy 1 other paper
1 later
2203.07988 (2022-03)
Smoothing Matters: Momentum Transformer for Domain Adaptive Semantic Segmentation
resize 1 other paper
1 dated earlier
2103.13253 (2021-03)
Learning Versatile Neural Architectures by Propagating Network Codes

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

High-resolution representations (HR) are essential for dense prediction tasks such as segmentation, detection, and pose estimation. Learning HR representations is typically ignored in previous Neural Architecture Search (NAS) methods that focus on image classification. This work proposes a novel NAS method, called HR-NAS, which is able to find efficient and accurate networks for different tasks, by effectively encoding multiscale contextual information while maintaining high-resolution representations. In HR-NAS, we renovate the NAS search space as well as its searching strategy. To better encode multiscale image contexts in the search space of HR-NAS, we first carefully design a lightweight transformer, whose computational complexity can be dynamically changed with respect to different objective functions and computation budgets. To maintain highresolution representations of the learned networks, HR-NAS adopts a multi-branch architecture that provides convolutional encoding of multiple feature resolutions, inspired by HRNet [73]. Last, we proposed an efficient fine-grained search strategy to train HR-NAS, which effectively explores the search space, and finds optimal architectures given various tasks and computation resources. As shown in Fig. 1 (a), HR-NAS is capable of achieving state-of-the-art tradeoffs between performance and FLOPs for three dense prediction tasks and an image classification task, given only small computational budgets. For example, HR-NAS surpasses SqueezeNAS [63] that is specially designed for semantic segmentation while improving efficiency by 45.9%. Code is available at https://github.com/dingmyu/HR-NAS.

For agents

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

get_harvested_code_for_paper("2106.06560")
get_code_for_paper("2106.06560")
have("2106.06560")

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

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

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

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

Connect an agent — have() is free.