Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[91] Three things everyone should know about Vision Transformers #120

Open
dhkim0225 opened this issue Apr 19, 2022 · 0 comments
Open

[91] Three things everyone should know about Vision Transformers #120

dhkim0225 opened this issue Apr 19, 2022 · 0 comments
Labels

Comments

@dhkim0225
Copy link
Owner

dhkim0225 commented Apr 19, 2022

paper

Touvron 의 신작.

  1. 모듈들을 병렬로 잘 연결하자
  2. data 가 적으면 mhsa 만 튜닝해도 좋다
  3. 16 patchify layer 를 resnet-d 처럼 작은 stride 를 갖는 레이어들로 쪼개면 좋다. (multi-step 으로 달성시킨다)

ViT 의 특성을 잘 정리해 주었는데, 다음과 같다.

paramter 는 depth 에 비례, width 에 quadratic
FLOP 은 depth 에 비례, width 에 quadratic
Peak memory 는 depth 에는 constant, width 에 quadratic
latency 는 이론상 wide 한 게 더 좋은데, 꼭 그렇지는 않음.

Parallel ㄱㄱ

image

AS-IS
image

TO-BE
image

2개의 block 을 하나의 block 으로 합치는 형태이다.
공평하게 하기 위해서 36 block 와 비교할 때, 18x2 block 과 비교하는 식으로 실험이 진행된다.
image

LS 는 LayerScale 인데, 네트워크가 깊어질 수록 안정화시키는 장치이다.
learnable diagonal matrix 를 residual block output 에 더하는 것이고,
diangonal matrix 는 0으로 initialize 된다.
어떻게 보면 learnable 한 per-channel attention parameter라 보면 되겠다.

Data 적을 때는 attn 이 효과적이다.

image
image

patchifty 는 나눠서 진행하면 좋다.

image
image
image

@dhkim0225 dhkim0225 added the WIP label Apr 19, 2022
@dhkim0225 dhkim0225 changed the title Three things everyone should know about Vision Transformers [91] Three things everyone should know about Vision Transformers Apr 19, 2022
@dhkim0225 dhkim0225 added Meta AI and removed WIP labels Apr 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant