mirror of
https://github.com/wassname/denoising-diffusion-pytorch.git
synced 2026-09-11 12:11:43 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f900f40f14 |
@@ -5,7 +5,7 @@ import torch.nn.functional as F
|
|||||||
from torch.special import expm1
|
from torch.special import expm1
|
||||||
|
|
||||||
from tqdm import tqdm
|
from tqdm import tqdm
|
||||||
from einops import rearrange, repeat
|
from einops import rearrange, repeat, reduce
|
||||||
from einops.layers.torch import Rearrange
|
from einops.layers.torch import Rearrange
|
||||||
|
|
||||||
# helpers
|
# helpers
|
||||||
@@ -268,7 +268,7 @@ class ContinuousTimeGaussianDiffusion(nn.Module):
|
|||||||
model_out = self.denoise_fn(x, log_snr)
|
model_out = self.denoise_fn(x, log_snr)
|
||||||
|
|
||||||
losses = self.loss_fn(model_out, noise, reduction = 'none')
|
losses = self.loss_fn(model_out, noise, reduction = 'none')
|
||||||
losses = losses.mean(dim = tuple(range(1, losses.ndim)))
|
losses = reduce(losses, 'b ... -> b', 'mean')
|
||||||
|
|
||||||
if self.p2_loss_weight_gamma >= 0:
|
if self.p2_loss_weight_gamma >= 0:
|
||||||
# following eq 8. in https://arxiv.org/abs/2204.00227
|
# following eq 8. in https://arxiv.org/abs/2204.00227
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ from setuptools import setup, find_packages
|
|||||||
setup(
|
setup(
|
||||||
name = 'denoising-diffusion-pytorch',
|
name = 'denoising-diffusion-pytorch',
|
||||||
packages = find_packages(),
|
packages = find_packages(),
|
||||||
version = '0.18.1',
|
version = '0.18.2',
|
||||||
license='MIT',
|
license='MIT',
|
||||||
description = 'Denoising Diffusion Probabilistic Models - Pytorch',
|
description = 'Denoising Diffusion Probabilistic Models - Pytorch',
|
||||||
author = 'Phil Wang',
|
author = 'Phil Wang',
|
||||||
|
|||||||
Reference in New Issue
Block a user