mirror of
https://github.com/open-mmlab/mmclassification.git
synced 2025-06-03 21:53:55 +08:00
* [Squash] Refator ViT (from #295) * Use base variable to simplify auto_aug setting * Use common PatchEmbed, remove HybridEmbed and refactor ViT init structure. * Add `output_cls_token` option and change the output format of ViT and input format of ViT head. * Update unit tests and add test for `output_cls_token`. * Support out_indices. * Standardize config files * Support resize position embedding. * Add readme file of vit * Rename config file * Improve docs about ViT. * Update docstring * Use local version `MultiheadAttention` instead of mmcv version. * Fix MultiheadAttention * Support `qk_scale` argument in `MultiheadAttention` * Improve docs and change `layer_cfg` to `layer_cfgs` and support sequence. * Use init_cfg to init Linear layer in VisionTransformerHead * update metafile * Update checkpoints and configs * Imporve docstring. * Update README * Revert GAP modification.
17 lines
705 B
Python
17 lines
705 B
Python
# Copyright (c) OpenMMLab. All rights reserved.
|
|
from .attention import MultiheadAttention, ShiftWindowMSA
|
|
from .augment.augments import Augments
|
|
from .channel_shuffle import channel_shuffle
|
|
from .embed import HybridEmbed, PatchEmbed, PatchMerging
|
|
from .helpers import is_tracing, to_2tuple, to_3tuple, to_4tuple, to_ntuple
|
|
from .inverted_residual import InvertedResidual
|
|
from .make_divisible import make_divisible
|
|
from .se_layer import SELayer
|
|
|
|
__all__ = [
|
|
'channel_shuffle', 'make_divisible', 'InvertedResidual', 'SELayer',
|
|
'to_ntuple', 'to_2tuple', 'to_3tuple', 'to_4tuple', 'PatchEmbed',
|
|
'PatchMerging', 'HybridEmbed', 'Augments', 'ShiftWindowMSA', 'is_tracing',
|
|
'MultiheadAttention'
|
|
]
|