timm documentation

MLP-Mixer, ResMLP 및 gMLP

You are viewing main version, which requires installation from source. If you'd like regular pip install, checkout the latest stable version (v1.0.31).
Hugging Face's logo
Join the Hugging Face community

and get access to the augmented documentation experience

to get started

MLP-Mixer, ResMLP 및 gMLP

카테고리: MLP · 코드: timm/models/mlp_mixer.py · 아키텍처: 15 · 프리트레인드 가중치: 19 (ImageNet-1k 결과가 포함된 14개)

패치 간 토큰 믹싱과 채널 믹싱을 번갈아 사용하는 All-MLP 아키텍처: MLP-Mixer, ResMLP 및 gMLP(공간 투영을 통한 게이팅). 모듈 docstring에는 gMLP 구현이 검증되지 않았다고 명시되어 있습니다.

논문

사용

사전 학습된 가중치 로드, 이미지 전처리 및 파인튜닝에 대해서는 Quickstart를, 모델을 백본으로 사용하는 방법에 대해서는 Feature Extraction을 참고하세요.

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

모델 API 지원

기능MlpMixer
features_only=True feature map✓ (strides 16, 16, 16)
forward_intermediates()✓
prune_intermediate_layers()✓
입력 크기 무관, 변경 불필요✗
set_input_size()✗
dynamic_img_size=True✗
set_grad_checkpointing()✓
레이어별 LR 감쇠(group_matcher())✓
reset_classifier()✓

✓ 지원됨, ✓ (정사각형) 정사각형 크기만 작동, ✗ 미지원, – 필요 없음(모델이 이미 모든 입력 크기를 허용함). 무작위로 초기화된 모델(MlpMixer의 gmlp_ti16_224, 224)에서 각 기능을 실행하여 확인했습니다. 같은 클래스의 다른 아키텍처도 동일한 동작을 하는 것으로 예상됩니다. 자세한 내용은 Model API 페이지를 참조하세요.

아키텍처

아키텍처매개변수 (M)GMAC입력 크기사전 학습된 가중치
gmixer_12_22412.702.672240
gmixer_24_22424.725.282241
gmlp_b16_22473.0815.782240
gmlp_s16_22419.424.422241
gmlp_ti16_2245.871.342240
mixer_b16_22459.8812.622244
mixer_b32_22460.293.242240
mixer_l16_224208.2044.602242
mixer_l32_224206.9411.272240
mixer_s16_22418.533.792240
mixer_s32_22419.101.002240
resmlp_12_22415.353.012243
resmlp_24_22430.025.962243
resmlp_36_22444.698.912242
resmlp_big_24_224129.14100.232243

GMACs와 매개변수 수는 각 아키텍처의 기본 입력 크기 및 분류기에 대한 값이며, 벤치마크 결과에서 가져왔습니다.

사전 학습된 가중치

Top-1은 results-imagenet.csv에 나열된 평가 크기에서 측정된 ImageNet-1k 검증 정확도입니다. - 가중치에 ImageNet-1k 결과가 없는 경우(예: 사전 학습 또는 이미지-텍스트 가중치)에는 표시하지 않습니다. Classes는 사전 학습된 분류기의 크기를 나타내며, 분류기가 없는 가중치의 경우 none입니다.

Weights는 소스에 따라 그룹화됩니다. 사전 학습 설정에 명시된 논문 또는 출처, 그렇지 않으면 timm가 아닌 Hub 조직, 그렇지 않으면 사전 학습 태그의 첫 번째 부분(architecture.tag)입니다. 단일 weight만 있는 소스는 other에 나열됩니다.

fb 태그

가중치입력 크기Top-1(%)평가 크기클래스라이선스Hub
resmlp_12_224.fb_dino224--1000apache-2.0timm
resmlp_12_224.fb_distilled_in1k22477.9482241000apache-2.0timm
resmlp_12_224.fb_in1k22476.6602241000apache-2.0timm
resmlp_24_224.fb_dino224--1000apache-2.0timm
resmlp_24_224.fb_distilled_in1k22480.7662241000apache-2.0timm
resmlp_24_224.fb_in1k22479.3802241000apache-2.0timm
resmlp_36_224.fb_distilled_in1k22481.1502241000apache-2.0timm
resmlp_36_224.fb_in1k22479.7722241000apache-2.0timm
resmlp_big_24_224.fb_distilled_in1k22483.5942241000apache-2.0timm
resmlp_big_24_224.fb_in1k22481.0342241000apache-2.0timm
resmlp_big_24_224.fb_in22k_ft_in1k22484.4142241000apache-2.0timm

goog 태그

가중치입력 크기Top-1(%)평가 크기클래스라이선스Hub
mixer_b16_224.goog_in21k224--21843apache-2.0timm
mixer_b16_224.goog_in21k_ft_in1k22476.6162241000apache-2.0timm
mixer_l16_224.goog_in21k224--21843apache-2.0timm
mixer_l16_224.goog_in21k_ft_in1k22472.0842241000apache-2.0timm

miil 태그

가중치입력 크기Top-1(%)평가 크기클래스라이선스Hub
mixer_b16_224.miil_in21k224--11221apache-2.0timm
mixer_b16_224.miil_in21k_ft_in1k22482.3142241000apache-2.0timm

ra3 태그

가중치입력 크기Top-1(%)평가 크기클래스라이선스Hub
gmixer_24_224.ra3_in1k22478.0482241000apache-2.0timm
gmlp_s16_224.ra3_in1k22479.6522241000apache-2.0timm

인용

@article{tolstikhin2021,
  title={MLP-Mixer: An all-MLP Architecture for Vision},
  author={Tolstikhin, Ilya and Houlsby, Neil and Kolesnikov, Alexander and Beyer, Lucas and Zhai, Xiaohua and Unterthiner,
        Thomas and Yung, Jessica and Keysers, Daniel and Uszkoreit, Jakob and Lucic, Mario and Dosovitskiy, Alexey},
  journal={arXiv preprint arXiv:2105.01601},
  year={2021}
}

@misc{touvron2021resmlp,
      title={ResMLP: Feedforward networks for image classification with data-efficient training},
      author={Hugo Touvron and Piotr Bojanowski and Mathilde Caron and Matthieu Cord and Alaaeldin El-Nouby and
        Edouard Grave and Armand Joulin and Gabriel Synnaeve and Jakob Verbeek and Hervé Jégou},
      year={2021},
      eprint={2105.03404},
}

@misc{liu2021pay,
      title={Pay Attention to MLPs},
      author={Hanxiao Liu and Zihang Dai and David R. So and Quoc V. Le},
      year={2021},
      eprint={2105.08050},
}
Update on GitHub