πŸŽ‰ 75% of content is free forever β€” Unlock Premium from $10/mo β†’
CW
Search courses…
πŸ’Ό Servicesℹ️ Aboutβœ‰οΈ ContactView Pricing Plansfrom $10

Consistency Distillation

Generative AIConsistency Distillation🟒 Free Lesson

Advertisement

Consistency Distillation

Module: Generative AI | Difficulty: Advanced

Consistency Distillation

Train student to match teacher's ODE trajectory:

Progressive Distillation

  1. Train teacher with steps
  2. Train student in 2 steps
  3. Student becomes new teacher
  4. Repeat times

One-Step Generation

class ConsistencyDistillation:
    def __init__(self, teacher, student, ema_decay=0.999):
        self.teacher = teacher
        self.student = student
        self.teacher_ema = EMA(teacher, ema_decay)
    def loss(self, x0, t1, t2):
        xt1 = self.add_noise(x0, t1)
        xt2 = self.add_noise(x0, t2)
        s1 = self.student(xt1, t1)
        with torch.no_grad():
            s2 = self.teacher_ema(xt2, t2)
        return ((s1 - s2)**2).mean()
StepsFID (Consistency)FID (Progressive)
14.128.3
23.455.1
43.214.2
83.113.6

Need Expert Generative AI Help?

Get personalized tutoring, project support, or professional consulting.

Advertisement