4.5.13 · HinglishGenerative Models

Score-based generative models

2,329 words11 min readRead in English

4.5.13 · AI-ML › Generative Models

Score Function Kya Hai?

Log probability ka gradient kyun?

Isko first principles se derive karte hain. Maano hamare paas hai jahan partition function hai.

Kyunki ka par depend nahi karta:

Jaadu: Intractable normalization constant gayab ho jaata hai! Isliye score-based models powerful hain — hume kabhi compute ya estimate nahi karna padta.

Figure — Score-based generative models

Score Matching: Score Ko Seekhna

Problem: Hume pata nahi! Yahi toh hum learn karne ki koshish kar rahe hain.

Denoising Score Matching

Breakthrough yeh hai: Hum scores ko estimate kar sakte hain noise add karke aur denoising seekh ke.

Scratch se Derivation:

  1. Gaussian noise add karo: jahan
  2. Perturbed distribution hai
  3. Marginal hai

Key insight: Gaussian noise ke liye, ka score hai:

Ek Gaussian ke liye, hamare paas hai:

ke respect mein gradient lete hain:

Apne case mein apply karte hain (, , ):

Yeh kyun kaam karta hai: Denoising seekhne se, network implicitly noise level par score function seekh leta hai.

Multi-Scale Score Matching

Real data high-dimensional space mein low-dimensional manifolds par rehti hai. Ek akela noise level poori distribution ko achhi tarah cover nahi karega.

Multiple scales kyun?

  • Bada : Connectivity ensure karta hai, koi isolated modes nahi
  • Chhota : Fine data structure capture karta hai
  • Interpolation: Scales ke beech smooth transition

Langevin Dynamics se Sampling

Jab hamare paas score function aa jaata hai, hum Langevin MCMC use karke samples generate karte hain:

Derivation: Yeh Langevin SDE se aata hai: jahan ek Wiener process hai. Step size ke saath discretize karte hain:

noise term kyun? Yeh diffusion term ka discretization hai. ka variance time ke upar hota hai, toh step ke upar yeh ho jaata hai.

Annealing schedule: (coarse) se shuru karo, gradually (fine) tak kam karo. Yeh ensure karta hai:

  1. High-noise regime mein initial exploration
  2. Low-noise regime mein refinement
  3. Local minima se bachna

Diffusion Models Se Connection

Derivation: Diya hua , conditional distribution hai:

Score hai:

Isliye, predict karna seekhna score seekhne ke equivalent hai.

Recall 12-saal ke bacche ko explain karo

Socho tum pahaadon mein ghere ho ghane kohere mein. Tum woh valley nahi dekh sakte jahan tumhe jaana hai, lekin tumhare paas ek jadui compass hai jo hamesha neeche ki taraf point karta hai.

Score-based models us compass ki tarah hain. Har pahaad ki exact shape yaad karne ki koshish karne ke bajay (jo impossible hoga), hum ek "kaun si taraf neeche hai" function seekhte hain har jagah ke liye. Phir valley tak pahunchne ke liye (realistic data generate karne ke liye), hum kahin bhi random se shuru karte hain aur compass follow karte hue neeche jaate hain, chhote chhote steps lete hue.

Trick yeh hai ki hum yeh compass ek game khel ke seekhte hain: hum real valley locations lete hain, unhe pahaad ke upar randomly uchhal dete hain (noise add karte hain), phir apne compass ko train karte hain ki woh wapas wahin point kare jahan se woh aaye the. Yeh kaam hazaaron baar alag alag heights par (noise levels) karne se, hamaara compass har jagah sahi direction seekh leta hai.

Connections

  • Diffusion Models: Score-based models discrete diffusion ka continuous-time limit hain
  • VAE: Dono latent structures seekhte hain, lekin scores directly model karta hai encoder-decoder ke bajay
  • GAN: Dono samples generate karte hain, lekin scores gradients use karta hai adversarial training ke bajay
  • Energy-Based Models: Score energy function ka gradient hai
  • Langevin Dynamics: Generation ke liye use hone wala MCMC sampling procedure
  • Stochastic Differential Equations: Modern formulation diffusion ko reverse-time SDE ki tarah treat karta hai

#flashcards/ai-ml

Score-based generative models mein score function kya hota hai? :: Log-probability ka gradient: . Yeh increasing probability density ki direction mein point karta hai.

Hum density ki jagah score kyun model karte hain?
(1) mein intractable normalization constant log ka gradient lete waqt cancel ho jaata hai. (2) Scores aksar high dimensions mein estimate karna aasaan hota hai.
Denoising score matching ki key insight kya hai?
Data mein Gaussian noise add karo. Noised distribution ka score hai , jo hum directly compute kar sakte hain aur training target ki tarah use kar sakte hain.

Denoising score matching objective likho :: jahan .

Score-based models mein multiple noise scales kyun use karte hain?
(1) Bada poore space ki coverage ensure karta hai. (2) Chhota fine data details capture karta hai. (3) Intermediate scales gap bridge karte hain, mode collapse aur poor mixing se bachte hain.
Annealed Langevin dynamics kya hai?
Ek MCMC sampling procedure jo high noise se shuru hota hai aur progressively low noise tak jaata hai, har level par run karta hai: jahan .
Score matching loss ko se weight kyun karte hain?
Weighting ke bina, chhota (bade scores) gradient dominate karta hai. se weight karna loss ko scale-invariant banata hai aur saare noise levels mein learning balance karta hai.
Score-based models aur diffusion models kaise related hain?
Diffusion mein, . Score hai . Toh noise predict karna (diffusion objective) score predict karne ke equivalent hai (ek scale factor tak).
Score matching mein minimize ki jaane wali Fisher divergence kya hai?
. Yeh model score aur true score ke beech squared difference measure karta hai, data distribution ke upar average karke.
Langevin dynamics mein noise term kyun aata hai?
Yeh Langevin SDE ko discretize karne se aata hai. Diffusion term ka variance time step ke upar hota hai, toh discrete step ke upar yeh ho jaata hai.

Concept Map

hard to learn with Z

definition

Z cancels

learn via

minimizes

problem: true score unknown

solved by

add Gaussian noise

Gaussian score

tractable target for

follow uphill from noise

Density p of x

Score function grad log p

s of x = grad log p

No partition constant Z

Score Matching

Fisher divergence J theta

Cannot access grad log p_data

Denoising Score Matching

x tilde = x + sigma epsilon

grad log q = -epsilon over sigma

Generate realistic data