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
135acd83
Commit
135acd83
authored
Jun 26, 2022
by
Patrick von Platen
Browse files
fix bug
parent
433cb3f8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
src/diffusers/schedulers/scheduling_sde_ve.py
src/diffusers/schedulers/scheduling_sde_ve.py
+2
-3
No files found.
src/diffusers/schedulers/scheduling_sde_ve.py
View file @
135acd83
...
@@ -24,13 +24,12 @@ from .scheduling_utils import SchedulerMixin
...
@@ -24,13 +24,12 @@ from .scheduling_utils import SchedulerMixin
class
ScoreSdeVeScheduler
(
SchedulerMixin
,
ConfigMixin
):
class
ScoreSdeVeScheduler
(
SchedulerMixin
,
ConfigMixin
):
def
__init__
(
self
,
snr
=
0.15
,
sigma_min
=
0.01
,
sigma_max
=
1348
,
N
=
2
,
sampling_eps
=
1e-5
,
tensor_format
=
"np"
):
def
__init__
(
self
,
snr
=
0.15
,
sigma_min
=
0.01
,
sigma_max
=
1348
,
sampling_eps
=
1e-5
,
tensor_format
=
"np"
):
super
().
__init__
()
super
().
__init__
()
self
.
register_to_config
(
self
.
register_to_config
(
snr
=
snr
,
snr
=
snr
,
sigma_min
=
sigma_min
,
sigma_min
=
sigma_min
,
sigma_max
=
sigma_max
,
sigma_max
=
sigma_max
,
N
=
N
,
sampling_eps
=
sampling_eps
,
sampling_eps
=
sampling_eps
,
)
)
...
@@ -54,7 +53,7 @@ class ScoreSdeVeScheduler(SchedulerMixin, ConfigMixin):
...
@@ -54,7 +53,7 @@ class ScoreSdeVeScheduler(SchedulerMixin, ConfigMixin):
def
step_pred
(
self
,
result
,
x
,
t
):
def
step_pred
(
self
,
result
,
x
,
t
):
t
=
t
*
torch
.
ones
(
x
.
shape
[
0
],
device
=
x
.
device
)
t
=
t
*
torch
.
ones
(
x
.
shape
[
0
],
device
=
x
.
device
)
timestep
=
(
t
*
(
2
-
1
)).
long
()
timestep
=
(
t
*
(
len
(
self
.
timesteps
)
-
1
)).
long
()
sigma
=
self
.
discrete_sigmas
.
to
(
t
.
device
)[
timestep
]
sigma
=
self
.
discrete_sigmas
.
to
(
t
.
device
)[
timestep
]
adjacent_sigma
=
torch
.
where
(
adjacent_sigma
=
torch
.
where
(
...
...
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