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
feaa7324
Unverified
Commit
feaa7324
authored
Oct 10, 2022
by
Nathan Lambert
Committed by
GitHub
Oct 10, 2022
Browse files
add sigmoid betas (#777)
* add sigmoid betas * convert to torch * add comment on source
parent
a73f8b72
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
src/diffusers/schedulers/scheduling_ddpm.py
src/diffusers/schedulers/scheduling_ddpm.py
+4
-0
No files found.
src/diffusers/schedulers/scheduling_ddpm.py
View file @
feaa7324
...
@@ -133,6 +133,10 @@ class DDPMScheduler(SchedulerMixin, ConfigMixin):
...
@@ -133,6 +133,10 @@ class DDPMScheduler(SchedulerMixin, ConfigMixin):
elif
beta_schedule
==
"squaredcos_cap_v2"
:
elif
beta_schedule
==
"squaredcos_cap_v2"
:
# Glide cosine schedule
# Glide cosine schedule
self
.
betas
=
betas_for_alpha_bar
(
num_train_timesteps
)
self
.
betas
=
betas_for_alpha_bar
(
num_train_timesteps
)
elif
beta_schedule
==
"sigmoid"
:
# GeoDiff sigmoid schedule
betas
=
torch
.
linspace
(
-
6
,
6
,
num_train_timesteps
)
self
.
betas
=
torch
.
sigmoid
(
betas
)
*
(
beta_end
-
beta_start
)
+
beta_start
else
:
else
:
raise
NotImplementedError
(
f
"
{
beta_schedule
}
does is not implemented for
{
self
.
__class__
}
"
)
raise
NotImplementedError
(
f
"
{
beta_schedule
}
does is not implemented for
{
self
.
__class__
}
"
)
...
...
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