Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
renzhc
diffusers_dcu
Commits
78a78515
Commit
78a78515
authored
Sep 29, 2023
by
Patrick von Platen
Browse files
make style
parent
9c03a7da
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
src/diffusers/schedulers/scheduling_ddim_inverse.py
src/diffusers/schedulers/scheduling_ddim_inverse.py
+3
-1
tests/schedulers/test_scheduler_ddim_inverse.py
tests/schedulers/test_scheduler_ddim_inverse.py
+1
-1
No files found.
src/diffusers/schedulers/scheduling_ddim_inverse.py
View file @
78a78515
...
@@ -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
...
...
tests/schedulers/test_scheduler_ddim_inverse.py
View file @
78a78515
...
@@ -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
]):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment