Jungduri / MLPaperReivew

0 stars 0 forks source link

Soft Truncation: A Universal Training Technique of Score-based Diffusion Model for High Precision Score Estimation #12

Open Jungduri opened 1 year ago

Jungduri commented 1 year ago

official repo: https://github.com/Kim-Dongjun/Soft-Truncation

https://kimjy99.github.io/%EB%85%BC%EB%AC%B8%EB%A6%AC%EB%B7%B0/soft-truncation/ https://lilianweng.github.io/posts/2021-07-11-diffusion-models/#connection-with-stochastic-gradient-langevin-dynamics https://www.youtube.com/watch?v=uFoGaIVHfoE&t=411s https://theaisummer.com/diffusion-models/#the-reparameterization-trick-tractable-closed-form-sampling-at-any-timestep

Jungduri commented 1 year ago

생성모델이란?

Generative model

Jungduri commented 1 year ago

Overview of diffusion model

image

위의 그림처럼 diffusion model foward와 backward를 가지고 있습니다.

첫번째는 foward path는 given image에 대해서 latent vector를 계산하는 과정입니다. latent vector를 target value y로 폭넓게 해석하면 inference 과정에 해당한다고 볼 수 있습니다.

두번째 Backward 과정은 given target value y(latent value)로 부터 input 이미지를 생성하는 과정입니다. 이미 학습을 통해서 모델 분포와 데이터 분포를 어느정도 맞추었기 때문에 모델은 데이터 분포와 비슷한 입력으로 데이터를 생성해줄 수 있을거라고 기대 할 수 있습니다.

Diffusion vs Hierarchical AVE의 공통점과 차이점

다른 관점에서 봤을때 q(x_t|x_t-1) 가우시간 분포로 매우 좋은 모델링을 제공할 수 있기 때문에 모델링 측면에서도 데이터 분포를 설명하기 조금 더 용이한 모델이 됩니다.

Jungduri commented 1 year ago

[breif review] Deep unsupervised learning using nonequilibrium thermodynamics

아무리 생각해도 더 이상 논문의 내용을 보는 것은 의미가 없다고 판단했습니다. 이유는, 도무지 저자가 이야기하는 reasoning의 행간이 읽히지 않기 때문입니다. 그래서 Diffusion model의 history를 이해하는 것이 필요하다고 판단이 되어서 해당 논문을 간단하게 나마 리뷰합니다.


이 논문은 diffusion model의 시초가 되는 논문입니다.


Trade-off

대부분의 확률 모델들은 tractability와 flexibility의 trade-off 관계를 가지고 있습니다.

Tractability(다루기 쉬움)은 Gaussian이나 Laplace 같은 확률 모델로 분석적으로 데이터가 평가되면서 model의 분포와 data 분포가 일치 될 수 있습니다. 일반적으로는 데이터 분포가 우리가 fit하고자 하는 model에 일치할 것이라는 직관(혹은 믿음)에서 시작합니다.

Flexibility(유연성) 임의의 입력에 대해 모델이 fit할 것이라고 생각하고 표현성이 넓은 모델을 만듭니다. 우리가 알고 있는 대부분 VAE, GAN과 같은 생성모델이 이렇습니다.

Diffusion probabilistic models

아래와 같은 목표를 위해 모델이 설계 되었습니다.

  1. extreme flexibility in model structure,
  2. exact sampling(tractability),
  3. easy multiplication with other distributions, e.g. in order to compute a posterior, and
  4. the model log-likelihood, and the probability of individual states, to be cheaply evaluated.

non-equilibrium statistical physics과 sequential Monte Carlo에서 영감을 받아 Markov chain을 기본적으로 사용합니다. Generative Markov chain를 설계하여 우리가 알고 있는 분포(Gaussian)를 모르는 분포(data)로 전환하는 방법을 가능하게 합니다.

Forward

데이터 x0에 대한 분포를 q(x0)라고 하고 최종적으로 pi(y)라는 우리가 잘 알고 있는 분포로 만드는 것이 목표입니다. image

Backward

Gaussian과 binomial diffusion에서 아주 작은 beta를 갖고 있을때 forward 과정과 같은 분포를 가질 수 있습니다. (Feller, 1949)

image

Model Probability

데이터 x0에 대해서 생성 모델의 확률 분포는 아래와 같이 정의 될 수 있습니다.

image image

Training

학습하는 과정은 모든 x에 대해서 두개의 모델 분포의 유사도를 최대화하는 방향으로 진행됩니다.

image

Beta selection

여러 논문에서 제시하듯, Guassian diffusion process에서는 beta를 점진적으로 감소시켜야 합니다. 이 내용은 본문을 실험하면서도 증명된 사실이며, b0에서 발생한 노이즈 레벨이 process가 진행되면서 frozen noise의 형태로 띄게 해주어야 합니다.