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
21ceda3f
Commit
21ceda3f
authored
Aug 22, 2022
by
anton-l
Browse files
Remove duplicate add_noise
parent
5321f3e2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
10 deletions
+1
-10
src/diffusers/schedulers/scheduling_lms_discrete.py
src/diffusers/schedulers/scheduling_lms_discrete.py
+0
-9
src/diffusers/utils/__init__.py
src/diffusers/utils/__init__.py
+1
-1
No files found.
src/diffusers/schedulers/scheduling_lms_discrete.py
View file @
21ceda3f
...
...
@@ -130,14 +130,5 @@ class LMSDiscreteScheduler(SchedulerMixin, ConfigMixin):
noisy_samples
=
(
alpha_prod
**
0.5
)
*
original_samples
+
((
1
-
alpha_prod
)
**
0.5
)
*
noise
return
noisy_samples
def
add_noise
(
self
,
original_samples
,
noise
,
timesteps
):
sqrt_alpha_prod
=
self
.
alphas_cumprod
[
timesteps
]
**
0.5
sqrt_alpha_prod
=
self
.
match_shape
(
sqrt_alpha_prod
,
original_samples
)
sqrt_one_minus_alpha_prod
=
(
1
-
self
.
alphas_cumprod
[
timesteps
])
**
0.5
sqrt_one_minus_alpha_prod
=
self
.
match_shape
(
sqrt_one_minus_alpha_prod
,
original_samples
)
noisy_samples
=
sqrt_alpha_prod
*
original_samples
+
sqrt_one_minus_alpha_prod
*
noise
return
noisy_samples
def
__len__
(
self
):
return
self
.
config
.
num_train_timesteps
src/diffusers/utils/__init__.py
View file @
21ceda3f
...
...
@@ -28,12 +28,12 @@ from .import_utils import (
DummyObject
,
is_flax_available
,
is_inflect_available
,
is_modelcards_available
,
is_scipy_available
,
is_tf_available
,
is_torch_available
,
is_transformers_available
,
is_unidecode_available
,
is_modelcards_available
,
requires_backends
,
)
from
.logging
import
get_logger
...
...
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