-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Codebase Update via Noah's Refactored DDPM Notebook #64
Conversation
Updated DDPM with the Noah's refactored notebook version. Preemptively added p2_weighting, need to figure out if/how it works on bit sequences.
dim_mults=(1, 2, 4, 8), | ||
channels = 3, | ||
bits = BITS, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is BITS
? I'm assuming it's meant to be a type hint but it isn't defined anywhere in this script.
|
||
|
||
init_dim = default(init_dim, dim) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is default
?
src/models/diffusion/ddim.py
Outdated
return times | ||
|
||
@torch.no_grad() | ||
def ddim_sample(self, shape, classes, time_difference = None): | ||
def ddim_sample(self, shape, classes, time_difference=None): | ||
batch, device = shape[0], self.device | ||
|
||
time_difference = default(time_difference, self.time_difference) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, default
?
src/models/diffusion/ddim.py
Outdated
@@ -88,38 +91,42 @@ def ddim_sample(self, shape, classes, time_difference = None): | |||
|
|||
# get predicted noise | |||
|
|||
pred_noise = (img - alpha * x_start) / sigma.clamp(min = 1e-8) | |||
pred_noise = (img - alpha * x_start) / sigma.clamp(min=1e-8) | |||
|
|||
# calculate x next | |||
|
|||
img = x_start * alpha_next + pred_noise * sigma_next | |||
|
|||
return bits_to_decimal(img) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is bits_to_decimal
? some sorta utility function ?
The following modules have been updated: