timm documentation

BYOANet (BoTNet, HaloNet, LambdaNet)

Hugging Face's logo
Join the Hugging Face community

and get access to the augmented documentation experience

to get started

BYOANet (BoTNet, HaloNet, LambdaNet)

Category: Hybrid · Code: timm/models/byoanet.py · Architectures: 15 · Pretrained weights: 13 (13 with ImageNet-1k results)

Networks built with the ByobNet block / stage config system that place self-attention (or similar) layers in ResNet style stages: Bottleneck Transformers (BoTNet), HaloNets and Lambda ResNets. The module docstring marks these definitions as experimental.

Papers

Usage

See the Quickstart for loading pretrained weights, image preprocessing and fine-tuning, and Feature Extraction for using the models as backbones.

>>> import timm
>>> model = timm.create_model('halonet50ts.a1h_in1k', pretrained=True)
>>> data_config = timm.data.resolve_model_data_config(model)

Model API support

FeatureByobNet
features_only=True feature maps✓ (strides 2, 4, 8, 16, 32)
forward_intermediates()✓
prune_intermediate_layers()✓
Any input size, no changes needed✗
set_input_size()✗
dynamic_img_size=True✗
set_grad_checkpointing()✓
Layer-wise LR decay (group_matcher())✓
reset_classifier()✓

✓ supported, ✓ (square) works for square sizes only, ✗ not supported, – not needed (the model already accepts any input size). Checked by running each feature on a randomly initialized model (ByobNet with halonet_h1 at 256), other architectures of the same class are expected to behave the same. See the Model API page for details.

Architectures

ArchitectureParams (M)GMACsInput sizePretrained weights
botnet26t_25612.493.322561
botnet50ts_25622.745.542560
eca_botnext26ts_25610.592.462561
eca_halonext26ts10.762.442561
halo2botnet50ts_25622.645.022561
halonet26t12.483.192561
halonet50ts22.735.302561
halonet_h18.103.002560
haloregnetz_b11.681.972241
lambda_resnet26rpt_25610.993.162561
lambda_resnet26t10.963.022561
lambda_resnet50ts21.545.072561
lamhalobotnet50ts_25622.575.022561
sebotnet33ts_25613.703.892561
sehalonet33ts13.693.552561

GMACs and parameter counts are for the default input size and classifier of each architecture, from the benchmark results.

Pretrained weights

Top-1 is ImageNet-1k validation accuracy from results-imagenet.csv at the listed eval size, - if the weight has no ImageNet-1k result (e.g. pretraining or image-text weights). Classes is the size of the pretrained classifier, none for weights without one.

Weights are grouped by source: the paper or origin given in the pretrained config, else a Hub organization other than timm, else the first part of the pretrained tag (architecture.tag). Sources with a single weight are listed under other.

a1h tags

WeightInput sizeTop-1 (%)Eval sizeClassesLicenseHub
halo2botnet50ts_256.a1h_in1k25682.0842561000apache-2.0timm
halonet26t.a1h_in1k25679.1342561000apache-2.0timm
halonet50ts.a1h_in1k25681.6402561000apache-2.0timm
lambda_resnet50ts.a1h_in1k25681.1842561000apache-2.0timm
lamhalobotnet50ts_256.a1h_in1k25681.5522561000apache-2.0timm
sebotnet33ts_256.a1h_in1k25681.1562561000apache-2.0timm

c1 tags

WeightInput sizeTop-1 (%)Eval sizeClassesLicenseHub
botnet26t_256.c1_in1k25679.2562561000apache-2.0timm
eca_botnext26ts_256.c1_in1k25679.2622561000apache-2.0timm
eca_halonext26ts.c1_in1k25679.5182561000apache-2.0timm
lambda_resnet26rpt_256.c1_in1k25678.9602561000apache-2.0timm
lambda_resnet26t.c1_in1k25679.1262561000apache-2.0timm

Other

WeightInput sizeTop-1 (%)Eval sizeClassesLicenseHub
haloregnetz_b.ra3_in1k22481.0582241000apache-2.0timm
sehalonet33ts.ra2_in1k25680.9762561000apache-2.0timm
Update on GitHub