Skip to main content

Official implementation of HyViTas-Bench, from 'A CNN-ViT hybrid architecture search benchmark on a large-scale dataset' (IEEE Access 2025)

Project description

HyViTas-Bench

Code release for A CNN-ViT hybrid architecture search benchmark on a large-scale dataset

Getting started

Installation:

pip3 install hyvitasbench

Usage:

import torch
from hyvitasbench import *
import hyvitasbench.datasets as datasets

bench = HyViTASBench('hyvitasbench.pkl.zst')
exemplar = bench[1000]

print(exemplar.genotype)
# [[[32, 2, 3], [32, 2, 3], [32, 2, 3]], [[64, 2, 3], [64, 2, 3], [64, 2, 3]], [[112, 8, 1, 5], [112, 8, 1, 5], [112, 8, 1, 5]], [[224, 8, 1, 5], [224, 8, 1, 5], [224, 8, 1, 5]]]

# Available modes: mean, random, normal, trunc_normal, raw
print(exemplar.evaluate(mode='mean'))
# 67.164

print(exemplar.evaluate(mode='mean', dataset=datasets.OOD_RED_IMAGENET_SKETCH))
# 6.784834669601216

for dev_id, dev_name in bench.device_names.items():
    print(f"{dev_id:20s} : {dev_name}")
# aarch64_rpizero2w    : Raspberry Pi Zero 2W
# aarch64_rpi4         : Raspberry Pi 4
# tegra_orin-nano      : Jetson Orin Nano
# ...

print(exemplar.get_inference_time('tegra_orin-nano'))
# 19.04989266

net = exemplar.instantiate(device=torch.device('cuda'))  # Instantiate PyTorch model
print(net)
# Network(
# ...
# )

other_exemplar = bench.lookup([
    [[48, 4, 3], [48, 4, 3], [48, 4, 3]],
    [[64, 4, 3], [64, 4, 3], [64, 4, 3]],
    [[144, 8, 4, 5], [144, 8, 4, 5], [144, 8, 4, 5]],
    [[256, 8, 4, 5], [256, 8, 4, 5], [256, 8, 4, 5]]
])
print(other_exemplar.index)
# 1439

Download

The benchmark data archive can be downloaded from the repository release files.

The RedImageNet dataset can be downloaded from https://dx.doi.org/10.21227/egmb-rc53.

Contributors

Citation

@article{hyvitasbench,
    title        = {A CNN-ViT hybrid architecture search benchmark on a large-scale dataset},
    author       = {Robbiano, Luca and Pistilli, Francesca and Averta, Giuseppe},
    year         = {2025},
    journal      = {IEEE Access},
    volume       = {13},
    pages        = {209965-209979}
    doi          = {10.1109/ACCESS.2025.3642734}
    number       = {}
}

License

This codebase is released under the MIT License, except for portions of files that explicitly state otherwise. Please check in-file notices for any exceptions.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hyvitasbench-1.0.0-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file hyvitasbench-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: hyvitasbench-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for hyvitasbench-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 92cfba53036912726bdb6995453ee1bee50c568ba11e33b63018a68750a29ea8
MD5 07e133c271cc923ab2441b5adde1de3a
BLAKE2b-256 150cd4ee279c741169fc821124c38fa19f4b00f24d2f31a3ba224225d5a9576e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page