huggingface / huggingface/diffusers

Implementation error of v_prediction in eulara and eular

Aperta
#7,046 7 commenti 1 reazione 0 assegnatari Vedi su GitHub
stale
Lingua principale
Python
Stelle
34.5k
Fork
7.3k
Merge medio
3g 3h
PR unite (30g)
91

Descrizione

I came across a potential inconsistency in the implementation of v_prediction within the Euler scheduler when examining the source code. Specifically, in the computation of pred_original_sample, the formula is given as:
`pred_original_sample = model_output * (-sigma / (sigma**2 + 1) ** 0.5) + (sample / (sigma**2 + 1))`
Where sigma is calculated as:
`sigmas = np.array(((1 - self.alphas_cumprod) / self.alphas_cumprod) ** 0.5)`
Substituting the definition of sigma into the equation for pred_original_sample, we arrive at:
`pred_original_sample = sample * alphas_cumprod - model_output * ((1-alphas_cumprod) ** 0.5)`
Here, it appears that `sample * alphas_cumprod` is missing a square root operation on `alphas_cumprod`. Shouldn't this be `sample * (alphas_cumprod**0.5)`? This seems to be an inconsistency, especially considering that in the DDIM scheduler as in
`(alpha_prod_t**0.5) * sample - (beta_prod_t**0.5) * model_output`.
Could this be an error?

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.