MCPcopy Create free account
hub / github.com/294coder/Dif-PAN / create_window

Function create_window

utils/loss_utils.py:21–27  ·  view source on GitHub ↗
(window_size, channel, sigma=1.5)

Source from the content-addressed store, hash-verified

19
20
21def create_window(window_size, channel, sigma=1.5):
22 _1D_window = gaussian(window_size, sigma).unsqueeze(1)
23 _2D_window = _1D_window.mm(_1D_window.t()).float().unsqueeze(0).unsqueeze(0)
24 window = Variable(
25 _2D_window.expand(channel, 1, window_size, window_size).contiguous()
26 )
27 return window
28
29
30def _ssim(img1, img2, window, window_size, channel, size_average=True):

Callers 3

__init__Method · 0.70
forwardMethod · 0.70
ssimFunction · 0.70

Calls 1

gaussianFunction · 0.70

Tested by

no test coverage detected