Git Product home page Git Product logo

Comments (3)

subinium avatar subinium commented on June 2, 2024

Abstract

  • BERT, GPT 등의 NLP의 대규모 모델은 비지도 학습으로 성공했는데, 이미지는 왜 pre-trained 지도학습이 더 잘될까?
    • 데이터의 특성의 차이가 클 것으로 생각
    • 자연어는 word, sub-word unit 등 discrete한 tokenized dictionaries를 구성할 수 있고 이게 비지도 학습의 베이스. (라고 생각)
    • 이미지는 연속적이고 매우 고차원이라 단어처럼 구조화시킬 수 없다. (뭔가 게슈탈트처럼(?) 빼내는 모델은 없을까. 고민고민)
    • 근데 이미지에서 contrastive loss를 사용하여 비지도학습 결과가 좀 보여서 이를 대규모 데이터로 발전시킨 것이 핵심

Contrastive Learning

  • query와 비슷한 positive key에서는 유사하고, query와 다른 negative key와는 달라야 loss가 줄어드는 방법론
    • 댕댕이 사진이라면 댕댕이스러워야하고, 고먐미랑은 달라야 한다는 것.
  • 인력과 척력을 사용하는 느낌으로 해석 (뭔가 랩세미나에서 dimension reduction 관련해서 이거와 유사하게 하는 걸 들은 거 같은데)
  • 유사도는 dot product로 계산, InfoNCE라는 loss를 사용

Momentum Contrast

연속적인 속성을 가지는 이미지를 discrete한 사전을 만들려면 어떻게 해야할까?

  • Dictionary as a quque
    • 이미지 자체로 딕셔너리 만드면 커다란 컬러 픽셀과 다를 바 없다. 이미지 블록을 key로 만드는 인코딩이 필요
    • 인코더를 만들고 계속 학습시켜 좋은 인코더를 만든다.
    • 초반에 모든 데이터 구성을 딕셔너리로 만들려면 딕셔너리가 엄청 커야한다. (연속적인 이미지의 특징을 다 담기 위해서는)
    • 그래서 딕셔너리를 queue로 만든다. 오래된 key는 버리고, 새로운 key를 추가하는 것이다. (미니 배치 단위로 진행)
    • 오래된 키는 버려도 된다. 이때 인코딩된 키들은 어짜피 최신키랑 또 다르기 때문
  • Momentum update
    • 큐는 좋은 아이디어지만, back-propagation으로 키 인코더 학습이 어렵다. (큐 모든 샘플에 gradient 전달? ㅗㅜㅑ)
    • 그럼 큐 인코더의 파라미터를 그대로 쓰면 되지 않을까? -> 했더니 망함
    • key representations' consistency를 급격하게 줄여서 망한 것으로 가정. 그럼 점진적으로 업데이트 해보자.
    • 모멘텀 업데이트를 진행하자. (기존 키인코더 * 0.999) + (큐인코더 * 0.001) 로 했더니 잘됨!
    • 식을 보면 알 수 있듯이 큐인코더만으로 계속 키인코더를 조금씩 업데이트 함
  • Relations to previous mechanisms : 다른 2가지 방법과 비교
    • end2end : 큐/키 인코더를 한 번에 업데이트 하는 것. OOM(Out-of-Memory)각.
    • memory bank : 미니 배치마다 모든 데이터를 한번에 랜덤 샘플 키로 만들어 딕셔너리 구성하고, 큐만 업데이트 하는 것.
      • 이러면 큐 인코더는 마지막 랜덤 샘플된 키에 대한 것이므로 비효울적.
      • 그리고 이러면 대규모 데이터에 대해 할 수 없음
    • 결론 : 성능도 그렇고 모멘텀쓴 우리가 짱이다.

Pretext Tasks

Pretext task란 모델의 해결을 확인하기 위해 사용자가 정의하는 테스크를 의미한다.

  • 이미지를 augmente해서 같은 이미지에서 생성됬는가 아닌가를 classification하는 걸로 모델 측정
  • ResNet + L2-norm으로 output-vector만듬 (이게 key, queue)
  • 해보니 Batch Normalization이 안좋더라 (뭔가 loss만 낮게 나오게 학습하는데 이게 batch간 정보가 leak되서 그런듯한 느낌)
  • 그래서 Shuffling BN을 사용했다. key encoder에서 GPU 할당하기 전에 mini-batch shuffle, 그리고 인코딩 후 다시 복구.
    • 서로 다른 인코더로 만들어진 key를 사용
    • 이건 multi-gpu 훈련 방식을 기본적으로 이해하면 더 도움이 된다. link

from deep-papers.

subinium avatar subinium commented on June 2, 2024

ETC

  • InfoNCE,,,이해하고 싶게 생긴 수식,,,

    • InfoNCE 식은 softmax + cross entropy처럼 생겼습니다. 왜 쓰는지 느낌만 대충 오는...?
    • InfoNCE loss를 최소화하면 mutual information의 lower_bound를 최대화한다고 한다(???)
    • 관련하여 다음 논문을 읽어볼 예정 Representation Learning with Contrastive Predictive Coding
  • pseudocode를 pytorch 스타일로 적는 논문이 있다.(신기)

  • 나만 이 논문이 지나치게 함축되어 쓴 글처럼 읽히는걸까. 내용 자체가 어려운 건 아닌데 서술이 너무 별로다.

from deep-papers.

subinium avatar subinium commented on June 2, 2024

도움되는 자료

from deep-papers.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.