Schedulers
beignet.diffusers.schedulers.AlphaFold3Scheduler
Bases: SchedulerMixin
AF3-style coordinate diffusion scheduler (paired with your DiffusionModule).
Uses the update scheme consistent with your SampleDiffusion:
t_hat = c_{τ-1} * (γ + 1)
ζ ∼ λ * sqrt(max(t_hat^2 - c_{τ-1}^2, 0)) * N(0, I)
x_{τ} = x_noisy + η * (c_τ - t_hat) * ((x_{τ-1} - x_denoised) / t_hat)
Args: schedule: 1-D tensor of shape (T+1,) with noise levels [c0,...,cT] gamma0: γ_0 (default 0.8) gamma_min: threshold: if c_τ > gamma_min → γ=γ_0 else 0 noise_scale: λ (default 1.003) step_scale: η (default 1.5)
Source code in src/beignet/diffusers/schedulers/_alphafold3_scheduler.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
|
add_noise
add_noise(x_clean, t_index)
Build x_noisy and t_hat from clean x at schedule index t_index
(>=1).
Args: x_clean: (B, N, 3) t_index: int or (B,) int tensor with values in [1, T] Returns: x_noisy: (B, N, 3) t_hat : (B,) time scalars matching AF3 equations
Source code in src/beignet/diffusers/schedulers/_alphafold3_scheduler.py
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
|
step
step(x_denoised, x_noisy, x_prev_ref, t_index)
One sampler update: delta = (x_{τ-1} - x̂) / t_hat x_τ = x_noisy + η * (c_τ - t_hat) * delta
Source code in src/beignet/diffusers/schedulers/_alphafold3_scheduler.py
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
|