Skip to content

Commit

Permalink
add preliminary karras unet 3d for @QuantPrincess at #295
Browse files Browse the repository at this point in the history
  • Loading branch information
lucidrains committed Feb 23, 2024
1 parent e39893b commit 3a3ab1b
Show file tree
Hide file tree
Showing 4 changed files with 710 additions and 17 deletions.
3 changes: 2 additions & 1 deletion denoising_diffusion_pytorch/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@
InvSqrtDecayLRSched
)

from denoising_diffusion_pytorch.karras_unet_1d import KarrasUnet1D
from denoising_diffusion_pytorch.karras_unet_1d import KarrasUnet1D
from denoising_diffusion_pytorch.karras_unet_3d import KarrasUnet3D
15 changes: 0 additions & 15 deletions denoising_diffusion_pytorch/karras_unet_1d.py
Original file line number Diff line number Diff line change
Expand Up @@ -693,21 +693,6 @@ def forward(self, x):

return x

# works best with inverse square root decay schedule

def InvSqrtDecayLRSched(
optimizer,
t_ref = 70000,
sigma_ref = 0.01
):
"""
refer to equation 67 and Table1
"""
def inv_sqrt_decay_fn(t: int):
return sigma_ref / sqrt(max(t / t_ref, 1.))

return LambdaLR(optimizer, lr_lambda = inv_sqrt_decay_fn)

# example

if __name__ == '__main__':
Expand Down
Loading

0 comments on commit 3a3ab1b

Please sign in to comment.