Diffusion Model 背後的數學原理 感謝姜成翰同學大力協助
感謝姜成翰同學大力協助
基本概念 Forward Process Add noise Add noise Reverse Process Denoise Denoise
基本概念 Reverse Process Forward Process Add noise Denoise Denoise Add noise
VAE vs.Diffusion Model VAE Encoder Decoder XN Diffusion Add noise Denoise XN
VAE vs. Diffusion Model VAE Diffusion Encoder Decoder Denoise Add noise X N X N
Denoising Diffusion Probabilistic Models Algorithm 1 Training Algorithm 2 Sampling 1:repeat 1:xr~W(0,I) 2:x0~q(x0) 3:Uniform({1,...,T]) 2:fort=T;...,1 do 4: e~W(0,I) 3:z N(0,I)ift 1,elsez=0 5:Take gradient descent step on 4: x-1=点(x-器(x,)+z Volle-Eo(vaixo+VI-aie,t)l2 5:end for 6:until converged 6:return xo 暗藏玄機!
Denoising Diffusion Probabilistic Models 暗藏玄機!
Training xo:clean image noise Algorithm 1 Training 1:repeat 2:xo ~g(xo)+..sample clean image 3:Uniform({1,...,T}) 4: E~(0,I)..sample a noise 5: Take gradient descent step on Volle co(/arxo v1-arg,t)2 a1,a2…T 6:until converged Noisy image smaller Target Noise Noise predictor
Training 𝑥0: clean image sample clean image sample a noise Noise predictor Target Noise Noisy image 𝛼ത1, 𝛼ത2,… 𝛼ത𝑇 𝜀: noise smaller
Training a1,a2.a7 Sample t -at Noise ◆????◆ Predicter
Training 𝛼ത1, 𝛼ത2,… 𝛼ത𝑇 𝑥0 𝜀 𝛼ത𝑡 + 1 − 𝛼ത𝑡 = Noise Predicter t ????? 𝜀 𝑥 𝜀 0 Sample 𝑡
想像中… input Random ground sample truth Step 1 Step 2 input 實際上… 一t Xo E ground input truth
想像中 … 實際上 … Step 1 Step 2 Random sample + + …… input input ground truth 𝛼ത𝑡 + 1 − 𝛼ത𝑡 = 𝑥 𝜀 0 ground truth input
Inference Algorithm 2 Sampling 1:xr~W(0,I) 2:fort=T....,1 do 3: zN(0,I)if t 1,else=0 sample a noise?! 4: Xt-1=Vai (x-器ex,)+1z XT 5:end for 1a2.瓦T 6:return xo C1,02…CT 1 1-0t 1-at Xt-1 Noise Z Predicter
Inference 𝑡 Noise Predicter - 𝑥𝑇 𝑥𝑡 1 − 𝛼𝑡 1 − 𝛼ത𝑡 1 𝛼𝑡 𝑥𝑡−1 𝑧 + sample a noise?! 𝛼ത1, 𝛼ത2,… 𝛼ത𝑇 𝛼1, 𝛼2,… 𝛼𝑇
影像生成模型本質上的共同目標 Real Image Network G(z)=x
影像生成模型本質上的共同目標 Network 𝑧 𝑥 Real Image 𝐺 𝑧 = 𝑥
影像生成模型本質上的共同目標 Real Image Network 一隻在奔跑的狗 (Condition)
影像生成模型本質上的共同目標 Network 𝑧 𝑥 Real Image 一隻在奔跑的狗 (Condition)