File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,9 @@ def set_seed(seed: int):
43
43
44
44
Args:
45
45
seed (`int`): The seed to set.
46
+
47
+ Returns:
48
+ `None`
46
49
"""
47
50
random .seed (seed )
48
51
np .random .seed (seed )
@@ -58,6 +61,17 @@ def compute_snr(noise_scheduler, timesteps):
58
61
"""
59
62
Computes SNR as per
60
63
https://github.com/TiankaiHang/Min-SNR-Diffusion-Training/blob/521b624bd70c67cee4bdf49225915f5945a872e3/guided_diffusion/gaussian_diffusion.py#L847-L849
64
+ for the given timesteps using the provided noise scheduler.
65
+
66
+ Args:
67
+ noise_scheduler (`NoiseScheduler`):
68
+ An object containing the noise schedule parameters, specifically `alphas_cumprod`, which is used to compute
69
+ the SNR values.
70
+ timesteps (`torch.Tensor`):
71
+ A tensor of timesteps for which the SNR is computed.
72
+
73
+ Returns:
74
+ `torch.Tensor`: A tensor containing the computed SNR values for each timestep.
61
75
"""
62
76
alphas_cumprod = noise_scheduler .alphas_cumprod
63
77
sqrt_alphas_cumprod = alphas_cumprod ** 0.5
You can’t perform that action at this time.
0 commit comments