This commit is contained in:
Cédric Deltheil 2023-10-21 11:30:31 +02:00 committed by Cédric Deltheil
parent e70dee987e
commit fc71e900a0

View file

@ -56,9 +56,7 @@ class DDPM(Scheduler):
else tensor(1, device=self.device)
)
current_factor = current_cumulative_factor / previous_cumulative_scale_factor
estimated_denoised_data = (
x - (1 - current_cumulative_factor) ** 0.5 * noise
) / current_cumulative_factor**0.5
estimated_denoised_data = (x - (1 - current_cumulative_factor) ** 0.5 * noise) / current_cumulative_factor**0.5
estimated_denoised_data = estimated_denoised_data.clamp(-1, 1)
original_data_coeff = (previous_cumulative_scale_factor**0.5 * (1 - current_factor)) / (
1 - current_cumulative_factor