Read the equation
The code subtracts √(1−α) times its predicted noise, divides by √α, and adds σ times fresh noise. It requires 0<α≤1. Under the usual DDPM noise-prediction convention, the reverse mean instead uses (1−αₜ)/√(1−ᾱₜ) as the predicted-noise coefficient; this helper lacks ᾱ and should be described as its own update unless the caller supplies a correspondingly rescaled prediction.
Terms & definitions
| Term | Meaning in this source |
|---|---|
| x_t | Current noisy vector |
| epsilon_theta | Supplied noise prediction |
| alpha | Per-step signal coefficient |
| sigma | Fresh-noise scale |
| z | Fresh noise |
How it works
Read the definition from its right-hand expression to the quantity on the left. Its surrounding source records the intended input, state, or parameter context. Where the source leaves an operation unspecified, this page preserves that gap.
Assumptions & limits
Source recovery establishes that the expression appears in this record. Its mathematical validity, implementation behavior, and interpretation must be assessed separately. See the linked source and research notes for the checks available for this version.
Original context
Read the surrounding source passage
}
result[i] = sqrtAlpha*x0[i] + sqrtOneMinusAlpha*n
}
return result
}
// ReverseDiffusion computes one step of reverse diffusion
// x_{t-1} = (x_t - √(1-α_t)ε_θ) / √α_t + σ_t z
func ReverseDiffusion(xt []float64, epsilonPred []float64, alpha, sigma float64, noise []float64) []float64 {
sqrtAlpha := math.Sqrt(alpha)
sqrtOneMinusAlpha := math.Sqrt(1.0 - alpha)
result := make([]float64, len(xt))
for i := range result {
eps := 0.0
if i < len(epsilonPred) {
eps = epsilonPred[i]
}Exact original notation
x_{t-1} = (x_t - √(1-α_t)ε_θ) / √α_t + σ_t z