Skip to content
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

Merged
merged 16 commits into from
Dec 23, 2022

Conversation

mateibejan1
Copy link
Collaborator

The following modules have been updated:

  1. Conditioned DDPM (with extra p2_weighting function for loss optimization, still need to figure out how to apply it to our use case).
  2. Diffusion base class.
  3. Metrics.

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,
Copy link
Collaborator

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)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is default ?

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)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, default ?

@@ -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)
Copy link
Collaborator

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 ?

@mateibejan1 mateibejan1 merged commit 7af7244 into codebase Dec 23, 2022
@cameronraysmith cameronraysmith deleted the codebase-nb-update branch March 21, 2023 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
codebase enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants