release ExVideo

This commit is contained in:
Artiprocher
2024-06-20 16:01:51 +08:00
parent b78ec9e086
commit 6e25864a3d
6 changed files with 259 additions and 50 deletions

View File

@@ -43,3 +43,17 @@ class ContinuousODEScheduler():
sigma = self.sigmas[timestep_id]
sample = (original_samples + noise * sigma) / (sigma*sigma + 1).sqrt()
return sample
def training_target(self, sample, noise, timestep):
timestep_id = torch.argmin((self.timesteps - timestep).abs())
sigma = self.sigmas[timestep_id]
target = (-(sigma*sigma + 1).sqrt() / sigma + 1 / (sigma*sigma + 1).sqrt() / sigma) * sample + 1 / (sigma*sigma + 1).sqrt() * noise
return target
def training_weight(self, timestep):
timestep_id = torch.argmin((self.timesteps - timestep).abs())
sigma = self.sigmas[timestep_id]
weight = (1 + sigma*sigma).sqrt() / sigma
return weight