Commit 78a78515 authored by Patrick von Platen's avatar Patrick von Platen
Browse files

make style

parent 9c03a7da
...@@ -333,7 +333,9 @@ class DDIMInverseScheduler(SchedulerMixin, ConfigMixin): ...@@ -333,7 +333,9 @@ class DDIMInverseScheduler(SchedulerMixin, ConfigMixin):
""" """
# 1. get previous step value (=t+1) # 1. get previous step value (=t+1)
prev_timestep = timestep prev_timestep = timestep
timestep = min(timestep - self.config.num_train_timesteps // self.num_inference_steps, self.num_train_timesteps-1) timestep = min(
timestep - self.config.num_train_timesteps // self.num_inference_steps, self.num_train_timesteps - 1
)
# 2. compute alphas, betas # 2. compute alphas, betas
# change original implementation to exactly match noise levels for analogous forward process # change original implementation to exactly match noise levels for analogous forward process
......
...@@ -51,7 +51,7 @@ class DDIMInverseSchedulerTest(SchedulerCommonTest): ...@@ -51,7 +51,7 @@ class DDIMInverseSchedulerTest(SchedulerCommonTest):
scheduler_config = self.get_scheduler_config(steps_offset=1) scheduler_config = self.get_scheduler_config(steps_offset=1)
scheduler = scheduler_class(**scheduler_config) scheduler = scheduler_class(**scheduler_config)
scheduler.set_timesteps(5) scheduler.set_timesteps(5)
assert torch.equal(scheduler.timesteps, torch.LongTensor([ 1, 201, 401, 601, 801])) assert torch.equal(scheduler.timesteps, torch.LongTensor([1, 201, 401, 601, 801]))
def test_betas(self): def test_betas(self):
for beta_start, beta_end in zip([0.0001, 0.001, 0.01, 0.1], [0.002, 0.02, 0.2, 2]): for beta_start, beta_end in zip([0.0001, 0.001, 0.01, 0.1], [0.002, 0.02, 0.2, 2]):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment