pytorch-image-models/timm/layers
Ross Wightman cb3f9c23bb
Metaformer baselines for vision (final PR with cleanup) (#1793)
* update

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* merge with poolformer, initial version

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Revert "Update metaformers.py"

This reverts commit 2916f37f8d.

* Revert "Update metaformers.py"

This reverts commit 1d882eb494.

* Revert "Update metaformers.py"

This reverts commit 2209d0830e.

* Revert "Update metaformers.py"

This reverts commit 32bede4e27.

* Revert "Update metaformers.py"

This reverts commit 4ed934e000.

* Revert "Update metaformers.py"

This reverts commit 3f0b075367.

* Revert "Update metaformers.py"

This reverts commit 2fef9006d7.

* Update metaformers.py

* Update metaformers.py

* rename model

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Stem/Downsample rework

* Update metaformers.py

* try NHWC

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Squashed commit of the following:

commit b7696a30a7
Author: Fredo Guan <fredo.guan@hotmail.com>
Date:   Fri Feb 10 01:46:44 2023 -0800

    Update metaformers.py

commit 41fe5c3626
Author: Fredo Guan <fredo.guan@hotmail.com>
Date:   Fri Feb 10 01:03:47 2023 -0800

    Update metaformers.py

commit a3aee37c35
Author: Fredo Guan <fredo.guan@hotmail.com>
Date:   Fri Feb 10 00:32:04 2023 -0800

    Update metaformers.py

commit f938beb81b
Author: Fredo Guan <fredo.guan@hotmail.com>
Date:   Fri Feb 10 00:24:58 2023 -0800

    Update metaformers.py

commit 10bde717e5
Author: Fredo Guan <fredo.guan@hotmail.com>
Date:   Sun Feb 5 02:11:28 2023 -0800

    Update metaformers.py

commit 39274bd45e
Author: Fredo Guan <fredo.guan@hotmail.com>
Date:   Sun Feb 5 02:06:58 2023 -0800

    Update metaformers.py

commit a2329ab8ec
Author: Fredo Guan <fredo.guan@hotmail.com>
Date:   Sun Feb 5 02:03:34 2023 -0800

    Update metaformers.py

commit 53b8ce5b8a
Author: Fredo Guan <fredo.guan@hotmail.com>
Date:   Sun Feb 5 02:02:37 2023 -0800

    Update metaformers.py

commit ab6225b941
Author: Fredo Guan <fredo.guan@hotmail.com>
Date:   Sun Feb 5 01:04:55 2023 -0800

    try NHWC

commit 02fcc30eaa
Author: Fredo Guan <fredo.guan@hotmail.com>
Date:   Sat Feb 4 23:47:06 2023 -0800

    Update metaformers.py

commit 366aae9304
Author: Fredo Guan <fredo.guan@hotmail.com>
Date:   Sat Feb 4 23:37:30 2023 -0800

    Stem/Downsample rework

commit 26a8e481a5
Author: Fredo Guan <fredo.guan@hotmail.com>
Date:   Wed Feb 1 07:42:07 2023 -0800

    Update metaformers.py

commit a913f5d438
Author: Fredo Guan <fredo.guan@hotmail.com>
Date:   Wed Feb 1 07:41:24 2023 -0800

    Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* channels first for whole network

* Channels first

* Update metaformers.py

* Use buffer for randformer

* Update metaformers.py

* Remove einsum

* don't test randformer for feature extraction

* arbitrary input sizes for randformer

* Squashed commit of the following:

commit 6c089ca4325ab10942fe56e0999dcc1a11e1d2f0
Author: Fredo Guan <fredo.guan@hotmail.com>
Date:   Mon Mar 6 02:11:17 2023 -0800

    Update metaformers.py

commit 521528a900e49ef8f462f5ccd795efb3a5d14214
Author: Fredo Guan <fredo.guan@hotmail.com>
Date:   Mon Mar 6 02:06:08 2023 -0800

    Update metaformers.py

commit 3827eec7963698ff727fbb13ace53594ceb374d5
Author: Fredo Guan <fredo.guan@hotmail.com>
Date:   Mon Mar 6 02:03:08 2023 -0800

    Update metaformers.py

commit ac1c6fea8adcd846e031ea0f5fa81ffe63d3c4bb
Author: Fredo Guan <fredo.guan@hotmail.com>
Date:   Mon Mar 6 02:01:04 2023 -0800

    Update metaformers.py

commit 26f3d343cdc46183543f83482187f669f3181ddf
Merge: d577129 f736730
Author: Fredo Guan <fredo.guan@hotmail.com>
Date:   Mon Mar 6 01:57:29 2023 -0800

    Merge branch 'metaformer_workspace' of https://github.com/fffffgggg54/pytorch-image-models into metaformer_workspace

commit d577129aaa23fb348a8bb93bcd17cf1d5a4e8ff8
Author: Fredo Guan <fredo.guan@hotmail.com>
Date:   Mon Mar 6 01:57:20 2023 -0800

    Update metaformers.py

commit f7367304e8f3b7a9a7f16e0a032bb72546afcc2a
Author: Fredo Guan <fredo.guan@hotmail.com>
Date:   Mon Mar 6 01:56:11 2023 -0800

    Metaformer baselines for vision (#12)

* formatting, cleanup, fix dropout

* fix regression, pass kwargs

* fix poolformerv1 weights, formatting

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* Update metaformers.py

* some cleanup

* SDPA from ViT, fix imports

* Update metaformers.py

* fix head reset

* fast norm bias patch for metaformers

* Metaformer refactor, remove rand/ident models, fix issues, remove old poolformer

* Switch to hub weights

---------

Co-authored-by: Fredo Guan <fredo.guan@hotmail.com>
2023-05-05 11:18:26 -07:00
..
__init__.py More models w/ multi-weight support, moving to HF hub. Removing inplace_abn from all models including TResNet 2023-04-20 22:44:49 -07:00
activations.py Major module / path restructure, timm.models.layers -> timm.layers, add _ prefix to all non model modules in timm.models 2022-12-06 15:00:06 -08:00
activations_jit.py Major module / path restructure, timm.models.layers -> timm.layers, add _ prefix to all non model modules in timm.models 2022-12-06 15:00:06 -08:00
activations_me.py Major module / path restructure, timm.models.layers -> timm.layers, add _ prefix to all non model modules in timm.models 2022-12-06 15:00:06 -08:00
adaptive_avgmax_pool.py All swin models support spatial output, add output_fmt to v1/v2 and use ClassifierHead. 2023-03-15 23:21:51 -07:00
attention_pool2d.py Add FlexiViT models and weights, refactoring, push more weights 2022-12-22 17:23:09 -08:00
blur_pool.py Major module / path restructure, timm.models.layers -> timm.layers, add _ prefix to all non model modules in timm.models 2022-12-06 15:00:06 -08:00
bottleneck_attn.py Major module / path restructure, timm.models.layers -> timm.layers, add _ prefix to all non model modules in timm.models 2022-12-06 15:00:06 -08:00
cbam.py Major module / path restructure, timm.models.layers -> timm.layers, add _ prefix to all non model modules in timm.models 2022-12-06 15:00:06 -08:00
classifier.py Final push to get remaining models using multi-weight pretrained configs, almost all weights on HF hub 2023-04-26 15:52:13 -07:00
cond_conv2d.py Major module / path restructure, timm.models.layers -> timm.layers, add _ prefix to all non model modules in timm.models 2022-12-06 15:00:06 -08:00
config.py fast_attn -> fused_attn, implement global config for enable/disable fused_attn, add to more models. vit clip openai 336 weights. 2023-04-10 12:04:33 -07:00
conv2d_same.py Add onnx utils and export code, tweak padding and conv2d_same for better dynamic export with recent PyTorch 2023-04-11 17:03:57 -07:00
conv_bn_act.py Final push to get remaining models using multi-weight pretrained configs, almost all weights on HF hub 2023-04-26 15:52:13 -07:00
create_act.py More models w/ multi-weight support, moving to HF hub. Removing inplace_abn from all models including TResNet 2023-04-20 22:44:49 -07:00
create_attn.py Major module / path restructure, timm.models.layers -> timm.layers, add _ prefix to all non model modules in timm.models 2022-12-06 15:00:06 -08:00
create_conv2d.py Major module / path restructure, timm.models.layers -> timm.layers, add _ prefix to all non model modules in timm.models 2022-12-06 15:00:06 -08:00
create_norm.py Add EfficientFormer-V2, refactor EfficientFormer and Levit for more uniformity across the 3 related arch. Add features_out support to levit conv models and efficientformer_v2. All weights on hub. 2023-02-03 14:12:29 -08:00
create_norm_act.py Major module / path restructure, timm.models.layers -> timm.layers, add _ prefix to all non model modules in timm.models 2022-12-06 15:00:06 -08:00
drop.py Major module / path restructure, timm.models.layers -> timm.layers, add _ prefix to all non model modules in timm.models 2022-12-06 15:00:06 -08:00
eca.py Major module / path restructure, timm.models.layers -> timm.layers, add _ prefix to all non model modules in timm.models 2022-12-06 15:00:06 -08:00
evo_norm.py Major module / path restructure, timm.models.layers -> timm.layers, add _ prefix to all non model modules in timm.models 2022-12-06 15:00:06 -08:00
fast_norm.py Metaformer baselines for vision (final PR with cleanup) (#1793) 2023-05-05 11:18:26 -07:00
filter_response_norm.py Major module / path restructure, timm.models.layers -> timm.layers, add _ prefix to all non model modules in timm.models 2022-12-06 15:00:06 -08:00
format.py All swin models support spatial output, add output_fmt to v1/v2 and use ClassifierHead. 2023-03-15 23:21:51 -07:00
gather_excite.py Major module / path restructure, timm.models.layers -> timm.layers, add _ prefix to all non model modules in timm.models 2022-12-06 15:00:06 -08:00
global_context.py Major module / path restructure, timm.models.layers -> timm.layers, add _ prefix to all non model modules in timm.models 2022-12-06 15:00:06 -08:00
grn.py Add ConvNeXt-V2 support (model additions and weights) (#1614) 2023-01-05 07:53:32 -08:00
halo_attn.py Major module / path restructure, timm.models.layers -> timm.layers, add _ prefix to all non model modules in timm.models 2022-12-06 15:00:06 -08:00
helpers.py Add FlexiViT models and weights, refactoring, push more weights 2022-12-22 17:23:09 -08:00
inplace_abn.py Major module / path restructure, timm.models.layers -> timm.layers, add _ prefix to all non model modules in timm.models 2022-12-06 15:00:06 -08:00
lambda_layer.py Major module / path restructure, timm.models.layers -> timm.layers, add _ prefix to all non model modules in timm.models 2022-12-06 15:00:06 -08:00
linear.py Major module / path restructure, timm.models.layers -> timm.layers, add _ prefix to all non model modules in timm.models 2022-12-06 15:00:06 -08:00
median_pool.py Major module / path restructure, timm.models.layers -> timm.layers, add _ prefix to all non model modules in timm.models 2022-12-06 15:00:06 -08:00
mixed_conv2d.py Major module / path restructure, timm.models.layers -> timm.layers, add _ prefix to all non model modules in timm.models 2022-12-06 15:00:06 -08:00
ml_decoder.py Major module / path restructure, timm.models.layers -> timm.layers, add _ prefix to all non model modules in timm.models 2022-12-06 15:00:06 -08:00
mlp.py Adding EVA02 weights and model defs, move beit based eva_giant to same eva.py file. Cleanup rotary pos, add lang oriented freq bands to be compat with eva design choice. Fix #1738 2023-03-27 17:16:07 -07:00
non_local_attn.py Major module / path restructure, timm.models.layers -> timm.layers, add _ prefix to all non model modules in timm.models 2022-12-06 15:00:06 -08:00
norm.py Torchscript fixes/hacks for rms_norm, refactor ParallelScalingBlock with manual combination of input projections, closer paper match 2023-02-16 16:57:42 -08:00
norm_act.py Final push to get remaining models using multi-weight pretrained configs, almost all weights on HF hub 2023-04-26 15:52:13 -07:00
padding.py Add onnx utils and export code, tweak padding and conv2d_same for better dynamic export with recent PyTorch 2023-04-11 17:03:57 -07:00
patch_dropout.py Implement patch dropout for eva / vision_transformer, refactor / improve consistency of dropout args across all vit based models 2023-04-07 20:27:23 -07:00
patch_embed.py Final push to get remaining models using multi-weight pretrained configs, almost all weights on HF hub 2023-04-26 15:52:13 -07:00
pool2d_same.py Major module / path restructure, timm.models.layers -> timm.layers, add _ prefix to all non model modules in timm.models 2022-12-06 15:00:06 -08:00
pos_embed.py Add FlexiViT models and weights, refactoring, push more weights 2022-12-22 17:23:09 -08:00
pos_embed_rel.py All swin models support spatial output, add output_fmt to v1/v2 and use ClassifierHead. 2023-03-15 23:21:51 -07:00
pos_embed_sincos.py Add onnx utils and export code, tweak padding and conv2d_same for better dynamic export with recent PyTorch 2023-04-11 17:03:57 -07:00
selective_kernel.py Major module / path restructure, timm.models.layers -> timm.layers, add _ prefix to all non model modules in timm.models 2022-12-06 15:00:06 -08:00
separable_conv.py Major module / path restructure, timm.models.layers -> timm.layers, add _ prefix to all non model modules in timm.models 2022-12-06 15:00:06 -08:00
space_to_depth.py Always some torchscript issues 2023-04-26 20:42:34 -07:00
split_attn.py Major module / path restructure, timm.models.layers -> timm.layers, add _ prefix to all non model modules in timm.models 2022-12-06 15:00:06 -08:00
split_batchnorm.py Major module / path restructure, timm.models.layers -> timm.layers, add _ prefix to all non model modules in timm.models 2022-12-06 15:00:06 -08:00
squeeze_excite.py Major module / path restructure, timm.models.layers -> timm.layers, add _ prefix to all non model modules in timm.models 2022-12-06 15:00:06 -08:00
std_conv.py Major module / path restructure, timm.models.layers -> timm.layers, add _ prefix to all non model modules in timm.models 2022-12-06 15:00:06 -08:00
test_time_pool.py Major module / path restructure, timm.models.layers -> timm.layers, add _ prefix to all non model modules in timm.models 2022-12-06 15:00:06 -08:00
trace_utils.py Major module / path restructure, timm.models.layers -> timm.layers, add _ prefix to all non model modules in timm.models 2022-12-06 15:00:06 -08:00
weight_init.py Major module / path restructure, timm.models.layers -> timm.layers, add _ prefix to all non model modules in timm.models 2022-12-06 15:00:06 -08:00