huggingface / huggingface/diffusers

Implementation error of v_prediction in eulara and eular

オープン
#7,046 コメント 7 件 リアクション 1 件 担当者 0 名 GitHub で見る
stale
主要言語
Python
スター
34.5k
フォーク
7.3k
平均マージ
3日 3時間
マージ済み PR(30日)
91

説明

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?

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

Euler scheduler の実装と pred_original_sample の計算箇所を特定する。報告された sigma の置換を、DDIM の式および scheduler の予測規約と照らし合わせて確認する。平方根が欠落しているかどうかを判断し、それに応じて実装を文書化または修正できれば完了とする。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
machine-learning
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。