Skip to content

Commit

Permalink
fix something nonsensical when sampling random times, thanks to @jtawade
Browse files Browse the repository at this point in the history
  • Loading branch information
lucidrains committed Nov 14, 2022
1 parent d8bb4d4 commit 103d65f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions imagen_pytorch/imagen_pytorch.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@ def __init__(self, *, noise_schedule, timesteps = 1000):
def get_times(self, batch_size, noise_level, *, device):
return torch.full((batch_size,), noise_level, device = device, dtype = torch.float32)

def sample_random_times(self, batch_size, max_thres = 0.999, *, device):
return torch.zeros((batch_size,), device = device).float().uniform_(0, max_thres)
def sample_random_times(self, batch_size, *, device):
return torch.zeros((batch_size,), device = device).float().uniform_(0, 1)

def get_condition(self, times):
return maybe(self.log_snr)(times)
Expand Down
2 changes: 1 addition & 1 deletion imagen_pytorch/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '1.15.0'
__version__ = '1.15.1'
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
install_requires=[
'accelerate',
'click',
'datasets',
'einops>=0.4',
'einops-exts',
'ema-pytorch>=0.0.3',
Expand Down

0 comments on commit 103d65f

Please sign in to comment.