MCPcopy Index your code
hub / github.com/CompVis/diff2flow / cosine_log_snr

Function cosine_log_snr

diff2flow/diffusion.py:16–21  ·  view source on GitHub ↗

Returns log Signal-to-Noise ratio for time step t and image size 64 eps: avoid division by zero

(t, eps=0.00001)

Source from the content-addressed store, hash-verified

14
15
16def cosine_log_snr(t, eps=0.00001):
17 """
18 Returns log Signal-to-Noise ratio for time step t and image size 64
19 eps: avoid division by zero
20 """
21 return -2 * np.log(np.tan((np.pi * t) / 2) + eps)
22
23
24def shifted_cosine_log_snr(t, im_size: int, ref_size: int = 64):

Callers 1

shifted_cosine_log_snrFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected